Security reference

One page per vulnerability class: what actually goes wrong, the vulnerable and the fixed code next to each other in every language it matters in, how to find it in your own repository, and the real pull requests where we fixed it.

CWE-79CWE-80

DOM XSS via innerHTML: why it happens and what to use instead

Assigning untrusted data to innerHTML executes attacker HTML in the page origin. Use textContent, or sanitize with DOMPurify when markup is required.

JavaScript (browser) · JavaScript (markup genuinely required) · React / TypeScript
CWE-120CWE-121CWE-122

strcpy, strcat and sprintf: bounded replacements that are actually safe

strcpy, strcat and sprintf write until a NUL byte with no destination bound. Replace them with snprintf or strlcpy and check the return value for truncation.

C — copying a string · C — the strncpy trap · C — sizeof across a function boundary
CWE-78CWE-77CWE-88

OS command injection: pass an argument list, never a shell string

Command injection happens when user data reaches a shell string. Pass an argument array with the shell disabled, and validate the executable path yourself.

Python · Node.js · Java
CWE-22CWE-23CWE-36

Path traversal: resolve first, then check containment

Stripping ../ does not stop traversal. Resolve the path to an absolute real path, then verify it sits inside the base directory before opening it.

Python · Node.js · Java — archive extraction (Zip Slip)
CWE-502CWE-94CWE-915

Insecure deserialization: pickle, Java serialization and YAML

pickle.loads, Java ObjectInputStream and yaml.load execute code during deserialization. Use JSON with a schema, or safe_load, and never trust the byte stream.

Python — pickle · Python — YAML · Java
CWE-918CWE-441

SSRF: validate the resolved IP, not the URL string

Blocking localhost in a URL does not stop SSRF. Resolve the hostname, reject private and link-local ranges, pin the connection, and disable redirects.

Python · Node.js

Looking for a specific fix?

Every case study on our blog is a pull request Orbis AppSec opened against a real open-source repository — the vulnerability, the patch, and the verification.

Browse the case studies