Exploited now
Vulnerability WatchVulnerabilities, exploits & advisories — updated every 15 minutes
Alerts

Home › CVE › Vulnerabilities

CVE-2022-24836

High · CVSS 7.5EPSS 3.5% First seen December 01, 2026
Vulnerabilities

Research article

Nokogiri HTML encoding detection inefficient regular expression enables denial of service (CVE-2022-24836)

CVECVE-2022-24836
PublishedDecember 02, 2026 00:30 UTC
Research cut-offDecember 02, 2026 00:25 UTC
Sources reviewed4: NVD record (last modified 2026-06-17); CISA KEV catalog; vendor advisory page (ubuntu.com); FIRST EPSS (2026-12-01)

Executive summary

CVE-2022-24836 is a denial-of-service flaw in the sparklemotion nokogiri library: an inefficient regular expression used for HTML encoding detection can drive excessive resource consumption while parsing HTML [1, 3]. NIST NVD scored it CVSS 3.1 7.5 HIGH with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, which reflects only a high availability impact [1]. The vendor's CVE record lists nokogiri versions before 1.13.4 as affected, and the fixed version is 1.13.4 [1]. The Ubuntu bulletin names ruby-nokogiri package builds 1.13.1+dfsg-2ubuntu0.1~esm2 and 1.10.7+dfsg1-2ubuntu0.1~esm3 as the fixed builds [3]. NVD's configuration data also lists Debian Linux 9.0 and 10.0, Fedora 34, 35 and 36, and macOS 13.0 to 13.1 (fixed in 13.1) as affected configurations [1]. The exploitation prerequisites come from the vector: network access, no privileges, no user interaction, and an application that parses attacker-supplied HTML with Nokogiri [1, 3]. CISA's KEV catalog did not list the CVE as of 2026-12-02, and the FIRST EPSS estimate is 3.52% for 30-day exploitation activity, which is a statistical estimate and not evidence of exploitation [2, 4]. The most important immediate action is to inventory every Nokogiri installation and upgrade it to 1.13.4 or the distribution build that fixes it [1, 3].

Key points

  • CVE-2022-24836 is an availability flaw in nokogiri: an inefficient regular expression used for HTML encoding detection can exhaust resources [1, 3].
  • NVD scores it CVSS 3.1 7.5 HIGH with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H [1].
  • The vendor CVE record lists nokogiri versions before 1.13.4 as affected; the fixed version is 1.13.4 [1].
  • Ubuntu identifies ruby-nokogiri builds 1.13.1+dfsg-2ubuntu0.1~esm2 and 1.10.7+dfsg1-2ubuntu0.1~esm3 as fixed [3].
  • CISA KEV did not list the CVE as of 2026-12-02; the EPSS estimate is 0.0352 and is not evidence of exploitation [2, 4].

Vulnerability identification

FieldValue
CVE IDCVE-2022-24836 [1]
Vendor and productsparklemotion nokogiri [1]
Affected componentHTML encoding detection in the HTML, XML, SAX and Reader parsers of Nokogiri [3]
Published2022-04-11T22:15:07 [1]
Last modified2026-06-17T04:32:37 [1]
Record statusModified [1]
CWECWE-1333 (Inefficient Regular Expression Complexity) and CWE-400 (Uncontrolled Resource Consumption) [1]
CVSS 3.1 base score7.5 HIGH; vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H; scored by NIST NVD (Primary) [1]
Other CVSS scoresNone in the reviewed sources [1]
Related identifiersAdvisory GHSA-crjr-9rc5-ghw8, Gentoo GLSA 202208-29, Apple HT213532, Ubuntu notice USN-9363-1 [1, 3]

CWE-1333 describes a regular expression whose matching cost grows sharply for particular inputs, so a single check can consume disproportionate processing time. CWE-400 describes a program that lets input drive resource use without a limit. NVD mapped both [1].

Technical background

Nokogiri is a Ruby library for parsing HTML and XML. The affected component is its HTML, XML, SAX and Reader parser family [3]. SAX (Simple API for XML) is an event-driven parser, and Reader is a pull-style parser. Before a parser can read a document, it must decide how the bytes map to characters; this is encoding detection. The flaw sits in that detection step for HTML documents [3].

Vulnerability description

The flaw is an inefficient regular expression used to detect the encoding of an HTML document. When a document has incorrect encoding information, the detection step can consume excessive resources, which may lead to denial of service through resource exhaustion [3]. The security property violated is availability. The vector scores high impact on availability and no impact on confidentiality or integrity [1]. The reviewed sources describe no code execution, data disclosure or memory corruption from this flaw [1, 3].

Root cause analysis

Confirmed (per the Ubuntu bulletin): the root cause is the use of an inefficient regular expression for encoding detection during HTML parsing [3].

Analyst assessment: a pattern whose matching work grows faster than the input length will take disproportionate time on crafted input. This is the mechanism CWE-1333 describes [1]. The reviewed sources do not contain the regular expression, the upstream patch diff, or the advisory text, so the exact pattern and the fix are unknown.

Attack surface and exploitation prerequisites

PrerequisiteBasis
Network access (AV:N)Vector only [1]
Low attack complexity (AC:L)Vector only [1]
No privileges required (PR:N)Vector only [1]
No user interaction (UI:N)Vector only [1]
Unchanged scope (S:U)Vector only [1]
Application parses attacker-supplied HTML with Nokogiri's HTML parserStated by the advisory's description of the parsing path [3]; the vector does not show this

The vector alone does not prove that any given deployment is reachable. The attacker must be able to get an HTML document to a parsing call that uses the affected code path. The reviewed sources do not identify default configurations or enabled features that make this path reachable [3].

Impact analysis

PropertyAssessmentBasis
ConfidentialityNone per vector[1]
IntegrityNone per vector[1]
AvailabilityHigh per vector; denial of service through resource exhaustion[1, 3]
Authentication and authorizationNo authentication required per vector[1]
Business operationsAnalyst assessment: a parsing endpoint or background job that stalls on crafted input may cause service interruptionAnalyst assessment

Downstream consequences depend on how an application uses Nokogiri. The reviewed sources give no regulatory or contractual consequence.

Affected products and versions

Vendor or productAffected versionsFixed versionSource and qualification
sparklemotion nokogiriLess than 1.13.4 (vendor CVE record)1.13.4[1]; the vendor-published range
Ubuntu ruby-nokogiriPrior to 1.13.1+dfsg-2ubuntu0.1~esm2 and 1.10.7+dfsg1-2ubuntu0.1~esm31.13.1+dfsg-2ubuntu0.1~esm2 and 1.10.7+dfsg1-2ubuntu0.1~esm3[3]; distribution package builds, not upstream versions
Debian Linux9.0 and 10.0 (NVD CPE)Not in the reviewed sources[1]
Fedora34, 35 and 36 (NVD CPE)Not in the reviewed sources[1]
Apple macOS13.0 or later and before 13.1 (NVD CPE)13.1[1]; the record references an Apple support entry

The Debian and Fedora entries are operating system versions from NVD's configuration data, not package versions. Nokogiri's own range and the Ubuntu builds come from different publishers, and the record does not say how they correspond. The macOS entry is an operating system range and does not establish that a given macOS build bundles a vulnerable Nokogiri.

Exploitation and threat intelligence status

CISA's KEV catalog did not list CVE-2022-24836 as of 2026-12-02. The catalog listing is not evidence that the CVE has not been exploited [2]. The FIRST EPSS estimate is 0.0352 (3.52%) for exploitation activity in the next 30 days, with percentile 0.8952, dated 2026-12-01. EPSS is a statistical model estimate and does not show that exploitation has happened [4]. The reviewed sources list no proof-of-concept exploit and no threat actor or campaign for this CVE [1, 2, 4]. Exploitation in the wild is not established by the reviewed sources.

Detection and exposure assessment

  1. Inventory Ruby applications by reading lock files. Run grep -R "nokogiri (" --include=Gemfile.lock /path/to/apps (read-only; requires read access to the application trees). The output lists the locked nokogiri version for each project. Compare each version with 1.13.4 [1].
  2. On Ubuntu hosts, run apt-cache policy ruby-nokogiri (read-only; standard APT tooling). The output shows the installed and candidate versions. Compare the installed version with the fixed builds listed in [3].
  3. On macOS hosts, run sw_vers -productVersion (read-only). Compare the result with 13.1, the fixed release in the NVD configuration [1].
  4. A version match shows presence of the affected code, not that an attacker can reach it. Check whether the application passes untrusted HTML to Nokogiri's HTML parser (analyst assessment; the code path is the deciding factor).

The reviewed sources give no detection signatures, log events or telemetry fields for this CVE.

Remediation

Immediate mitigation (analyst assessment, not vendor-confirmed): limit request body size for endpoints that accept HTML from untrusted users, using the reverse proxy or gateway limit, and keep timeouts on parsing workers. These limits reduce the input size an attacker can send. They do not remove the regular expression, and they may reject large legitimate documents.

Permanent fix (vendor-supported): upgrade nokogiri to 1.13.4 or later [1]. On Ubuntu, install the update that provides ruby-nokogiri 1.13.1+dfsg-2ubuntu0.1~esm2 or 1.10.7+dfsg1-2ubuntu0.1~esm3, which the bulletin describes as a standard system update [3]. On macOS, install 13.1 or later [1].

After updating: restart or reload any process that loaded the old library, because a running Ruby process keeps the previously loaded gem (analyst assessment based on standard Ruby behaviour). Verify with the commands in the detection section. Keep the previous lock file so you can roll back, and test parsing of representative HTML documents in staging before production.

Recommended hardening (analyst assessment): add a parsing timeout around every HTML parse of untrusted input, so that slow parsing fails without blocking other work.

Remediation checklist

  1. Inventory every Ruby project that uses Nokogiri by searching Gemfile.lock files for the nokogiri entry and record each locked version; flag anything below 1.13.4 [1].
  2. Upgrade nokogiri to 1.13.4 or later in each affected project, update the lock file, and run the application's test suite [1].
  3. On Ubuntu hosts, apply the standard system update that provides ruby-nokogiri 1.13.1+dfsg-2ubuntu0.1~esm2 or 1.10.7+dfsg1-2ubuntu0.1~esm3, then confirm with apt-cache policy ruby-nokogiri [3].
  4. On Debian Linux 9.0 and 10.0 and Fedora 34 to 36 systems, identify the package providing Nokogiri and apply the distribution's update; the reviewed sources do not give the fixed package builds [1].
  5. On macOS hosts, install 13.1 or later and confirm with sw_vers -productVersion [1].
  6. Before patching, cap request body size at the reverse proxy or gateway for endpoints that accept untrusted HTML, to reduce the input an attacker can send (analyst assessment; not vendor-confirmed).
  7. After upgrading, restart or reload every process that loaded the old library, because the running process keeps the previously loaded code (analyst assessment based on standard Ruby behaviour).
  8. Verify remediation by re-running the version inventory and confirming that no project still locks a version below 1.13.4 [1].
  9. Keep the previous lock file and a rollback procedure available until parsing tests pass in production-like conditions (analyst assessment).

Evidence gaps

  • Not established by the reviewed sources: the exact regular expression and the upstream patch diff; the commit referenced in the record is not included in the pack, so the precise fix is unknown.
  • Not established by the reviewed sources: fixed package builds for Debian Linux 9.0 and 10.0 and for Fedora 34, 35 and 36; settle this by reading the distribution advisories the record references.
  • Not established by the reviewed sources: whether the Ubuntu builds and the upstream nokogiri range match; settle this with the upstream advisory text.
  • Not established by the reviewed sources: the full text of the upstream GitHub Security Advisory, which the pack lists only as a reference.
  • Not established by the reviewed sources: which default configurations or application frameworks pass untrusted HTML to the affected parser.
  • Not established by the reviewed sources: proof-of-concept or exploit references and any confirmed exploitation in the wild; the KEV catalog listing and the EPSS value do not settle this.
  • Not established by the reviewed sources: indicators of compromise, log events or telemetry fields; settle this with the vendor's detection guidance or incident data.
  • Not established by the reviewed sources: CVSS scores other than CVSS 3.1 from NVD, and any change history explaining the 2026-06-17 modification of the NVD record.
  • Not established by the reviewed sources: the macOS builds that bundle a vulnerable Nokogiri; settle this with the Apple support entry the record references.

References

  1. CVE-2022-24836 record. NIST National Vulnerability Database (NVD), 2026-06-17. https://nvd.nist.gov/vuln/detail/CVE-2022-24836. Accessed 2026-12-02. CVE identity, publication and modification dates, record status, CWE mappings, CVSS 3.1 score and vector, vendor-published affected range (less than 1.13.4), fixed version 1.13.4, NVD CPE entries for Debian, Fedora and macOS, and the reference identifiers.
  2. Known Exploited Vulnerabilities Catalog. Cybersecurity and Infrastructure Security Agency (CISA), 2026-12-02. https://www.cisa.gov/known-exploited-vulnerabilities-catalog. Accessed 2026-12-02. CISA KEV status: CVE-2022-24836 not listed as of 2026-12-02, with the caveat that this does not show absence of exploitation.
  3. Vendor bulletin page (ubuntu.com). ubuntu.com. https://ubuntu.com/security/notices/USN-9363-1. Accessed 2026-12-02. Affected component, vulnerability mechanism (inefficient regular expression for encoding detection), denial-of-service impact, Ubuntu package fixed builds and the standard-update recommendation, and the root cause as stated by the bulletin.
  4. EPSS score for CVE-2022-24836. FIRST, 2026-12-01. https://api.first.org/data/v1/epss?cve=CVE-2022-24836. Accessed 2026-12-02. FIRST EPSS estimate of 0.0352 with percentile 0.8952 dated 2026-12-01, qualified as a statistical estimate and not evidence of exploitation.

Written with AI assistance from the 4 sources listed above, as of the research cut-off; each fact is cited to its source. Check the vendor's advisory before acting.

Summary

It was discovered that Nokogiri used an inefficient regular expression when detecting the encoding of HTML documents. An attacker could possibly use this issue to cause Nokogiri to consume excessive resources, leading to a denial of service. (CVE-2022-24836) It was discovered that Nokogiri incorrectly checked the bounds of indexes into node sets, leading to an out-of-bounds read. An attacker coul…

Excerpt from Ubuntu USN. No official description has been published yet.

Severity breakdown

High · 7.5 CVSS 3.1 base score from NVD

An attacker without an account can exploit this over the network, without any user action.

Attack from
the network (remotely)
Attack complexity
low (no special conditions)
Login needed
no
User action needed
no
Scope
stays within the vulnerable component
Impact
high on availability, none on confidentiality and integrity

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

Weakness

  • CWE-1333: Inefficient Regular Expression Complexity
  • CWE-400: Uncontrolled Resource Consumption

Affected and fixed versions

ProductAffected versionsFixed in
sparklemotion nokogiri< 1.13.4—

From the vendor's CVE record; confirm with the vendor advisory before relying on a version number.

References by type

Vendor advisories

Patches and fixed releases

Other references

Details from NVD (public domain).

Frequently asked questions

What is CVE-2022-24836?

CVE-2022-24836 is a denial-of-service flaw in the sparklemotion nokogiri library: an inefficient regular expression used for HTML encoding detection can drive excessive resource consumption while parsing HTML. NIST NVD scored it CVSS 3.1 7.5 HIGH with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, which reflects only a high availability impact. Weakness type: Inefficient Regular Expression Complexity (CWE-1333).

How severe is CVE-2022-24836?

CVE-2022-24836 has a CVSS 3.1 base score of 7.5 (high), from NVD. An attacker without an account can exploit this over the network, without any user action.

Is CVE-2022-24836 being exploited?

Not as far as is known: CVE-2022-24836 is not in CISA's Known Exploited Vulnerabilities catalog as of December 3, 2026. EPSS estimates a 3.5% chance that it is exploited in the next 30 days.

Which versions are affected by CVE-2022-24836?

sparklemotion nokogiri < 1.13.4.

How do I fix CVE-2022-24836?

Inventory every Ruby project that uses Nokogiri by searching Gemfile.lock files for the nokogiri entry and record each locked version; flag anything below 1.13.4. Upgrade nokogiri to 1.13.4 or later in each affected project, update the lock file, and run the application's test suite. On Ubuntu hosts, apply the standard system update that provides ruby-nokogiri 1.13.1+dfsg-2ubuntu0.1~esm2 or 1.10.7+dfsg1-2ubuntu0.1~esm3, then confirm with apt-cache policy ruby-nokogiri.

Timeline & sources

References