getting swf flash to work securely again on fedi
swf died at around year 2020, but then came back with a brand new fresh player, known as ruffle that tackles many problems that the original player have.
there are attempts on get it working and make it alive again, platforms that has it back then like newgrounds and kongregate try exactly that by putting ruffle onto their website. that works, however most swfs are buried than good nowadays. it's not even as instant as it was back then.
on fedi, ability to play swf are very limited to such numbers of instance, especially the frontend being used for this process. as of the time i'm writing this (March 9th 2026), the only frontend that can play swfs nowadays are: – Pleroma-FE, – Sharkey, a misskey fork, – Waltuh.cyou's akkoma-fe fork
although the first two frontend can did the job, It's apparently obvious for some potential security risk.
same context, window for hell.
if you check how these two frontends did their job, the flow is apparently looking like this:
frontend -> ruffle.js -> ruffle.wasm -> flash
this is fine by itself. ruffle already has it's own sandbox set up per SWF, however, we still have some potential security window opened. for such, even though we have disabled allowScriptAccess, there are still risks for example, if the ruffle itself is vulnerable (which is rare), then it could basically alter or read the page for it's own purpose.
and we don't want that potential risks to happen.
my “secured” approach
if you remember, akkoma and pleroma started playing with CSP to tackle vulnerabilities from a media (eg, image, video, etc). Doesn't sound making any sense, but you can't blame them for protecting everyone. Akkoma for example has began to encourage everyone to switch their media domain to not be the same as their instance/frontend domain.
for the cross-domain approach, though, i would say, it's smart. you see, by cross-domain, that means that if anything happens on something that's loaded from different domain, anything on the root won't really impact much. such as, cookies, localStorage, etc.
and so, i did the same on the flash function.
akkoma-fe actually have a code for loading SWF, but it's mostly unused as they didn't bundle ruffle in the end (they never use it), and so, the current code is here, but it didn't work. it's also as vulnerable as what i said above.
so, my approach is now this:
akkoma-fe (has csp) -> iframe (with sandbox) -> simpleWebFlashViewer (different domain, also has it's own csp) -> ruffle.js -> ruffle.wasm -> swf
you can say, this is way more unnecessary than done, i agree. however, it's on purpose as i was focusing a lot on the security, so i had to make it this way.
for this job alone, modifying akkoma-fe alone wasn't enough, as i also had to alter akkoma-be to adjust it's CSP header so the iframe would work.
simpleWebFlashViewer is a small thing that i made as the swf loader, paired with ruffle. so all akkoma-fe need to do is basically iframe and forget about it. i also documented how you should apply the CSP on simpleWebFlashViewer despite it being a simple static page. It's highly recommended that you do that
this approach, despite being overkill, actually able to destroy the ruffle player properly with no potential of memory leakage. for such, when you press the stop button, it removes the iframe from the frontend, immediately free the memory usage and CPU usage in a instant. as the result, when user face such problem, they do not really need to refresh the entire page.
as the result, my safety plug worked. The recent Windows XP tour SWF that i just uploaded tries to access intro.txt on a path where simpleWebFlashViewer is located, which is nonexistent.
even if it tries to access beyond that, i guess it's pretty impossible as there's only /media, /proxy, and /static/flashplayer (this is where simpleWebFlashViewer live). as the player & loader itself is on different subdomain (media.fedinet.waltuh.cyou) than the root (fedinet.waltuh.cyou).

what if you're an admin of existing akkoma instance?
to be frank with you, i think you can just simply alter the CSP header to achieve the same thing as what my akkoma-BE did, and then simply use my akkoma-fe on your instance. You do not need to trust me because i highly doubt you would, but unless you're fine with experiments, then go on.
you then start serving simpleWebFlashViewer on different subdomain, say like, your own media domain at https://fedimedia.yourdomain.com/static/flashplayer/. if you're using caddy, then setting this would make sense:
handle_path /static/flashplayer* {
root /var/www/flashplayer/
header "Cache-Control" "public, max-age=604800, immutable"
header "Content-Security-Policy" "script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-ancestors 'self' https://fedinet.waltuh.cyou"
file_server
}
you will need to make client's browser to cache ruffle WASM aggressively because the runtime itself is sized at around 13 MB.
now, on your akkoma, copy instance/static/frontends/pleroma-fe/<ref>/static/config.json to instance/static/static/config.json, and edit the config here, adjust your flashplayer_loader to look like this:
{
...
"flashplayer_loader": "https://fedimedia.yourdomain.com/static/flashplayer/"
}
conclusion

well, what do you think? although the solution that i made is a bit overkill, it turned out to ended up being better than worse. for such, arbitrary risks are somewhat became minimized as the ruffle itself ran on different page context now (iframe).
if you're curious, how about giving it a try in fedinet.waltuh.cyou? our instance is currently open for registration.
that's it from me.
you can also watch on the video that's showcasing this functionability.
happy hacking.










