CWE-647: Use of Non-Canonical URL Paths for Authorization Decisions
The product defines policy namespaces and makes authorization decisions based on the assumption that a URL is canonical. This can allow a non-canonical URL to bypass the authorization.
If an application defines policy namespaces and makes authorization decisions based on the URL, but it does not require or convert to a canonical URL before making the authorization decision, then it opens the application to attack. For example, if the application only wants to allow access to http://www.example.com/mypage, then the attacker might be able to bypass this restriction using equivalent URLs such as: http://WWW.EXAMPLE.COM/mypage http://www.example.com/%6Dypage (alternate encoding) http://192.168.1.1/mypage (IP address) http://www.example.com/mypage/ (trailing /) http://www.example.com:80/mypage Therefore it is important to specify access control policy that is based on the path information in some canonical form with all alternate encodings rejected (which can be accomplished by a default deny rule).
Consequences
- Access Control: Bypass Protection Mechanism
- Confidentiality: Read Files or Directories
How to prevent it
- Architecture and Design: Make access control policy based on path information in canonical form. Use very restrictive regular expressions to validate that the path is in the expected form.
- Architecture and Design: Reject all alternate path encodings that are not in the expected canonical form.
Recent advisories
- GHSA-7rc3-g7h6-22m7 — File Browser: Colliding username normalization gives two users the same home directory
- GHSA-vj59-8hwv-xxmv — Astro: Authorization Bypass via Decode Iteration Limit and Rewrite Path Canonicalization Mismatch
- GHSA-p688-r7jv-fm6f — Cargo can be coerced to share credentials between registries
- GHSA-whqg-ppgf-wp8c — Astro has an Authentication Bypass via Double URL Encoding, a bypass for CVE-2025-64765
- GHSA-3rg7-wf37-54rm — Symfony's incorrect parsing of PATH_INFO can lead to limited authorization bypass
- CVE-2022-43939 — Hitachi Vantara Pentaho Business Analytics Server versions before 9.4.0.1 and 9.3.0.2, including 8.3.x contain security restrictions using non-canonical URLs…
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor