CVE-2026-129320
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Apache Shiro is an open-source Java security framework that performs authentication, authorization, cryptography, and session management for applications ranging from small mobile apps to large web and enterprise systems. It exposes a single Subject-centric API that applications use to log users in, check roles and permissions, and manage sessions independently of any servlet or EJB container, and integrates with common Java stacks through modules such as shiro-web, shiro-spring, and shiro-guice.
A cross-site scripting (XSS) vulnerability (CVE-2026-129320) has been identified in the shiro:principal tag of Apache Shiro, which allows attackers who can influence a principal value to inject script into pages that display it. The tag writes the principal to the page without escaping it, so markup in the value is rendered by the browser of the user whose principal the page displays.
Per OWASP: Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted websites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user. Flaws that allow these attacks to succeed are quite widespread and occur anywhere a web application uses input from a user within the output it generates without validating or encoding it.
This issue affects all versions of Apache Shiro through 3.0.1, in applications that use the principal tag.
Details
Module Info
- Product: Apache Shiro
- Affected packages:
org.apache.shiro:shiro-web,org.apache.shiro:shiro-jakarta-ee - Affected versions:
org.apache.shiro:shiro-web: <3.0.2org.apache.shiro:shiro-jakarta-ee: >=2.0.0-alpha-0 <3.0.2
- GitHub repository: https://github.com/apache/shiro
- Published packages: https://central.sonatype.com/artifact/org.apache.shiro/shiro-web, https://central.sonatype.com/artifact/org.apache.shiro/shiro-jakarta-ee
- Package manager: Maven
- Fixed in:
- OSS Apache Shiro 3.0.2
- NES for Apache Shiro
Vulnerability Info
This Low-severity vulnerability is found in the org.apache.shiro:shiro-web and org.apache.shiro:shiro-jakarta-ee packages in all versions of Apache Shiro through 3.0.1. The shiro:principal tag prints the current Subject's principal, or one of its properties, into the rendered page. In shiro-web, the JSP tag class org.apache.shiro.web.tags.PrincipalTag builds the string from principal.toString() or from the property named by the tag's property attribute, and writes it straight to the page output:
// Print out the principal value if not null
if (strValue != null) {
try {
pageContext.getOut().write(strValue);
} catch (IOException e) {
throw new JspTagException("Error writing [" + strValue + "] to JSP.", e);
}
}
The Jakarta Faces version of the tag in shiro-jakarta-ee does the same through ctx.getResponseWriter().write(strValue), which also emits the text as raw markup.
Neither path HTML-encodes the value. A principal is often a username, email address or other identity attribute that a user chooses at registration or that comes from an external identity store. If that value contains HTML such as a <script> element, the tag inserts it into the page unchanged and the browser executes it in the context of the application whenever a page renders that Subject's principal. The issue applies only when an application uses the principal tag and the principal value is not fully trusted.
Mitigation
Apache Shiro 1.x is End-of-Life and no longer receives open-source updates to address this issue. The final 1.x release was 1.13.0; as of February 28, 2024, Shiro v1 was superseded by v2.
Users of the affected components should apply one of the following mitigations:
- Upgrade Apache Shiro to a currently supported release line that contains the fix, first shipped upstream in Apache Shiro 3.0.2 (requires Java 17+).
- Leverage a commercial support partner like HeroDevs for post-EOL security support.
Credits
- The ASF LLM-based security scan (finder)