Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2023-5072: Logic to exclude object keys that are themselves objects is imperfect · Issue #771 · stleary/JSON-java

Denial of Service in JSON-Java versions prior to 20230618. A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used.

CVE
#dos#js#java

It’s certainly possible to introduce a clearer rule for unquoted keys. Those aren’t standard JSON, but we can imagine that if people use them then they are expecting something like JavaScript semantics. Scanning to the first : is probably a fair approximation of that. For the example string {a:1,[{b:2,[{c:3,[{d:4}]:5}]:6}]:7}, I would expect that to be a syntax error. The first parsed keys would indeed be a, [{b, [{c, and [{d, with corresponding values 1, 2, 3, 4, but then the } after 4 would be interpreted as the end of the object. As far as I can see, the current code doesn’t actually throw an exception if there is junk after the closing }, so in fact the result would be

{
    "a":1,
    "[{b":2,
    "[{c":3,
    "[{d":4
}

A similar rule for unquoted values in arrays (scanning to the first , or ]) would I think be straightforward to do at the same time.

In both cases this can change the parse of some existing strings. For example {a:1,[{b:2,[{c:3,[{d:4}]:5}]:6}]:7} is currently parsed as an object with two keys: a and [{"b":2,"[{"c":3,"[{\"d\":4}]":5}]":6}]. For JSONArray, I think it means that some strings that are not currently accepted would be. [a}] is currently rejected but with the change it would be a single-element array containing the string a}.

To be honest, I’m not sure that this would be solving a problem that anyone has. I don’t think anyone has JSON strings like this that they expect to be able to parse with the results above, or to be able to parse at all. But the new rules are at least simpler to explain.

I will look into what’s involved in making another PR implementing these rules.

Related news

Red Hat Security Advisory 2024-6536-03

Red Hat Security Advisory 2024-6536-03 - Red Hat AMQ Streams 2.5.2 is now available from the Red Hat Customer Portal. Issues addressed include bypass, denial of service, information leakage, and memory leak vulnerabilities.

Red Hat Security Advisory 2024-3762-03

Red Hat Security Advisory 2024-3762-03 - Red Hat AMQ Broker 7.11.7 is now available from the Red Hat Customer Portal.

Red Hat Security Advisory 2024-3354-03

Red Hat Security Advisory 2024-3354-03 - Red Hat Fuse 7.13.0 release is now available. The purpose of this text-only errata is to inform you about the security issues fixed in this release. Issues addressed include HTTP request smuggling, bypass, denial of service, deserialization, and traversal vulnerabilities.

Red Hat Security Advisory 2024-1353-03

Red Hat Security Advisory 2024-1353-03 - An update is now available for Red Hat Process Automation Manager. Issues addressed include code execution, denial of service, and deserialization vulnerabilities.

Red Hat Security Advisory 2023-7845-03

Red Hat Security Advisory 2023-7845-03 - Red Hat Integration Camel for Spring Boot 3.20.4 release and security update is now available.

CVE-2023-50770: Jenkins Security Advisory 2023-12-13

Jenkins OpenId Connect Authentication Plugin 2.6 and earlier stores a password of a local user account used as an anti-lockout feature in a recoverable format, allowing attackers with access to the Jenkins controller file system to recover the plain text password of that account, likely gaining administrator access to Jenkins.

CVE-2023-50775: Jenkins Security Advisory 2023-12-13

A cross-site request forgery (CSRF) vulnerability in Jenkins Deployment Dashboard Plugin 1.0.10 and earlier allows attackers to copy jobs.

CVE-2023-50774: Jenkins Security Advisory 2023-12-13

A cross-site request forgery (CSRF) vulnerability in Jenkins HTMLResource Plugin 1.02 and earlier allows attackers to delete arbitrary files on the Jenkins controller file system.

CVE-2023-50773: Jenkins Security Advisory 2023-12-13

Jenkins Dingding JSON Pusher Plugin 2.0 and earlier does not mask access tokens displayed on the job configuration form, increasing the potential for attackers to observe and capture them.

CVE-2023-50771: Jenkins Security Advisory 2023-12-13

Jenkins OpenId Connect Authentication Plugin 2.6 and earlier improperly determines that a redirect URL after login is legitimately pointing to Jenkins, allowing attackers to perform phishing attacks.

CVE-2023-50777: Jenkins Security Advisory 2023-12-13

Jenkins PaaSLane Estimate Plugin 1.0.4 and earlier does not mask PaaSLane authentication tokens displayed on the job configuration form, increasing the potential for attackers to observe and capture them.

CVE-2023-50769: Jenkins Security Advisory 2023-12-13

Missing permission checks in Jenkins Nexus Platform Plugin 3.18.0-03 and earlier allow attackers with Overall/Read permission to connect to an attacker-specified HTTP server using attacker-specified credentials IDs obtained through another method, capturing credentials stored in Jenkins.

CVE-2023-50764: Jenkins Security Advisory 2023-12-13

Jenkins Scriptler Plugin 342.v6a_89fd40f466 and earlier does not restrict a file name query parameter in an HTTP endpoint, allowing attackers with Scriptler/Configure permission to delete arbitrary files on the Jenkins controller file system.

CVE-2023-50765: Jenkins Security Advisory 2023-12-13

A missing permission check in Jenkins Scriptler Plugin 342.v6a_89fd40f466 and earlier allows attackers with Overall/Read permission to read the contents of a Groovy script by knowing its ID.

CVE-2023-50766: Jenkins Security Advisory 2023-12-13

A cross-site request forgery (CSRF) vulnerability in Jenkins Nexus Platform Plugin 3.18.0-03 and earlier allows attackers to send an HTTP request to an attacker-specified URL and parse the response as XML.

CVE-2023-50779: Jenkins Security Advisory 2023-12-13

Missing permission checks in Jenkins PaaSLane Estimate Plugin 1.0.4 and earlier allow attackers with Overall/Read permission to connect to an attacker-specified URL using an attacker-specified token.

Red Hat Security Advisory 2023-7705-03

Red Hat Security Advisory 2023-7705-03 - Red Hat Build of Apache Camel for Quarkus 2.13.3 release and security update is now available. The purpose of this text-only errata is to inform you about the security issues fixed. Issues addressed include a denial of service vulnerability.

Red Hat Security Advisory 2023-7678-03

Red Hat Security Advisory 2023-7678-03 - Red Hat AMQ Streams 2.6.0 is now available from the Red Hat Customer Portal. Issues addressed include XML injection, bypass, and open redirection vulnerabilities.

Red Hat Security Advisory 2023-7617-02

Red Hat Security Advisory 2023-7617-02 - Red Hat Build of Apache Camel for Quarkus 3.2.0 is now available.

GHSA-rm7j-f5g5-27vv: Denial of Service in JSON-Java

Denial of Service in JSON-Java versions prior to 20230618.  A bug in the parser means that an input string of modest size can lead to indefinite amounts of memory being used. 

CVE: Latest News

CVE-2023-6905
CVE-2023-6903
CVE-2023-3907
CVE-2023-6904