Latest / Software Testing with Fexingo: QA, Automation, and Reliable Software Engineering / How to Test Security Vulnerabilities Without a Red Team
Transcript
- Lucas: So there's this fintech startup — let's call them PayFast — that had a classic broken access control bug. Any logged-in user could change another user's email address just by tweaking a number in the API request. It sat in production for months, and no one caught it until a security researcher poked at it. Luna: Wait, that's terrifying. And they had a QA team, right? Lucas: They did — a pretty decent one, actually. They had thorough functional tests, good coverage on the happy paths. But they never tested the 'what if someone else tries to do this' scenario. Luna: So how do you catch that kind of thing without hiring a red team? I mean, most QA teams don't have security engineers on standby. Lucas: Right, and that's exactly the angle for today. You can build a solid security testing practice with tools and techniques that are already in your toolbox — fuzzing, threat modeling, and a free scanner like OWASP ZAP. It won't replace a dedicated pentest, but it will catch the low-hanging fruit. Lucas: Let's start with threat modeling, because that's the cheapest thing you can do — it's just a whiteboard exercise. You map out the system: what are the assets, who are the actors, where are the trust boundaries? For PayFast, the asset is user data, the actors are unauthenticated visitors, regular users, and admins. Luna: And the trust boundary is like, the API endpoint, right? The moment you accept a request, you're trusting something. Lucas: Exactly. And that's where you start asking the questions: can a regular user access an admin endpoint? Can user A access user B's resources? Is the check done on the client side — which is worthless — or on the server? Lucas: The key is to do this before you write tests, not after. A thirty-minute threat modeling session on a new feature can surface a half-dozen scenarios you never would have thought to test. Luna: Okay, so after you've mapped the threats, what's the next step? I'm guessing you don't just start writing test cases for every possible attack. Lucas: No, you prioritize. You focus on the ones that are both likely and damaging. For PayFast, that's broken access control — which, by the way, OWASP consistently ranks in their top ten. So you write a few specific tests: one where you log in as user A, try to access user B's profile, and expect a 403. Those are just regular integration tests. Luna: And then you add them to your CI pipeline so they run on every commit. That's the regression safety net. Lucas: Exactly. But here's the thing — you can't think of every edge case upfront. That's where fuzzing comes in. You throw random or malformed data at your API and see if anything breaks in a way it shouldn't. Lucas: There's a great open-source tool called fuzz-lightyear — no, that's not a real one, sorry. Actually, let's talk about something like Burp Suite's intruder, or even just a Python script that sends random mutations of a valid request. Luna: So you're not looking for a crash, you're looking for a behavior change? Like, 'oh, I sent an unexpected field and suddenly the server returned a 200 when it should have been a 400'? Lucas: Precisely. And the beautiful thing is, you can automate that. Run a fuzzer against your staging environment every night, and let it report anything that doesn't match the expected behavior. You'll get false positives, sure, but you'll also find real bugs that nobody would have thought to write a test for. Luna: And then there's the scanner you mentioned — OWASP ZAP. How does that fit in? Lucas: ZAP is like the swiss-army knife of free security tools. It can passively scan your website as you browse it, or you can run an active scan that attacks your endpoints with a bunch of known attack patterns — SQL injection, cross-site scripting, that kind of thing. Lucas: You can even integrate it into your CI pipeline using their Docker image. Run it against your staging environment on every merge, and it'll flag high-severity issues automatically. Luna: But I imagine it's not a set-it-and-forget-it thing. You must have to tune it, right? Lucas: Oh, absolutely. The first time you run an active scan, you'll get flooded with alerts, most of them false positives. You have to configure it to ignore things like CSRF tokens or session management patterns that are actually safe. But once you've tuned it, it's a fantastic early warning system. Lucas: Look, the point is this: security testing isn't a phase you bolt on at the end. It's a mindset — you're constantly asking, 'how could this be abused?' And you can build that into your existing QA process without a dedicated security team. Luna: Before we go deeper, Lucas — I know this show runs on listener support, and honestly, that's what keeps these deep dives ad-free. If you've gotten something out of today's episode, a couple of dollars a month at buy me a coffee dot com slash fexingo makes a real difference. Lucas: Yeah, seriously. It's what keeps us going, and we appreciate every bit of it. Luna: So back to the fun part — what's the most surprising bug you've seen caught by fuzzing? Lucas: There was a case where a developer had written a custom JSON parser, and it handled nested objects with a recursive function. The fuzzer sent a deeply nested payload — like a thousand levels deep — and the function hit the stack limit, crashing the process. The error message was so cryptic that nobody had ever thought to test it. Lucas: But here's the kicker: that crash wasn't just a denial of service. In some languages, a stack overflow can be exploited to execute arbitrary code. So something that looked like a harmless typo in a parser was actually a critical vulnerability. Luna: Wow. And that's the kind of thing a human would never write a test for. Lucas: Right. Now, let's talk about how to prioritize security tests when you can't test everything. The OWASP Top Ten is a good starting point — broken access control, injection, misconfiguration, those are the big ones. But you also need to think about your own business logic. Luna: Every app has its own weird flows, like 'buy one get one free' or 'transfer money to a friend'. Those are where business-logic bugs hide. Lucas: Exactly. Take PayFast again — they had a referral program where you get a bonus when your friend signs up. A smart attacker could create a bunch of fake accounts and refer himself. That's not something OWASP ZAP will catch; that's a business logic flaw you need to reason about. Lucas: So my rule of thumb: use threat modeling to generate the high-value scenarios, use fuzzing to shake out the weird stuff, and use ZAP to catch the known attack patterns. Together, they cover a lot of ground. Luna: And you mentioned earlier that you can run all of this in CI. How do you keep the pipeline from becoming the bottleneck? Lucas: That's a great question. You don't want to run an active scan on every single commit — that takes time. So you split it: run your targeted security regression tests on every commit, and schedule the full fuzz and ZAP scan nightly or on a weekly basis. Lucas: Also, you need to treat security findings like any other bug. They should go into your regular backlog, with severity and priority, and get fixed in the normal cadence. Luna: That's smart. It makes security part of the definition of done, not a scary red door. Lucas: Exactly. And speaking of done — there's one more angle I want to touch on: testing the security of your test data itself. If you're using production-like data in staging, you might be exposing sensitive information. That's a whole other can of worms. Luna: Oh, right. Like, if you have a test that asserts on a real customer's email, and that test fails, the email might end up in a log file. Lucas: Yeah, and that's a data privacy issue. So when you're writing security tests, make sure your test data is either fake or fully anonymized. You don't want your fuzzer to accidentally expose a real social security number. Luna: Good point. So to wrap it up — what's the one thing a QA team can start doing tomorrow to improve their security posture? Lucas: I'd say grab a whiteboard and do a threat model on your most critical feature. Just thirty minutes. You'll be surprised at how many 'what if' scenarios you come up with, and each one is a test case you can add to your suite. Luna: That's a solid takeaway. And if listeners want more episodes like this, you know where to find us — buy me a coffee dot com slash fexingo. Lucas: Yeah, that's the best way to keep these conversations going. Until next time, keep testing the weird stuff.