org.json:json@20231013

  • latest version

    20260814

  • latest non vulnerable version

  • first published

    19 years ago

  • latest version published

    3 months ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.json:json package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via numeric conversion in the JSONObject.stringToValue() and XML.stringToValue() methods. An attacker can send JSON or XML containing an extremely long numeric literal to an application that parses attacker-controlled input with org.json; constructing a BigInteger or BigDecimal from it consumes excessive CPU and blocks request-handling threads, causing legitimate requests to time out.

    Workarounds

    • Set nginx’s client_max_body_size 64k; to limit request bodies and reduce the maximum size of numeric literals reaching the parser.
    • In Spring Boot, register a CommonsRequestLoggingFilter or OncePerRequestFilter that caps Content-Length before the request reaches the controller, limiting the size of inputs the parser processes.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade org.json:json to version 20260719 or higher.

    [20150729,20260719)