Skip to content

fix(security): require authentication for the credential check endpoint - #323

Merged
hirokiterashima merged 1 commit into
WISE-Community:developfrom
Isaries:fix/check-authentication-endpoint
Sep 16, 2026
Merged

hirokiterashima merged 1 commit into
WISE-Community:developfrom
Isaries:fix/check-authentication-endpoint

Conversation

@Isaries

@Isaries Isaries commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

The credential check endpoint required no authentication and always returned the account id and real name for any valid username, even when the password was wrong. This let anyone harvest user ids and real names by probing usernames. This requires authentication and only returns the identity fields once the correct password has been provided.

Changes

  • Add @Secured("ROLE_USER") to the credential check method.
  • Only include userId, username, firstName and lastName in the response when the password is valid.

Testing

  • Builds on JDK 17 (mvnw package).
  • The only caller in WISE-Client reads those identity fields only on a successful check, so trimming them on failure does not affect the client.

The endpoint that verifies a username and password was reachable without
authentication and returned the account's id and real name for any valid
username, letting an anonymous caller brute-force passwords and harvest
user ids and real names by probing usernames.

Require an authenticated user, and only return the account id and name
after the correct password has been supplied. The team sign-in flow, the
only caller, already runs in an authenticated session and reads those
fields only after a successful check.

@hirokiterashima hirokiterashima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for taking so long to review this. It looks good. Helps prevent malicious users. Thanks for making this PR.

@hirokiterashima
hirokiterashima merged commit a6791f7 into WISE-Community:develop Sep 16, 2026
@hirokiterashima hirokiterashima self-assigned this Sep 16, 2026
@hirokiterashima hirokiterashima added the enhancement New feature or request label Sep 16, 2026
@hirokiterashima

Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.25.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants