Module 11 · Web Application Security · Lesson 33 of 75

Access control, authentication and secure configuration

IDOR and privilege flaws, login and password-reset weaknesses, rate limiting, error handling, security headers and WAFs, checked with curl in a lab.

In this lesson · about 40 minutes

  • Find and explain IDOR and function-level access control flaws
  • Review login, reset and session handling for common weaknesses
  • Check security headers and recommend a hardened configuration

Broken access control

  • IDOR (insecure direct object reference): GET /api/orders/1042 returns your order; changing it to 1043 returns someone else's.
  • Function-level: an ordinary user calls /api/admin/users and the server never checks the role, because "the button is hidden".
  • Mass assignment: sending {"name":"Al","role":"admin"} to a profile update, and the server saves every field.
  • Fix: check authorisation on the server, on every request, for every object; deny by default; use non-guessable IDs as an extra layer (not instead of checks); allow-list the fields users may change; test with two accounts.

Authentication weaknesses

  • No rate limit or lockout on login, so passwords can be guessed.
  • User enumeration: different messages for "no such user" and "wrong password", or different response times.
  • Password reset flaws: guessable tokens, tokens that never expire, reset links sent to an address taken from the request's Host header.
  • MFA that can be skipped by going straight to the next page.
  • Default or shared admin credentials.

Configuration and headers

HeaderPurpose
Strict-Transport-SecurityAlways use HTTPS (HSTS)
Content-Security-PolicyRestrict script, style and frame sources
X-Content-Type-Options: nosniffStop the browser guessing file types
X-Frame-Options or CSP frame-ancestorsPrevent clickjacking
Referrer-PolicyLimit what URLs leak to other sites

Remove version banners (Server: Apache/2.4.49, X-Powered-By), turn off directory listing and debug modes, show generic error pages and log the details privately.

WAFs

A web application firewall blocks common attack patterns and can buy time (a "virtual patch") while code is fixed. It does not fix the code, and determined testers often bypass it.

Hands-on lab (simulated terminal)

Lab: test access control and headers with curl

Authorised test of the training shop at http://127.0.0.1:3000, running on your own machine. You have two test accounts you created: alice (token in $ALICE) and bob. Output is simulated.

Step 1 of 4. Type each command and press Enter. Nothing runs on your computer.

kali@kali: ~

1. Show only the response headers of the home page (HEAD request).

┌──(kali㉿kali)-[~]
└─$

Flashcards

Module 11 flashcards

0 of 11 known

Say the answer out loud, flip the card, then be honest: cards you miss come back at the end.

11 left in the deck

Practice exam

Module 11 checkpoint

10 questions, 12 minutes.

  • 10 questions · 12 minutes
  • No feedback until you submit. Flag questions to come back to them.
  • Aim for 85% or better before you move on. The real exam's 750 out of 900 is roughly 80–83%.

Written by Noviq Academy in its own words. All labs are simulations: no real systems are touched, and every name, address, password and hash is made up. The offensive techniques taught here are for defending systems and for authorised testing only; never scan, access or test a system without the owner's written permission. Tool and product names belong to their owners, and command output may differ slightly from yours. Read-aloud uses your device's built-in voices.