Secure Coding and Application Security Questions

Writing and reviewing code that resists attack. Covers the OWASP Top Ten and common web vulnerabilities (XSS, SQL injection, CSRF), input validation, secure coding practices and security code review, static application security testing (SAST), API and HTTP security, database and frontend security, and mobile app security. The application-layer defense discipline for engineers building software.

HardTechnical
33 practiced

An attacker used SSRF to reach an internal configuration service, retrieved credentials, and exfiltrated them by appending them to application log URLs visible to a third-party log-aggregation service. Describe the full attack chain, and for each step name a concrete control that would have broken it (prevention or detection), including how you would harden secrets handling and logging to prevent this exfiltration path specifically.

MediumTechnical
36 practiced

A web page echoes a query parameter without encoding:

php
<!-- vulnerable.php -->
<html>
  <body>
    Search results: <?php echo $_GET['q']; ?>
  </body>
</html>

Demonstrate a reflected-XSS payload an attacker could use against this page to exfiltrate cookies, then provide a secure server-side fix and a recommended Content Security Policy header. Explain why both the code fix and the CSP header are useful together.

EasyTechnical
40 practiced

You are reviewing a Python Flask endpoint that builds SQL queries by string concatenation, for example:

python
cursor.execute('SELECT * FROM users WHERE username = "%s"' % username)

Explain the vulnerability, map it to the appropriate CWE, and provide a secure Python fix using parameterized queries or an ORM. Then list any remaining risks you would still check for (for example, over-privileged DB accounts or an ORM call that silently falls back to raw SQL).

HardTechnical
45 practiced

You discover an insecure-deserialization vulnerability in a microservice that consumes messages from a queue and forwards deserialized objects to other services written in different languages. Explain an exploitation plan for how an attacker could abuse the serialization formats involved to achieve remote code execution or privilege escalation across services, and propose architectural mitigations to prevent this cross-service gadget abuse.

EasyTechnical
40 practiced

Explain the three types of Cross-Site Scripting (stored, reflected, and DOM-based): how each one arises in source code and executes at runtime, how they map to CWE-79, and the concrete mitigations you would apply for each (output encoding, safe templating, Content Security Policy, sanitization libraries).

Unlock Full Question Bank

Get access to all Secure Coding and Application Security interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.