# GHSA-fvv5-h29g-f6w5: Impact A bug in permissions validation allows a user with the `ci:ReadAction` permission to skip read checks when copying an object.

> A user with specific CI and path write permissions can bypass read restrictions to access otherwise unreadable repository objects.

- **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:** 22 Feb 2024
- **Also known as:** GO-2024-2581

## What is GHSA-fvv5-h29g-f6w5?

GHSA-fvv5-h29g-f6w5 is a missing authorization vulnerability in github.com/treeverse/lakefs, published on 22 Feb 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Impact

A bug in permissions validation allows a user with the `ci:ReadAction` permission to skip read checks when copying an object.  If they additionally have read and write permission to path in the repository, they can copy an otherwise unreadable object and read it.

In order to be affected and exploitable, the following conditions must ALL occur on the same user:
1. `ci:ReadAction` enabled for the repository.  Predefined policies RepoManagementRead and RepoManagementFullAccess allow this action.
2. `fs:ReadObject` and `fs:WriteObject` enabled for some path.
3. `fs:ReadObject` _not_ available for some path

Such a user can use (1) to copy the unreadable object (3) to a path that they can read and write (2).  At that point they can read the object copy.

### Patches

Releases >= 1.12.1 fix this issue in lakeFS.

### Workarounds

As a workaround, use RBAC to deny `ci:*` permissions to all users, or to all users who have limited read access.

Many installations are unaffected:

* **Installations using ACLs are _not_ affected.** This includes all OSS installations that have not implemented an external authorization server.  We do not know of any OSS installations that have implemented such a server.  ACLs that allow ci:ReadAction also allow reading repositories, so no capabilities are granted.
* **Installations using RBAC that use only predefined policies with "all" ARNs ("*") are _not_ affected.**  This includes **all installations that have not defined any new groups in RBAC.**

In order to be affected, **installations using RBAC** must define users and simultaneous allow `ci:ReadAction` and disallow `fs:ReadObject` for some path.  `ci:ReadAction` is available in policies RepoManagementReadAll and RepoManagementFullAccess.  By default these actions are configured for groups Developers and above, for all repositories and paths.

### References

* [lakeFS RBAC](https://docs.lakefs.io/reference/security/rbac.html)

## Which versions are affected by GHSA-fvv5-h29g-f6w5?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/treeverse/lakefs` | Go | From 0.90.0 | 1.12.1 |
| `github.com/treeverse/lakefs` | Go | From 0.90.0 | 1.12.1 |
| `github.com/treeverse/lakefs` | Go | From 0.90.0 | 1.12.1 |

## How do I fix GHSA-fvv5-h29g-f6w5?

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

## Is GHSA-fvv5-h29g-f6w5 being exploited?

There is no known exploitation of GHSA-fvv5-h29g-f6w5 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-fvv5-h29g-f6w5 and fix it if it is affected.

What it is: GHSA-fvv5-h29g-f6w5 is a missing authorization vulnerability in github.com/treeverse/lakefs, published on 22 Feb 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-fvv5-h29g-f6w5 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/treeverse/lakefs (Go): affected from 0.90.0; fixed in 1.12.1
- github.com/treeverse/lakefs (Go): affected from 0.90.0; fixed in 1.12.1
- github.com/treeverse/lakefs (Go): affected from 0.90.0; fixed in 1.12.1

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-fvv5-h29g-f6w5/ (Markdown: https://insights.sbomify.com/GHSA-fvv5-h29g-f6w5/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-fvv5-h29g-f6w5

---
From sbomify Insights: https://insights.sbomify.com/GHSA-fvv5-h29g-f6w5/
Summaries are generated and may contain mistakes; the official description above is the record.
