# CVE-2023-24827: Credential disclosure in syft when SYFT_ATTEST_PASSWORD environment variable set in syft

> Attackers can read sensitive passwords from logs or SBOM attestations if the SYFT_ATTEST_PASSWORD environment variable is set.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/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:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 7 Feb 2023
- **Updated:** 10 Mar 2025
- **Also known as:** GHSA-jp7v-3587-2956, GO-2023-1533

## What is CVE-2023-24827?

CVE-2023-24827 is a medium-severity vulnerability in anchore syft, published on 7 Feb 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

syft is a a CLI tool and Go library for generating a Software Bill of Materials (SBOM) from container images and filesystems. A password disclosure flaw was found in Syft versions v0.69.0 and v0.69.1. This flaw leaks the password stored in the SYFT_ATTEST_PASSWORD environment variable. The `SYFT_ATTEST_PASSWORD` environment variable is for the `syft attest` command to generate attested SBOMs for the given container image. This environment variable is used to decrypt the private key (provided with `syft attest --key <path-to-key-file>`)  during the signing process while generating an SBOM attestation. This vulnerability affects users running syft that have the `SYFT_ATTEST_PASSWORD` environment variable set with credentials (regardless of if the attest command is being used or not). Users that do not have the environment variable `SYFT_ATTEST_PASSWORD` set are not affected by this issue. The credentials are leaked in two ways: in the syft logs when `-vv` or `-vvv` are used in the syft command (which is any log level >= `DEBUG`) and in the attestation or SBOM only when the `syft-json` format is used. Note that as of v0.69.0 any generated attestations by the `syft attest` command are uploaded to the OCI registry (if you have write access to that registry) in the same way `cosign attach` is done. This means that any attestations generated for the affected versions of syft when the `SYFT_ATTEST_PASSWORD` environment variable was set would leak credentials in the attestation payload uploaded to the OCI registry. This issue has been patched in commit `9995950c70` and has been released as v0.70.0. There are no workarounds for this vulnerability. Users are advised to upgrade.

Weakness: CWE-532 (Insertion of Sensitive Information into Log File), CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

## Which versions are affected by CVE-2023-24827?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/anchore/syft` | Go | From 0.69.0 | 0.70.0 |
| `github.com/anchore/syft` | Go | From 0.69.0 | 0.70.0 |
| `github.com/anchore/syft` | Go | From 0.69.0 | 0.70.0 |

Products: Anchore Syft.

## How do I fix CVE-2023-24827?

Upgrade github.com/anchore/syft to 0.70.0 or later.

## Is CVE-2023-24827 being exploited?

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

## Other vulnerabilities in anchore syft

- [CVE-2026-33481](https://insights.sbomify.com/CVE-2026-33481/): Syft improper temporary file cleanup (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-24827 and fix it if it is affected.

What it is: CVE-2023-24827 is a medium-severity vulnerability in anchore syft, published on 7 Feb 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-24827 exists.

Affected packages and fixed versions:
- github.com/anchore/syft (Go): affected from 0.69.0; fixed in 0.70.0
- github.com/anchore/syft (Go): affected from 0.69.0; fixed in 0.70.0
- github.com/anchore/syft (Go): affected from 0.69.0; fixed in 0.70.0

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-2023-24827/ (Markdown: https://insights.sbomify.com/CVE-2023-24827/index.md)
```

## Sources

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

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