GHSA-p2jh-44qj-pf2v

Suggest an improvement
Source
https://github.com/advisories/GHSA-p2jh-44qj-pf2v
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/11/GHSA-p2jh-44qj-pf2v/GHSA-p2jh-44qj-pf2v.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-p2jh-44qj-pf2v
Aliases
Related
Published
2022-11-10T12:38:57Z
Modified
2023-11-08T04:09:59.820649Z
Severity
  • 5.4 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:N/A:L CVSS Calculator
Summary
Exfiltration of hashed SMB credentials on Windows via file:// redirect
Details

Impact

When following a redirect, Electron delays a check for redirecting to file:// URLs from other schemes. The contents of the file is not available to the renderer following the redirect, but if the redirect target is a SMB URL such as file://some.website.com/, then in some cases, Windows will connect to that server and attempt NTLM authentication, which can include sending hashed credentials.

Patches

This issue has been fixed in all current stable versions of Electron. Specifically, these versions contain the fixes:

  • 21.0.0-beta.1
  • 20.0.1
  • 19.0.11
  • 18.3.7

We recommend all apps upgrade to the latest stable version of Electron.

Workarounds

If upgrading isn't possible, this issue can be addressed without upgrading by preventing redirects to file:// URLs in the WebContents.on('will-redirect') event, for all WebContents:

app.on('web-contents-created', (e, webContents) => {
  webContents.on('will-redirect', (e, url) => {
    if (/^file:/.test(url)) e.preventDefault()
  })
})

For more information

If you have any questions or comments about this advisory, email us at security@electronjs.org.

Credit

Thanks to user @coolcoolnoworries for reporting this issue.

Database specific
{
    "github_reviewed_at": "2022-11-10T12:38:57Z",
    "github_reviewed": true,
    "nvd_published_at": "2022-11-08T07:15:00Z",
    "cwe_ids": [
        "CWE-200",
        "CWE-522"
    ],
    "severity": "MODERATE"
}
References

Affected packages

npm / electron

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
18.3.7

npm / electron

Package

Affected ranges

Type
SEMVER
Events
Introduced
20.0.0-beta.1
Fixed
20.0.1

npm / electron

Package

Affected ranges

Type
SEMVER
Events
Introduced
19.0.0-beta.1
Fixed
19.0.11