CVE-2023-34478 Overview
CVE-2023-34478 is a path traversal vulnerability in Apache Shiro, a powerful and flexible open-source security framework for Java applications. This vulnerability allows attackers to bypass authentication controls when Apache Shiro is used alongside APIs or other web frameworks that route requests based on non-normalized request paths.
The flaw exists in how Apache Shiro processes URL paths for security filtering. When combined with web frameworks that do not normalize request paths before routing, an attacker can craft malicious requests containing path traversal sequences to access protected resources without proper authentication.
Critical Impact
Successful exploitation allows unauthenticated attackers to bypass security controls and access protected resources, potentially leading to unauthorized data access, privilege escalation, or full system compromise.
Affected Products
- Apache Shiro versions before 1.12.0
- Apache Shiro 2.0.0-alpha1
- Apache Shiro 2.0.0-alpha2
Discovery Timeline
- 2023-07-24 - CVE-2023-34478 published to NVD
- 2025-02-13 - Last updated in NVD database
Technical Details for CVE-2023-34478
Vulnerability Analysis
This vulnerability stems from improper path normalization in Apache Shiro's request filtering mechanism. Apache Shiro uses path-based security rules to protect endpoints, determining which URLs require authentication or specific permissions. When a request arrives, Shiro evaluates the request path against its configured security filters.
The vulnerability manifests when Apache Shiro is deployed alongside web frameworks that route requests without first normalizing the URL path. In these configurations, an attacker can inject path traversal sequences (such as ../ or URL-encoded variants) into requests. Shiro's filter evaluation may see a different path than the actual endpoint being accessed by the underlying framework, creating a security mismatch that allows authentication bypass.
This type of authentication bypass is particularly dangerous because it can expose administrative interfaces, sensitive APIs, and protected resources to unauthenticated attackers over the network without requiring any user interaction.
Root Cause
The root cause is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory / Path Traversal). Apache Shiro fails to properly normalize request paths before evaluating them against security filter configurations. When paired with web frameworks that perform their own path normalization for routing purposes, a mismatch occurs between the path Shiro evaluates and the actual endpoint that handles the request.
Attack Vector
The attack is network-based and can be performed by unauthenticated remote attackers. The exploitation flow involves:
- Reconnaissance: The attacker identifies an application using Apache Shiro for authentication with a vulnerable version
- Path Crafting: The attacker constructs URLs containing path traversal sequences designed to bypass Shiro's path-based security filters
- Filter Bypass: The malicious path causes Shiro to evaluate the request against a different security rule (or no rule at all) than intended
- Resource Access: The underlying web framework normalizes the path and routes the request to the protected resource, granting unauthorized access
Example attack patterns may include requests like /public/../admin/secret or URL-encoded variants that bypass Shiro's filter matching while the framework ultimately routes to /admin/secret. For detailed technical analysis, see the Apache Mailing List Thread and Openwall OSS-Security Discussion.
Detection Methods for CVE-2023-34478
Indicators of Compromise
- Web server access logs containing URL paths with path traversal sequences (../, ..%2F, %2e%2e/) targeting protected endpoints
- Successful HTTP 200 responses to requests with traversal patterns that should return 401/403
- Unusual access patterns to administrative or sensitive endpoints from unauthenticated sessions
- Log entries showing access to protected resources without corresponding authentication events
Detection Strategies
- Implement web application firewall (WAF) rules to detect and block path traversal sequences in incoming requests
- Deploy intrusion detection systems (IDS) with signatures for URL path manipulation attempts
- Review application logs for requests containing encoded or literal path traversal characters
- Correlate authentication logs with access logs to identify protected resource access without valid sessions
Monitoring Recommendations
- Enable detailed access logging on web servers and reverse proxies to capture full request URIs
- Configure alerting for abnormal access patterns to sensitive endpoints, especially from new or unauthenticated sources
- Monitor for increases in 401/403 responses followed by 200 responses to similar paths, which may indicate bypass attempts
- Implement anomaly detection for request URI patterns that deviate from normal application usage
How to Mitigate CVE-2023-34478
Immediate Actions Required
- Upgrade Apache Shiro to version 1.12.0 or later for the 1.x branch
- Upgrade Apache Shiro to version 2.0.0-alpha-3 or later for the 2.x alpha branch
- Audit application configurations to ensure Shiro filter chains are properly defined
- Review web framework configurations for path normalization behavior
Patch Information
Apache has released patched versions that address this path traversal vulnerability. Organizations should update to Apache Shiro 1.12.0 or later for production environments, or 2.0.0-alpha-3 or later for those testing the 2.x alpha releases. For additional context, see the NetApp Security Advisory NTAP-20230915-0005.
Workarounds
- Implement additional path normalization at the web server or reverse proxy level before requests reach the application
- Deploy a web application firewall (WAF) to reject requests containing path traversal sequences
- Configure strict URL validation at the application layer to reject non-normalized paths
- Consider implementing additional authentication checks at the controller/endpoint level as defense in depth
# Example: Apache mod_rewrite rule to block path traversal attempts
RewriteEngine On
RewriteCond %{REQUEST_URI} \.\./ [OR]
RewriteCond %{REQUEST_URI} %2e%2e [NC]
RewriteRule .* - [F,L]
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

