Electron: HTTP redirect followed into local file loader
Package
Affected versions
< 39.8.8
>= 40.0.0-alpha.1, < 40.9.0
>= 41.0.0-alpha.1, < 41.2.1
>= 42.0.0-alpha.1, < 42.0.0-beta.3
Patched versions
39.8.8
40.9.1
41.2.1
42.0.0-beta.3
Description
Published to the GitHub Advisory Database
Aug 5, 2026
Reviewed
Aug 5, 2026
Last updated
Aug 5, 2026
Impact
When following HTTP redirects,
net.fetch()andnet.request()did not restrict which schemes a redirect could target. A remote server could redirect a request to a local resource, and if the app returns or forwards the response body, local file contents could be disclosed.Apps are only affected if they make
netrequests to attacker-influenced URLs with redirects followed (the default) and expose the response body. Apps that only request fixed, trusted URLs are not affected.Workarounds
Set
redirect: 'error'orredirect: 'manual'on requests to untrusted URLs and validate any redirect target before following it.Fixed Versions
42.0.0-beta.341.2.140.9.039.8.8For more information
If you have any questions or comments about this advisory, email Electron at security@electronjs.org
References