August 23, 2026
20 Modern Web Attack Surfaces Pentesters Need to Understand for Real-World Success
Ever had a web application bug pop up that made you think, “How on earth did they miss this?” You’re not alone. In 2024, web attack…

By Very Lazy Tech 👾
7 min read
Ever had a web application bug pop up that made you think, "How on earth did they miss this?" You're not alone. In 2024, web attack surfaces are evolving so quickly that even experienced pentesters can fall behind. One recent study found that over 85% of successful breaches exploit vulnerabilities that weren't even on the security team's radar. Wild, right? Let's make sure that doesn't happen on your watch.
This guide dives into the 20 modern attack surfaces every pentester should know — not just as theory, but with real-world techniques, step-by-step examples, and code you can actually use in your next assessment.
What Exactly Is an "Attack Surface" Anyway?
You might think the term's just security jargon, but it's central to every good pentest. An attack surface is every point where an unauthorized user could try to enter or extract data from your system — endpoints, APIs, file uploads, third-party integrations, the whole shebang.
In simple terms: It's everywhere a hacker might poke, prod, or slip past your defenses.
Let's break down the 20 most relevant ones for modern web apps — and how you, as a pentester, can actually exploit or secure them.
RESTful API Endpoints
APIs are the backbone of today's web. They're also one of the juiciest targets, because developers often trust them more than they should.
Common Flaws
- Broken Object Level Authorization (BOLA)
- Excessive data exposure
- Improper rate limiting
Example: Exploiting BOLA
Say you've got an API like:
GET /api/users/1234
Authorization: Bearer eyJhbGciOiJIUzI1...GET /api/users/1234
Authorization: Bearer eyJhbGciOiJIUzI1...Change the user ID to another value:
GET /api/users/1235GET /api/users/1235If you get another user's data, that's BOLA in action — and a strong finding for your report.
Pentester Tips
- Dump the OpenAPI (Swagger) spec if it exists.
- Enumerate endpoints and try IDOR attacks.
- Check for HTTP method confusion (e.g., POST vs. PUT).
2. GraphQL Endpoints
GraphQL is powerful, but often misconfigured. By design, it gives clients control over what data they get. Attackers love this.
Attack Techniques
- Introspection queries (discover schema)
- Overly deep queries (DoS)
- Field-level access bypass
Example: Introspection
Run this query:
{
__schema {
types {
name
fields {
name
}
}
}
}{
__schema {
types {
name
fields {
name
}
}
}
}If you get back the whole schema, you can start hunting for sensitive fields, mutations, or hidden functionality.
Real-World Move
Try for nested queries that pull huge datasets. You might crash the API or find an unprotected admin field.
3. Single Page Application (SPA) Frontends
React, Vue, Angular — love them or hate them, SPAs are everywhere. And the attack surface isn't just the code you see, but how data flows.
Key Findings
- Sensitive data in JavaScript bundles
- Hidden endpoints in source maps
- Privilege checks only on the client (never trust the UI!)
Example: Finding API Keys in Bundles
- Download the main JavaScript bundle (e.g.,
main.abcdef.js). - Search for strings like
apiKey,token, or full URLs.
You'd be surprised how often keys or even credentials live right in the client-side code.
4. Server-Side Template Injection (SSTI)
Template engines like Jinja2, Twig, or ERB can be dangerous in the wrong hands. SSTI lets attackers execute code on the server.
Example: Jinja2 SSTI
Input:
{{7*7}}{{7*7}}Expected Output:
4949If the server renders 49, you're looking at SSTI. The cool part? With more payloads, you might get full RCE.
Code Injection Demo
Try expanding with:
{{config.items()}}{{config.items()}}Sometimes you'll see sensitive configuration variables spilled right into your response.
5. Third-Party JavaScript and Dependencies
You'd think npm and yarn would keep things tidy, but modern apps often pull in dozens, even hundreds, of third-party scripts.
Threats to Watch
- Malicious packages (typosquatting, supply chain)
- Outdated libraries with known CVEs
- Insecure CDN links
Quick Test
Run npm audit in the client directory, or use Retire.js to scan for known vulnerable libraries.
npx retirenpx retireIf you see any "high" or "critical" flags, dig deeper — attackers certainly will.
6. OAuth and OpenID Connect Flows
Authentication integrations are tricky. Tiny missteps can lead to account takeover or privilege escalation.
Common Issues
- Improper redirect URI validation
- Token leakage in URLs
- Confused deputy attacks
Step-by-Step: Manipulating Redirect URLs
- Start the OAuth flow, capture the authorization URL.
- Change the
redirect_urito one you control. - If your site gets the code/token back, you can hijack the session.
Real Bug Bounty
I once found an app where changing the redirect_uri let me receive tokens for any Google user — all because of a missing whitelist check.
7. Subdomain Takeover
Cloud services make it easy to leave "dangling" DNS records. Attackers can claim these and host whatever they want.
Practical Guide
- Find subdomains pointing to unclaimed SaaS (e.g., AWS S3, Azure, Heroku).
- Use tools like
Subjack:
subjack -w subdomains.txt -t 100 -timeout 30 -sslsubjack -w subdomains.txt -t 100 -timeout 30 -ssl- If you can claim the service, you control the subdomain — and can potentially phish users or serve malware.
8. CORS Misconfigurations
Cross-Origin Resource Sharing (CORS) is a web developer's necessary evil. Set it too loose, and you're offering up data to any site.
Misconfig Patterns
- Allowing * origins with credentials
- Reflecting
Originheader - Overly permissive methods
Example Attack
Send a cross-origin XHR from your own site:
fetch("https://target.com/api/secret", {
credentials: "include"
})fetch("https://target.com/api/secret", {
credentials: "include"
})If the response contains sensitive data, bingo — you've got a CORS bug.
9. File Upload Handlers
It's 2024, and file uploads are still a prime target. Why? Because many backends don't validate file types or paths thoroughly.
What to Try
- Double extensions (
shell.php.jpg) - Content-type spoofing
- Path traversal in filenames
Exploitation Example
Try uploading:
../../../tmp/evil.php../../../tmp/evil.phpSometimes, you can get code execution if the server saves files in a web-exposed directory. Always check if you can access the file afterward.
10. JWT and Token-Based Auth Bugs
JSON Web Tokens (JWT) are everywhere, but developers often misunderstand their security guarantees.
Common Bugs
- None algorithm (alg: none)
- Weak secret keys
- Leaking JWTs via logs or URLs
Demo: Cracking Weak JWT Secrets
- Obtain a JWT from the app (e.g., from localStorage).
- Use a tool like
jwtcrack:
jwtcrack eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...jwtcrack eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...If the token uses a weak key (secret, password, etc.), you can forge tokens with higher privileges.
11. SSRF (Server-Side Request Forgery)
SSRF lets you make the server request internal or external resources on your behalf.
Where to Look
- Image fetchers (
?url=) - Webhooks
- Import-from-URL features
Example Payload
Try:
http://127.0.0.1:80/adminhttp://127.0.0.1:80/adminIf you get internal data back, you've got SSRF — and maybe a path to internal RCE or cloud metadata.
12. Deserialization Flaws
Many backends deserialize user-supplied data, sometimes without validation. This is a classic path to code execution.
What You'll See
- Serialized objects in cookies or parameters (look for
gASorO:in values) - Custom binary blobs
Exploit Example: Python Pickle
If you can control pickle data:
cos
system
(S'ls /'
tR.cos
system
(S'ls /'
tR.Feed it in and watch the server execute arbitrary commands. Of course, this is a rare but critical finding.
13. WebSockets and Realtime APIs
WebSockets bypass a lot of traditional HTTP security controls, making them a ripe target.
What to Probe
- Authentication checks on messages
- Sensitive actions over unauthenticated channels
- Message spoofing
Testing Flow
- Connect with
wscat:
wscat -c wss://target.com/socketwscat -c wss://target.com/socket- Send crafted JSON messages, see what data you can pull or what actions you can perform. Many times, logic errors are just waiting here.
14. Broken Access Control on Endpoints
It's boring but everywhere. APIs or endpoints that don't check if a user should really access a resource.
Pentesting Steps
- Enumerate all endpoints (use Burp or a crawler).
- Try accessing as a lower-privilege user or logged out.
- Repeat with direct object references (
/profile/2,/admin/config).
If you get access, you've found gold.
15. DOM-Based XSS
DOM XSS lives only in the browser, thanks to mishandled JavaScript.
How to Find
- Look for dynamic sinks:
innerHTML,document.write - Trace data from URL or user input into those sinks
Example Payload
Given a vulnerable page:
example.com/welcome?name=Johnexample.com/welcome?name=JohnTry:
example.com/welcome?name=<img src=x onerror=alert(1)
example.com/welcome?name=<img src=x onerror=alert(1)
If you get an alert box, the bug is real — though in practice, you'll want to chain this for an actual exploit.
16. HTTP Host Header Attacks
Sometimes, the server trusts the Host header a bit too much. This can lead to password reset poisoning, cache poisoning, or SSRF.
Attack Example
Send a request with:
Host: evil.comHost: evil.comIf the password reset link you receive uses evil.com, you're looking at a serious issue.
Real-World Usage
I've chained a Host header injection with a CORS misconfig for full account takeover. Worth testing every time.
17. Cloud Storage and Bucket Exposures
S3, Azure, GCP — public buckets are a constant source of leaks.
Pentester Workflow
- Enumerate possible bucket names (
company-assets, etc.). - Try direct access:
https://company-assets.s3.amazonaws.com/https://company-assets.s3.amazonaws.com/- Use
aws s3 lsor tools likes3reconto list contents.
You might find sensitive backups, code, or even credentials sitting right there.
18. Client-Side Storage (LocalStorage / IndexedDB)
Developers love the convenience, but attackers love the loot.
What to Check
- JWTs or session tokens stored in localStorage
- Sensitive user data
- Exposed secrets in browser dev tools
Example
Open browser console, type:
localStoragelocalStorageIf you spot keys named token, jwt, or auth, see if they're valid and if you can replay them elsewhere.
19. Third-Party Integrations & Webhooks
Apps love connecting to Slack, GitHub, Stripe, and more. Every integration adds risk.
Attack Surface
- Webhook endpoints without authentication
- Leaked API keys
- Privilege escalation via misconfigured integrations
Practical Test
Try sending JSON to any /webhook endpoint you find. If there's no auth, see what actions you can trigger — sometimes you can impersonate trusted partners.
20. Infrastructure-as-Code and CI/CD Secrets
Modern teams automate everything, but secrets often sneak into pipelines.
Where to Look
.envfiles- GitHub Actions logs
- CI artifacts or Docker build logs
Example: Extracting Secrets from CI Logs
- Browse public CI logs (GitHub Actions, GitLab).
- Search for strings like
SECRET_KEY,AWS_ACCESS_KEY. - If you find valid credentials, see what environments or APIs they unlock.
This is a goldmine for privilege escalation.
Wrapping Up: Stay Ahead of the Attack Curve
Let's be honest, no one can memorize every new attack vector. But if you get in the habit of exploring these 20 surfaces every time you pentest — with real, practical tests and a bit of curiosity — you'll catch the stuff others miss.
The wild part? Many real-world breaches in the last year started from just one overlooked API, one stale subdomain, or one innocent-looking file upload. I've seen even "secure" orgs get blindsided by the basics.
So next time you gear up for a web pentest or bug bounty, pull up this list, poke at every surface, and dig deeper when something smells off. Because the attackers out there? They never stop learning new tricks — and neither should you.
Happy hacking!
🚀 Become a VeryLazyTech Member — Get Instant Access
What you get today:
✅ 70GB Google Drive packed with cybersecurity content
✅ 3 full courses to level up fast
👉 Join the Membership → https://shop.verylazytech.com
📚 Need Specific Resources?
✅ Instantly download the best hacking guides, OSCP prep kits, cheat sheets, and scripts used by real security pros.
👉 Visit the Shop → https://shop.verylazytech.com
💬 Stay in the Loop
Want quick tips, free tools, and sneak peeks?
| 👾 https://github.com/verylazytech/
| 📺 https://youtube.com/@verylazytech/
| 📩 https://t.me/+mSGyb008VL40MmVk/
| 🕵️♂️ https://www.verylazytech.com/