ACTIVESTORAGE · GHSA-p2pm-g2h6-7j5j · Package
FIX → 8.1.4.1 +1
Active Storage raises an error when a stored attachment filename contains a NUL byte, because File.basename and File.extname reject it. A user allowed to upload a file can store such a name on SQLite or MySQL/MariaDB, and each later request that renders that blob fails, which is a persistent denial of service until the blob is purged or renamed.
first public Nov 4, 2026 · 1 source
Could this affect your app?
Free first check from your website. Connect your repo for the full answer.
Applications that use Active Storage with a database that accepts NUL bytes in string columns, such as SQLite or MySQL/MariaDB, and that let users upload attachments. Applications on PostgreSQL are not affected because the database rejects the row. Apps without user-uploaded attachments have little exposure.
Not affected if no-user-uploads, postgresql
Who cares activestorage, rails, ruby, self-hosted
Gemfile.lock for the activestorage gem.Upgrade to 8.1.4.1 +1
ActiveStorage::Filename#base and #extension_with_delimiter, and therefore #extension, pass the stored filename unmodified to File.basename and File.extname, which raise ArgumentError when the name contains a NUL byte. Active Storage stores the client-supplied filename verbatim, so a user who is permitted to upload an attachment could persist such a filename on databases that accept NUL bytes in string columns, such as SQLite and MySQL/MariaDB. Each subsequent request that builds a variant or preview of the blob, opens it, or renders it as an Action Text attachment then raises, possibly resulting in a persistent DoS vulnerability for the pages that display the blob until it is purged or its filename is corrected. Applications that use PostgreSQL are not affected, because PostgreSQL rejects the row.
Filename#base and #extension_with_delimiter now derive from Filename#sanitized, the form that Filename#to_s and the header already use. For a filename that changes, such as one containing a NUL byte, an invalid byte sequence, a path separator or another replaced character, the base and extension now agree with ; the variant format inferred from such a name may change, and an existing variant may be regenerated once. Stored filenames are not modified, and no data migration is required.
Check it with your coding agent
It reads this page and tells you if your code is affected.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
8.1.x below 8.1.4.1: move to 8.1.4.18.0.x below 8.0.5.2: move to 8.0.5.2Content-Disposition#sanitized#to_sThe fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
This issue was found by the Anthropic OSS Scanner (ANT-2026-UQM5Z4YL).