CVE-2022-40082 Hertz contains path traversal via normalizePath function

High 7.5 Published Updated

Attackers can exploit a path traversal flaw in the Hertz Go web framework to read arbitrary files from the server.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-40082?

CVE-2022-40082 is a high-severity path traversal vulnerability in n/a, published on 28 Sep 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Hertz v0.3.0 ws discovered to contain a path traversal vulnerability via the normalizePath function.

Weakness: CWE-22

Which versions are affected by CVE-2022-40082?

3 open source packages ship an affected version, including github.com/cloudwego/hertz. It affects 1 product.

PackageAffectedFixed in
github.com/cloudwego/hertz GoAll versions0.3.1
github.com/cloudwego/hertz GoAll versions0.3.1
github.com/cloudwego/hertz GoAll versions0.3.1

Products include Cloudwego Hertz.

How do I fix CVE-2022-40082?

Upgrade github.com/cloudwego/hertz to 0.3.1 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2022-40082 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-40082 exists.

Sources

Also known as GHSA-c9qr-f6c8-rgxf, GO-2022-1027.

Is CVE-2022-40082 in your software?

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

Check your SBOMs for free