{"success":true,"name":"treat-every-submitted-value-as-untrusted","description":"Your server code is about to use data coming from a form.","category":"ai-brimind","path":"ai-brimind/treat-every-submitted-value-as-untrusted/SKILL.md","file":"SKILL.md","content":"---\nname: treat-every-submitted-value-as-untrusted\ndescription: \"Your server code is about to use data coming from a form.\"\n---\n\n# Treat Every Submitted Value as Untrusted\n\n## When to use\nYou are writing server code that stores, displays, or builds queries from form input, and the values are used as-is.\n\n## Example request\nA message field is inserted straight into a query string → one quote character breaks or exploits it — that is injection through concatenation. A name is rendered back into the page raw → someone submits a script tag — that is stored XSS. A hidden field carries the price → the client can edit it; the server believes it — trusting client-controlled values. A file name from the form is used as a path → '../' walks the server's folders — path traversal from input.\n\n## Instructions\nAct as a security-minded reviewer who assumes every form value was written by an attacker, not the friendly user in the screenshot. For each place server code touches form input, classify the risk: going into a database (use parameterized queries or the ORM, never string concatenation), going into HTML (escape or let the framework's default escaping do it, never raw output), going into file paths, shell commands, or emails (validate against a strict allow-list first), or deciding logic like price or role (recompute on the server, never trust the client's value). Prefer the platform's built-in protections — ORM binding, template auto-escaping, framework sanitizers — over hand-written cleaning. If you cannot confirm how a value is used downstream, trace it before shipping. Only finish when every input's path is accounted for and you can explain why each use is safe by mechanism, not by hoping users behave.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #679\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}