CVE-2016-4437
Improper Access Control in Apache Shiro
Description
Response & Mitigation
Why act now?
Prioritisation rationale
CVE-2016-4437 carries an EPSS score of 93 % at the 99.8th percentile, reflecting sustained, real-world exploitation activity despite the vulnerability's age — ungoverned Shiro deployments embedded in Java enterprise applications remain widespread. The attack requires no authentication and is executable via a single HTTP request with a crafted rememberMe cookie, placing it firmly in the low-complexity, network-accessible category (CVSS AV:N/AC:L). Organisations most at risk are those running Java web applications — internal portals, legacy ERP front-ends, API gateways — that depend on Shiro versions below 1.2.5 without an explicitly configured cipher key. NIS2-obligated operators of critical infrastructure should treat this as a critical finding and target patch deployment within 72 hours, using the cipher-key hardening and WAF controls above as immediate compensating measures.
Runbook · Step 1
Immediate response (0-24 h)
- Apply the patch: Upgrade Apache Shiro to version 1.2.5 or later (Maven coordinate
org.apache.shiro:shiro-core:1.2.5). All versions from 1.0.0-incubating through 1.2.4 are affected. Verify the current stable release in the Apache Shiro release repository before deploying. - Set a strong RememberMe cipher key immediately: Regardless of patch status, configure a random AES key (minimum 128 bit, preferably 256 bit) for
securityManager.rememberMeManager.cipherKeyinshiro.inior your Spring/Guice configuration. Without an explicit key, Shiro falls back to a hardcoded default key that is publicly known and trivially exploitable. - Disable the RememberMe feature if it is not required by the application: set
securityManager.rememberMeManager = org.apache.shiro.mgt.DisabledRememberMeManagerand restart the application. This eliminates the attack surface entirely. - Inventory all affected deployments: Run a Maven dependency scan (
mvn dependency:tree | grep shiro) or SBOM analysis across all Java application servers to identify every instance of a vulnerable Shiro version, including transitive dependencies. - Verify network exposure: Confirm that vulnerable Shiro endpoints are not directly reachable from the internet. Place a WAF or reverse proxy in front of any exposed instance if one is not already present.
Runbook · Step 2
Mitigation layers
- WAF rule targeting the RememberMe cookie: Block or quarantine HTTP requests carrying a
rememberMecookie whose Base64-decoded value exceeds 256 bytes or contains unexpected binary structures. Suggested Snort pattern:alert http any any -> $HTTP_SERVERS any (msg:"CVE-2016-4437 Shiro RememberMe"; content:"rememberMe="; http_cookie; pcre:"/rememberMe=[A-Za-z0-9+\/]{200,}/"; sid:9164437; rev:1;). - JVM-level deserialization filtering: Deploy Java serialization filters (
-Djdk.serialFilter) or a library such as SerialKiller or NotSoSerial to block known gadget chains (Commons Collections, Spring Framework, etc.) at the class level. This acts as a defence-in-depth layer independent of the Shiro patch. - Least-privilege for the application process: Run the application server under an OS account with minimal rights — no root/SYSTEM, no write access to critical directories. This limits the blast radius of a successful RCE.
- Egress filtering: Restrict outbound connections from the application server to an explicit allowlist of destinations and ports. Most post-exploitation payloads (reverse shells, C2 beaconing) require outbound TCP to non-standard ports.
- Secrets management for the cipher key: Do not store the cipher key in plaintext configuration files. Use a secrets manager (HashiCorp Vault, AWS Secrets Manager, or equivalent). Rotate the key after patch deployment, since a previously exposed key re-opens the vulnerability.
Runbook · Step 3
Detection rules
- Web access log pattern: Requests carrying a
rememberMecookie that produce HTTP 4xx/5xx responses followed by a successful request (200/302) with the same or a similar cookie value — indicative of cipher-key brute-forcing or payload iteration. SPL:index=webserver sourcetype=access_combined | rex field=_raw "Cookie:.*rememberMe=(?<rm_cookie>[^;]+)" | stats count by rm_cookie, status | where count > 10 AND status IN ("200","302"). - Suspicious process ancestry (EDR/Sysmon): Child processes of the JVM (e.g.
java.exeorjava) spawning shell interpreters (cmd.exe,powershell.exe,/bin/sh,/bin/bash) or network utilities (curl,wget,nc). Monitor Sysmon EID 1 or auditdexecvesyscalls where the parent PID belongs to the JVM process. - Network telemetry (Zeek/Suricata): Outbound connections from the application server to ports outside the defined allowlist — particularly TCP 4444 or high-numbered ports commonly used by reverse shells — or DNS queries to unknown external resolvers occurring shortly after a Shiro request.
- JVM deserialization exceptions in application logs: Log entries containing
java.io.InvalidClassException,ClassNotFoundException, ororg.apache.shiro.crypto.CryptoExceptionmay indicate failed or probing exploit attempts. Sigma shape:keywords: ['CryptoException', 'rememberMe', 'InvalidClassException']against the application log source. - Filesystem activity: New
.class,.jar, or.jspfiles appearing in the web root or temporary directories of the application server. Linux auditd rule:-w /opt/tomcat/webapps -p wa -k shiro_webshell.
Metrics
Affected products
Products and version ranges extracted from the vendor/CERT advisory. A range like „<4.14.6“ implies the update recommendation „upgrade to 4.14.6 or later“.
maven
org.apache.shiro:shiro-core1.0.0-incubating
maven
org.apache.shiro:shiro-core1.1.0
maven
org.apache.shiro:shiro-core1.2.0
maven
org.apache.shiro:shiro-core1.2.1
maven
org.apache.shiro:shiro-core1.2.2
maven
org.apache.shiro:shiro-core1.2.3
maven
org.apache.shiro:shiro-core1.2.4
Public exploit references
Public proof-of-concepts and detection templates for this vulnerability. Maturity ranges from reported PoCs through working detection scripts up to fully weaponized exploit modules. NEOSEC mirrors the code internally for forensic analysis; externally we only link to the original sources.
References & sources
- https://nvd.nist.gov/vuln/detail/CVE-2016-4437advisory
- https://lists.apache.org/thread.html/ef3a800c7d727a00e04b78e2f06c5cd8960f09ca28c9b69d94c3c4c4%40%3Cannouncements.aurora.apache.org%3Eweb
- https://lists.apache.org/thread.html/ef3a800c7d727a00e04b78e2f06c5cd8960f09ca28c9b69d94c3c4c4@%3Cannouncements.aurora.apache.org%3Eweb
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2016-4437web
- http://packetstormsecurity.com/files/137310/Apache-Shiro-1.2.4-Information-Disclosure.htmlweb
- http://packetstormsecurity.com/files/157497/Apache-Shiro-1.2.4-Remote-Code-Execution.htmlweb
- http://rhn.redhat.com/errata/RHSA-2016-2035.htmlweb
- http://rhn.redhat.com/errata/RHSA-2016-2036.htmlweb
- http://www.securityfocus.com/archive/1/538570/100/0/threadedweb
- http://www.securityfocus.com/bid/91024web