# GHSA-57cf-349j-352g: Out-of-bounds Read in npmconf

> An out-of-bounds read in npmconf allows attackers to disclose uninitialized memory contents when processing typed numbers on Node.js 4.x.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 12 Jun 2019

## What is GHSA-57cf-349j-352g?

GHSA-57cf-349j-352g is a vulnerability in npmconf, published on 12 Jun 2019. 

### Official description

Versions of `npmconf` before 2.1.3 allocate and write to disk uninitialized memory contents when a typed number is passed as input on Node.js 4.x.

## Recommendation

Update to version 2.1.3 or later. Consider switching to another config storage mechanism, as npmconf is deprecated and should not be used.

## Which versions are affected by GHSA-57cf-349j-352g?

2 open source packages ship an affected version, including npmconf.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `npmconf` | npm | All versions | 2.1.3 |
| `npmconf` | npm | All versions | 2.1.3 |

## How do I fix GHSA-57cf-349j-352g?

Upgrade npmconf to 2.1.3 or later.

## Is GHSA-57cf-349j-352g being exploited?

There is no known exploitation of GHSA-57cf-349j-352g in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-57cf-349j-352g and fix it if it is affected.

What it is: GHSA-57cf-349j-352g is a vulnerability in npmconf, published on 12 Jun 2019. 
Exploitation: There is no known exploitation of GHSA-57cf-349j-352g in the wild and no public exploit code.

Affected packages and fixed versions:
- npmconf (npm): affected all versions; fixed in 2.1.3
- npmconf (npm): affected all versions; fixed in 2.1.3

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/GHSA-57cf-349j-352g/ (Markdown: https://insights.sbomify.com/GHSA-57cf-349j-352g/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-57cf-349j-352g

---
From sbomify Insights: https://insights.sbomify.com/GHSA-57cf-349j-352g/
Summaries are generated and may contain mistakes; the official description above is the record.
