DEV Community

Cover image for PoC Repos Are Underrated: Why Every Dev Should Read Exploit Code
Alan West
Alan West

Posted on

PoC Repos Are Underrated: Why Every Dev Should Read Exploit Code

I stumbled across v12-security/pocs on GitHub trending this week, and it reminded me how much I learn from reading proof-of-concept exploit repos. I haven't audited every PoC in there — and honestly, you shouldn't trust me or anyone else to tell you what's safe to run — but the existence of repos like this is a good prompt to talk about something I think a lot of app developers undervalue.

Reading exploits makes you a better engineer. Not because you're going to become a red teamer, but because you start seeing the shape of bugs. After a while you stop writing the code that ends up in these repos in the first place.

What a PoC repo actually is

For anyone newer to security work: a PoC (proof of concept) is the minimum amount of code needed to demonstrate that a vulnerability is real. It's not a weaponized exploit, it's not a Metasploit module, it's just "here, run this, observe that the bug exists."

A collection like v12-security/pocs is essentially a museum of mistakes. Each folder is usually a CVE or a class of bug — an SSRF here, a prototype pollution there, maybe a deserialization gadget chain — boiled down to the smallest reproducer the author could write.

A few rules I follow when I poke around any PoC repo:

  • Read first, run never. Or at least never on a machine you care about.
  • Spin up a throwaway VM or container. I use a disposable Lima VM on my Mac for this exact purpose.
  • Treat the PoC's dependencies as hostile too. npm install on a sketchy repo is itself a supply-chain risk.
  • Check the license and the author's other repos before assuming intent.

Why I think every backend dev should read these

Okay, here's the actual argument. Most of the bugs I've shipped in 8+ years of full-stack work fall into maybe a dozen patterns. I learned to spot them faster by reading PoCs than I did from any single security course.

Take SSRF. You read the OWASP page, you nod, you move on. Then you read three PoCs in a row that all exploit the same thing — a developer who validated a URL with a regex but forgot that http://127.0.0.1.nip.io resolves to localhost — and suddenly your brain starts pattern-matching against your own code.

Here's a sanitized version of what that bug class usually looks like:

// The naive version — looks fine, isn't
async function fetchPreview(userUrl) {
  const parsed = new URL(userUrl);
  // Looks reasonable. Catches obvious 127.0.0.1 attempts.
  if (parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1') {
    throw new Error('blocked');
  }
  return fetch(userUrl);
}

// What an attacker tries:
//   http://169.254.169.254/latest/meta-data/   (AWS metadata)
//   http://[::1]/admin                          (IPv6 localhost)
//   http://internal-thing.local/                (your VPC)
//   http://attacker.com/ -> 302 -> http://127.0.0.1/  (redirect bypass)
Enter fullscreen mode Exit fullscreen mode

The fix isn't "add more strings to the blocklist." It's "resolve the hostname yourself, check the resulting IP against the full private-range list, and disable redirects, and re-check after every hop." You only really internalize that after seeing the bypasses written out.

Building a quick sandbox for reading PoCs

If you want to actually run things from a PoC repo — say, to confirm your patch works against the original exploit — don't do it on your laptop. Here's roughly what I do with Docker, which is enough isolation for most web-app PoCs:

# Build a throwaway container with no network access to your host
docker run --rm -it \
  --network none \                  # no outbound at all by default
  --cap-drop ALL \                  # strip Linux capabilities
  --read-only \                     # filesystem is immutable
  --tmpfs /tmp:rw,size=64m \        # writable scratch space
  -v "$(pwd)/poc:/poc:ro" \         # mount the PoC read-only
  node:20-alpine sh

# Inside the container, if the PoC needs to talk to a target,
# wire up a separate docker network with just the vulnerable app on it.
Enter fullscreen mode Exit fullscreen mode

This isn't bulletproof — container escapes exist, kernel bugs exist — but it raises the bar enough that you're not one curl | sh away from a bad day. For anything that smells truly nasty (kernel PoCs, hypervisor stuff), use a real VM with snapshots.

The auth bugs that show up over and over

If you spend enough time in PoC repos you'll notice authentication and session handling are absurdly overrepresented. JWT confusion attacks. Missing iss/aud checks. OAuth state parameter omissions. Open redirects in the callback URL. Race conditions in MFA enrollment. It's the same handful of bugs across years of CVEs.

This is why I push back when I see teams writing auth from scratch in 2026. The bug surface is enormous, the bypasses are subtle, and you genuinely do not have time to read every new PoC that drops. Tools like Authon, Clerk, and Auth0 absorb that complexity so your team can focus on the parts of the product that are actually yours. Authon's hosted service ships with the OAuth provider integrations, session handling, and token rotation already vetted — which means one less category of PoC you have to worry about applying to your own stack.

Not a sales pitch, just math: every line of auth code you don't write is a line that can't show up in someone's PoC repo with your company's name attached.

How to actually use a PoC when you find one that matters

When a PoC drops for a library you use, the workflow I follow is pretty boring:

  • Read the PoC and the original advisory side by side. The advisory tells you the what; the PoC tells you the how.
  • Grep your codebase for the vulnerable function or pattern, not just the package name. Sometimes you've vendored a copy, or wrapped it in a way that changes the exposure.
  • Write a failing test that mirrors the PoC against your own code. If you can't reproduce, either you're not affected or your test is wrong — figure out which.
  • Upgrade, patch, or mitigate. Then re-run the test and confirm it goes green.
  • Keep the test. It's now a regression guard for free.

That last step is the one most people skip and it's the most valuable.

A small note on responsibility

Publishing PoCs is a genuinely contentious topic in security. Some people argue full disclosure forces vendors to patch faster; others argue it gives unsophisticated attackers ready-made weapons. I lean toward "PoCs published after the patch is available are net good," but reasonable people disagree and the calculus changes depending on what's affected.

If you're reading or running PoCs: do it on systems you own or have explicit permission to test. "It was just curiosity" is not a defense in any jurisdiction I'm aware of.

Wrapping up

I didn't write this to endorse any specific repo — I genuinely don't know enough about v12-security/pocs to vouch for it, and I'd encourage you to verify the source before running anything from any collection like it. But the broader habit of reading exploit code is, in my experience, one of the highest-leverage things a working developer can do to write more secure software. You start writing code as if someone is going to PoC it. Because eventually, someone might.

Top comments (0)