Uploaded November 2026 | Updated November 2026, 14 hours ago
In this episode, I take on one of those deceptively small LMS security problems that quickly turns into a much deeper design exercise:
How do you safely let instructors upload and download HTML, ZIP, TAR, and other potentially dangerous files?
Teachers need these files. Source code often comes in ZIP archives. HTML examples are useful in courses. But uploaded HTML can also become a Trojan horse if the browser treats it as trusted application content.
So I start tightening up Tsugi’s file-serving path.
The goals are to allow useful file types while making dangerous behavior much harder:
Warn users before opening risky uploads
Open untrusted content in a separate browser context
Sandbox uploaded HTML
Prevent access to the application’s authenticated origin
Disable MIME sniffing
Force archive formats to download safely
Keep ZIP and TAR files usable without pretending they are harmless
A key part of the solution is browser security headers, including Content Security Policy sandboxing and X-Content-Type-Options: nosniff. The sandbox deliberately avoids allow-same-origin, which prevents uploaded HTML from inheriting Tsugi’s authenticated browser state.
Then the session gets more entertaining.
I ask Cursor to build an intentionally hostile HTML test fixture designed to probe things like cookies, local storage, forms, JavaScript execution, and same-origin access.
Then I ask ChatGPT to make it even more evil.
The goal is defensive: create nasty browser content and verify that Tsugi’s isolation actually stops it from escaping the sandbox or acting with the privileges of a logged-in user.
Along the way I also exercise the file-replacement feature from the previous session, debug MIME-type detection, refine the hostile HTML fixtures, and keep both versions around for future regression testing.
This is a security problem I first ran into in Sakai nearly twenty years ago. Modern browsers give us much stronger tools now, and AI makes it much easier to explore the threat model, build tests, implement the protections, and iterate on the user experience quickly.
Happy Halloween. 🎃
In this episode, I take on one of those deceptively small LMS security problems that quickly turns into a much deeper design exercise:
How do you safely let instructors upload and download HTML, ZIP, TAR, and other potentially dangerous files?
Teachers need these files. Source code often comes in ZIP archives. HTML examples are useful in courses. But uploaded HTML can also become a Trojan horse if the browser treats it as trusted application content.
So I start tightening up Tsugi’s file-serving path.
The goals are to allow useful file types while making dangerous behavior much harder:
Warn users before opening risky uploads
Open untrusted content in a separate browser context
Sandbox uploaded HTML
Prevent access to the application’s authenticated origin
Disable MIME sniffing
Force archive formats to download safely
Keep ZIP and TAR files usable without pretending they are harmless
A key part of the solution is browser security headers, including Content Security Policy sandboxing and X-Content-Type-Options: nosniff. The sandbox deliberately avoids allow-same-origin, which prevents uploaded HTML from inheriting Tsugi’s authenticated browser state.
Then the session gets more entertaining.
I ask Cursor to build an intentionally hostile HTML test fixture designed to probe things like cookies, local storage, forms, JavaScript execution, and same-origin access.
Then I ask ChatGPT to make it even more evil.
The goal is defensive: create nasty browser content and verify that Tsugi’s isolation actually stops it from escaping the sandbox or acting with the privileges of a logged-in user.
Along the way I also exercise the file-replacement feature from the previous session, debug MIME-type detection, refine the hostile HTML fixtures, and keep both versions around for future regression testing.
This is a security problem I first ran into in Sakai nearly twenty years ago. Modern browsers give us much stronger tools now, and AI makes it much easier to explore the threat model, build tests, implement the protections, and iterate on the user experience quickly.
Happy Halloween. 🎃










