Source Code Review CTF Challenges by Vulnerability

Telechargé par AppSec Master
Source Code Review CTF Challenges by
Vulnerability
Source code review CTF challenges can be tackled two ways by difficulty level, or by
vulnerability type. Organizing your practice around vulnerability type (SQL injection, XSS, IDOR,
SSRF, CSRF, command injection, authentication flaws) mirrors how the OWASP Top 10 itself is
structured and it is the faster route to building deep, transferable pattern recognition for one flaw
class before moving to the next, rather than spreading attention thin across unrelated bugs.
Most people approach Source code review CTF challenges practice by difficulty: easy, medium,
hard. That is a reasonable starting point, but it has a weakness: two medium challenges can
test completely unrelated skills, one about broken access control and the other about injection
flaws, with nothing connecting them. A vulnerability first approach fixes that by letting you go
deep on one flaw category until it is second nature, then deliberately moving to the next.
Why Organize Practice by Vulnerability Type
Security teams that run internal training programs have largely converged on this approach for a
simple reason: real code review work is rarely generic. A reviewer assigned to audit an
authentication service needs deep, specific fluency in auth logic bugs not a broad but shallow
familiarity with everything. Vulnerability first practice builds that specific fluency.
It also maps cleanly onto the framework most hiring teams and internal audits already use: the
OWASP Top 10. Practicing this way means every challenge you complete has a direct,
nameable connection to an industry standard category, which makes your progress easier to
track and easier to explain in a portfolio or interview.
Mapping OWASP Top 10 Categories to Code Review Practice
OWASP Category
What to Look For in Code
Typical Challenge
Format
Injection (SQLi, command
injection)
Stringbuilt queries, unsanitized shell
calls
Functionlevel
snippet
Broken Access Control
(IDOR)
Missing ownership checks after
authentication
Multiendpoint
challenge
Cryptographic Failures
Weak hashing, hardcoded secrets,
plaintext storage
Config + code
review
Security Misconfiguration
Debug flags left on, permissive CORS,
verbose errors
Fullapp review
Identification and
Authentication Failures
Session fixation, weak token checks,
logic gaps in login flow
Multifile challenge
ServerSide Request Forgery
(SSRF)
Unvalidated outbound URL fetches
Function + config
review
CrossSite Scripting (XSS)
Unescaped output in templates or DOM
writes
Snippet or fullapp
CrossSite Request Forgery
(CSRF)
Missing tokens on statechanging
requests
Endpointlevel
review
This table is a practical study map: work through each row in order, complete two or three
challenges per category and you've covered the categories responsible for the overwhelming
majority of realworld application vulnerabilities.
Injection Flaws: SQL Injection Code Review
Injection remains one of the most consistently tested categories and for good reason it's still
common in production code, particularly in legacy systems and code generated quickly under
deadline pressure. In a code review setting, SQL injection code review means training your eye
to catch:
String concatenation or strings building a query directly from user input.
ORM methods used in ways that bypass builtin parameterization (raw query escapes are
a frequent culprit).
Stored procedures that reintroduce stringbuilding internally, even when the outer
application code looks safe.
The pattern to internalize: any point where usercontrolled data touches a query string without a
parameter binding is a candidate, regardless of how many layers of abstraction sit on top of it.
CrossSite Scripting (XSS) Review Challenges
XSS review challenges train a different kind of attention tracing where data exits the application
toward a browser, rather than where it enters. Look for:
Output rendered without contextual encoding (HTML vs. attribute vs. JavaScript context
each need different escaping).
Framework escape hatches like dangerouslySetInnerHTML or v html used without
sanitization.
DOMbased sinks, where clientside JavaScript writes untrusted data directly into the
page without ever touching the server.
Because modern frameworks autoescape by default, most realworld cross siteXSS in code
review challenges hides specifically in the places developers explicitly opted out of that
protection which is exactly why those spots are worth learning to scan for first.
CSRF and SSRF: The RequestBased Vulnerability Pair
These two often get confused by newer learners because both involve requests, but they
represent opposite directions of risk:
CSRF exploits requests sent to your application from an attacker controlled page, relying
on a victim's authenticated session. In code, look for statechanging endpoints (POST,
PUT, DELETE) missing CSRF tokens or samesite cookie enforcement.
SSRF exploits requests sent from your application to an attacker-influenced destination,
often through a feature like import from URL or a webhook handler. In code, look for
outbound HTTP calls where the destination URL, host, or IP is not validated against an
allowlist.
Reviewing both back to back is a useful drill, since it forces you to think about who initiates the
request and who controls the destination rather than patternmatching on surface similarity
alone.
IDOR: Insecure Direct Object Reference Review
IDOR is one of the hardest categories for automated tools to catch reliably, which makes it one
of the most valuable categories to practice manually. The core pattern: an endpoint checks that
a user is authenticated, but never checks that they are authorized for the specific record being
requested.
In code, this typically looks like a database lookup keyed directly on a client supplied ID, with no
accompanying check that the ID belongs to the requesting user account, tenant, or role. Strong
IDOR review means asking, for every data access line: authenticated as who and authorized for
what?
Command Injection Review Challenges
Command injection hides in code that shells out to the operating system image processors, file
converters, backup scripts and system utility wrappers are common hiding spots. Review
checklist:
Any use of exec, system, subprocess (with shell=True), or backticks that
incorporates user input.
Allowlist validation on the input versus blocklist validation (blocklists are reliably
bypassable).
Whether the application even needs shell access at all, versus a safer library based
alternative.
Authentication Vulnerabilities in Code Review
Authentication vulnerabilities are less about a single missing check and more about logic gaps
across a multistep flow: password reset, multifactor verification, session issuance and token
refresh. Common patterns worth training your eye on:
Password reset tokens that do not expire or are not invalidated after use.
Session tokens generated with predictable or insufficiently random values.
Multifactor flows where the second factor can be skipped by directly calling a laterstage
endpoint.
Static Detection vs. Manual Review, by Vulnerability Type
Not every vulnerability class is equally suited to automated detection. Understanding this table
helps you know where to trust a scanner and where manual eyes are nonnegotiable.
Vulnerability Type
SAST Detection
Strength
Manual Review
Necessity
SQL Injection
Strong
Moderate
Command Injection
Strong
Moderate
XSS (reflected/stored)
Moderate
Moderate
XSS (DOMbased)
Weak
High
IDOR
Weak
High
CSRF
Moderate
Moderate
SSRF
WeakModerate
High
Authentication Logic Flaws
Weak
High
The general rule: the more a vulnerability depends on business logic rather than a syntax
pattern, the less reliable automated scanning becomes and the more valuable structured
manual practice is.
Building a VulnerabilityFirst Practice Track
A practical way to apply this framework:
1. Pick one row from the OWASP mapping table above.
2. Complete three to five challenges focused only on that category.
3. Write a oneline note describing the pattern that gave each flaw away.
4. Move to the next category only after you can spot that pattern in under two minutes.
For structured challenges organized around exactly this kind of progression, AppSecMaster
source code review lab provides vulnerability tagged exercises you can filter by category rather
than difficulty alone. If you'd rather test whether a flaw you found in code is actually exploitable,
the web security CTF lab lets you follow a codereview finding through to a working proof of
concept.
For a broader set of practice environments spanning multiple formats and skill levels, the
challenges library is worth bookmarking as your primary practice hub.
From Vulnerability Categories to Full Applications
Once you're confident across the individual categories, the next step is recognizing how they
interact inside a full application, where one flaw often enables another (an IDOR that exposes a
1 / 9 100%
La catégorie de ce document est-elle correcte?
Merci pour votre participation!

Faire une suggestion

Avez-vous trouvé des erreurs dans l'interface ou les textes ? Ou savez-vous comment améliorer l'interface utilisateur de StudyLib ? N'hésitez pas à envoyer vos suggestions. C'est très important pour nous!