[SONARJAVA-6484] Implement new rule S8899#5684
Conversation
There was a problem hiding this comment.
This should be a separate PR
1ce8a49 to
d42ffb2
Compare
0cec425 to
63869c9
Compare
This rule detects a critical security vulnerability where HTTP request paths
are used in security checks without normalizing multiple consecutive slashes.
Attackers can bypass authentication and authorization by inserting extra slashes
in URLs (e.g., //admin instead of /admin). The rule flags path-based security
checks that lack proper normalization via replaceAll("/+", "/") and applies to
both javax.servlet and jakarta.servlet frameworks, as well as JAX-RS UriInfo.
…e 90% quality gate threshold
…actual test results
f5270aa to
91015a6
Compare
Code Review ✅ Approved 11 resolved / 11 findingsImplements rule S8899 to detect unnormalized HTTP request paths in security checks, addressing identified issues with regex logic, false-positive sensitivity, and redundant code paths. ✅ 11 resolved✅ Quality: Unrelated local tooling/config files committed in this PR
✅ Edge Case: Over-broad security-context detection causes many false positives
✅ Edge Case: Normalization detection too narrow; misses common forms
✅ Quality: Dead state: normalizedVariables set is written but never read
✅ Quality: Internal AI analysis doc committed to repo
...and 6 more resolved from earlier reviews OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|




This rule detects a critical security vulnerability where HTTP request paths are used in security checks without normalizing multiple consecutive slashes. Attackers can bypass authentication and authorization by inserting extra slashes in URLs (e.g., //admin instead of /admin). The rule flags path-based security checks that lack proper normalization via replaceAll("/+", "/") and applies to both javax.servlet and jakarta.servlet frameworks, as well as JAX-RS UriInfo.
Part of
Summary by Gitar
S8899to detect unnormalized HTTP request paths in security checks..cursor/rules/sonar_code_context.mdcand.sonar-code-context/settings.jsonto manage development quality standards..gitignoreto track critical Sonar configuration while excluding transient files.java-S8899.jsontracking files to multiple test projects inits/ruling/.updatePathStateFromMethodInvocationhelper withinRequestPathNormalizationCheck.java.mise.tomlto lock Java to version21.Sonar_agentic_AI_profile.jsonandSonar_way_profile.jsonand adjustedAutoScanTestexpectations.This will update automatically on new commits.