Skip to content

fix(auth): enforce public path boundaries - #3214

Closed
yyqdbngt wants to merge 1 commit into
apache:rocketmq-studiofrom
yyqdbngt:codex/yy-auth-public-boundary
Closed

yyqdbngt wants to merge 1 commit into
apache:rocketmq-studiofrom
yyqdbngt:codex/yy-auth-public-boundary

Conversation

@yyqdbngt

@yyqdbngt yyqdbngt commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • require public documentation and health endpoints to match a complete path segment
  • keep valid descendants such as /swagger-ui/index.html and /actuator/health/readiness public
  • add regression coverage for lookalike protected paths

Why

The authentication interceptor previously used raw prefix checks for public endpoint trees. That also exempted unrelated paths such as /api-docs-private and /actuator/healthcheck whenever login enforcement was enabled.

Verification on Linux

Ubuntu 22.04, OpenJDK 21.0.12, Maven 3.6.3, rebased onto rocketmq-studio 6c24d2ed, run from
server/:

$ mvn -B -ntp test
Tests run: 2160, Failures: 2, Errors: 0, Skipped: 0

Both failures are AuthCorsIntegrationTest, which fails on the branch head without this
change too (the test still stubs the pre-#2895 isAuthenticated call). #4217 repairs it.
Every other test, including the ones added here, passes.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

Fixes an auth bypass vulnerability where path.startsWith("/api-docs") would incorrectly allow paths like /api-docs-private or /swagger-ui-admin to bypass authentication. The new isPathOrDescendant helper properly enforces path boundaries by requiring either an exact match or a / separator.

Security-critical fix. Excellent test coverage including negative cases for paths that only share a prefix.

LGTM.


Automated review by github-manager-bot

@yyqdbngt
yyqdbngt force-pushed the codex/yy-auth-public-boundary branch 2 times, most recently from 447430c to 4fccbad Compare September 11, 2026 02:30
@lizhimins
lizhimins deleted the branch apache:rocketmq-studio September 16, 2026 12:41
@lizhimins lizhimins closed this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants