1000-ft view: these demos show what not to do — fetching resources without owner checks, relying on guessable IDs, missing server-side role checks, accepting over-posted fields, and serving files directly by id/path. Try the suggested inputs to see the risks.
Compare with the Secure version.
Vulnerable idea: fetch by id alone
(e.g., SELECT ... WHERE id = $id). An attacker can enumerate others’ notes.
user_id check.Vulnerable idea: expose a “UUID” that is actually short/guessable, and treat possession as authorization (no user check).
public_id (seed includes an obviously guessable one).Vulnerable idea: hide the “Promote” button in the UI, but don’t verify role on the server. Attackers can still POST directly.
Vulnerable idea: take every incoming POST field and apply it to the
user record. Attackers can set is_admin=1, credit=9999, etc.
is_admin=1).Vulnerable idea: fetch files by id (or even direct
path) without checking ownership. Attackers can read other users’ files.