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 followers214 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

Patching a vulnerability doesn't kick an attacker out of your system. We've been talking about PHP2Shell for almost a week now. The patches are available, and hopefully everyone has been updating. But there's an important new development. 1/8

View full thread

If your organization was running a vulnerable version of PHP, especially on an internet-facing system, there are two important questions to ask: 1. Have we patched it? 2. Have we investigated whether anyone exploited it before we patched? Assume breach isn't just a design philosophy. 7/8

Patching a vulnerability doesn't kick an attacker out of your system. We've been talking about PHP2Shell for almost a week now. The patches are available, and hopefully everyone has been updating. But there's an important new development. 1/8

View full thread

We design with defense in depth, least privilege, segmentation, and monitoring because we know prevention isn't perfect. And when a serious vulnerability is disclosed, we don't just patch it and declare victory. We consider whether attackers may have exploited it already. 5/8

Patching a vulnerability doesn't kick an attacker out of your system. We've been talking about PHP2Shell for almost a week now. The patches are available, and hopefully everyone has been updating. But there's an important new development. 1/8

View full thread

According to their investigation, attackers chained PHP2Shell with a Linux privilege escalation vulnerability, installed webshells, and established persistent access. These findings haven't yet been independently verified, but they remind us of an incredibly important security principle: 3/8

Patching a vulnerability doesn't kick an attacker out of your system. We've been talking about PHP2Shell for almost a week now. The patches are available, and hopefully everyone has been updating. But there's an important new development. 1/8

If you're building software that handles sensitive personal information, I have a question for you. What would happen to the PEOPLE using your application if that information was stolen? Not just your company's reputation. Not just your compliance obligations. 1/6

View full thread

And this is also a **software supply chain security** problem, because third-party service providers are part of the systems we depend on. I made a video about the Crime Stoppers breach, the surprising gaps in Canadian privacy law, and how we can better protect vulnerable people. 5/6

If you're building software that handles sensitive personal information, I have a question for you. What would happen to the PEOPLE using your application if that information was stolen? Not just your company's reputation. Not just your compliance obligations. 1/6

View full thread

What happens if your third-party software provider gets breached? These are questions we should be asking when we threat model our applications. Privacy isn't just a policy someone writes and puts on a website. It needs to be designed INTO the software. 3/6

If you're building software that handles sensitive personal information, I have a question for you. What would happen to the PEOPLE using your application if that information was stolen? Not just your company's reputation. Not just your compliance obligations. 1/6

The actual human beings whose information you're protecting. Imagine you're building software for a nonprofit helping someone escape an abusive relationship. Do you really need their temporary new home address? How long do you retain their information? Who can access it? 2/6

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