Skip to content
Open redirect Disclosed report Beginner

CVE-2020-11082 - `original_script_name` parameter allows pagination to link to arbitratry websites because of a bug in kaminari

The kaminari pagination library accepted an `original_script_name` query parameter that changed the base URL used for the previous and next pager links. An attacker could craft a link so that those pager buttons pointed to an arbitrary external site, which could be used for phishing.

GitLab

Originally disclosed on GitLab

  • Fixed in 2 months
  • Disclosed after 2 months
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "bug" label: - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. --->

Summary

It was reported to us through [Zendesk][REDACTED] that kaminari allows to change the pager links through the original_script_name query parameter. The reporter has already opened a PR for it on the repository [REDACTED]

Steps to reproduce

Visit https://gitlab.com/explore/projects?non_archived=true&page=2&sort=latest_activity_desc&original_script_name=http://google.com

The prev and next pager buttons will link to google.

What is the current bug behavior?

The prev and next pager buttons will link to google.

What is the expected correct behavior?

The prev and next pager buttons should link to gitlab.

Possible fixes

The vulnerability is interesting for someone who wants to do phishing (next links to their domain that mimics GitLab and requests a relogin to steal credentials). It's not super high severity though so we can probably wait for the PR to be merged and then update.

Or maybe we can do something on our side?

The original report as published on GitLab. Images and videos are our own copies; raw HTML is shown as text. View it on GitLab.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could use the crafted link for phishing, sending users to a look-alike site that asks them to log in again, though the report notes this is not very high severity.

What the attacker needed

Victim clicks a crafted link

The fix

The report suggests waiting for the upstream pull request to be merged and then updating the library, or applying a mitigation on their own side.

How it was found

  1. Visit the projects explore page with a page number and a crafted original_script_name value pointing to another site.
  2. Observe that the previous and next pager buttons now link to that other site.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Pagination is the set of previous and next buttons on a list of results. This library let a value in the web address decide where those buttons point, so a crafted link could send a visitor to a different website that looks like the real one and asks them to log in again.

What is Open redirect?

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

More from GitLab

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.