Rails Asset Pipeline Directory Traversal Vulnerability

Published on 20 Dec 2021
Vulnerability

Description:

Sprockets has an information leak vulnerability. 4.0.0.beta7 and lower, 3.7.1 and lower, 2.12.4 and lower are all affected. When the Sprockets server is used in production, specially constructed requests can be used to access files that exist on the filesystem outside of an application’s root directory. Users operating an affected release should upgrade or implement one of the workarounds as soon as possible.

Recommendation:

It is highly recommended to not use the Sprockets server in production and to instead precompile assets to disk and serve them through a server such as Nginx or via the static file middleware that ships with rails config.public_file_server.enabled = true.

Sooraj V Nair
Written by
Cyber Security Engineer

Sooraj was probably the kid who opened up a remote control just to see what was inside, then had to figure out how to put it back together before anyone noticed. That curiosity eventually found its way into cybersecurity, where breaking things is actually part of the job description. Today, he explores vulnerabilities, analysis threats, and helps build safer digital spaces. His favourite question remains the same: “What happens if I try this?”

Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 14 days
4.8 on G2 • ISO 27001 certified
See How Beagle Security Works
No credit card • No setup required
Launch interactive demo