# GHSA-4rgc-5g6r-2rjf: lakeFS logs S3 credentials in plain text

> lakeFS logs S3 credentials in plain text, allowing attackers with log access to steal cloud storage keys.

- **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:** 12 Dec 2023
- **Also known as:** GO-2023-2398

## What is GHSA-4rgc-5g6r-2rjf?

GHSA-4rgc-5g6r-2rjf is a vulnerability in github.com/treeverse/lakefs, published on 12 Dec 2023. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Impact

S3 credentials are logged in plain text

```
S3Creds:{Key:AKIAIOSFODNN7EXAMPLE Secret:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
```

appears as part of the log message: 

```
time="2023-05-12T13:51:52Z" level=error msg="failed to perform diff" func="pkg/plugins/diff.(*Service).RunDiff" file="build/pkg/plugins/diff/service.go:124" error="rpc error: code = Canceled desc = stream terminated by RST_STREAM with error code: CANCEL" host="localhost:8000" method=GET operation_id=OtfDiff params="{TablePaths:{Left:{Ref:data_load@ Path:aggs/agg_variety/} Right:{Ref:data_load Path:aggs/agg_variety/} Base:{Ref: Path:}} S3Creds:{Key:AKIAIOSFODNN7EXAMPLE Secret:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY Endpoint:http://0.0.0.0:8000} Repo:example}" path="/api/v1/repositories/example/otf/refs/data_load%40/diff/data_load?table_path=aggs%2Fagg_variety%2F&type=delta" request_id=d3b6fdc7-2544-4c12-8e05-376f16e35a80 service_name=rest_api type=delta user=docker
```

Discovered when investigating [#5862](https://github.com/treeverse/lakeFS/issues/5862)

### Patches
_Has the problem been patched? What versions should users upgrade to?_

No

### Workarounds
_Is there a way for users to fix or remediate the vulnerability without upgrading?_

disable all logging? 

### References
_Are there any links users can visit to find out more?_

## Which versions are affected by GHSA-4rgc-5g6r-2rjf?

3 open source packages ship an affected version, including github.com/treeverse/lakefs.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/treeverse/lakefs` | Go | All versions | 0.101.0 |
| `github.com/treeverse/lakefs` | Go | All versions | 0.101.0 |
| `github.com/treeverse/lakefs` | Go | All versions | 0.101.0 |

## How do I fix GHSA-4rgc-5g6r-2rjf?

Upgrade github.com/treeverse/lakefs to 0.101.0 or later.

## Is GHSA-4rgc-5g6r-2rjf being exploited?

There is no known exploitation of GHSA-4rgc-5g6r-2rjf in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-4rgc-5g6r-2rjf and fix it if it is affected.

What it is: GHSA-4rgc-5g6r-2rjf is a vulnerability in github.com/treeverse/lakefs, published on 12 Dec 2023. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-4rgc-5g6r-2rjf in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/treeverse/lakefs (Go): affected all versions; fixed in 0.101.0
- github.com/treeverse/lakefs (Go): affected all versions; fixed in 0.101.0
- github.com/treeverse/lakefs (Go): affected all versions; fixed in 0.101.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-4rgc-5g6r-2rjf/ (Markdown: https://insights.sbomify.com/GHSA-4rgc-5g6r-2rjf/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-4rgc-5g6r-2rjf

---
From sbomify Insights: https://insights.sbomify.com/GHSA-4rgc-5g6r-2rjf/
Summaries are generated and may contain mistakes; the official description above is the record.
