# GHSA-pmwx-rm49-xv39: ActiveRecord::Tenanted::Storage::DiskService#path_for has a possible path traversal

> Path traversal in Active Record Tenanted allows attackers to read, write, or delete arbitrary files if untrusted input is used as blob 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:** 29 Jul 2026

## What is GHSA-pmwx-rm49-xv39?

GHSA-pmwx-rm49-xv39 is a path traversal vulnerability in activerecord-tenanted, published on 29 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Summary

Active Record Tenanted's override of Active Storage's `DiskService#path_for` does not validate that the resolved filesystem path remains within the storage root directory. If a blob key containing path traversal sequences (e.g. `../`) is used, it could allow reading, writing, or deleting arbitrary files on the server. Blob keys are expected to be trusted strings, but some applications could be passing user input as keys and would be affected.

### Mitigation

Upgrade to Active Record Tenanted v0.7.0 or later.

As a workaround, do not use untrusted user input as blob keys. Blob keys are expected to be trusted strings.

### Credit

This issue was responsibly reported by @tonghuaroot.

## Which versions are affected by GHSA-pmwx-rm49-xv39?

2 open source packages ship an affected version, including activerecord-tenanted.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `activerecord-tenanted` | RubyGems | All versions | 0.7.0 |
| `activerecord-tenanted` | RubyGems | All versions | 0.7.0 |

## How do I fix GHSA-pmwx-rm49-xv39?

Upgrade activerecord-tenanted to 0.7.0 or later.

## Is GHSA-pmwx-rm49-xv39 being exploited?

There is no known exploitation of GHSA-pmwx-rm49-xv39 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-pmwx-rm49-xv39 and fix it if it is affected.

What it is: GHSA-pmwx-rm49-xv39 is a path traversal vulnerability in activerecord-tenanted, published on 29 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-pmwx-rm49-xv39 in the wild and no public exploit code.

Affected packages and fixed versions:
- activerecord-tenanted (RubyGems): affected all versions; fixed in 0.7.0
- activerecord-tenanted (RubyGems): affected all versions; fixed in 0.7.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-pmwx-rm49-xv39/ (Markdown: https://insights.sbomify.com/GHSA-pmwx-rm49-xv39/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-pmwx-rm49-xv39

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