# CVE-2022-32190: Failure to strip relative path components in net/url

> The Go net/url library fails to strip relative path components, potentially allowing path traversal in applications using JoinPath.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 13 Sep 2022
- **Updated:** 3 Aug 2024
- **Also known as:** BIT-golang-2022-32190, DEBIAN-CVE-2022-32190, GHSA-q856-gh5w-3vwg, GO-2022-0988, RHBA-2023:0568

## What is CVE-2022-32190?

CVE-2022-32190 is a high-severity path traversal vulnerability in Golang Go, published on 13 Sep 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

JoinPath and URL.JoinPath do not remove ../ path elements appended to a relative path. For example, JoinPath("https://go.dev", "../go") returns the URL "https://go.dev/../go", despite the JoinPath documentation stating that ../ path elements are removed from the result.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2022-32190?

2 open source packages ship an affected version, including golang and stdlib. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `golang` | Bitnami | From 1.19.0-0 | 1.19.1 |
| `stdlib` | Go | From 1.19.0-0 | 1.19.1 |
| `atomic-openshift-service-idler` | Red Hat:openshift:4.12::el8 | All versions | 0:4.12.0-202301312133.p0.ga0f9090.assembly.stream.el8 |
| `bpftool` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `bpftool-debuginfo` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `buildah` | Red Hat:openshift:4.12::el8 | All versions | 1:1.23.4-3.rhaos4.12.el8 |
| `buildah-debuginfo` | Red Hat:openshift:4.12::el8 | All versions | 1:1.23.4-3.rhaos4.12.el8 |
| `buildah-debugsource` | Red Hat:openshift:4.12::el8 | All versions | 1:1.23.4-3.rhaos4.12.el8 |
| `buildah-tests` | Red Hat:openshift:4.12::el8 | All versions | 1:1.23.4-3.rhaos4.12.el8 |
| `buildah-tests-debuginfo` | Red Hat:openshift:4.12::el8 | All versions | 1:1.23.4-3.rhaos4.12.el8 |
| `containers-common` | Red Hat:openshift:4.12::el8 | All versions | 2:1-32.rhaos4.12.el8 |
| `kernel` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-core` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-cross-headers` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debug` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debug-core` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debug-debuginfo` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debug-devel` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debug-modules` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debug-modules-extra` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debug-modules-internal` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debuginfo` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debuginfo-common-aarch64` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debuginfo-common-ppc64le` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debuginfo-common-s390x` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-debuginfo-common-x86_64` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-devel` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-doc` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-headers` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-ipaclones-internal` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-modules` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-modules-extra` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-modules-internal` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.43.1.el8_6 |
| `kernel-rt` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.41.1.rt7.198.el8_6 |
| `kernel-rt-core` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.41.1.rt7.198.el8_6 |
| `kernel-rt-debug` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.41.1.rt7.198.el8_6 |
| `kernel-rt-debug-core` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.41.1.rt7.198.el8_6 |
| `kernel-rt-debug-debuginfo` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.41.1.rt7.198.el8_6 |
| `kernel-rt-debug-devel` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.41.1.rt7.198.el8_6 |
| `kernel-rt-debug-kvm` | Red Hat:openshift:4.12::el8 | All versions | 0:4.18.0-372.41.1.rt7.198.el8_6 |

Products: Golang Go.

## How do I fix CVE-2022-32190?

Upgrade golang to 1.19.1 or later.

## Is CVE-2022-32190 being exploited?

There is no known exploitation of CVE-2022-32190 in the wild and no public exploit code.

## Other vulnerabilities in Golang Go

- [CVE-2020-0601](https://insights.sbomify.com/CVE-2020-0601/): Microsoft Windows CryptoAPI Spoofing (high 8.1, exploited in the wild)
- [CVE-2026-27143](https://insights.sbomify.com/CVE-2026-27143/): Missing bound checks can lead to memory corruption in safe Go in cmd/compile (critical 9.8)
- [CVE-2024-24790](https://insights.sbomify.com/CVE-2024-24790/): Unexpected behavior from Is methods for IPv4-mapped IPv6 addresses in net/netip (critical 9.8)
- [CVE-2023-39320](https://insights.sbomify.com/CVE-2023-39320/): Arbitrary code execution via go.mod toolchain directive in cmd/go (critical 9.8)
- [CVE-2023-24540](https://insights.sbomify.com/CVE-2023-24540/): Improper handling of JavaScript whitespace in html/template (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-32190 and fix it if it is affected.

What it is: CVE-2022-32190 is a high-severity path traversal vulnerability in Golang Go, published on 13 Sep 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-32190 in the wild and no public exploit code.

Affected packages and fixed versions:
- golang (Bitnami): affected from 1.19.0-0; fixed in 1.19.1
- stdlib (Go): affected from 1.19.0-0; fixed in 1.19.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-32190/ (Markdown: https://insights.sbomify.com/CVE-2022-32190/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-32190
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-32190
- OSV: https://osv.dev/vulnerability/CVE-2022-32190

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-32190/
Summaries are generated and may contain mistakes; the official description above is the record.
