OWASP Top 10, secure coding, auth, secrets, SAST/DAST
Practise these as flashcards. One or two lines each; the ones you miss come back first.
Start freeThe OWASP Top 10 is a list of the ten most critical web application security risks, updated regularly by the Open Web Application Security Project. It's important because it highlights the most common and impactful vulnerabilities, helping teams prioritize security efforts.
SQL injection can be prevented by using parameterized queries or prepared statements, which separate user input from SQL code. This ensures that user data can't change the intent of the query.
An example is when a user can access another user's data just by changing a user ID in the URL, because the server doesn't check if they have permission to view that data.
Hardcoding secrets in code risks accidental exposure through source control or logs. Instead, secrets should be stored securely, such as in environment variables or a secrets manager.
I use secure, HttpOnly cookies for session tokens, set the Secure and SameSite flags, and ensure sessions expire after inactivity. I also implement logout endpoints and rotate session tokens on privilege changes.
IDOR stands for Insecure Direct Object Reference, where attackers access objects by manipulating identifiers in requests. To prevent it, always enforce authorization checks server-side and avoid exposing raw IDs when possible.
SAST analyzes source code or binaries for vulnerabilities without running the application, while DAST tests the application in a running state by simulating attacks from the outside. Both approaches are complementary.
I use the CI/CD platform's secrets management features to inject secrets as environment variables at runtime, and restrict access to only the necessary jobs or stages. I never store secrets in code or pipeline configs.
I check for proper input validation, secure handling of authentication and sessions, correct access control enforcement, no hardcoded secrets, safe use of dependencies, and appropriate error handling.
Software Composition Analysis (SCA) scans dependencies for known vulnerabilities and license issues. It helps ensure that third-party libraries don't introduce security risks into the application.
Client-side validation can be bypassed by attackers, so server-side validation is essential to enforce security and data integrity regardless of how the request is made.
I'd use a centralized authorization layer, apply the principle of least privilege, and ensure all resource access is checked server-side. I'd also use opaque identifiers instead of sequential IDs and regularly audit access logs for anomalies.