fix: weak-credential check now inspects response body, not just HTTP status#75
Merged
GovindarajanL merged 1 commit intoJul 25, 2026
Conversation
…status
BrokenAuthenticationTestCase flagged a CRITICAL "Weak Default Credentials
Accepted" finding whenever a login attempt returned 2xx, without checking
whether the response body actually indicated success. Some APIs (e.g.
VAmPI) return HTTP 200 for both successful and failed logins, with the
real result only in the JSON body — producing a false CRITICAL.
Reproduced against VAmPI in both vulnerable and secure modes: the exact
admin/admin request flagged as "accepted" actually fails
({"status":"fail",...}) on both instances.
Adds a body check (looksLikeAuthSuccess) requiring the absence of common
failure markers before trusting a 2xx status, applied consistently to the
weak-credential, missing-auth, JWT-none, expired-JWT, and 2FA-bypass
checks, which shared the same status-code-only pattern.
Fixes OWASP#70
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #70
Summary
BrokenAuthenticationTestCaseflagged a CRITICAL "Weak Default Credentials Accepted" finding whenever a login attempt returned HTTP 2xx, without checking whether the response body actually indicated success. Some APIs (e.g. VAmPI) return HTTP 200 for both successful and failed logins, with the real result only in the JSON body — producing a false CRITICAL.Reproduction
Scanned VAmPI in both
vulnerable=1andvulnerable=0modes. Both flaggedPOST /users/v1/loginas acceptingadmin/admin. Manually replaying the exact request:HTTP 200, but the login clearly failed.
Fix
Adds
looksLikeAuthSuccess(), which requires the response body to be free of common failure markers ("status":"fail",incorrect,invalid credentials,unauthorized, ...) before trusting a 2xx status as a real success. Applied consistently to the weak-credential, missing-auth, JWT-none, expired-JWT, and 2FA-bypass checks in the same file, which all shared the identical status-code-only pattern.Verification
Test plan
mvn testpasses