Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.

Require login for private team ownership - #41

Merged
Zarel merged 1 commit into
smogon:masterfrom
DieterReinert:codex/require-authenticated-team-ownership
Oct 26, 2026
Merged

Zarel merged 1 commit into
smogon:masterfrom
DieterReinert:codex/require-authenticated-team-ownership

Conversation

@DieterReinert

@DieterReinert DieterReinert commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

showdown_username lets someone set a display name without logging in. getteam treated that name as proof of team ownership and skipped the password check for private teams. This change requires a valid login before skipping that check.

Reproduce locally

Create a private dummy team with teamid=knownid, ownerid=victim, private=secret, and team=dummy-team. Then request it without a SID or team password:

curl -H 'Cookie: showdown_username=victim' 'http://localhost:8080/api/getteam?teamid=knownid'

Before the fix, the response includes dummy-team. With the fix, it is ]{"team":null}. Adding &password=secret still returns the team. A valid SID for victim works too.

I ran the getteam method against dummy data in an isolated Docker container. The name-only case was denied, while the password and logged-in owner cases succeeded. git diff --check passed.

@Zarel
Zarel merged commit bcd408d into smogon:master Oct 26, 2026
0 of 2 checks passed
@Zarel

Zarel commented Oct 26, 2026

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants