Skip to content

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

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

fix(auth): enforce public path boundaries#3214
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

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.

Testing

  • mvn -Dmaven.repo.local=D:\taiyi-maven-cache -Dtest=AuthInterceptorTest test (passes)
  • Full server suite was attempted on Windows: 2037 tests ran; unrelated existing CLI-agent shell assumptions and AliyunInstanceProviderTest.getGroupProgressShouldMapLagRowsTest failed.

@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

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.

2 participants