Repository navigation
Make allowNetworking testable and throw in AVM2 navigateToURL - #25102
Merged
Merged
Conversation
kjarosh
reviewed
Nov 5, 2026
kjarosh
reviewed
Nov 5, 2026
kjarosh
reviewed
Nov 5, 2026
evazion
referenced
this pull request
in danbooru/danbooru
Nov 5, 2026
Ruffle gave Flash files script access to the page by default. When loading a URL, it sets `allowScriptAccess` to `samedomain`, which is true when the SWF is served from the site's own domain. This let any Flash post call `ExternalInterface` to run JavaScript as the viewer and hijack their account. It also allowed `navigateToURL` and unrestricted network access. Fix it by disabling script access, networking, and URL opening in the Ruffle config, and by running the player inside an `<iframe sandbox="allow-scripts" srcdoc="...">`. The sandboxed frame has an opaque origin, so even if Ruffle has a bug, a malicious Flash file can't access the user's cookies, session, or the parent page. Because the frame's origin is `null`, Ruffle's fetches for the .wasm and .swf files now count as cross-origin. For this reason, the shipped nginx for the prod image now sends `Access-Control-Allow-Origin: *` for .wasm and .swf files only. CDNs serving flash files might need to have their caches purged and/or add this header to these extensions.
evilpie
force-pushed
the
allowNetworking
branch
2 times, most recently
from
November 5, 2026 22:08
6ee46c2 to
a1cc151
Compare
evilpie
enabled auto-merge (rebase)
November 6, 2026 23:06
evilpie
disabled auto-merge
November 6, 2026 23:27
evilpie
force-pushed
the
allowNetworking
branch
from
November 6, 2026 23:28
a1cc151 to
aa1dfd1
Compare
evilpie
force-pushed
the
allowNetworking
branch
from
November 7, 2026 21:00
aa1dfd1 to
3af2c79
Compare
evilpie
enabled auto-merge (rebase)
November 7, 2026 21:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of #25100 and #3044.
This is the first step towards more correctly implementing the
allowNetworkingsetting (Restricting networking APIs) that can be used with<object>or<embed>tags. This is mostly just some preliminary architectural work. As a proof of concept I implemented throwing in AVM2'snavigateToURL. I think next we should probably expose this to the desktop app.Afterwards of course all the APIs listed in the Adobe documentation need to be restricted.
Testing
This feature is only available when running the Flash Player inside a browser, so this isn't directly testable with something like
flashplayerdebugger. I did test this using https://hub.docker.com/r/jchprj/play-adobe-flash-after-eol.Checklist