Technical Mid Level

What are the most critical security concerns in PHP applications and how do you mitigate them?

Quick Tip

Show layered thinking: "I use parameterised queries, encode all output, set CSP headers, run composer audit in CI, and use Argon2id for password hashing."

What good answers include

Key concerns: SQL injection (parameterised queries/ORM), XSS (output encoding, CSP headers), CSRF (tokens), session security (httponly/secure flags, regeneration), file upload validation, password hashing (bcrypt/argon2), and dependency vulnerabilities (composer audit). Strong candidates mention security headers, input validation vs output encoding, and defence in depth.

What interviewers are looking for

Critical for any PHP developer. Those who only mention SQL injection are thinking too narrowly. Look for awareness of the full attack surface including session handling and dependency security.

← All PHP questions