Loading
0x90Lesson 10 of 15

Build security into development

Use secure defaults, protect dependencies and secrets, and prioritize real-world vulnerabilities.

35 min 7-question quiz 1 code exercise
By the end of this lesson you can
  • Map common failures to the OWASP Top 10:2025
  • Keep secrets out of code and dependencies up to date
  • Choose security checks for design, code and release
  • Inventory exposed assets and prioritize vulnerabilities using exploitation and business impact

The OWASP Top 10:2025 ranks the most critical web application risks:

Category
A01Broken Access Control
A02Security Misconfiguration
A03Software Supply Chain Failures
A04Cryptographic Failures
A05Injection
A06Insecure Design
A07Authentication Failures
A08Software or Data Integrity Failures
A09Security Logging and Alerting Failures
A10Mishandling of Exceptional Conditions

New in 2025: supply chain failures - vulnerable or malicious dependencies, compromised build systems - and mishandling exceptional conditions, like failing open when an error occurs.

Try it

Up to 15 XP

Which Top 10 category?

Match each finding to its OWASP Top 10:2025 category.

0 of 7 sortedScore 0/0
  • “Any signed-in user can call DELETE /api/users/{id}”

  • “The production server shows full stack traces and has the default admin password”

  • “A build pulls a typosquatted package “reqeusts” that steals environment variables”

  • “Passwords are stored as unsalted MD5 hashes”

  • “When the permission service times out, the code allows the request”

  • “A storage bucket is publicly listable”

  • “Dependencies are unpinned, so each build may fetch a different version”

Secrets and dependencies

Secrets (API keys, database passwords, private keys) don’t belong in source code: repositories get cloned, forked and leaked, and Git history keeps deleted lines forever. Load them from a secrets manager or environment, scan commits for them, and rotate any secret that was ever committed.

Most of an application is other people’s code. Protect the supply chain: pin versions with a lockfile, verify checksums, keep a software bill of materials (SBOM), watch advisories with a scanner, update promptly, and be wary of new or lookalike package names.

No single check finds everything, so teams layer them: threat modeling at design, code review and static analysis (SAST) while coding, software composition analysis (SCA) for dependencies, dynamic testing (DAST) and penetration testing against running systems.

Real case · 2021CVE-2021-44228

Log4Shell: dangerous input in a common library

Apache Log4j Core could interpret attacker-controlled text in a logged message as a JNDI lookup. In affected configurations, this could lead to remote code execution.

  1. 01An attacker places crafted text in a field the application logs.
  2. 02A vulnerable Log4j Core version processes the lookup.
  3. 03The lookup can reach an attacker-controlled endpoint and load code.
  4. 04Defenders inventory affected apps, update, verify, and investigate exposure.
Defender lesson: Know which dependencies your services actually ship, including transitive ones, and verify that fixes reach every deployed copy. Apache security advisory ↗

Find the vulnerable thing, then verify the fix

A scanner cannot protect a server it does not know exists. Keep an asset inventory of deployed applications, devices, cloud resources, owners and software versions. Compare it with advisories and scan results. The Equifax case showed how an unpatched public system and a scan that missed it can turn a known flaw into a breach.

Do not sort a patch queue by a severity number alone. Ask: Is the flaw being exploited? Is the system reachable? What data or business process does it protect? Is there a safe fix or temporary mitigation? CISA’s Known Exploited Vulnerabilities catalog identifies flaws exploited in the wild. A known-exploited issue on a public service deserves urgent attention even if a different scanner result has a higher numeric score.

The cycle is discover → prioritize → remediate or mitigate → verify. If a patch cannot be applied immediately, restrict access or disable the affected feature, then track the remaining risk. Re-scan or otherwise confirm the vulnerable version is gone after deployment. CISA’s vulnerability response playbook describes these steps.

Try it

Up to 15 XP

Audit the patch plan

A team wrote this weekly vulnerability plan. Find the decisions that leave important exposure untreated.

Weekly vulnerability review (round 1 of 1)Flags found 0/0

Click every suspicious section. There are 3.

• The inventory lists the public billing API and its owner. • An older remote-access server is still online but has no owner and is absent from scans. • The team checks CISA’s known-exploited list every week. • A known-exploited flaw on the public billing API is deferred because another isolated test server has a higher scanner score. • When a patch is unavailable, the affected feature is disabled and the exception is tracked. • Patch tickets are closed as soon as a release is requested; nobody checks the deployed version afterward.

Practice: triage a dependency scan

Try it

Up to 15 XP

What should you fix first?

Scanners report a lot. Part of the job is deciding what matters.

Round 1 of 2: Find the urgent oneScore 0/0

Which one do you fix today?

$ npm audit

Key takeaways

  • The OWASP Top 10:2025 starts with broken access control, misconfiguration and supply chain failures.

  • Keep secrets out of code; rotate any that leak.

  • Pin, verify and update dependencies; layer review, SAST, SCA and DAST.

  • Inventory assets, prioritize exploited and exposed weaknesses, and verify remediation on the deployed system.

Lesson quiz

7 questions · pass with 5 correct · up to 50 XP

Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.

Practice: write Python

Write Python in the editor and run it against sample inputs. Python runs locally in your browser using a WebAssembly runtime.

Exercise 1

Scan a commit for secrets

+25 XP

The input is several files: each starts with a line === PATH, followed by its lines. For each line (numbered from 1 within its file) report the first match of:

  1. AKIA followed by 16 uppercase letters or digits → AWS access key
  2. -----BEGIN ... PRIVATE KEY----- → private key
  3. password, secret or api_key (any case, possibly with a prefix like db_), then =, then a quoted literal → hardcoded secret

Print PATH:LINE: TYPE.

  • Three files
main.py
Loading editor…

Python runs in a sandboxed browser worker with a 60 second time limit. Its runtime loads from the Pyodide CDN; your code stays in this browser.

Questions about this lesson

Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.

Loading posts…