Skip to content

HackerOne

Ruby on Rails

Every publicly disclosed report for Ruby on Rails, what kind of bugs they were and what was paid.

disclosed reports
74
with a public bounty
9
median public bounty
$1,000
public bounties in all
$9,500
Scope, rewards and live status on bugbounty.fyi Accepting reports Disclosure program, no bounty 1 target in scope

Disclosed reports

Newest first. Only what Ruby on Rails chose to make public.

XSS

ActionText `to_markdown` still allows `javascript:` links in kramdown via Rails-generated table cells after PR #58754

ActionText's to_markdown method wrote the contents of code and pre elements without escaping, relying on the code span delimiter to keep them inert. When such code sat in a table cell and began with whitespace, kramdown rebuilt the span with a single backtick and rendered a javascript: link that to_markdown would otherwise refuse to produce.

Ruby on Rails

Medium
DoS

Possible DoS in NumberHelpers

Active Support's number helpers accepted strings in scientific notation, so a string like a large exponent was parsed by BigDecimal into a number with an enormous number of digits. An application passing user input to a helper such as number_to_currency could be taken down by a single request through memory exhaustion or CPU use.

Ruby on Rails

Medium
XSS

Action Text to_markdown: <code>/<pre> content escapes its delimiter, letting a stored body inject arbitrary Markdown

The Markdown converter in Action Text fails to keep text inside <code> and <pre> elements inert, because the delimiters it wraps around that text can be broken by blank lines or by being spliced mid-line. A user who can store rich text can therefore emit live Markdown link syntax with a javascript: scheme, or raw HTML, which the escaping is meant to prevent.

Ruby on Rails

Medium
XSS

URI scheme validation bypass in ActionText `to_markdown` via user-supplied `<action-text-markdown>` marker tag

The markdown converter in ActionText treats any `<action-text-markdown>` element as trusted internal markup and emits its text without escaping, so a user-supplied tag of that name bypasses the URI-scheme validation applied to normal links. An attacker who can author rich text could therefore produce markdown export containing a `javascript:` link.

Ruby on Rails

Medium
DoS

Action Text ReDoS (Ruby 3.1 or lower)

A regular expression used in Action Text's plain text conversion can take a very long time on crafted input when running Ruby 3.1 or lower. An attacker could send a message containing a blockquote with many whitespace characters and a couple of letters, causing a denial of service when the text is converted to plain text.

Ruby on Rails

Low
Path traversal

ActiveStorage Disk Service Path Traversal via Custom Blob Key Injection

ActiveStorage's DiskService builds file paths from blob keys without checking for traversal sequences, and the Hash attachable interface forwards a user-supplied key straight through to the blob without filtering. An attacker who can influence that Hash could write, read or delete files outside the storage root, potentially leading to code execution.

Ruby on Rails

Medium
XSS

1-Click Cross-Site Scripting via Custom Configuration in SafeListSanitizer

The SafeListSanitizer, when explicitly configured to allow form and button tags plus the formaction attribute, can be given crafted input that results in cross-site scripting. The maintainers argue this is not a vulnerability because the default configuration sanitises the input and the required configuration is extremely unlikely.

Ruby on Rails

Medium
XSS

Action Text XSS (Rails 7.1.x)

A crafted rich-text attachment value stored through the blog creation form is rendered unsafely on the Action Text edit page, so script in the attachment fires there. An attacker could run script in the browser of another user who opens the same edit page.

Ruby on Rails

Medium
Path traversal

Path traversal in AcitveStorage, and lead RCE

ActiveStorage's disk service allows path traversal via the signed key value, enabling arbitrary file read and write. An attacker who knows secret_key_base can forge tokens to read any file and write to any path, leading to remote code execution.

Ruby on Rails

High
Leaked secrets

Sauce Labs API key unencrypted in an old commit

An API key for Sauce Labs was found in an old commit of a Travis CI configuration file, encoded but not encrypted. The key was still active, and the reporter believes it could give an attacker full control of the account.

Ruby on Rails

Medium
XSS

XSS when using `translate` in Action Controller (Rails 7.0, 7.1)

The `translate` helper in Action Controller marks error messages and default values as HTML-safe without escaping, so a key containing `_html` and a tag value, or an unescaped `default` value, leads to cross-site scripting. An attacker could inject script through a controller parameter passed to `translate`.

Ruby on Rails

Low
DoS

DoS with crafted "Range" header

The Active Storage proxy controller passes the Range header to Rack's byte-range parser without limiting the number of overlapping ranges. An attacker can send a crafted Range header with many overlapping ranges, causing the server to allocate large amounts of memory and potentially exhaust it.

Ruby on Rails

High
Crypto

Unexpected deserialization in Kredis

Kredis casts JSON values using JSON.load, which honours the json_class key and can instantiate classes that define json_create rather than returning a plain hash. An attacker who controls a value stored through Kredis.json could cause unexpected object types to be deserialised, and if json/add/core is loaded, a regular expression could be revived, risking ReDoS.

Ruby on Rails

High
XSS

XSS vulnerabilities due to missing checks in tag helpers

Several Rails view tag helpers fail to properly restrict characters in attribute names and tag names, so user-controlled input can break out of the generated HTML tag and inject script. An attacker could run arbitrary JavaScript in a victim's browser, including stored XSS where input is saved.

Ruby on Rails

Medium
RCE

Argument/Code Injection via ActiveStorage's image transformation functionality

ActiveStorage's image transformation methods pass user-supplied arguments to ImageMagick without sanitisation, allowing argument injection and arbitrary file write. Additionally, the transformation name is passed to Ruby's send, enabling code execution if the application uses user-controlled transformation names.

Ruby on Rails

High
DoS

ReDoS in Rack::Multipart

A regular expression in Rack's multipart parser is vulnerable to catastrophic backtracking (ReDoS). An attacker can send a crafted Content-Disposition header that causes the server to spend excessive CPU time, leading to denial of service.

Ruby on Rails

High
XSS

ActionView sanitize helper bypass leading to XSS using SVG tag.

The Rails sanitize helper could be bypassed when the svg and use tags were explicitly allowed, because a use element could reference a base64-encoded SVG containing an event handler. An attacker could then run script in the victim's browser and act as that user.

Ruby on Rails

Medium
Misconfiguration

Escape Sequence Injection vulnerability in Rack

Rack's common logger writes the request method into the log line without sanitising it, so control characters such as backspaces pass through unchanged. An attacker could inject escape sequences into the logs, which may then be executed by a victim's terminal emulator when the log is viewed.

Ruby on Rails

Medium
DoS

Possible DOS in app with crashing `exceptions_app`

A shared, non-frozen constant response in Rails' exception-handling middleware was mutated by other middleware on each request, growing a self-referencing object until the server crashed. An attacker could take the app offline by repeating a request that triggers the error path enough times.

Ruby on Rails

Medium
XSS

Incomplete fix for CVE-2022-32209 (XSS in Rails::Html::Sanitizer under certain configurations)

The fix for CVE-2022-32209 only removed the dangerous combination of 'select' and 'style' from tag lists passed directly to the sanitize method, not from the class-level allow list configured in the application. An attacker could therefore still inject script through a crafted select/style combination when the allow list was set in configuration, resulting in cross-site scripting.

Ruby on Rails

Medium
Subdomain takeover

Subdomain Takeover at https://new.rubyonrails.org/

The subdomain new.rubyonrails.org had a DNS record pointing to an unclaimed GitHub Pages site, so anyone could register that page and serve content under the trusted domain. The reporter claimed it and showed a simple page as proof, noting that cookies scoped to the root domain could be exposed and that the domain could host phishing or malicious content.

Ruby on Rails

High
XSS

XSS by MathML at Active Storage

Active Storage's list of binary formats did not include application/mathml+xml, so a file uploaded with the .mml extension was served as MathML rather than as a download. An attacker could upload a MathML file containing a javascript link and get a Firefox user to click it, running script in the site's origin.

Ruby on Rails

Medium
Open redirect

HTTP Host injection in redirect_to function

The redirect_to method in Ruby on Rails concatenates the request host with a user-supplied path, and the host is taken from the Host or X-Forwarded-Host header. An attacker can inject a malicious host to redirect users to an attacker-controlled site, potentially enabling password reset poisoning or web cache poisoning.

Ruby on Rails

RCE

Regex Injection from request header (Rack::Sendfile, send_file)

Rack::Sendfile and Rails send_file trust the X-Sendfile-type and X-Accel-Mapping request headers, which are meant to come from nginx. An attacker can inject a regular expression through X-Accel-Mapping to cause CPU exhaustion (ReDoS) or redirect file paths to internal nginx locations, potentially reading files like /etc/passwd.

Ruby on Rails

Info disclosure

redirect_to(["string"]) remote code execution

The redirect_to helper in Ruby on Rails could be tricked into calling arbitrary controller methods when given an array parameter, because it treats the array as a method name to call. An unauthenticated attacker could use this to discover which routes exist by observing whether the app returns a 500 error or redirects.

Ruby on Rails

Low