Vulnerabilities in pkg:gem/activerecord-tenanted

PACKAGE
Advisory Summary

GHSA-pmwx-rm49-xv39 is a LOW path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting ActiveRecord libraries in the RubyGems ecosystem. The issue involves :tenanted::storage::diskservice#path_for has a possible path traversal. Remediation is available by upgrading affected packages to version 0.7.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/activerecord-tenanted

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/activerecord-tenanted. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-pmwx-rm49-xv39 - LOW ActiveRecord::Tenanted::Storage::DiskService#path_for has a possible path traversal

GHSA-pmwx-rm49-xv39 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-pmwx-rm49-xv39
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product ActiveRecord
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix GHSA-pmwx-rm49-xv39

To remediate this vulnerability, upgrade all affected ActiveRecord dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

activerecord-tenanted fixed: 0.7.0
Upgrade activerecord-tenanted to 0.7.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for activerecord-tenanted

How to Check if You Are Affected

To determine whether your application is affected by GHSA-pmwx-rm49-xv39, inspect your project dependencies for ActiveRecord:

inspect dependencies for activerecord-tenanted

Analyze the terminal output to locate any version of ActiveRecord in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In ActiveRecord, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

GHSA-pmwx-rm49-xv39 Affected ActiveRecord Versions

1 component(s)
Fixed Versions:
0.7.0
Product / Package Ecosystem Affected Versions Fixed Version
activerecord-tenanted
RubyGems
< 0.7.0
0.7.0

References

Frequently Asked Questions

What is GHSA-pmwx-rm49-xv39?
GHSA-pmwx-rm49-xv39 is a security vulnerability in ActiveRecord involving :Tenanted::Storage::DiskService#path_for has a possible path traversal under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which ActiveRecord versions are affected?
Affected versions include releases prior to 0.7.0 across affected packages: activerecord-tenanted.
What version fixes GHSA-pmwx-rm49-xv39?
Upgrading to 0.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is activerecord-tenanted affected?
Yes, activerecord-tenanted is affected in releases prior to 0.7.0. Upgrade your dependency to 0.7.0 or later.
What CWE is associated with GHSA-pmwx-rm49-xv39?
GHSA-pmwx-rm49-xv39 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check RubyGems dependencies for GHSA-pmwx-rm49-xv39?
Run the dependency tree command: 'inspect dependencies for activerecord-tenanted'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pmwx-rm49-xv39",
  "modified" : "2026-07-29T17:06:00Z",
  "published" : "2026-07-29T17:06:00Z",
  "aliases" : [ ],
  "summary" : "ActiveRecord::Tenanted::Storage::DiskService#path_for has a possible path traversal",
  "details" : "### Summary\n\nActive 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.\n\n### Mitigation\n\nUpgrade to Active Record Tenanted v0.7.0 or later.\n\nAs a workaround, do not use untrusted user input as blob keys. Blob keys are expected to be trusted strings.\n\n### Credit\n\nThis issue was responsibly reported by @tonghuaroot.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activerecord-tenanted"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/basecamp/activerecord-tenanted/security/advisories/GHSA-pmwx-rm49-xv39"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/security/advisories/GHSA-9xrj-h377-fr87"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/basecamp/activerecord-tenanted/pull/307"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/basecamp/activerecord-tenanted/commit/b242c8ad9bf58bbd7f5a032d153b0f29db54b9ba"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/basecamp/activerecord-tenanted"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/basecamp/activerecord-tenanted/releases/tag/v0.7.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-29T17:06:00Z",
    "nvd_published_at" : null
  }
}