# GHSA-635v-pc42-fr74: AWS SageMaker Training Toolkit logs CodeArtifact Authorization token

> Attackers with CloudWatch log access can steal CodeArtifact tokens to publish or consume packages if logging is enabled.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 11 Sep 2024

## What is GHSA-635v-pc42-fr74?

GHSA-635v-pc42-fr74 is a vulnerability in sagemaker-training, published on 11 Sep 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

## Description
For SageMaker Training Toolkit[1] versions 4.7.4; 4.7.3; 4.7.2; 4.7.1; 4.7.0, the authorization tokens for CodeArtifact (temporary token with an expiration of 12 hours) were logged in the log files when the CodeArtifact capability was enabled. If customers push these log files to their CloudWatch Log streams, anyone having access to cloudwatch logs within their AWS account, may be abe to see the authorization token. If the token is not expired, they may use the authorization token to publish or consume CodeArtifact package versions.

This issue was addressed in version 4.8.0. We recommend users upgrade to version 4.8.0 or higher.  

Please note that users can add SageMaker Training Toolkit to any Docker container[2] used for SageMaker training[3]. It also comes pre-packaged with the prebuilt SageMaker Docker image[4] for SageMaker training. 

## Patches
This issue has been addressed in version 4.8.0 and higher.

## Workarounds
N/A

## References
N/A

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

[1] https://github.com/aws/sagemaker-training-toolkit
[2] https://www.docker.com/resources/what-container/
[3] https://aws.amazon.com/sagemaker/train/
[4] https://docs.aws.amazon.com/sagemaker/latest/dg/pre-built-containers-frameworks-deep-learning.html
[5] Vulnerability reporting page: https://aws.amazon.com/security/vulnerability-reporting

## Which versions are affected by GHSA-635v-pc42-fr74?

2 open source packages ship an affected version, including sagemaker-training.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `sagemaker-training` | PyPI | From 4.7.0 | 4.8.0 |
| `sagemaker-training` | PyPI | From 4.7.0 | 4.8.0 |

## How do I fix GHSA-635v-pc42-fr74?

Upgrade sagemaker-training to 4.8.0 or later.

## Is GHSA-635v-pc42-fr74 being exploited?

There is no known exploitation of GHSA-635v-pc42-fr74 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-635v-pc42-fr74 and fix it if it is affected.

What it is: GHSA-635v-pc42-fr74 is a vulnerability in sagemaker-training, published on 11 Sep 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-635v-pc42-fr74 in the wild and no public exploit code.

Affected packages and fixed versions:
- sagemaker-training (PyPI): affected from 4.7.0; fixed in 4.8.0
- sagemaker-training (PyPI): affected from 4.7.0; fixed in 4.8.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-635v-pc42-fr74/ (Markdown: https://insights.sbomify.com/GHSA-635v-pc42-fr74/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-635v-pc42-fr74

---
From sbomify Insights: https://insights.sbomify.com/GHSA-635v-pc42-fr74/
Summaries are generated and may contain mistakes; the official description above is the record.
