CyberSecBulletin
CVE-2022-25857NVD status: Modified

org.yaml:snakeyaml: Improper Restriction of Recursive Entity References in DTDs

CVE-2022-25857 is a high-severity improper restriction of recursive entity references in dtds vulnerability in org.yaml:snakeyaml, with a CVSS 3.1 base score of 7.5 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists version 1.31 as the first without the flaw, so updating org.yaml:snakeyaml to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 2.93% chance of exploitation within 30 days, higher than 87% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update org.yaml:snakeyaml to 1.31 or a later version.
  2. Update Snakeyaml to 1.31 or a later version.
  3. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
Org.yaml:snakeyamlorg.yaml:snakeyaml0; before 1.311.31
Snakeyaml ProjectSnakeyamlbefore 1.311.31
DebianDebian Linux10.0Not stated

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
NoneNo account or login is needed.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
NoneNo data is disclosed.
Integrity
NoneNothing can be modified.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.5HighCNA (snyk.io)
CVSS 3.17.5HighNVD

Official description

The package org.yaml:snakeyaml from 0 and before 1.31 are vulnerable to Denial of Service (DoS) due missing to nested depth limitation for collections.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Improper Restriction of Recursive Entity References in DTDs

The product uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.

How developers prevent this class of flaw

  • If possible, prohibit the use of DTDs or use an XML parser that limits the expansion of recursive DTD entities.
  • Before parsing XML files with associated DTDs, scan for recursive entity declarations and do not continue parsing potentially explosive content.

More Improper Restriction of Recursive Entity References in DTDs vulnerabilities (CWE-776)

Timeline

  1. CVE record published.
  2. Record last changed materially (score, affected products, status or references).

References

Third-party and government advisories

Technical write-ups (may include proof of concept)

Recent Improper Restriction of Recursive Entity References in DTDs vulnerabilities

Spotted an error? Tell us.