CWEweakness
CWE-177 Improper Handling of URL Encoding (Hex Encoding)
- Abstraction
- Variant
- Structure
- Simple
- Status
- Draft
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The product does not properly handle when all or part of an input has been URL encoded.
Common consequences
• Integrity: Unexpected State
Potential mitigations
• [Architecture and Design] Avoid making decisions based on names of resources (e.g. files) if those resources can have alternate names.
• [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.
• [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.
Observed examples
• CVE-2000-0900: Hex-encoded path traversal variants - "%2e%2e", "%2e%2e%2f", "%5c%2e%2e"
• CVE-2005-2256: Hex-encoded path traversal variants - "%2e%2e", "%2e%2e%2f", "%5c%2e%2e"
• CVE-2004-2121: Hex-encoded path traversal variants - "%2e%2e", "%2e%2e%2f", "%5c%2e%2e"
• CVE-2004-0280: "%20" (encoded space)
• CVE-2003-0424: "%20" (encoded space)
• CVE-2001-0693: "%20" (encoded space)
• CVE-2001-0778: "%20" (encoded space)
• CVE-2002-1831: Crash via hex-encoded space "%20".
• CVE-2000-0671: "%00" (encoded null)
• CVE-2004-0189: "%00" (encoded null)
• CVE-2002-1291: "%00" (encoded null)
• CVE-2002-1031: "%00" (encoded null)
• CVE-2001-1140: "%00" (encoded null)
• CVE-2004-0760: "%00" (encoded null)
• CVE-2002-1025: "%00" (encoded null)
• CVE-2002-1213: "%2f" (encoded slash)
• CVE-2004-0072: "%5c" (encoded backslash) and "%2e" (encoded dot) sequences
• CVE-2004-0847: web framework for .NET allows remote attackers to bypass authentication for .aspx files in restricted directories via a request containing a (1) "\" (backslash) or (2) "%5C" (encoded backslash)
• CVE-2002-1575: "%0a" (overlaps CRLF)
Related
Attack pattern · CAPEC (4)
Observed example · CVE (19)
- CVE-2005-2256 Encoded directory traversal vulnerability in phpPgAdmin 3.1 to 3.5.3 allows remote attackers to access arbitrary files via "%2e%2e%2f"… vulnerability
- CVE-2004-2121 Multiple directory traversal vulnerabilities in Borland Web Server (BWS) 1.0b3 and earlier allow remote attackers to read and download… vulnerability
- CVE-2004-0280 Caucho Technology Resin 2.1.12 allows remote attackers to view JSP source via an HTTP request to a .jsp file that ends in a "%20" (encoded… vulnerability
- CVE-2004-0847 The Microsoft .NET forms authentication capability for ASP.NET allows remote attackers to bypass authentication for .aspx files in… vulnerability
- CVE-2004-0760 Mozilla allows remote attackers to cause Mozilla to open a URI as a different MIME type than expected via a null character (%00) in an FTP… vulnerability
- CVE-2004-0189 The "%xx" URL decoding function in Squid 2.5STABLE4 and earlier allows remote attackers to bypass url_regex ACLs via a URL with a NULL… vulnerability
- CVE-2002-1575 cgiemail allows remote attackers to use cgiemail as a spam proxy via CRLF injection of encoded newline (%0a) characters in parameters such… vulnerability
- CVE-2004-0072 Directory traversal vulnerability in Accipiter Direct Server 6.0 allows remote attackers to read arbitrary files via encoded \.. vulnerability
- CVE-2003-0424 Apple QuickTime / Darwin Streaming Server before 4.1.3f allows remote attackers to obtain the source code for scripts by appending encoded… vulnerability
- CVE-2002-1831 Microsoft MSN Messenger Service 1.0 through 4.6 allows remote attackers to cause a denial of service (crash) via an invite request that… vulnerability
- CVE-2002-1291 The Microsoft Java implementation, as used in Internet Explorer, allows remote attackers to read arbitrary local files and network shares… vulnerability
- CVE-2002-1213 Directory traversal vulnerability in RadioBird Software WebServer 4 Everyone 1.23 and 1.27, and other versions before 1.30, allows remote… vulnerability
- CVE-2002-1025 JRun 3.0 through 4.0 allows remote attackers to read JSP source code via an encoded null byte in an HTTP GET request, which causes the… vulnerability
- CVE-2002-1031 KeyFocus (KF) web server 1.0.2 allows remote attackers to list directories and read restricted files via an HTTP request containing a %00… vulnerability
- CVE-2001-0778 OmniHTTPd 2.0.8 and earlier allow remote attackers to obtain source code via a GET request with the URL-encoded symbol for a space (%20). vulnerability
- CVE-2001-0693 WebTrends HTTP Server 3.1c and 3.5 allows a remote attacker to view script source code via a filename followed by an encoded space (%20). vulnerability
- CVE-2001-1140 BadBlue Personal Edition v1.02 beta allows remote attackers to read source code for executable programs by appending a %00 (null byte) to… vulnerability
- CVE-2000-0900 Directory traversal vulnerability in ssi CGI program in thttpd 2.19 and earlier allows remote attackers to read arbitrary files via a… vulnerability
- CVE-2000-0671 Roxen web server earlier than 2.0.69 allows allows remote attackers to bypass access restrictions, list directory contents, and read source… vulnerability
Child of · CWE (1)
- CWE-172 Improper Encoding or Decoding of Data weakness
Referenced by CAPEC · weakness (4)
Referenced by CVE · weakness (19)
- CVE-2026-118650 Echo is a Go web framework. vulnerability
- CVE-2026-100409 OpenNext Cloudflare is an open Next.js adapter for Cloudflare. vulnerability
- CVE-2026-76504 A vulnerability in the API session-based authentication management of Cisco Catalyst SD-WAN Manager could allow an unauthenticated, remote… vulnerability
- CVE-2026-96748 PyMongo's connection string parsing decodes percent-encoded characters in the host portion before the host list is separated on its… vulnerability
- CVE-2026-76172 fast-uri is a URI parser for Node.js. vulnerability
- CVE-2026-67448 Mailpit is an email testing tool and API for developers. vulnerability
- CVE-2026-15371 Velociraptor's web GUI allows specifying a custom type for columns in tables. vulnerability
- CVE-2026-59083 Improper Handling of URL Encoding (Hex Encoding) vulnerability in Apache Tomcat's rewrite valve allowed security constraint bypass for some… vulnerability
- CVE-2026-41041 URL path injection via unencoded user-supplied identifiers vulnerability in Apache Gravitino. vulnerability
- CVE-2026-6414 @fastify/static versions 8.0.0 through 9.1.0 decode percent-encoded path separators (%2F) before filesystem resolution, while Fastify's… vulnerability
- CVE-2026-29045 Hono is a Web application framework that provides support for any JavaScript runtime. vulnerability
- CVE-2026-22031 @fastify/middie is the plugin that adds middleware support on steroids to Fastify. vulnerability
- CVE-2026-22037 The @fastify/express plugin adds full Express compatibility to Fastify. vulnerability
- CVE-2025-11990 GitLab has remediated an issue in GitLab EE affecting all versions from 18.4 before 18.4.4, and 18.5 before 18.5.2 that could have allowed… vulnerability
- CVE-2024-48866 An improper handling of URL encoding (Hex Encoding) vulnerability has been reported to affect several QNAP operating system versions. vulnerability
- CVE-2024-23983 Improper handling of canonical URL-encoding may lead to bypass not properly constrained by request rules. vulnerability
- CVE-2022-3854 A flaw was found in Ceph, relating to the URL processing on RGW backends. vulnerability
- CVE-2022-27780 The curl URL parser wrongly accepts percent-encoded URL separators like '/'when decoding the host name part of a URL, making it a… vulnerability
- CVE-2018-3718 serve node module suffers from Improper Handling of URL Encoding by permitting access to ignored files if a filename is URL encoded. vulnerability