GCVE-1988-2026-0531

Vulnerability from gna-1988 – Published: 2026-11-02 09:47 – Updated: 2026-11-02 09:47
VLAI
Title
Apache Struts2 Core TokenHelper Token Cryptographic Timing Side-Channel
Summary
Description The Apache Struts2 Core 7.4.0 and below performs session token comparisons cryptographically insecure early-exit comparison functions (e.g., `!=`, `memcmp`, byte-by-byte loops with `break`) that return as soon as the first mismatched byte is encountered. The execution time of the comparison is therefore proportional to the number of leading bytes that match, creating a measurable timing side-channel. Importantly, this side-channel has been dynamically verified and exploited across networks using modern techniques that reduce/factor out latency. Impact Attackers can measure response latency, iteratively determining the correct value of the hash or secret one byte at a time, reducing the attack complexity from `36^n`, where `n` is the number of bytes in the secret. While, in the ideal circumstance, the complexity of a pure brute-force attack would be `2^165` since the system is using a 165-bit BigInteger, the conversion from BigInteger to an A-Z0-9 string does not map cleanly -- the resulting string, itself, can actually be 31 or 32 characters long and bytes don't simply slot into a given character or position, thus requiring the greater `36^32` brute-force. With that said, in a system where lag can be injected, latency reduced or factored out, the theoretical floor move from the worst case `36^32` to `36*32` (1,152 requests). Of course, since the string length can vary by one, attackers must first determine the string length, which can be done via two requests -- one with each length -- a trivial addition to the worst case mentioned above but worth noting. Successful exploitation enables bypassing the `TokenHelper`-generated token, which is designed to "[s]top double-submission of forms" and may be used by information systems as a nonce as part of cross-site request forgery protections. Examples Sample Code `TokenHelper.validToken()`, leveraged by both `TokenInterceptor.handleToken(ActionInvocation)` and `TokenSessionStoreInterceptor.handleToken(ActionInvocation)`, utilises the cryptographically insecure, early-exiting `String.equals(String)` method to compare the in-session token against the user-provided token. ```java /** * Checks for a valid transaction token in the current request params. If a valid token is found, it is * removed so the it is not valid again. * * @return false if there was no token set into the params (check by looking for {@link #TOKEN_NAME_FIELD}), true if a valid token is found */ public static boolean validToken() { String tokenName = getTokenName(); if (tokenName == null) { LOG.debug("No token name found -> Invalid token "); return false; } String token = getToken(tokenName); if (token == null) { LOG.debug("No token found for token name {} -> Invalid token ", normalizeSpace(tokenName)); return false; } Map session = ActionContext.getContext().getSession(); String tokenSessionName = buildTokenSessionAttributeName(tokenName); String sessionToken = (String) session.get(tokenSessionName); if (!token.equals(sessionToken)) { if (LOG.isWarnEnabled()) { LocalizedTextProvider localizedTextProvider = ActionContext.getContext().getContainer().getInstance(LocalizedTextProvider.class); LOG.warn(localizedTextProvider.findText(TokenHelper.class, "struts.internal.invalid.token", ActionContext.getContext().getLocale(), "Form token {0} does not match the expected session token.", new Object[]{ normalizeSpace(token) })); } Dispatcher dispatcher = Dispatcher.getInstance(); if (dispatcher != null && dispatcher.isDevMode()) { LOG.warn("Token mismatch detail - token name [{}], form token [{}], session token [{}]", normalizeSpace(tokenName), normalizeSpace(token), sessionToken); } return false; } // remove the token so it won't be used again session.remove(tokenSessionName); ActionContext.getContext().put(VALIDATED_TOKEN_KEY, new ValidatedToken(tokenName, token)); return true; } ``` Code snippet from `struts2-core`'s core/src/main/java/org/apache/struts2/util/TokenHelper.java, lines 164-210 ```java protected String handleToken(ActionInvocation invocation) throws Exception { //see WW-2902: we need to use the real HttpSession here, as opposed to the map //that wraps the session, because a new wrap is created on every request HttpSession session = ServletActionContext.getRequest().getSession(true); synchronized (session.getId().intern()) { if (!TokenHelper.validToken()) { return handleInvalidToken(invocation); } } return handleValidToken(invocation); } ``` Snippet from `struts2-core`'s core/src/main/java/org/apache/struts2/interceptor/TokenInterceptor.java, lines 140-150, showing the interceptor calling for token validation -- note, too, the improper, unsafe synchronisation on `session.getId().intern()`, though that is a separate finding with a separate write-up ```java @Override protected String handleToken(ActionInvocation invocation) throws Exception { //see WW-2902: we need to use the real HttpSession here, as opposed to the map //that wraps the session, because a new wrap is created on every request HttpSession session = ServletActionContext.getRequest().getSession(true); synchronized (session.getId().intern()) { if (!TokenHelper.validToken()) { return handleInvalidToken(invocation); } return handleValidToken(invocation); } } ``` Code from `struts2-core`'s core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java, lines 104-115, showing the interceptor calling for token validation -- note, too, the improper, unsafe synchronisation on `session.getId().intern()`, though that is a separate finding with a separate write-up _______________________________________________ Sent through the Full Disclosure mailing list https://nmap.org/mailman/listinfo/fulldisclosure Web Archives & RSS: https://seclists.org/fulldisclosure/
Severity
No CVSS data available.
Assigner
VULNARCHIVE GNA GNA-1988
GNA scorecard E 38/100 over 581 records in the last 180 days details
Impacted products
Vendor Product Version CPE status
Apache Struts2 Core Affected: unknown
guessed Create a notification for this product.

{
  "containers": {
    "cna": {
      "affected": [
        {
          "product": "Struts2 Core",
          "vendor": "Apache",
          "versions": [
            {
              "status": "affected",
              "version": "unknown"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "type": "finder",
          "value": "Daniel Owens via Fulldisclosure"
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "Description\nThe Apache Struts2 Core 7.4.0 and below performs session token comparisons cryptographically insecure early-exit \ncomparison functions (e.g., `!=`, `memcmp`, byte-by-byte loops with `break`) that return as soon as the first \nmismatched byte is encountered.  The execution time of the comparison is therefore proportional to the number of \nleading bytes that match, creating a measurable timing side-channel.  Importantly, this side-channel has been \ndynamically verified and exploited across networks using modern techniques that reduce/factor out latency.\n\nImpact\nAttackers can measure response latency, iteratively determining the correct value of the hash or secret one byte at a \ntime, reducing the attack complexity from `36^n`, where `n` is the number of bytes in the secret.  While, in the ideal \ncircumstance, the complexity of a pure brute-force attack would be `2^165` since the system is using a 165-bit \nBigInteger, the conversion from BigInteger to an A-Z0-9 string does not map cleanly -- the resulting string, itself, \ncan actually be 31 or 32 characters long and bytes don\u0027t simply slot into a given character or position, thus requiring \nthe greater `36^32` brute-force.  With that said, in a system where lag can be injected, latency reduced or factored \nout, the theoretical floor move from the worst case `36^32` to `36*32` (1,152 requests).  Of course, since the string \nlength can vary by one, attackers must first determine the string length, which can be done via two requests -- one \nwith each length -- a trivial addition to the worst case mentioned above but worth noting.\n\nSuccessful exploitation enables bypassing the `TokenHelper`-generated token, which is designed to \"[s]top \ndouble-submission of forms\" and may be used by information systems as a nonce as part of cross-site request forgery \nprotections.\n\nExamples\nSample Code\n`TokenHelper.validToken()`, leveraged by both `TokenInterceptor.handleToken(ActionInvocation)` and \n`TokenSessionStoreInterceptor.handleToken(ActionInvocation)`, utilises the cryptographically insecure, early-exiting \n`String.equals(String)` method to compare the in-session token against the user-provided token.\n\n```java\n    /**\n     * Checks for a valid transaction token in the current request params. If a valid token is found, it is\n     * removed so the it is not valid again.\n     *\n     * @return false if there was no token set into the params (check by looking for {@link #TOKEN_NAME_FIELD}), true \nif a valid token is found\n     */\n    public static boolean validToken() {\n        String tokenName = getTokenName();\n\n        if (tokenName == null) {\n            LOG.debug(\"No token name found -\u003e Invalid token \");\n            return false;\n        }\n\n        String token = getToken(tokenName);\n\n        if (token == null) {\n            LOG.debug(\"No token found for token name {} -\u003e Invalid token \", normalizeSpace(tokenName));\n            return false;\n        }\n\n        Map session = ActionContext.getContext().getSession();\n                                String tokenSessionName = buildTokenSessionAttributeName(tokenName);\n        String sessionToken = (String) session.get(tokenSessionName);\n\n        if (!token.equals(sessionToken)) {\n            if (LOG.isWarnEnabled()) {\n                LocalizedTextProvider localizedTextProvider = \nActionContext.getContext().getContainer().getInstance(LocalizedTextProvider.class);\n                LOG.warn(localizedTextProvider.findText(TokenHelper.class, \"struts.internal.invalid.token\", \nActionContext.getContext().getLocale(), \"Form token {0} does not match the expected session token.\", new Object[]{\n                        normalizeSpace(token)\n                }));\n            }\n            Dispatcher dispatcher = Dispatcher.getInstance();\n            if (dispatcher != null \u0026\u0026 dispatcher.isDevMode()) {\n                LOG.warn(\"Token mismatch detail - token name [{}], form token [{}], session token [{}]\",\n                        normalizeSpace(tokenName), normalizeSpace(token), sessionToken);\n            }\n\n            return false;\n        }\n\n        // remove the token so it won\u0027t be used again\n        session.remove(tokenSessionName);\n        ActionContext.getContext().put(VALIDATED_TOKEN_KEY, new ValidatedToken(tokenName, token));\n\n        return true;\n    }\n```\nCode snippet from `struts2-core`\u0027s core/src/main/java/org/apache/struts2/util/TokenHelper.java, lines 164-210\n\n```java\n    protected String handleToken(ActionInvocation invocation) throws Exception {\n        //see WW-2902: we need to use the real HttpSession here, as opposed to the map\n        //that wraps the session, because a new wrap is created on every request\n        HttpSession session = ServletActionContext.getRequest().getSession(true);\n        synchronized (session.getId().intern()) {\n            if (!TokenHelper.validToken()) {\n                return handleInvalidToken(invocation);\n            }\n        }\n        return handleValidToken(invocation);\n    }\n```\nSnippet from `struts2-core`\u0027s core/src/main/java/org/apache/struts2/interceptor/TokenInterceptor.java, lines 140-150, \nshowing the interceptor calling for token validation -- note, too, the improper, unsafe synchronisation on \n`session.getId().intern()`, though that is a separate finding with a separate write-up\n\n```java\n    @Override\n    protected String handleToken(ActionInvocation invocation) throws Exception {\n        //see WW-2902: we need to use the real HttpSession here, as opposed to the map\n        //that wraps the session, because a new wrap is created on every request\n        HttpSession session = ServletActionContext.getRequest().getSession(true);\n        synchronized (session.getId().intern()) {\n            if (!TokenHelper.validToken()) {\n                return handleInvalidToken(invocation);\n            }\n            return handleValidToken(invocation);\n        }\n    }\n```\nCode from `struts2-core`\u0027s core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java, lines \n104-115, showing the interceptor calling for token validation -- note, too, the improper, unsafe synchronisation on \n`session.getId().intern()`, though that is a separate finding with a separate write-up\n_______________________________________________\nSent through the Full Disclosure mailing list\nhttps://nmap.org/mailman/listinfo/fulldisclosure\nWeb Archives \u0026 RSS: https://seclists.org/fulldisclosure/"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-11-02T09:47:23Z",
        "orgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
        "shortName": "VULNARCHIVE"
      },
      "references": [
        {
          "tags": [
            "technical-description"
          ],
          "url": "https://vuln.freearchive.org/archive/full-disclosure/2026/Nov/6"
        },
        {
          "tags": [
            "technical-description"
          ],
          "url": "https://seclists.org/fulldisclosure/2026/Nov/6"
        },
        {
          "url": "https://nmap.org/mailman/listinfo/fulldisclosure"
        },
        {
          "url": "https://seclists.org/fulldisclosure/"
        }
      ],
      "source": {
        "defect": [
          "https://seclists.org/fulldisclosure/2026/Nov/6"
        ],
        "discovery": "EXTERNAL"
      },
      "title": "Apache Struts2 Core TokenHelper Token Cryptographic Timing Side-Channel",
      "x_gcve": [
        {
          "recordType": "advisory",
          "relationships": [],
          "vulnId": "GCVE-1988-2026-0531",
          "x_vulnarchive": {
            "archiveUrl": "https://vuln.freearchive.org/archive/full-disclosure/2026/Nov/6",
            "automated": true,
            "contentSha256": "044200c139b8cd0f5d7295ea756dda08f09367d31f08f0c057f69133a4d8b66c",
            "evidenceScore": 7,
            "messageId": "",
            "originalUrl": "https://seclists.org/fulldisclosure/2026/Nov/6",
            "policy": "vulnarchive-1",
            "sourceFormat": "text/html",
            "sourcePublishedAt": "2026-10-31T21:21:13Z"
          }
        }
      ]
    }
  },
  "cveMetadata": {
    "assignerOrgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
    "assignerShortName": "VULNARCHIVE",
    "datePublished": "2026-11-02T09:47:23Z",
    "dateUpdated": "2026-11-02T09:47:23Z",
    "state": "PUBLISHED",
    "vulnId": "GCVE-1988-2026-0531"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.