All labs

Practical labs: fix vulnerable code against a security test suite, review pull requests for defects, and investigate incidents from real-looking logs. Each lab is a set of tasks with questions and points.

Labs
26
Solved
0/26
Points
0/2020

26 of 26 labs

Secure CodingSCD

StatusIDLabLevelTimePoints
Not solvedSCD-01Fix SQL injection in a user lookup

A support tool builds SQL by concatenating a name from the URL. Parameterise it without breaking lookups.

Foundational20m0/70
Not solvedSCD-02Encode output to stop stored XSS

Comments are rendered with string concatenation. Encode author and text so markup is displayed, not executed.

Foundational20m0/70
Not solvedSCD-03Add object-level authorisation

Any signed-in customer can read any invoice by changing the ID. Enforce ownership without locking out admins.

Practitioner25m0/60
Not solvedSCD-04Contain file downloads to one directory

A download endpoint joins user input onto a base path. Make sure no input can resolve outside it.

Practitioner25m0/60
Not solvedSCD-05Run a system command without a shell

A connectivity check passes a user-supplied host to a shell. Remove the shell and validate the input.

Practitioner25m0/60
Not solvedSCD-06Verify JSON Web Tokens correctly

An API reads claims from a JWT without checking the signature. Verify it properly and pin the algorithm.

Advanced30m0/60
Not solvedSCD-07Stop open redirects after login

The login page redirects to any ?next= value. Allow same-site paths only.

Foundational15m0/50
Not solvedSCD-08Stop SSRF in a link-preview fetcher

The server fetches any URL a user pastes. Its allow-list is a substring check. Make it impossible to reach internal hosts.

Practitioner25m0/80
Not solvedSCD-09Fix mass assignment in a profile update

PATCH /me copies the whole request body onto the user. Let users edit their profile without promoting themselves.

Foundational20m0/70
Not solvedSCD-10Stop prototype pollution in a settings merge

A deep merge applies user JSON to stored settings. One key reaches every object in the process. Make the merge safe.

Advanced30m0/70
Not solvedSCD-11Fix password storage

Passwords are stored as unsalted MD5. Replace it with a salted, slow key-derivation function and a constant-time check.

Practitioner25m0/70
Not solvedSCD-12Fix a CSRF token check

The API has double-submit CSRF protection, but the check lets requests without a token through. Close the gaps.

Foundational20m0/80
Not solvedSCD-13Fix predictable password-reset tokens

Reset tokens come from Math.random() and the clock, and stay valid for a week. Make them unguessable and short-lived.

Foundational15m0/70

Secure Code ReviewCRV

StatusIDLabLevelTimePoints
Not solvedCRV-01Review a pull request: customer API

A backend PR adds customer search, bulk export and support password resets. Find every security defect before it merges.

Practitioner25m0/85
Not solvedCRV-02Review a pull request: React profile page

A frontend PR renders user bios, stores a token and redirects after saving. Find the client-side defects.

Foundational20m0/65
Not solvedCRV-03Review a pull request: orders API

A PR adds order detail, address change and item removal routes. The list route is scoped to the user — are the new ones?

Foundational20m0/75
Not solvedCRV-04Review a pull request: coupons and withdrawals

Money-moving code that is correct one request at a time. Find what breaks when requests arrive together.

Advanced25m0/75
Not solvedCRV-05Review a pull request: validation helpers

New validators for sign-up and search. Some regexes take exponential time on the right input. Find them.

Practitioner20m0/75
Not solvedCRV-06Review a pull request: ticket attachments

Customers can now attach files to support tickets. Upload handling is one of the riskiest features to get wrong — review it.

Practitioner25m0/85
Not solvedCRV-07Review a pull request: login endpoint

A rewrite of the login route adds logging and a remember-me cookie. The password check is fine — almost nothing else is.

Foundational20m0/75

Detection & ResponseINV

StatusIDLabLevelTimePoints
Not solvedINV-01Investigate a credential-stuffing breach

A customer list leaked. Use web, auth and audit logs to find the account, the attacker and what was exported.

Practitioner30m0/100
Not solvedINV-02Trace a secret leaked by CI

A deploy token was used at 2 a.m. from an unknown address. Find how it leaked, who used it and what was read.

Advanced30m0/100
Not solvedINV-03Find the SQL injection the WAF missed

The WAF blocked a noisy sqlmap scan. Use web, WAF and database logs to prove whether anything got through.

Practitioner30m0/110
Not solvedINV-04Trace a key leaked through git history

A live payments key was “removed” from the repo weeks ago. The repo went public today. Find out what happened.

Practitioner25m0/100
Not solvedINV-05Investigate a web shell on the helpdesk

A PHP helpdesk server called out to an unknown host. Find the uploaded shell, what the attacker ran and whose account they used.

Practitioner30m0/110
Not solvedINV-06Investigate an account takeover via password reset

A customer lost her account after clicking a genuine reset email. Work out how the attacker got the token and what they did with it.

Advanced35m0/95