# CVE-2022-21831: Possible code injection vulnerability in Rails / Active Storage

Source: https://junglewise.ai/threats/cve-2022-21831-possible-code-injection-vulnerability-in-rails-active-storage  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-03-08  
License: CC BY 4.0 with a link back

CVE-2022-21831 · Severity: low · CVSS 3.1 · Published 2022-03-08

Possible code injection vulnerability in Rails / Active Storage

Technologies: [activestorage (RubyGems)](https://junglewise.ai/threats/technologies/activestorage). Vendors: [RubyGems](https://junglewise.ai/threats/vendors/rubygems).

## Quick answers

**Is CVE-2022-21831 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2022-21831 being exploited in the wild.

**How severe is CVE-2022-21831?** Low severity, with a CVSS score of 3.1, published 8 March 2022.

**Which products and versions are affected?** activestorage (RubyGems) ECOSYSTEM:introduced=5.2.0,fixed=5.2.6.3.

**Is there a fix for CVE-2022-21831?** Yes. activestorage (RubyGems): upgrade to 5.2.6.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2022-21831?** Check whether you run activestorage (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- activestorage (RubyGems): upgrade to 5.2.6.3 or later

  ```sh
  bundle update activestorage
  ```


## Affected products

- activestorage (RubyGems) ECOSYSTEM:introduced=5.2.0,fixed=5.2.6.3

## Identifiers

- CVE-2022-21831
- GHSA-w749-p3v6-hccq

## Related threats

- [Active Storage: Possible local file disclosure in video previews and analysis](https://junglewise.ai/threats/cve-2026-126188-active-storage-makes-it-simple-to-upload-and-reference-files-in)
- [Ruby on Rails Active Storage arbitrary file read and RCE in media processing](https://junglewise.ai/threats/cve-2026-126186-active-storage-possible-arbitrary-file-read-and-remote-code)
- [Ruby on Rails Active Storage content length bypass in Google Cloud Storage uploads](https://junglewise.ai/threats/cve-2026-126085-active-storage-possible-circumvention-of-file-size-limits-in)
- [Ruby on Rails Active Storage GCS signature bypass](https://junglewise.ai/threats/cve-2026-126084-active-storage-makes-it-simple-to-upload-and-reference-files-in)
- [Rails Active Storage persistent DoS via NUL byte filename](https://junglewise.ai/threats/cve-2026-126074-active-storage-makes-it-simple-to-upload-and-reference-files-in)
