# CVE-2023-38037: Active Support Possibly Discloses Locally Encrypted Files

> Local attackers can read sensitive data from temporary files created by ActiveSupport::EncryptedFile due to insecure default permissions.

- **Severity:** Medium 5.5 (`CVSS:3.0/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 9 Jan 2025
- **Updated:** 15 Feb 2025
- **Also known as:** DEBIAN-CVE-2023-38037, GHSA-cr5q-6q9f-rq6q, OESA-2023-1627, OESA-2023-1633, UBUNTU-CVE-2023-38037, openSUSE-SU-2023:0350-1, openSUSE-SU-2024:13397-1, openSUSE-SU-2024:13432-1, openSUSE-SU-2024:13433-1

## What is CVE-2023-38037?

CVE-2023-38037 is a medium-severity vulnerability in Rails ActiveSupport, published on 9 Jan 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

ActiveSupport::EncryptedFile writes contents that will be encrypted to a
temporary file.  The temporary file's permissions are defaulted to the user's
current `umask` settings, meaning that it's possible for other users on the
same system to read the contents of the temporary file.

Attackers that have access to the file system could possibly read the contents
of this temporary file while a user is editing it.

All users running an affected release should either upgrade or use one of the
workarounds immediately.

Weakness: CWE-732 (Incorrect Permission Assignment for Critical Resource)

## Which versions are affected by CVE-2023-38037?

4 open source packages ship an affected version, including activesupport.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `activesupport` | RubyGems | From 5.2.0 | 6.1.7.5 |
| `activesupport` | RubyGems | From 5.2.0 | 6.1.7.5 |
| `activesupport` | RubyGems | From 7.0.0 | 7.0.7.1 |
| `activesupport` | RubyGems | From 7.0.0 | 7.0.7.1 |
| `rubygem-activesupport-5.2` | SUSE:Package Hub 15 SP5 | All versions | 5.2.3-bp155.3.5.1 |
| `rubygem-activesupport-5.2` | openSUSE:Leap 15.5 | All versions | 5.2.3-bp155.3.5.1 |
| `ruby3.2-rubygem-activerecord-7.0` | openSUSE:Tumbleweed | All versions | 7.0.8-1.1 |
| `ruby3.2-rubygem-activesupport-7.0` | openSUSE:Tumbleweed | All versions | 7.0.8-1.1 |
| `ruby3.2-rubygem-rails-7.0` | openSUSE:Tumbleweed | All versions | 7.0.8-1.1 |

## How do I fix CVE-2023-38037?

Upgrade activesupport to a fixed version for your release line: 6.1.7.5 or 7.0.7.1.

## Is CVE-2023-38037 being exploited?

There is no known exploitation of CVE-2023-38037 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-38037 and fix it if it is affected.

What it is: CVE-2023-38037 is a medium-severity vulnerability in Rails ActiveSupport, published on 9 Jan 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2023-38037 in the wild and no public exploit code.

Affected packages and fixed versions:
- activesupport (RubyGems): affected from 5.2.0; fixed in 6.1.7.5
- activesupport (RubyGems): affected from 5.2.0; fixed in 6.1.7.5
- activesupport (RubyGems): affected from 7.0.0; fixed in 7.0.7.1
- activesupport (RubyGems): affected from 7.0.0; fixed in 7.0.7.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/CVE-2023-38037/ (Markdown: https://insights.sbomify.com/CVE-2023-38037/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-38037
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-38037
- OSV: https://osv.dev/vulnerability/CVE-2023-38037

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-38037/
Summaries are generated and may contain mistakes; the official description above is the record.
