Skip to content
OpenAdvisories

Weakness (CWE)

CWE-177: Improper Handling of URL Encoding (Hex Encoding)

Variant Draft

The product does not properly handle when all or part of an input has been URL encoded.

How to prevent it (3 mitigations)
  1. Architecture and Design

    Avoid making decisions based on names of resources (e.g. files) if those resources can have alternate names.

  2. Implementation

    Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.

    When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."

    Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

  3. Implementation

    Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.

Source: MITRE CWE-177

8 results · Clear filters · Feed

  • Medium 6.5

    Connection redirection via percent-encoded delimiter injection in connection string hosts

    PyMongo's connection string parsing decodes percent-encoded characters in the host portion before the host list is separated on its delimiters. When an application places a hostname value supplied by an unauthenticated party into a connection string, that par…

  • Medium 6.5

    Mailpit: WebSocket origin check bypass via percent-encoded path (regression of CVE-2026-22689)

    Mailpit is an email testing tool and API for developers. From 1.29.0 until 1.30.6, Mailpit's server/server.go origin middleware checks the raw RequestURI for the /api/ prefix while Go's ServeMux routes using the percent-decoded URL path, and server/websockets…

  • Medium 5.9

    @fastify/static vulnerable to route guard bypass via encoded path separators

    @fastify/static versions 8.0.0 through 9.1.0 decode percent-encoded path separators (%2F) before filesystem resolution, while Fastify's router treats them as literal characters. This mismatch allows attackers to bypass route-based middleware or guards that pr…

  • Medium 5.8

    Access rules for PingAccess may be circumvented with URL-encoded characters

    Improper handling of canonical URL-encoding may lead to bypass not properly constrained by request rules.

  • Medium 4.8

    Incorrect processing of fragment in the URL leads to Authorization Bypass in Traefik

    Traefik is an open source HTTP reverse proxy and load balancer. When a request is sent to Traefik with a URL fragment, Traefik automatically URL encodes and forwards the fragment to the backend server. This violates RFC 7230 because in the origin-form the URL…

  • Medium 6.5

    A flaw was found in Ceph, relating to the URL processing on RGW backends. An attacker can exploit the URL processing by…

  • Medium 5.3

    The curl URL parser wrongly accepts percent-encoded URL separators like '/'when decoding the host name part of a URL, m…

  • Medium 5.3

    vercel/serve allows access to restricted files if filename is URL encoded.

    serve node module suffers from Improper Handling of URL Encoding by permitting access to ignored files if a filename is URL encoded.