CVE-2020-13973 Cross-site scripting in json-sanitizer

Medium 6.1 Published Updated

An attacker can inject malicious JavaScript into web pages by exploiting a parser confusion flaw in the OWASP json-sanitizer library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2020-13973?

CVE-2020-13973 is a medium-severity cross-site scripting vulnerability in n/a, published on 9 Jun 2020. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

OWASP json-sanitizer before 1.2.1 allows XSS. An attacker who controls a substring of the input JSON, and controls another substring adjacent to a SCRIPT element in which the output is embedded as JavaScript, may be able to confuse the HTML parser as to where the SCRIPT element ends, and cause non-script content to be interpreted as JavaScript.

Weakness: CWE-79

Which versions are affected by CVE-2020-13973?

2 open source packages ship an affected version, including com.mikesamuel:json-sanitizer. It affects 1 product.

PackageAffectedFixed in
com.mikesamuel:json-sanitizer MavenAll versions1.2.1
com.mikesamuel:json-sanitizer MavenAll versions1.2.1

Products include Owasp Json-Sanitizer.

How do I fix CVE-2020-13973?

Upgrade com.mikesamuel:json-sanitizer to 1.2.1 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2020-13973 being exploited?

There is no known exploitation of CVE-2020-13973 in the wild and no public exploit code.

Public exploit code: 2 proofs of concept on GitHub.

Sources

Also known as GHSA-g8jj-899q-8x3j.

Is CVE-2020-13973 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free