Skip to content
XSS Disclosed report Intermediate

javascript: URI is triggered when clicking 'view image' opening up old XSS vectors

A javascript: URI in an image's source was executed when the user chose 'view image' from the context menu, allowing script execution in the page's context. This reintroduced an old cross-site scripting vector that had been fixed in earlier Firefox versions.

Abdulrahman Alqabandi Follow

Originally disclosed on Mozilla

  • Fixed in 7 days
  • Paid in 20 days
  • Disclosed after 7 days
Text
Created attachment 8981565
imgXss.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36

Steps to reproduce:

1. Open attached PoC on latest Nightly build
2. Right click on broken image
3. Click on 'view image'




Actual results:

javascript is executed.


Expected results:

I tested Firefox 60.0b11 and this does not work. This is a regression introducing old XSS vectors. Other context menu options may be affected as well.

See also: https://www.mozilla.org/en-US/security/advisories/mfsa2006-34/

The original report as published on Mozilla's Bugzilla, by Abdulrahman Alqabandi. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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

Root cause

Likely the 'view image' context menu action failed to validate or sanitise the image URL scheme before navigating to it, allowing a javascript: URI to execute.

Impact

An attacker could execute arbitrary JavaScript in the context of the page, potentially leading to cross-site scripting; the report notes other context menu options may also be affected.

What the attacker needed

Victim uses affected Firefox Nightly; victim right-clicks a broken image; victim selects 'view image'

How it was found

  1. Open the proof-of-concept page in the latest Nightly build.
  2. Right-click on the broken image.
  3. Choose 'view image' from the context menu.

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.

A javascript: link is a special kind of web address that runs code instead of opening a page. Normally browsers block these in places like image sources, but here the 'view image' menu option ran the code anyway. That lets an attacker run their own script as if it were part of the website.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Abdulrahman Alqabandi

View all

33 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.