# GHSA-rjc6-vm4h-85cg: Sensitive Information Exposure Through Insecure Logging For Secrets Like Metadata.DockerBuildArgs

> AWS SAM CLI exposes sensitive Docker build arguments in clear text logs, allowing local attackers to read secrets if specific parameters are used.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 11 Sep 2024

## What is GHSA-rjc6-vm4h-85cg?

GHSA-rjc6-vm4h-85cg is a vulnerability in aws-sam-cli, published on 11 Sep 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

### Summary
The AWS Serverless Application Model (SAM) CLI is an open source tool that allows customers to build, deploy and test their serverless applications built on AWS. AWS SAM CLI can build container (Docker) images and customers can specify arguments in the SAM template that are passed to the Docker engine during build [1].

### Impact
If customers specify sensitive data in the DockerBuildArgs parameter of their template, the sensitive data will be shown in clear text in the AWS SAM CLI output via STDERR  when running the sam build command.

### Patches
A patch is included in aws-sam-cli>=1.122.0.

We strongly recommend customers install AWS SAM CLI v1.122.0 or above. Please review logs produced by your SAM CLI runs if you have used the DockerBuildArgs parameter and consider rotating the secrets if you believe they were exposed.

### References
If you have any questions or comments about this issue, we ask that you contact AWS/Amazon Security via our vulnerability reporting page [2] or directly via email to [aws-security@amazon.com](mailto:aws-security@amazon.com). Please do not create a public GitHub issue.

[1] https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html#build-container-image 

[2] https://aws.amazon.com/security/vulnerability-reporting

## Which versions are affected by GHSA-rjc6-vm4h-85cg?

2 open source packages ship an affected version, including aws-sam-cli.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `aws-sam-cli` | PyPI | All versions | 1.122.0 |
| `aws-sam-cli` | PyPI | All versions | 1.122.0 |

## How do I fix GHSA-rjc6-vm4h-85cg?

Upgrade aws-sam-cli to 1.122.0 or later.

## Is GHSA-rjc6-vm4h-85cg being exploited?

There is no known exploitation of GHSA-rjc6-vm4h-85cg in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-rjc6-vm4h-85cg and fix it if it is affected.

What it is: GHSA-rjc6-vm4h-85cg is a vulnerability in aws-sam-cli, published on 11 Sep 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-rjc6-vm4h-85cg in the wild and no public exploit code.

Affected packages and fixed versions:
- aws-sam-cli (PyPI): affected all versions; fixed in 1.122.0
- aws-sam-cli (PyPI): affected all versions; fixed in 1.122.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/GHSA-rjc6-vm4h-85cg/ (Markdown: https://insights.sbomify.com/GHSA-rjc6-vm4h-85cg/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-rjc6-vm4h-85cg

---
From sbomify Insights: https://insights.sbomify.com/GHSA-rjc6-vm4h-85cg/
Summaries are generated and may contain mistakes; the official description above is the record.
