Miggo Logo

CVE-2022-29546: OutOfMemory Exception by specifically crafted processing instruction in NekoHtml Parser

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.34264%
Published
4/26/2022
Updated
1/27/2023
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
net.sourceforge.htmlunit:neko-htmlunitmaven< 2.61.02.61.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper input termination handling in the processing instruction parsing logic. The commit diff shows the critical fix in HTMLScanner.java's scanPI() method, where a missing EOF check (-1) allowed infinite buffer growth. The added test case 'invalidProcessingInstruction' demonstrates how malformed PI input (<?a/) triggers this condition. The function's loop structure and buffer append operation directly correlate with uncontrolled memory consumption described in CWE-400.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t N*ko*tml P*rs*r su***rs *rom * **ni*l o* s*rvi** vuln*r**ility on v*rsions *.**.* *n* **low. * sp**i*i**lly *r**t** input r***r*in* t** p*rsin* o* pro**ssin* instru*tions l***s to ***p m*mory *onsumption. Pl**s* up**t* to v*rsion *.**.*.

Reasoning

T** vuln*r**ility st*ms *rom improp*r input t*rmin*tion **n*lin* in t** pro**ssin* instru*tion p*rsin* lo*i*. T** *ommit *i** s*ows t** *riti**l *ix in `*TMLS**nn*r.j*v*`'s `s**nPI()` m*t*o*, w**r* * missin* *O* ****k (-*) *llow** in*init* *u***r *ro