Skip to content
Access control Disclosed report Advanced CVE-2023-44402

ASAR Integrity bypass via filetype confusion

A crafted directory mimicking an ASAR archive could trick apps with ASAR integrity enabled into loading non-validated code, if the attacker can write to the app bundle.

marshallofsound Follow

Originally disclosed on HackerOne

Bounty$2,540 Medium 6.1 View original
  • Disclosed after 47 days

Summary by the program

ASAR Integrity bypass via filetype confusion Severity: Medium

Full GHSA: https://github.com/electron/electron/security/advisories/GHSA-7m48-wc93-9g85

The report

Maliciously crafted directories mirroring an ASAR file structure could be used to trick apps with ASAR integrity enabled into loading non-validated code.

Impact

This only impacts apps that have the embeddedAsarIntegrityValidation and onlyLoadAppFromAsar fuses enabled. Apps without these fuses enabled are not impacted. This issue is specific to macOS as these fuses are only currently supported on macOS.

Specifically this issue can only be exploited if your app is launched from a filesystem the attacker has write access too. i.e. the ability to edit files inside the .app bundle on macOS which these fuses are supposed to protect against.

There are no app side workarounds, you must update to a patched version of Electron.

Fixed Versions

  • 27.0.0-alpha.7
  • 26.2.1
  • 25.8.1
  • 24.8.3
  • 22.3.24

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

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 with write access to the app bundle on macOS could bypass ASAR integrity validation and load unvalidated code, but only if the app has both the embeddedAsarIntegrityValidation and onlyLoadAppFromAsar fuses enabled.

What the attacker needed

MacOS; app has both ASAR integrity fuses enabled; attacker can write to the .app bundle

The fix

The issue was fixed in Electron versions 27.0.0-alpha.7, 26.2.1, 25.8.1, 24.8.3, and 22.3.24; there are no app-side workarounds.

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.

Electron apps package their code in a special archive called ASAR. A security feature checks that this archive hasn't been tampered with. The bug let an attacker who can write files inside the app's folder create a fake folder structure that looked like the archive, so the app loaded malicious code without the check noticing.

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.

More by marshallofsound

View all

1 more disclosed report, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.