Cross-Site Scripting: an attacker gets their JavaScript to run on your page, for example by posting a comment containing <script>. That script runs as the victim and can steal sessions or act as them.
Say it like this in the interview
“XSS is injecting script into pages viewed by others: stored, reflected or DOM-based. Prevention: escape output for its context (frameworks like React do this by default; avoid dangerouslySetInnerHTML and innerHTML), sanitise HTML when it’s really needed with DOMPurify or wp_kses, HttpOnly cookies so scripts can’t read sessions, and a Content Security Policy as defence in depth.”
Cross-Site Request Forgery: you’re logged into your bank; you visit an evil site that secretly submits a form to your bank. Your browser automatically attaches your bank cookie, so the bank thinks you sent it.
Say it like this in the interview
“CSRF abuses automatically-sent cookies to make authenticated requests from another site. Defences: SameSite=Lax or Strict cookies, CSRF tokens (WordPress nonces, Laravel’s @csrf), checking Origin headers, and never changing state with GET requests.”
When user input is glued into a SQL string, the attacker can type SQL instead of data and change what the query does.
-- code builds: SELECT * FROM users WHERE email = '<input>' AND password = '...'
-- attacker types email: ' OR '1'='1' --
SELECT * FROM users WHERE email = '' OR '1'='1' -- ' AND password = '...'
-- everything after -- is a comment: logged in as the first user
Say it like this in the interview
“Untrusted input becomes part of the SQL syntax. The fix is parameterised queries / prepared statements everywhere, or an ORM that uses them, plus least-privilege database users. Escaping by hand is not enough.”
Server-Side Request Forgery: tricking your server into making requests on the attacker’s behalf, such as to internal services or cloud metadata URLs that outsiders can’t reach.
Say it like this in the interview
“When an app fetches user-supplied URLs, attackers can target internal addresses like 169.254.169.254 metadata or admin panels. Defences: allowlists of hosts, blocking private IP ranges after DNS resolution, disabling redirects, and network segmentation.”
Authentication = who are you? (login). Authorisation = what are you allowed to do? (Can Ali edit this post?)
Say it like this in the interview
“Authentication verifies identity; authorisation checks permissions for a specific action and resource. A very common vulnerability is checking login but not ownership, like changing /orders/123 to /orders/124 and seeing someone else’s order (IDOR). Every request must check both.”
It checks that you’re logged in, but not that the invoice is yours. Any logged-in user can download every invoice by changing the number.
Say it like this in the interview
“It’s an IDOR, broken object-level authorisation. The query must be scoped to the user: findOne({ id, userId: req.user.id }), returning 404 if not found. Random UUIDs make guessing harder but don’t replace the check.”
A regularly updated list of the most common and dangerous web application security risks, used as a checklist by companies.
Say it like this in the interview
“It’s OWASP’s list of the most critical web app risks. Key ones: broken access control (the #1), cryptographic failures, injection, insecure design, security misconfiguration, vulnerable and outdated components, authentication failures, integrity failures like unsafe deserialisation or unverified updates, logging and monitoring failures, and SSRF.”
Never in code or Git. They come from the environment or a secret manager, and each environment has its own.
Say it like this in the interview
“Environment variables or a secret manager (AWS Secrets Manager, Vault, platform env vars), least-privilege keys per environment, rotation, and secret scanning in CI. Front-end code can never hold secrets.”
Most code in your app comes from packages written by others. Known vulnerabilities in them are a common way in.
Say it like this in the interview
“Automated scanning with Dependabot, Renovate, npm audit or composer audit, lock files, prompt patching, removing unused packages, and checking package reputation before adding new ones.”
HTTPS puts the conversation in a sealed, tamper-proof envelope so nobody on the Wi-Fi can read or change it, and proves you’re talking to the real site. It does not make the site itself safe: a site with HTTPS can still have SQL injection.
Say it like this in the interview
“TLS provides encryption, integrity and server authentication via certificates. It doesn’t protect against application vulnerabilities or a compromised server. I enforce HTTPS with redirects and HSTS, and set Secure on cookies.”