Skip to content

Fix REST auth whitelist, resolve route before authorizing - #9254

Merged
timvisee merged 3 commits into
devfrom
actix-whitelist-endpoint-on-pattern
Jun 1, 2026
Merged

timvisee merged 3 commits into
devfrom
actix-whitelist-endpoint-on-pattern

Conversation

@timvisee

@timvisee timvisee commented Jun 1, 2026

Copy link
Copy Markdown
Member

In REST we use an authentication whitelist. Endpoints, such as /dashboard don't require authentication. The whitelist was enforced on the user provided path, not on resolved routes. This allowed requests with crafted paths to bypass authentication.

To fix the problem this now resolves the path to a route first. Then whitelisting is applied on the static route path.

Example path that was whitelisted before this fix: GET /dashboard%2f..%2fcollections

All Submissions:

  • My PR targets the dev branch (not master) and my branch was created from dev.
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@timvisee
timvisee requested a review from agourlay June 1, 2026 12:04
@qdrant qdrant deleted a comment from coderabbitai Bot Jun 1, 2026
@qdrant qdrant deleted a comment from coderabbitai Bot Jun 1, 2026
coderabbitai[bot]

This comment was marked as resolved.

@qdrant qdrant deleted a comment from coderabbitai Bot Jun 1, 2026
@timvisee
timvisee merged commit 29b933f into dev Jun 1, 2026
15 checks passed
@timvisee
timvisee deleted the actix-whitelist-endpoint-on-pattern branch June 1, 2026 12:42
timvisee added a commit that referenced this pull request Jun 3, 2026
* Don't whitelist endpoints on user provided path, but on endpoint pattern

* Add test

* Update comment
@timvisee timvisee mentioned this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants