CWE-551: Incorrect Behavior Order: Authorization Before Parsing and Canonicalization
Base
If a web server does not fully parse requested URLs before it examines them for authorization, it may be possible for an attacker to bypass authorization protection.
For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.
Consequences
- Access Control: Bypass Protection Mechanism
How to prevent it
- Architecture and Design: URL Inputs should be decoded and canonicalized to the application's current internal representation before being validated and processed for authorization. Make sure that your application does not decode the same input twice. Such errors could be used to bypass allowlist schemes by introducing dangerous inputs after they have been checked.
Recent advisories
- GHSA-4c8g-83qw-93j6 — fast-uri vulnerable to host confusion via failed IDN canonicalization
- GHSA-267c-6grr-h53f — Next.js has a Middleware / Proxy bypass in App Router applications via segment-prefetch routes
- GHSA-492v-c6pp-mqqv — Next.js has a Middleware / Proxy bypass through dynamic route parameter injection
- GHSA-36qx-fr4f-26g5 — Next.js has a Middleware / Proxy bypass in Pages Router applications using i18n
- GHSA-f2hx-5fx3-hmcv — Keycloak: UMA Policy Resource Injection Allows Unauthorized Cross-User Permission Grants
- GHSA-p77j-4mvh-x3m3 — gRPC-Go has an authorization bypass via missing leading slash in :path
- GHSA-gv94-wp4h-vv8p — Keycloak has Incorrect Behavior Order: Authorization Before Parsing and Canonicalization
- GHSA-26vr-8j45-3r4w — Jetty vulnerable to incorrect handling of invalid large TLS frame, exhausting CPU resources
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