CVE-2020-25739 Gon gem lack of escaping certain input when outputting as JSON
The gon gem for Ruby fails to escape fields by default, allowing attackers to inject malicious scripts via XSS.
- 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-25739?
CVE-2020-25739 is a medium-severity cross-site scripting vulnerability in Canonical Ubuntu Linux, published on 23 Sep 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
An issue was discovered in the gon gem before gon-6.4.0 for Ruby. MultiJson does not honor the escape_mode parameter to escape fields as an XSS protection mechanism. To mitigate, json_dumper.rb in gon now does escaping for XSS by default without relying on MultiJson.
Weakness: CWE-79
Which versions are affected by CVE-2020-25739?
2 open source packages ship an affected version, including gon. It affects 3 products.
| Package | Affected | Fixed in |
|---|---|---|
gon RubyGems | All versions | 6.4.0 |
gon RubyGems | All versions | 6.4.0 |
Products include Canonical Ubuntu Linux, Debian Debian Linux, Gon Project Gon.
How do I fix CVE-2020-25739?
Upgrade gon to 6.4.0 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-25739 being exploited?
There is no known exploitation of CVE-2020-25739 in the wild and no public exploit code.
Other vulnerabilities in Canonical Ubuntu Linux
Sources
Also known as DEBIAN-CVE-2020-25739, DLA-2380-1, GHSA-78vq-9j56-wrfr, UBUNTU-CVE-2020-25739, USN-4560-1.