isaac chan · portfolio · security review

Island Python — what the school site leaks, and a copy anyone can open

My school runs its Python course on a Firebase app. I read the whole thing with my own student account, tried to break the permissions, and then rebuilt it as a public copy: every class open, a superadmin page, and no school email needed.

Everything below is from an account I am allowed to use. I did not attack other students, and nothing here changed a record on the live site. Write attempts were made against my own documents and were refused.
100puzzles cloned
1,312 KBcourse content public
403on every write probe
266join code space
88 KBthe whole copy
01 — what held up

The database rules are the good part

The app has no server code at all. Every read and write goes from the browser straight to Firestore, so the rules file is the only thing standing between a student and everyone else's data. I expected to find holes and mostly did not.

AttemptResult
Read another student's profile, the user list, the class list403
Read the submission queue, progress sessions, teacher comments403
Read a teacher's account document403
Read my class member list403
Set my own role to superadmin403
Write a submission with a forged approved: true403
Write six more submission shapes, including the exact fields the app writes403
Write to the puzzle override, config or league collections403

So a student cannot promote themselves, cannot read the queue, and cannot invent a verified puzzle. Password login is switched off as well, so an account has to come from Google.

02 — what did not hold

Six things the copy fixes or exposes

1. Every course page is public, with no login

Eleven lab pages sit in /courses/ as plain files. Open one in a private window, press “Not now”, and the entire lesson set renders: teacher slides, worked examples, practice tasks. That is 1,312 KB of course material readable by anyone on the internet, not just by the school. There is no robots.txt and no login check on the file itself.

2. The class code is not random

A six character code looks like a secret. It is computed from the class document id: take the first six characters, run each through charCode % 32 and index a 32 letter alphabet. My class id 5AAFkITSBd2azpfgBpjS produces XBBGMK, which is exactly the code the site shows. Because the alphabet drops I, O, 0 and 1, only 26 of the 32 slots are ever used, and upper and lower case collide, so the real space is 266 = 308,915,776 rather than a true random six character secret.

3. Codes can be tested silently

Any signed in student can read joinCodes/{code}. A wrong code answers 404 and a real one answers 200 with the class id and the teacher id inside. There is no rate limit and no log entry. I also could not count the classes: listing the class or the code collection is refused, so the only way to learn the total is to guess codes one at a time.

4. The class league table is the whole school

The label says class table. The query reads the school wide collection with no class filter, so the moment anyone verifies a puzzle, every student in the school can read every other participant's name, id and count.

5. The puzzle check compares strings, not code

Puzzle one asks for two variables and their sum and product. Typing print(4) and print(3) produces the expected output after whitespace normalisation, and the submit button unlocks. Nothing inspects the code, so the only real gate is the teacher reading the explanation afterwards.

6. Small things

03 — the copy

Same puzzles, no school account, every class open

The rebuild is one HTML file. It keeps the parts of the original that were worth keeping and changes the two things I wanted changed.

Kept, from the real bundleChanged
All 100 puzzle definitions: title, prompt, example, starter code, expected output, hint. Extracted from the production JavaScript, in production order: 1–40 MYP, 41–80 GCSE, 81–100 IB.Every class is public, including the directory with codes, teachers and verified counts. No sign in needed to read it.
Real Python in the browser, Pyodide 0.27.2, the same version the live site loads.A superadmin page: role switching, class create and delete, per puzzle editing, invitations, data tools.
The code check itself, whitespace normalisation and all, so the weakness in item 5 stays visible.No @online.island.edu.hk, no SSO, no invite. Type a name, choose a role, you are in.
The join code derivation, kept identical so the admin page shows the weakness in item 2.All data is local: 24 classes, 345 students, 2,499 submissions and the league table are seeded in the browser, not fetched.

Student side: a 100 cell pathway, an editor, live output, an explanation box, submit, then a teacher approves and the cell fills in. Teacher side: the review queue. Admin side: everything.

04 — evidence

Numbers, not adjectives

ItemValue
Copy, size87,961 bytes, one file, no build step
Copy, SHA-256df438e1b4c6f1a9f8a15d6ab23f0d69a5bbf5b34bca4ece765a51aa298bb2d78
Puzzles carried over100 (40 MYP, 40 GCSE, 20 IB) from 24 source templates
Public course files on the live site11 pages, 1,312 KB, no auth
Write probes refused10 of 10, across 4 collections
Verified classes I could see1 (10CE102, Computing, Year 10); the total is not readable
Join code keyspace266 = 308,915,776, no rate limit on guessing

To get the puzzle data I sliced the generator function out of the minified bundle and ran it, rather than retyping 100 puzzles by hand. That is why the copy can claim the text is the real text.

05 — honesty notes

What I could not prove

Method. Read the bundle, drive my own logged in tab over the DevTools protocol, test every collection read and write directly against Firestore with my own token, then rebuild from the extracted data and check the rebuild in a headless browser: sign in, join a class, run Python, submit, approve as teacher, confirm the pathway cell filled.

Honesty notes. The copy is a teaching replica, not a replacement. The puzzles are the school's content and stay credited to whoever wrote them; the seeded students and results are invented so the screens have something to show. The findings were reported to the staff member who runs the site before this page went up.