Tanya Janca | SheHacksPurple

Tanya Janca | SheHacksPurple

@shehackspurple.bsky.social

Secure Code Trainer - Best-selling author of Alice and Bob Learn Secure Coding & Alice and Bob Learn Application Security. #AppSec she/her https://shehackspurple.ca 🌻

6K followers213 following3.6K posts

Pinned

**Not everything needs to be a damn AI agent.** There. I said it. And I will keep saying it. Warning: hot takes ahead. Recently, I was teaching a secure AI class, and one of my students was telling me about an AI agent they were building. 1/14

Your AI agent's instructions are NOT the same as its permissions. I think this is one of the most important distinctions developers need to understand as we start integrating agents into our daily work. You might ask an agent to write some code. Sure. But can it also: • Execute that code? 1/5

View full thread

Your AI agent's instructions are NOT the same as its permissions. I think this is one of the most important distinctions developers need to understand as we start integrating agents into our daily work. You might ask an agent to write some code. Sure. But can it also: • Execute that code? 1/5

• Install dependencies? • Read files containing secrets? • Connect to external services? • Publish an application? • Schedule something to run automatically? Because if it has those capabilities, then your prompt isn't necessarily going to prevent it from using them. 2/5

View full thread

I made a video explaining what happened with Crime Stoppers, the gaps in Canadian privacy law, and why I think our lawmakers need to address them. Because I've been saying this for years: **You can't have privacy without security.** 6/7

View full thread

Think about that for a moment. Domestic violence shelters. Victim support organizations. Addiction recovery services. Charities helping vulnerable children. These organizations can hold some of the most sensitive personal information imaginable. 4/7

After the massive Crime Stoppers data breach, Canada's federal privacy commissioner and Ontario's privacy commissioner indicated that they don't have the authority to formally investigate the Crime Stoppers organizations involved. WHAT?!?! 2/7

It turns out that Canada's federal privacy law, PIPEDA, generally doesn't cover nonprofits when they're conducting noncommercial activities. Now, some provinces, including BC, have their own privacy laws that DO cover nonprofits. But protections vary across Canada. 3/7

You can write perfectly secure application code and STILL end up with a critical security vulnerability. That's one of the most important lessons from PHP2Shell, and it's a perfect example of why **software supply chain security** matters so much. 1/8

View full thread

You can write perfectly secure application code and STILL end up with a critical security vulnerability. That's one of the most important lessons from PHP2Shell, and it's a perfect example of why **software supply chain security** matters so much. 1/8

View full thread

But what happens when the vulnerability isn't in your code? What happens when it's somewhere else in your software supply chain? That's why we need to think about securing the **entire software supply chain**, not just the dependencies listed in our package manager. 5/8

We need to know what we're running, understand what we depend on, keep those components updated, and verify that security fixes actually make it into production. For example, updating a container base image in your repository doesn't mean your running application has been fixed. 6/8

You can write perfectly secure application code and STILL end up with a critical security vulnerability. That's one of the most important lessons from PHP2Shell, and it's a perfect example of why **software supply chain security** matters so much. 1/8

View full thread

We spend a lot of time teaching developers how to validate input, implement authorization, use safe APIs, and avoid introducing vulnerabilities into their applications. And we should! Secure coding is incredibly important. (Obviously I care about this a lot) 4/8

You can write perfectly secure application code and STILL end up with a critical security vulnerability. That's one of the most important lessons from PHP2Shell, and it's a perfect example of why **software supply chain security** matters so much. 1/8

"Developers should carefully investigate every dependency before they install or update it." Okay - Sure... And while we're at it, perhaps they could personally audit the source code of all 1,847 transitive dependencies before lunch. 😂 We need security advice that works in the real world. 1/5

View full thread

And we should also limit what our development environments can access, so one malicious dependency doesn't automatically get every credential we own. I know, this one isn't as fun. :-/ **Our security controls need to scale to the way developers actually build software.** 4/5

"Developers should carefully investigate every dependency before they install or update it." Okay - Sure... And while we're at it, perhaps they could personally audit the source code of all 1,847 transitive dependencies before lunch. 😂 We need security advice that works in the real world. 1/5

Pin dependencies at dev. Use lock files. Only updating with dependencies that are 7 days or older, unless it's an emergency. But we also need to **automate the security analysis of dependencies.** Modern SCA and software supply chain security tooling needs to go beyond: 2/5

"Does this package have a known CVE?" We also care about things like: → malicious package detection → suspicious changes and behaviour → project and maintainer health → ** reachability ** → provenance and other supply chain integrity signals 3/5

Three service accounts aren't three security boundaries if your AI coding agent can use all three of them. 😬 Imagine your coding agent can push code to your repository. Great. Then CI has a separate service account to build and test it. Also great. 1/5

View full thread

Keep production deployment behind a separate identity and an independent approval or policy boundary. Then compromising one part of your development environment doesn't automatically mean: "Congratulations! You now own production!" 4/5

Three service accounts aren't three security boundaries if your AI coding agent can use all three of them. 😬 Imagine your coding agent can push code to your repository. Great. Then CI has a separate service account to build and test it. Also great. 1/5

Then production deployment uses a DIFFERENT identity with different permissions. Excellent! Yay! Separation of duties! Except... If the coding agent has access to all three sets of credentials, we haven't accomplished very much... 😂 2/5

View full thread
View full thread

👑 I asked Claude to build me an app that would call me Queen every morning. What could possibly go wrong? Well... I wanted a cute little application that would greet me, give me a compliment, and share an inspirational quote. 1/5

View full thread

👑 I asked Claude to build me an app that would call me Queen every morning. What could possibly go wrong? Well... I wanted a cute little application that would greet me, give me a compliment, and share an inspirational quote. 1/5

And the resulting application was missing authentication, authorization, and input validation. Naturally, I brought this into my secure coding class, and we threat modeled it together. This is the story behind the latest episode of DevSec Station: 3/5

🚨 PHP2Shell: Two critical PHP vulnerabilities have emergency fixes available. Even securely written applications can be vulnerable because the flaws are in the PHP runtime itself. Check your PHP versions, patch, and rebuild affected containers. Don't rely on a WAF alone. 1/2