← Back
IAmTimCorey November 12, 2026 29m

335. Application Security is a Developer's Job

Read full transcript 25 segments
  1. Application security is a developer's job. Actually, it's everybody's job, but as a developer, you should be really good at securing applications. And I don't mean just adding authentication. In today's episode of Dev Questions, we're going to talk about why developers need to be so focused on security as well as what areas to pay attention to, especially in light of AI and all the security vulnerabilities that it brings to software development. Software development is more than just writing code. So let's talk about the rest of it. Specifically, let's talk about the developer's role in application security. And let's start with the basics. Why is security everyone's job? Well, first of all, every choice can impact security.

  2. If you decide that we're going to take in this additional information from users, well, additional information means additional ways for people to send data in that could potentially harm your database. Or maybe you decide we're going to use um MySQL versus SQL. Well, where is that server and how is that connect and and do we have as good of a handle on how to secure MySQL versus SQL? Or we want to use microservices. Well, now we have a whole bunch of boundaries. And are we sure we're we're securing every single boundary? Every choice has an impact on security. Even even small things that you do can impact security. So knowing that, you need to know how to secure every bit of what you do. Another part of this is number two, defense in depth is important. Too often we think about defense, we think about a big wall, you know, and that wall stops everything. But that's never a good strategy. A good strategy is to have multiple layers of defense where, yeah, maybe one can get breached, but that's okay because we have another one that protects you from actually losing anything. And that's important here, too. When you talk about um you know having multiple people work on your system, well, if they're each looking for security issues, if they're each evaluating security, well, then what one

  3. person picks up another person might have missed. And so you have that defense in depth of just who's working on this. If you have one person that's a security person and that's the only person thinking about security, you have one wall. And if that person misses something, well, then it gets missed. Whereas if you have that defense in depth of it's everyone's job to make sure things are secure, well, then you have a much more resilient, much more uh secure environment. Number three, you might view code that maybe nobody else has for months and maybe nobody else will view for months. Maybe get a a ticket to fix a bug. And you go into part of the system that's not actually worked on that often. Well, if you aren't looking for security issues, then maybe nobody ever sees those security issues because you're the one there, you're the one that has the ability to see those issues, but no one else really does because they're they're doing other things in other places. So sometimes it's important just because you're the only one that's going to see it.

  4. And finally, this is most important, but your business depends on data security. Think of any business and think about what would happen if they lost their data, if their data was stolen, if their data was corrupted, if their data was destroyed. What would happen to those businesses? Well, almost to a business, they would go out of business uh because data is that important. If if I came out and said, you know what, every customer that's ever worked for me, I've given away your credit card information, I've given away your your you know, your payment information, your address, your everything. That'd be a big deal and you probably wouldn't trust me to give you give me my give me information again. Like you'd be like, I'm not sure I want to do payments with you because you were had a pretty big breach. Now, just to be clear, so we're clear the air here, I don't keep payment information. I don't keep sensitive information anymore than I have to because I do really value security. But if if I were to come out and say I lost everything, that would really hurt your trust in me and my business. And so that would potentially put me out of business.

  5. It's a big deal. So your business relies on this. So it's everybody's job to secure the data. So let's talk about the major areas where people mess up in security in software development. So this is not a comprehensive list, but these are the the top ones that I've seen as a consultant for a number of years. Uh number one, securing only the front door. So this is one that it it drives me nuts when I see it because it feel when you don't understand security, this looks good. And this is again kind of that that one wall mentality where we have a login and that login prevents anyone from logging into our site that's not authorized. Okay, is your server secure? Because if your server is not secure, then it doesn't matter that they can't get in through the front door, right? I saw this with one customer where they had a secure site that had a password on it that protected data that captured pretty sensitive data.

  6. The problem was they were storing that data on a server where people also had direct access to that server without authentication. Now, they didn't have necessarily a clear path to that data, but they could have. And so that data was stored on essentially an unsecure server even though it was rather sensitive data. So yes, if you went through the application, it was secure. But you could get around the application and still get the data. And that's something that people often miss is they think about, well, if the application secure, my data secure. That's not necessarily the case because your application is not the only way people can access your data or your your systems. So be very careful of that. Uh the next one is not securing a connection string. This is one that especially if you're a desktop app person, be very careful of this. Too often I see people build desktop apps that talk to servers, that talk to a SQL server or other database server. And they say, well, the data is secure because you have to log into the desktop app or you have to have certain credentials and we only limit what the those those logged in people can do.

  7. Here's the problem. That connection string is still available to that end user. And you might say, well, I encrypted it. No, you didn't because [clears throat] yes, it may be encrypted, but the desktop app, the one that they are using has to decrypt that connection string. So it's still available to the end user. It does not matter what you do, you cannot prevent that connection string from being available. Now, it may be harder to get to. It may not be the easiest thing to get to, but especially in the day of the AI, it's not that hard. Um so what happens is that connection string is still available. So if that connection string is still available, then the user can use that connection string without using the application. That means that they can access the data directly without those restrictions that are inside the application, which leads to the next point, which is if you gave your connection string too many permissions. Well, if the connection string directly is accessible and it has too many permissions, well, maybe the app said you can't do admin stuff or you can't access another user's information, but that connection string has the ability to do those things.

  8. That's a problem. But also, this is a problem because what if somehow there's a bug in the app that allows you to get around the the desired calls? For example, maybe, and don't do this, but maybe you're building a T-SQL statement and you say, you know, select star from users where last name equals and then have the person give you the last name to filter by. The problem there is that if you didn't do it right, then I could say, you know, query semicolon select star from table. And what it would do is it would it would return the query record plus all the rest of the records because it's SQL injection. That's a really simple example of SQL injection. But that's a problem. And if you have too many permissions in your connection string, then what happens is you're vulnerable to SQL injection should there be a place where you can inject into SQL. Now, you might say, well, we always prevent against SQL injection. Yes, that's one layer. That's one wall.

  9. Another wall to add is that you also don't give more permission to your your connection string than the user should have anyway. That way, it's a second wall. Maybe they get access to that connection string somehow. They still can't do what anything more than what the app would allow them to do. Again, they're hitting the wall. They shouldn't be there, but you've had you've a second wall in place to prevent further issues. So that's where having that defense in depth is really important. Another one is not securing the boundaries. Um, maybe an API can do too much, right? So, this is a case where you have a desktop app, you say, well, we need an API then or to have secure data access. Good job. But maybe that API can do too much and you rely on the front end to say, oh, you're Tim, you can only access this information. But if the API can access all the information, well, then if you somehow bypass the the desktop app and call the API directly, now you have access to all that data. So, that boundary issue is an important one. We're talking about microservices, you've got lots of boundaries. Now, typically what happens with microservices is they all happen in a closed environment behind, you know, a security boundary so that you might not even be using HTTPS, you might be, you know, talking directly and all the rest.

  10. That can be okay, but you have to be very careful that you then don't allow anything to slip into that environment because once it's in, it's it's a fox in the henhouse, it's going to go crazy because you have no walls inside of your big wall. That's important. Um, next up, anybody who trusts the user input. Uh, never trust the user. Never trust the user. If you learned nothing else from early uh software development, it should be that never trust the user. And this does not mean that users are malicious or they are trying actively to hack you, although some are. Um, it might just be they give bad input because they're users. They they don't necessarily think the same way you think and so when you ask, my simple example usually is when you ask for an age, you're expecting a number, like, you know, 15 for 15 and they type out f i f, you know, and they type out 15. Well, the the problem there is that that's a string, but the user doesn't know about strings versus numbers necessarily. What they know is that the typed out letters 15 represents an H.

  11. But that's going to break your inputs. Well, it can get even worse when you also have things like SQL injection or other things. But here's the here's the real kicker. I see people saying, well, I never trust the user. I always try and do some kind of filtering the inputs, etc. Great. Are you treating the data in your database the same way? Because some data comes from external sources. And sometimes those external sources aren't properly filtered. So maybe you get information from API, maybe you get information from a a data dump from, you know, some external source, maybe you're uploading CSV files or or whatever the case may be, are you treating that data the same way you would treat user input? Because you should. And people say, well, it's in the database. Yes, that's right. And that's where the real danger lays lies because if it's in the database, then you are more likely to feel like you can trust it.

  12. And then you run it through systems that could that it could then break. It could be a ticking time bomb in your database that, you know, when it finally runs through a certain process, it breaks and crashes your application or worse. So don't trust user input and be careful that you know where all user input is and know what data has been properly scrubbed and filtered and what data is essentially raw and needs to be treated as suspect. Next up, giving production access to anyone directly. This one that blows developers' minds. I don't want to see anyone have access to prod. That's just I I don't think that that's a wise idea because what happens is that maybe you're safe. Maybe you are doing things right, but maybe you accidentally use the wrong connection string and in your test, you're testing as prod versus dev. I have seen that a number of times. All of a sudden, you're writing data to prod that's incorrect or is changing data.

  13. That's a big deal. That's just one simple example. What if your computer gets compromised and that direct access to prod means direct access to actual customer data? This has happened a number of times. This is what uh LastPass had a problem with which was that one of the like three people that had access to the actual prod system um had their laptop compromised. And that's a problem because it gives that direct access allows for for major issues. So be very careful when talking about prod access. I like to see everything go through an automated system to prod. I don't like to see anyone directly touching prod if at all possible. If you do, I kind of like to see a different login where you're logging out of your laptop and logging as a different person and accessing prod and then logging back out. Next up uh swallowing exceptions.

  14. If you swallow exceptions, meaning if an exception happens and you don't do anything with it where you just say, you know, try your catches maybe a even a log to the the system log but then you don't do anything with that besides that, that's a real danger because your app might be in an unexpected state. And if it is and you don't do something about that, that's where a lot of security breaches come in because your app is in an unexpected state and so unexpected things happen. And if you keep pushing and prodding, you can find places where you might get information out that you shouldn't have otherwise been able to access. So don't swallow exceptions. If you have to, let the application crash. And I know that's mind-blowing, but it's better to let it crash than to let it keep going in an unexpected state. Ideally, you handle that unexpected issue and put it back into an expected state.

  15. But if you have to, let it crash. Don't just catch all exceptions because all exceptions are bad. Don't do that. [snorts] All right. Uh next up, capturing sensitive data in log files. This is a big one. So you you want to log your application. You want to capture those exceptions. You want to capture issues and warnings. You want to make sure that your application is running well. But if you're not careful, you're putting sensitive data into your log files and your log files might not have the same level of restrictions and and permissions around them that your production data does. You might leak sensitive data out of secure areas into unsecured areas or less secured areas. And so maybe your your developers don't have access to read, I don't know, uh phone numbers for users because that would be a sensitive piece of information. But if you capture the phone number in a log and put in a log files, when your developers have access to those log files, all of a sudden you're leaking out data. And that can get worse because you can actually manipulate the system to create those logs should you know how to do that. So be very careful there. And finally, using sensitive data to develop databases that developers use. So dev databases really should reflect production as much as possible. And I'm a big fan of that.

  16. But you have to be really careful not to leave sensitive data in when you build out a developer database. So my system for doing this is it takes a backup from the production server and then it cleans out the sensitive data and then it creates a new Docker file that is just the cleaned data. And that way the the uh developers never have access to phone numbers, email addresses, um you know, other personally identifiable information. We'll talk about that next week uh more. Uh but other things like that that could be an issue where maybe their their dev machines are definitely less secure than production. Well, you don't want to leak that information there. Okay? So, I can keep going. But these are some big ones that I've seen as a consultant. I've seen them over and over and over. I've seen them burn companies a lot. But did you notice what I didn't mention at all? I didn't mention AI.

  17. In fact, this list was true well before AI came out. And I think that uh there are specific some specific areas where AI actually makes us less secure that we need to address because all of those previous issues are true, but then AI adds even more security issues. So, let's talk about the AI specific areas where we should make sure that we're being even more secure. Uh the first one is anything sensitive, connection strings, passwords, API keys that are on our developer machines. Remember, your AI has access to those things. You might say, well, I've told it not to read those. Yeah, okay. Um that's how security works. Just just don't look in that one area. AI are notorious for breaking rules. They're notorious for going, oops, I shouldn't have done that. Next time I won't do that for sure, wink. Like this is what AI do. So, don't have connection strings, passwords, API keys, etc. on your machine that are for sensitive areas. For your dev machine, sure. For your your dev database, sure. Again, as long as it is a cleaned up version. So, these things are really important that you don't have on your machine. Again, one more huge reason why developers should not have prod access.

  18. Next up, you got to think about this. Sometime we do connection strings or other things based upon the logged in user or the machine or the IP address where we say, hey, if you're logged in as as Tim, then you have Tim's level access to the database. Think about that. Where does the AI run? It runs on your machine as you. So it has your IP address, it has your machine, and it has your user credentials. Be very careful about what that means. Again, which is why I say log out and log in as somebody else in order to have access to more sensitive areas. This is one that's the next one is is one that is a double-edged sword. It's documentation. When you're documenting sensitive systems, often you say, well, that's a great job for an AI. It is, but that also means that you're giving the AI access or information about your sensitive systems.

  19. That could be a an issue as well. It could be an attack vector. So be careful about how much you allow it to document. Sometimes the best way to do that is to let a human document instead. Maybe have the AI create all the documentation from dev and then you just change it for prod. Um, be very careful how you do that. Um, the next one, assumptions. Assumptions in general with AI are going to burn you, but assumptions in unreviewed code because AI can write some great code. AI can create some really cool stuff. AI can do things in a matter of minutes or hours that would take us weeks and months to do. But it's not perfect and it's not thinking like a human does. And so in even in a human, you're going to have assumptions that you need to be careful of. And that's why we have code reviews, that's why we have, you know, talk reviewing PRs. We talk through these changes that we do. We don't do as much anymore, unfortunately, because we're saying, well, the AI wrote it. You need to review that code because there will be there will be things in there.

  20. If the code is of any size at all, there will be things in there that you go, wait a minute, what were you doing there? And that could be a security issue. Yes, the AI can think about a lot of security things that you may not even know to think about, but it can also make some pretty boneheaded mistakes. And so you need to make sure that you don't have assumptions in unreviewed code. Um another one is that you need to look at the joins between code blocks the AI has worked on. What I mean by this is AI's are good at building out greenfield systems, meaning systems that are brand new. And they can build them up and they can have this architecture and build it out and have sub agents working on it and and build out this complex system that actually works really well. However, they're not as good at brownfield development. What is brownfield development? It is development in existing codebase. And why? Well, the code the the context window is around a million tokens for a lot of of AI's. And yeah, you can get, you know, different sizes for different AI's but let's go with a million tokens. A million tokens is not that big actually.

  21. Yes, it seems like a lot, but when you think that a token could be half of a word or one word or one symbol, well, then all of a sudden you look at your codebase and go, I have 100,000 lines of code, that's going to fill the context window up, right? And so what happens is the AI says it's reading your code and reviewing your code, but it's not actually ingesting all that information and retaining it. And so what happens is it will have a a lot of information about the area it's working on. And then it will have bits of information about other areas it connects to and some assumptions. And those assumptions and those joins between the sections it's working on can be where you find problems, where maybe this little island is, let's call it, perfect. And that little island is perfect, but where they connect isn't. And so the reason why is because that was outside the context window, outside the the scope of what the AI was working on. And we have these, you know, little spots here and there that that the AI is working. And what you have is a join problem. So look for those joins, look for those seams where, you know, the AI may have made a mistake. Again, assumptions, again, the limitations of what AI can do.

  22. Another area where AI can really burn you is when you have out of date documentation and code comments. Because just like humans, AIs will read the documentation, read the code comments, and make assumptions. Again, that context window is only so big. And so, sure, in a specific area it might read the code itself and go, oh, that comment was wrong, and make an adjustment. But on the edges, it can't do that. It's got to skim. And that's where that skimming comes in where it goes, oh, the code comment says this, that's what I'll I'll take as my my information about that code. And next thing you know, you got a problem because the code comment was wrong. And so now you have a faulty assumption that can cause a problem down the road. Um finally, in the AI category, data that gets changed to fit AI's picture of reality. AIs cheat. It it has been known to happen, it's been proven over and over to happen. And it's kind of a feature of how AIs work.

  23. The problem is if you don't realize that, you can have a problem. This is why people tell you, don't let the AI both write the code and the tests. Because when it writes the code and the tests, the tests are testing the assumptions the AI had when it wrote the code. And those will pass. But those are assumptions, and it might not be correct assumptions, which is why you should have it write one AI, write the tests and you work with that and review the tests and make sure it's testing the right things and make sure that the assumptions are correct assumptions. And then you have a different AI actually build the code to make those tests pass. It's a more complicated process. It's more difficult to do, but in the end what you do is you have less of the AI cheating. The problem with AI is it's it's going to make some changes to try and fit reality to what it wants.

  24. And that might include changing your data schema in a way that's unhealthy, deleting data that it shouldn't delete, uh changing how things work and reassociating things that don't associate. There's real problems and real security issues when it comes to just letting the AI do its thing, especially around anything that can go to production and make those same changes. So there's a lot more impact that AI has to make things even less secure. You've got to be very careful to work on those things because an AI can make your code much more secure. Don't get me wrong. But it can also lead to a lot of security flaws if you're not careful. Security is a massive issue right now in software development. It's always been important, but most companies got away with security through obscurity. It If you If you've ever worked at a company and looked at their code and went, this is not secure, this is terrible, but it somehow is never breached, uh that is because secu security through obscurity.

  25. Uh but now with AI security bots roaming around and hackers empowered to do even more harm using AI systems, everyone's in danger, not just a few people. It's not Your Your percentages are going way up. So as a developer, it's your job to ensure that you set your application and your company up for success by closing every security hole you find. Sometimes that even means limiting your AI's access to your systems. The alternative is to invite disaster into your company. All right? Thanks for listening. As always, I am Tim Courtney. >> [music]

Summary

This episode of Dev Questions explores the critical role developers play in application security, especially amidst new AI vulnerabilities. Key subjects discussed include defense in depth, managing database connections, server security, and the business impacts of data breaches. The practical takeaway is that security is everyone's responsibility, requiring developers to look beyond just authentication and secure every layer of their software and infrastructure.

View original episode ↗