CVE-2026-74763
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.
An authorization bypass vulnerability (CVE-2026-74763) has been identified in the annotation-based method authorization of Apache Shiro's Guice, AspectJ, CDI and Jakarta EE integrations, which allows attackers to invoke methods that should be protected by authorization annotations such as @RequiresRoles and @RequiresPermissions without passing the authorization check. Annotations declared on an interface are not enforced, and with shiro-guice or shiro-aspectj, annotations declared on a class or a superclass are not always enforced.
Per OWASP: Access control enforces policy such that users cannot act outside of their intended permissions. Failures typically lead to unauthorized information disclosure, modification or destruction of all data, or performing a business function outside the user's limits.
This issue affects all versions of Apache Shiro prior to 3.0.2, with impact depending on the module in use and on where the authorization annotations are declared.
Details
Module Info
- Product: Apache Shiro
- Affected packages:
org.apache.shiro:shiro-guice,org.apache.shiro:shiro-aspectj,org.apache.shiro:shiro-cdi,org.apache.shiro:shiro-jakarta-ee - Affected versions:
- org.apache.shiro:shiro-guice: <3.0.2
- org.apache.shiro:shiro-aspectj: <3.0.2
- org.apache.shiro:shiro-cdi: >=2.0.0-alpha-0 <3.0.2
- org.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-guice, https://central.sonatype.com/artifact/org.apache.shiro/shiro-aspectj, https://central.sonatype.com/artifact/org.apache.shiro/shiro-cdi, 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 Medium-severity vulnerability is found in the shiro-guice, shiro-aspectj, shiro-cdi and shiro-jakarta-ee packages in all versions of Apache Shiro prior to 3.0.2. Shiro's authorization annotations (@RequiresAuthentication, @RequiresUser, @RequiresGuest, @RequiresRoles and @RequiresPermissions) are enforced by method interceptors that the integration modules attach to annotated methods. In shiro-guice and shiro-aspectj, which methods are intercepted is decided by looking only at the invoked method and, for Guice, its declaring class, never at the interfaces it implements or the superclasses it extends.
In shiro-guice, ShiroAopModule binds the authorization interceptors only to methods matched by this check:
public boolean matches(Method method) {
Class<? extends Annotation> annotation = methodInterceptor.getHandler().getAnnotationClass();
return method.getAnnotation(annotation) != null
|| method.getDeclaringClass().getAnnotation(annotation) != null;
}
Java does not inherit annotations from interface methods, and the Shiro authorization annotations are not marked @Inherited. When @RequiresRoles("admin") is declared on a method of a service interface, the implementing method carries no annotation, the matcher returns false, and Guice binds no interceptor: the method runs with no authorization check at all. The same happens when the annotation is declared on a superclass and the subclass overrides the method, because the overriding method's declaring class is the subclass.
In shiro-aspectj, the ShiroAnnotationAuthorizingAspect pointcut only matches executions of methods that carry an annotation themselves:
private static final String pointCupExpression =
"execution(@org.apache.shiro.authz.annotation.RequiresAuthentication * *(..)) || " +
"execution(@org.apache.shiro.authz.annotation.RequiresGuest * *(..)) || " +
"execution(@org.apache.shiro.authz.annotation.RequiresPermissions * *(..)) || " +
"execution(@org.apache.shiro.authz.annotation.RequiresRoles * *(..)) || " +
"execution(@org.apache.shiro.authz.annotation.RequiresUser * *(..))";
Annotations placed on an interface, on a class or on a superclass therefore never trigger the aspect. Even when an interceptor does run, the shared DefaultAnnotationResolver in shiro-core looks up the annotation with m.getAnnotation(clazz) and then miThis.getClass().getAnnotation(clazz) only, so it also misses annotations declared on interfaces and on superclasses. The shiro-cdi and shiro-jakarta-ee modules, which are not part of Apache Shiro 1.x, likewise do not enforce annotations declared on interfaces. In each case an unauthenticated or unauthorized caller can invoke a method the application developer believed was protected.
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
- n0mi1k (finder)
- Joshua Rogers (finder)
- Wentao He (finder)