GCVE-1988-2026-0480

Vulnerability from gna-1988 – Published: 2026-11-02 07:30 – Updated: 2026-11-02 07:30
VLAI
Title
Apache Struts2 REST Plugin Untrimmed `Accept` Header Tokens Break Content Negation Fallback
Summary
Description The Apache Struts2 REST Plugin's `DefaultContentTypeHandlerManager.getHandlerForResponse(HttpServletRequest, HttpServletResponse)` splits the `Accept` header on commas and passes each resulting token directly to `findHandler(String)` without trimming leading or trailing whitespace. `findHandler(String)` only retries a trimmed lookup when a token contains a semicolon (`;`), so a token that merely carries a leading space has no such fallback and fails the direct map lookup. Impact Any client that sends a standard, comma-space-separated `Accept` header -- the typical of most Hypertext Transfer Protocol (HTTP) client libraries -- triggers this. As the lookup fails silently, `getHandlerForResponse()` falls through to the `defaultExtension` handler instead of the content type the caller actually requested, silently returning a representation that the client neither asked for nor can necessarily parse. In deployments that rely on content negotiation to select between differently-scoped representations of the same resource -- such as a minimal public representation served as the default extension against a fuller representation only intended for a specific, explicitly-requested type -- this fallback can cause the wrong representation to be returned, degrading interoperability and, where the two representations differ in which fields they expose, create a data-exposure vulnerability (insecure serialisation). While attackers cannot choose the default representation, they can abuse this to search for insecure serialisation, data exposures, and similar information disclosure issues, as well as to see if there is a difference between various representations and the default. Importantly, the default representation and ensuing serialisation library can be used against the information system (a trivial task). Examples Sample Code `getHandlerForResponse(HttpServletRequest, HttpServletResponse)` splits the raw `Accept` header on commas and sends each token to `findHandler(String)`, whose direct map lookup only has a trimming fallback when the token contains a semicolon, as shown below. ```java /** * Gets the handler for the response by looking at the extension of the request * @param request The request * @return The appropriate handler * * WW-4588: modified to get a handler for the response side and auto generate the response type * from the Accept: header * */ @Override public ContentTypeHandler getHandlerForResponse(HttpServletRequest request, HttpServletResponse res) { String extension = getExtensionIfPresent(request.getRequestURI()); if (extension == null) { extension = defaultExtension; final String acceptHeader = request.getHeader("accept") ; if (acceptHeader != null) { final String[] types = acceptHeader.split(","); for (final String type : types) { final ContentTypeHandler handler = findHandler(type); if (handler != null) { return handler; } } } } return handlersByExtension.get(extension); } private ContentTypeHandler findHandler(final String type) { ContentTypeHandler handler = handlersByContentType.get(type); if (handler == null) { // strip off encoding and search again (e.g., application/json;charset=ISO-8859-1) final int index = type.indexOf(';'); if (index != -1) { return handlersByContentType.get(type.substring(0, index).trim()); } } return handler; } ``` Code snippet from `struts2-rest-plugin`'s plugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java, lines 128-158 _______________________________________________ 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 REST Affected: unknown
guessed Create a notification for this product.

{
  "containers": {
    "cna": {
      "affected": [
        {
          "product": "Struts2 REST",
          "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 REST Plugin\u0027s `DefaultContentTypeHandlerManager.getHandlerForResponse(HttpServletRequest, \nHttpServletResponse)` splits the `Accept` header on commas and passes each resulting token directly to \n`findHandler(String)` without trimming leading or trailing whitespace.  `findHandler(String)` only retries a trimmed \nlookup when a token contains a semicolon (`;`), so a token that merely carries a leading space has no such fallback and \nfails the direct map lookup.\n\nImpact\nAny client that sends a standard, comma-space-separated `Accept` header -- the typical of most Hypertext Transfer \nProtocol (HTTP) client libraries -- triggers this.  As the lookup fails silently, `getHandlerForResponse()` falls \nthrough to the `defaultExtension` handler instead of the content type the caller actually requested, silently returning \na representation that the client neither asked for nor can necessarily parse.  In deployments that rely on content \nnegotiation to select between differently-scoped representations of the same resource -- such as a minimal public \nrepresentation served as the default extension against a fuller representation only intended for a specific, \nexplicitly-requested type -- this fallback can cause the wrong representation to be returned, degrading \ninteroperability and, where the two representations differ in which fields they expose, create a data-exposure \nvulnerability (insecure serialisation).  While attackers cannot choose the default representation, they can abuse this \nto search for insecure serialisation, data exposures, and similar information disclosure issues, as well as to see if \nthere is a difference between various representations and the default.  Importantly, the default representation and \nensuing serialisation library can be used against the information system (a trivial task).\n\nExamples\nSample Code\n`getHandlerForResponse(HttpServletRequest, HttpServletResponse)` splits the raw `Accept` header on commas and sends \neach token to `findHandler(String)`, whose direct map lookup only has a trimming fallback when the token contains a \nsemicolon, as shown below.\n\n```java\n    /**\n     * Gets the handler for the response by looking at the extension of the request\n     * @param request The request\n     * @return The appropriate handler\n     *\n     * WW-4588: modified to get a handler for the response side and auto generate the response type\n     * from the Accept: header\n     *\n     */\n    @Override\n    public ContentTypeHandler getHandlerForResponse(HttpServletRequest request, HttpServletResponse res) {\n\n        String extension = getExtensionIfPresent(request.getRequestURI());\n        if (extension == null) {\n            extension = defaultExtension;\n            final String acceptHeader = request.getHeader(\"accept\") ;\n            if (acceptHeader != null) {\n                final String[] types = acceptHeader.split(\",\");\n                for (final String type : types) {\n                    final ContentTypeHandler handler = findHandler(type);\n                    if (handler != null) {\n                        return handler;\n                    }\n                }\n            }\n        }\n        return handlersByExtension.get(extension);\n    }\n\n    private ContentTypeHandler findHandler(final String type) {\n        ContentTypeHandler handler = handlersByContentType.get(type);\n        if (handler == null) {\n            // strip off encoding and search again (e.g., application/json;charset=ISO-8859-1)\n            final int index = type.indexOf(\u0027;\u0027);\n            if (index != -1) {\n                return handlersByContentType.get(type.substring(0, index).trim());\n            }\n        }\n        return handler;\n    }\n```\nCode snippet from `struts2-rest-plugin`\u0027s \nplugins/rest/src/main/java/org/apache/struts2/rest/DefaultContentTypeHandlerManager.java, lines 128-158\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-02T07:30:01Z",
        "orgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
        "shortName": "VULNARCHIVE"
      },
      "references": [
        {
          "tags": [
            "technical-description"
          ],
          "url": "https://vuln.freearchive.org/archive/full-disclosure/2026/Nov/1"
        },
        {
          "tags": [
            "technical-description"
          ],
          "url": "https://seclists.org/fulldisclosure/2026/Nov/1"
        },
        {
          "url": "https://nmap.org/mailman/listinfo/fulldisclosure"
        },
        {
          "url": "https://seclists.org/fulldisclosure/"
        }
      ],
      "source": {
        "defect": [
          "https://seclists.org/fulldisclosure/2026/Nov/1"
        ],
        "discovery": "EXTERNAL"
      },
      "title": "Apache Struts2 REST Plugin Untrimmed `Accept` Header Tokens Break Content Negation Fallback",
      "x_gcve": [
        {
          "recordType": "advisory",
          "relationships": [],
          "vulnId": "GCVE-1988-2026-0480",
          "x_vulnarchive": {
            "archiveUrl": "https://vuln.freearchive.org/archive/full-disclosure/2026/Nov/1",
            "automated": true,
            "contentSha256": "39a913e28fcd0c859fde13fe06055f1a775142c59150158b86380e5e9bc1c461",
            "evidenceScore": 7,
            "messageId": "",
            "originalUrl": "https://seclists.org/fulldisclosure/2026/Nov/1",
            "policy": "vulnarchive-1",
            "sourceFormat": "text/html",
            "sourcePublishedAt": "2026-10-29T11:34:48Z"
          }
        }
      ]
    }
  },
  "cveMetadata": {
    "assignerOrgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
    "assignerShortName": "VULNARCHIVE",
    "datePublished": "2026-11-02T07:30:01Z",
    "dateUpdated": "2026-11-02T07:30:01Z",
    "state": "PUBLISHED",
    "vulnId": "GCVE-1988-2026-0480"
  },
  "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.