Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

.NET Rocks!

.NET Rocks! artwork

OWASP Top Ten and ASP.NET Core with Anders Abel

Nov 19, 202649 minAudio
ShareXLinkedInFacebookWhatsAppEmail

How does ASP.NET Core help you make secure web apps? Carl and Richard talk to Anders Abel about the OWASP Top Ten and how ASP.NET Core addresses many of the vulnerability elements - at least where it can. Anders talks about using the powerful libraries built into ASP.NET Core, like authentication/authorization and data protection, to address many of the concerns on the OWASP list. It doesn't keep you from making mistakes or misconfiguring security items, but it's better than doing nothing or rolling your own.

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

Speaker 1How'd you like to listen to. NET Rocks with no ads? Easy. Become a patron. For just $ 5 a month, you get access to a private RSS feed where all the shows have no ads. $ 20 a month will get you that and a special. NET Rocks patron mug. Sign up now at patreon.dotnetrocks.com. Hey, and welcome back to. NET Rocks. This

Speaker 1is episode, what the heck episode is this?

Speaker 22029.

Speaker 12029. There you go. And we don't know what happened in 2029 because it hasn't happened yet.

Speaker 2And I like that.

Speaker 1Yeah. I'm Carl Franklin. That's Richard Campbell.

Speaker 3Hey.

Speaker 1Anders Abel is going to be here with us in a bit. But first, where are you, Richard?

Speaker 2I'm in the Netherlands. I was in... Oradev. Remember Oradev Mamelmo? I went back to Oradev for the 20th anniversary.

Speaker 4Wow.

Speaker 2And then I had a few days before going on to update Conf and Prog, so I stopped at friend Remy's.

Speaker 1Remy Caron.

Speaker 2Remy Caron used to do his own conference. He hasn't done it for many years now.

Speaker 1That's right.

Speaker 2But he owns a whiskey store. So, I mean, what could go wrong there?

Speaker 1Oh, my goodness.

Speaker 4Oh, boy.

Speaker 1Did you get in trouble?

Speaker 2No.

Speaker 1No, no, we're doing.

Speaker 2With the whiskey store? We're doing pretty well, you know, as good as we can. I mean, it's a couple of damaged soldiers, but, you know, what are you going to do?

Speaker 1What are you going to do? Yeah. All right, let's kick things off with Better Know a Framework. Hit the music.

Speaker 4Awesome. All right, man.

Speaker 2What do you got?

Speaker 1I think it was Simon that showed me this, although it's not his.

Speaker 2It's not actually Simon's work.

Speaker 1It's not his work. However, it's stunning.

Speaker 2Because usually Simon's work.

Speaker 1It's stunning. It's called Office IMO. And when you go to the repo, there's so many folders that the readme actually starts about three quarters of the way down the page. Office IMO creates, edits, reads, and converts Word, Excel, PowerPoint, PDF, Markdown, and and two dozen other document formats in. NET without Microsoft Office or COM. Think about that. So at the

Speaker 1heart of it is this PowerShell tool called PSWriteOffice. And so this is a wrapper around that. But anything to anything.

Speaker 2Do you figure this is the LLMs gone wild, right? Probably.

Speaker 1Probably. I mean, you know, if I was sitting around bored and wanted to do something with an LLM for code, I'd probably do something like this. Yeah, yeah. Something that no sane person would attempt in their lifetime. I mean, come on.

Speaker 2That's awesome.

Speaker 1But it's pretty stunning, isn't it? I mean, did you see the repo?

Speaker 2But, you know, you always wanted this. Yeah. No, it's huge. Yeah.

Speaker 1So that's what I got. If you got a hankering for offline conversion and... Actually, I know someone who lives with me that could really use this. I bet.

Speaker 4Yeah.

Speaker 1This is your tool. Office IMO. All right. Know it, learn it, love it. Who's talking to us today, Richard?

Speaker 2Grounded comment on the show 2021. The one we did with Rocky Locke I'm talking about is RockBot and all the goodness that was happening there. Not that this comment has much to do with that. This is a comment from Cliff B who said, why stop the history we show 2025 or 2026? Would be great to hear the future from your perspective. And to which I say, No. Just no. No. Not going to do that. That's what geek outs are for. We'll do those as geek outs.

Speaker 1Okay.

Speaker 2Don't need to do the top of the show for that.

Speaker 1It's a lot of work.

Speaker 2Although, yeah, just looking at 2029, like, hmm, what's going to happen in 2029? But Clippy, thank you so much for tormenting me further. And a copy of Musicobuy, it's on its way to you. And if you'd like a copy of Musicobuy, write a comment on the website at. netrocks. com or on the Facebooks. We publish every show there. And if you comment there and are reading the show, we'll send you a copy of Musicobuy.

Speaker 1And if you want to just go get Music to Code By, it's at musictocodeby.net. And there's 22 tracks of 25-minute long music that is designed specifically to keep you in a state of flow and focus while you write code or do anything else that requires your attention. Let's bring on our guest, Anders Abel. He is a senior software development consultant in Stockholm, Sweden. and a former Microsoft MVP in Visual Studio and Development Technologies. And there's more

Speaker 1to his bio, which you can find at. nerox. com. Welcome, Anders.

Speaker 2Thank you.

Speaker 4I actually am current MVP again. Oh, congratulations. I got renewed again. Thank you.

Speaker 1Oh, that's great. Yeah, the MVP program has undergone some changes, but it's still a great program. I'm an MVP as well for guys like us.

Speaker 2Yeah, and the Summit is coming around again.

Speaker 1Yeah. So what's on your mind, Anders?

Speaker 4Well, security in different flavors is usually what I go thinking about. And I mostly do, all the people ask me that are not geeks what I do for a living, I tell them I put login buttons. That's an easy way to explain what I do.

Speaker 2That's great. Just log in buttons.

Speaker 1You know, the definition of a genius in this modern time, the definition of a genius is a person who can press the right button at the right time. It all comes down to that.

Speaker 4No, but what that means, I usually do single sign-on solutions and sample to OpenID Connect, API security with OWASP, things like that, and try to secure things.

Speaker 1And I know you're going to talk about the OWASP top 10. And I do a security show with Patrick Hines and Dwayne LaFlock called Security This Week. And we're always stunned because isn't it like the number one is still SQL injection?

Speaker 4It isn't actually.

Speaker 2No, it's down to number five.

Speaker 4Yeah.

Speaker 1It's a run down.

Speaker 2We've made progress. Wow.

Speaker 4And they also bundle SQL injection with other injections. So number five, it isn't even its own point anymore.

Speaker 1Wow.

Speaker 2So what is the big one these days?

Speaker 4So I would say the big one right now is software supply chain. It's number three, although it was top 10, 2025. But I feel that as what has happened this year, where we've seen larger problems I'd say software supply chain and especially now with LLMs getting so good at analyzing things they find.

Speaker 2Things yeah finding vulnerabilities.

Speaker 4Exactly and maintainers are having a hard time keeping up with the findings yeah You know.

Speaker 2Over on Windows Weekly, we've been talking about the number of patches to Windows. It's like last month was more than last year.

Speaker 1Right.

Speaker 2Like it's in the thousands. It's crazy.

Speaker 1But, you know, at least the good guys are keeping up with the bad guys. But they have to work extra hard to do that. And, you know, this is something that we lament on Security This Week as well, which is that as soon as even, you know, before there's a zero day, like the AI finds the zero day and immediately launches an attack. Nobody has time to patch.

Speaker 4And that's what's scary is that the time from finding vulnerability to building an exploit has become so short.

Speaker 1Seconds sometimes. Yeah.

Speaker 2Although admittedly, like that. php to shell hack i spent some time looking through that thing no human thought up that hack like that's an incredibly complicated exploit it's very powerful but my god you can see software in action.

Speaker 1Did you see the story about the one guy the volunteer who patched it like across 12 different packages and he basically is being lauded as the guy who saved the internet crazy yeah one.

Speaker 4Guy But what I also see is that high quality code where, so I was listening earlier this year to a conference talk by Daniel Stenberg, the author of Curl. And he, they have spent 20 years on code quality and ensuring the code is secure. And all these LLMs, they don't find that much in that code base. So what we see now is that sloppy quality now it

Speaker 4comes back and the LLMs find it. But high quality code where people have done appropriate defense in depth, it usually survives.

Speaker 1The chickens have come home to roost.

Speaker 2This is the important part, right? If we're going to live with LLMs, we've really got to work hard to make sure that the samples that they're going to learn from are good quality, that the documentation is correct, that it's current, like, that's what scares me. It's just so, you know, PHP, how much bad code are we talking about? Like, holy man.

Speaker 1Yeah. Yeah.

Speaker 2I mean, I had a good chat with Kathleen Dahl, and I suspect we'll have her back on again, talking about the efforts of the C Sharp team to make sure that the new C Sharp features are well documented. They've got good, secure examples. They are thinking in terms of the LLMs are going to read this, and this will be what they generate code from, you know, if we're lucky.

Speaker 1So what else is on the list?

Speaker 4So OWASP top 10, the number one now is actually broken access control. And what they did with this addition of OWASP top 10 is that they kind of bundled things. So in the past, we had broken access control, which contained a well, what you think about as access control. If you write an API, do you do proper authorization so that just the right people can, or the right users and clients can access that data? But also under

Speaker 4broken access control now is cross-site request forgery. Because that is also a kind of access control. Is it the right source of the data being posted to your application? And looking at the list, I'm not entirely fond of this restructuring. Because OWASP top 10 used to be like a recipe for a web developer. If you were fairly new to security, I mean, this was how I learned about OWASP top 10 some 15 years ago, is that

Speaker 4I was fairly new to the security area. It was a checklist. Don't do cross-site request forgery. Beware of cross-site scripting. Don't do SQL injection. Every single point on the list was a very well-defined... vulnerability, you could go check your code and have this as the 10 most important things to keep in mind while coding. But nowadays, it's hard because broken access control, it contains multiple things. And then

Speaker 4we have issue number two on the list, security misconfiguration. Yeah, okay, you misconfigured something. Hmm. What does that mean? Don't do stupid things?

Speaker 1Right.

Speaker 2Well, yes, but also.

Speaker 1Yeah, so it's not as clearly defined was what you're saying, the prescription.

Speaker 4No, unfortunately not. But what I've also spent some time on here is to actually cross-check OVA's top 10 versus what ASP.NET Core offers as built-in features and what you have to think of yourself. Because that is where I find it. this being useful for a. NET developer or ASP.NET developer is that some of these things are things that the framework really does for us. We don't have to care about it. Some of these things are things where we are completely on our own. The broken access control,

Speaker 4for example, if we look at the two major things, the authorization framework, there is a great authorization framework in ASP.NET Core that you can use to.

Speaker 2Right.

Speaker 4To express your authorization rules, a policy-based system that is extensible and works really well. Cross-site request forgery, if you do server-side rendered stuff like razor pages or classical MVC, it's built in. You get this anti-forgery token for free in your forms and For MVC, you have to opt in to enable the check for razor page. It's enabled out of the box. You don't have to think about it.

Speaker 2Yeah, as long as you use these tools. But you really made a great point there, Anders, about that number one is these two distinctly different things, like requiring authorization, but also turning on anti-forgery protection and so forth. They're both important. They don't really have anything to do with each other, except that normally you can put them under the same category.

Speaker 4Yeah, there are more things to it. Those are the two most, I'd say, most important examples there. But there are more. So should we just go through the list quickly and maybe deep dive?

Speaker 2Yeah, because the security misconfiguration comes up all the time on Run as Radio. Like that's how many open ports, how many things with no significant logins. And this is what burned Microsoft too, right? It was some demo app. that was turned on for a demo and never turned off again. It was never properly secured for the demo. And then suddenly it was a backdoor into all kinds of things. And that's what happens.

Speaker 4And if I look at what ASP.NET Core does, I think that I'm old enough to have written code when everything was HTTP modules in web forms. And realizing when you deployed something that, hey, this machine config on this server has a bunch of extra HTTP modules I've never heard of that is running in my pipeline. That is the kind of things you get for security configuration because there are additional features that you don't know about. And that's what I really appreciate with ASP.NET Core is that you have your startup. You add things to your startup.

Speaker 4That's what's running, period. It doesn't even serve static files unless you tell it to do that. That's really not the Microsoft way, right? Like Microsoft's always been very prone to like, I have a Swiss Army knife, and every knife is out. Everything is on by default.

Speaker 2Go crazy.

Speaker 1Yeah, it's more about convenience.

Speaker 2And they're all attack service, right?

Speaker 4Yeah, they actually went a bit in that direction when they, for example, now add user authentication. You don't have to add that to the pipeline. It's added automatically. So there are a few things now in modern versions of ASP.NET Core that are added without you having to do that, but still... I think it's fairly sensible things. It doesn't serve static files on this utility, which I still think is a great feature.

Speaker 2Well, it's very hard to hack at static files, right?

Speaker 4Yeah, but it's also, back in the very old days, having static file access was a common way to attack websites. For example, you could.

Speaker 1Interesting path traversal.

Speaker 4Treat the service to download the PHP script, the source code, and then you could analyze it and find out what was wrong. Right. And if there was any holes in there.

Speaker 1Yeah, there's a path traversal hack where you basically try to access a file and then append dot, dot, slash, dot, dot, slash, and go back outside of the sandbox where all your files are. And that comes up every once in a while as a vulnerability.

Speaker 4It was good times.

Speaker 1But that's static files.

Speaker 4But also just that you might have files in your website directory that you did not intend to serve publicly. And then we have software supply chain things that we covered. But I think the software supply chain has gotten better. And you get and Visual Studio and the tooling is now much better than it used to be. If you try to compile anything that references, even transiently references a vulnerable package, it will let you know. As a new Git maintainer, you can now mark things as deprecated or

Speaker 4vulnerable and be sure that this is flagged in the build pipeline. It will cause build errors for anyone consuming these versions.

Speaker 2One of my run-as shows, I had a conversation with a security guy who said, look, just don't use any packages that are less than 48 hours old. Like the good guys will find weaknesses, but they don't find them instantly. So as long as you let those things marinate for a little while, your risk level goes way down. I don't know how you feel about that, Anders.

Speaker 4Well, I'd say being an early adopter is always a risk. So being an early adopter, anything that is released that is new, as you said, it might have problems. And also for security sensitive things, It's always a good idea to be a bit reluctant, to be a bit old fashioned. And also, for example, LLMs coding. I've been very late or I'm still late on adopting it because I think

Speaker 4that for security components, that's not maybe not the right place to experiment.

Speaker 2I'm not going to ask an LLM to generate a cryptographic library. That just seems like a bad idea. There are some deterministic things in this world that non-deterministic software should not touch.

Speaker 1You only live once, Richard.

Speaker 4I had this conversation with Philippe Derrick, web security specialist. He recently got his first RFC published on best current practices for browser-based applications. And he said he used LLMs to generate But the thing is that he knows the specs because he was part in writing those, the new specs. And for him, it is a reasonable tool. But for other people, I would say use a pre-made component.

Speaker 2You need to understand the code it's generating when it's this sensitive, especially. I'm pretty loosey-goosey on the forms over data stuff. I'm not going to worry too much about that. But anything to do with authentication and stuff, like, holy man, be very sure. And let's face it, most of this stuff is solved problems. You do not need to roll your own. Exactly.

Speaker 4And that brings me to another point that is kind of my favorite thing here is also the viability of open source in the long run. A lot of these security components are open source components. And I maintain a sample two libraries since over a decade. And what I can see is that The number of organizations signing up for commercial support contract or in any way contributing in a meaningful way financially, it's way too low to be sustainable, unfortunately. Right. Yeah.

Speaker 2Well, certainly. And at the same time, it's like keeping this stuff secure is so important. You you need that but uh you do need you need.

Speaker 4Help too exactly That brings us to number four on the list, cryptographic failures. And this one is interesting because cryptographic failures is mostly about not that people roll their own crypto. We are past that. People know that they should use real crypto things.

Speaker 2Yeah, one would hope.

Speaker 4Yeah. But the problem is that if you use AES, for example, it's the state of the art symmetric crypto algorithm. Everything uses it. It's a good algorithm. Nothing wrong with it. But if you reuse the initialization vector, you're screwed. So when you use it, you have to know what an initialization vector is and that you shouldn't reuse it and how to store it, etc. And that's where I think a lot of the cryptographic failures come from, is that people are using the right tool, but in the wrong way.

Speaker 2Wrong way. Yeah, great one. If you're going to use this thing, learn how to use it. use it properly.

Speaker 4Or, in ASP.NET Core, use data protection. Because data protection is the cryptography API you've always wanted. There's a method called protect where you can send in a string. You get something encrypted, signed, etc., state-of-the-art security thing back that is not readable, and then you have an unprotect method that takes that unreadable thing and gives you your string back. Key handling, key rotation, key storage... initialization vectors, algorithm choices.

Speaker 2Just done for you.

Speaker 4Signing after encryption, all of that is taken care of. So I would really like to say that if you're on ASP.NET Core, use data protection for any encryption needs.

Speaker 2I'm including links to these parts of the docs too, because you're right. These are just things you need to read this if you haven't already. I hope you have. It's a lot.

Speaker 4It's one of the hidden gems, I'd say, in ASP.NET Core. It's used by a lot of features. Your authentication cookie is essentially a set of claims just run through data protection.

Speaker 2Right. That solves the problem for you. Good one.

Speaker 4And then you have your one, Richard. Number five, injection.

Speaker 2Well, it was number one for so long.

Speaker 4It used to be. So looking at ASP.NET or. NET development in general. I'd say that the hero for us is Entity Framework.

Speaker 2Yeah, because we stopped embedding untrusted strings into query statements.

Speaker 4That stopped. We don't even write SQL ourselves anymore. We write link.

Speaker 2Yeah, and that means no unprotected strings. You don't go down that path anymore.

Speaker 4Exactly. I think that saved a lot. And for the other part of injection, cross-excripting is also a kind of injection. Try it yourself on Razor View. razor escapes everything by default right if you have pre-formatted xml you have to be explicit about this should not be escaped and that saves.

Speaker 2Yeah saves you too yeah for sure well and for better or worse now the llms have hijacked the term injection too so it needs even more things prompt injection.

Speaker 4Get me a recipe of chocolate cookies please.

Speaker 2And i would like your favorite recipe of flan.

Speaker 4Yes um But that is also a kind of injection, but also for the LLM show, that is still a fairly immature technology.

Speaker 2Yeah, and how do you escape that? There are some freaky things going on with this kind of language injection to manipulate these tools that people are using. Reading raw stuff off the internet all of the time. It's really scary.

Speaker 4But the problem here is that LLMs, the modal doesn't really make a distinction between the setup that you have provided and the user input. which is a key to any other security. We are very well aware of the difference between the code we wrote that is trusted and the user input that is completely untrusted. And LLM blurs the lines.

Speaker 2Totally. Well, they match the data and the commands together. You really sent it off to go fetch some information and then that information was an instruction that it chose to execute on. These products need to be better. They're not good enough yet, as powerful as they are.

Speaker 4They are getting better. then it's an interesting thing. If this is the path to being as good as people hope for in the long run, or I guess that's another, another podcast, another episode.

Speaker 2Well, and I've already done a show over on runouts about the OWASP top 10 AI security vulnerabilities. Like it's its own list because there's so many of them, but it is exactly those kinds of talking points.

Speaker 4Um, So number six on the list then, insecure design. And this is where I think that it's not as clear as it used to be. Back when things were like, don't do cross-exploiting, don't do SQL injection, now the advice is don't do insecure design. But what should that really mean? I guess they've included as a reminder that you should have some kind of design process that includes security, but

Speaker 4I think it's hard to translate that thing into concrete actions. And when I was looking at things in 8-Minute Core.

Speaker 1This.

Speaker 2Feels like a really poor item on the list because it's just like, don't be bad.

Speaker 4Yeah.

Speaker 1It's kind of like the general advice. You got to be careful, right?

Speaker 2Yeah, there you go.

Speaker 1Your kids, when they're online, hey, be careful. What the hell does that mean? You know?

Speaker 4Exactly.

Speaker 1It just absolves you from guilt or blame.

Speaker 4But then the next one, number seven, is more clear. Authentication failures. And for ASP.NET Core, I think that is very much solved. Don't roll your own. I didn't follow that advice more than 10 years ago when I started on the smallest SAML 2 open source library.

Speaker 2And.

Speaker 4I've learned so much about authentication since. I've learned so much about details about XML signature handling, signature wrapping of things. And I'd say by now. I'm happy that I created a SAML 2 library, but it takes so much time to create a high quality authentication system.

Speaker 2Wow.

Speaker 4So either you are ready to invest in it because you want to build something that doesn't exist, go ahead and do it, but be prepared to spend a lot of time on it. go do something that someone else spent a lot of time on.

Speaker 2Can we talk about your provider? Why does it need to exist? Because you've gone through this whole process now. What's the gap that it's filling? So when it started, it.

Speaker 4Was a project for Swedish Healthcare where they wanted to use somebody's authentication for an ASP.NET Core application, or not ASP.NET Core even, ASP.NET application. It was an HTTP module when it all started. And back then, the general way to solve SAML 2 authentication for ASP.NET application was to put a proxy in front of it that would handle the session and then send HTTP headers with the currently authenticated users.

Speaker 4And I felt that was kind of awkward because then in the application, we had to create our own session and we had two sessions. And as soon as you have two sessions, they might get out of sync.

Speaker 2Yeah.

Speaker 4And that felt awkward.

Speaker 1So.

Speaker 4My first start here was to say that, okay, SAML is a huge standard and it's complex. So my intention was to create something that was a decent SAML basic implementation, but was a good fit with the ASP.NET system. I wanted to create an HTTP module that worked just like the WSFET module or something like that. And later on, it became an OWIN middleware that worked just like the OpenID Connect module. Middleware, now it's an ASP.NET Core handler available as well that you call add sample to, just

Speaker 4as you would do add OpenID Connect. And it plugs into the same authentication system and authentication architecture, which means it can also be used by other systems that expect an authentication handler.

Speaker 2That's cool.

Speaker 4So essentially, if your boss says you need to connect our application to. A SAML2 IDP, then we have an open source component for it. If you need to do more advanced things, encryption, data search, SAML2 federations, we can do that, but let's drop the news that we are looking into moving the high-end features to commercial tier. As I said, very few

Speaker 4organizations sign up to commercial support, and somehow we need to get paid for the time we spend on this.

Speaker 2Sure. And I'm sure you're getting pressure to add some pretty advanced features as people go down the path too. So is a good case for making a commercial version.

Speaker 4Especially the more advanced. The library is used by some fairly large software as a service providers. So I guess my intention is that if you're at this scale, do a multi-tenancy thing, You can probably pay a little.

Speaker 2Yeah, you should probably be contributing in some form. Fair enough. Why don't we take a break?

Speaker 1Okay, yeah. let's do that uh this is a good time to take a break so we'll be right back after these very important messages stick around And we're back.

Speaker 2It's On Air Rocks. I'm Richard Campbell. That's Carl Franklin.

Speaker 1Hey.

Speaker 2Here with Anders Abel talking a little bit about, well, security stuff in general, his SAML 2 service provider, which he's been doing for many years, and working our way down the OWASP top 10 lists, especially in the context of ASP.NET Core. Because there's no authentication failures in ASP.NET Core, right? That one works perfect.

Speaker 1It never happens.

Speaker 4Well, there are always ways to use things wrong. Even a good tool can be used wrong. But if you use the pre-made things, it usually works fairly well.

Speaker 1Yeah.

Speaker 2But like you said, use it correctly.

Speaker 1Yeah.

Speaker 4And that kind of brings us to number eight, software data integrity failures. It's once more about sensible defaults, et cetera. And one of my favorites here is that When they implement a system text JSON, they remove the capability to deserialize any type. Previously, that was a common vulnerability that you could, and it's been in various serialization libraries over the years, that you could send data that serialized a

Speaker 4type that was a system type of some kind, and that system type would then start Being a statuette is to start doing things. Right. And that's now disabled by default. And that's good.

Speaker 1And there have been these attacks that have been deserialization attacks. And I could never understand them because, you know, when you serialize an object, it just turns it into a stream of data. And then when you deserialize it again, it becomes data. And code is not serialized. But if you deserialize it to an object that exists already, like you said, a system object, that does have code. And if there's an initializer that executes, and if you can inject into that initializer, boom.

Speaker 4Exactly. So one of my favorite examples is the, in. NET, there's a temp file collection class, which for some odd reason is serializable. The temp file collection is a utility class that allows you to create a bunch of temp files, and it works really hard to delete those temp files for you when you're done, which is an excellent property for a temp file collection. But Carl, imagine if I serialize my temp file connection and includes a bunch of important file names in that temp file collection. It's deserialized

Speaker 4on your machine. And once it goes out of scope, it will go ahead and try very hard to delete the file names that I selected. So what files do you have on your machine that you don't want me to delete?

Speaker 1Oh, HTTP sys for baby. That would be bad. Yeah.

Speaker 4But they've improved it. It makes it harder to use wrong.

Speaker 2Data protection plays a role in there too, right? That's another great place to have data protection turned on.

Speaker 4It helps if you... Data protection helps a lot. If you serialize data for temporary storage and then you are the one reading it back.

Speaker 3Right.

Speaker 4But it doesn't work for the case where I'm going to send data to someone else.

Speaker 1Right, right.

Speaker 4But data protection is great, for example, for storing temporary data in a cookie. For storing, if you have a multi-step wizard, you want to hide previous steps in a hidden form field.

Speaker 2Excellent use of data protection. And this is just like signed data. You get packages, represent a security risk if you don't use signed ones, like that kind of thing falls into this category. Untrusted code, baby.

Speaker 4Well, I would say that software supply chain, but... I tend to agree, yeah. The line is somewhat fuzzy here.

Speaker 2Yeah, and looking at the OWASP docs, they're not making it easy either. No. They do talk about untrusted code and so forth.

Speaker 4And then we have number nine, security logging and alerting failures, which essentially is one of those things. hey, set up your logging.

Speaker 2Yeah, I set up. I turned on everything, man. Now I have a huge view of stuff I never look at, so I'm safe.

Speaker 1How big is your log? Oh, yeah, mine's bigger. I'm safer.

Speaker 4Yeah, that's one more thing to consider. What do you actually log, et cetera? It's hard. But still, I think we have great tooling support here. OpenTelemetry has been a tremendous success, and standardized logging and also being able to follow how a request is handled across a bunch of microservices, etc.

Speaker 4It's really gone through an evolution the last three, four, five years.

Speaker 2Do you find developers struggle to make good log entries from within the application? It's one thing to have your authentication logging and so forth. That's fine because a lot of that's driven by an external library that knows what it's doing. It's logging stuff within the app. I think folks really have a tough time. What do I need that's important?

Speaker 4Yeah, I was looking at troubleshooting a log today that for some reason we forgot to enable the cleanup job feature. when we moved environments. So now the log, this log was 100 gigabytes, which was not what was expected. And when we were looking at that, we found out that, yeah, we might be logging a tad too much details here, dumping whole objects into the logs. We might have something

Speaker 4to revisit here.

Speaker 1I had that problem early on in. NET Rock's website in database history. You remember that, Richard? We were logging... so much stuff that uh that uh it it just crippled the database and you know finally had to ask ourselves what are we doing this for you know why what are we actually looking for here and.

Speaker 2Uh yeah but i guess it's always a question like what data will help.

Speaker 4You do something useful exactly and right and that's where i think open telemetry is great because it samples on successes so If you look at the log that is handled by an open telemetry-based system, you will have all the errors, all the transactions that ended up in errors, but you will just have a sampling, maybe 10% of the successful events.

Speaker 3Right.

Speaker 4Because you don't need to be able to look at every successful event.

Speaker 1Right.

Speaker 4You might want to look at a few of them to compare to the error events. You might want to look at successful events a bunch of them to check timings and to analyze performance but you don't need every single one yeah and that's all built.

Speaker 2In yeah open telemetry just says that for you good.

Speaker 4And then we have number 10 the final one on the list mishandling of exceptional conditions and the easy answer here do you remember back in the days now we are i'm old 20 years back where the The default ASP.NET error page would show a complete stack trace, all the internal details.

Speaker 2Yeah, giant yellow bar of doom. Exactly.

Speaker 4And a lot of information for an attacker to get.

Speaker 2Yeah, you scored.

Speaker 4Right.

Speaker 1And if they were smart, they could cause an exception by sending in some bad data. Well, not just they were smart, but if the developer was stupid enough to let that happen.

Speaker 4But this is also an example of security misconfiguration. The problem back then was that the default was that the yellow screen was enabled. You had to remember to disable it before you went to production to create your own screen. And nowadays, with the default templates in ASP.NET Core, it adds a similar page, which is restricted to development mode. And then on the production mode... It shows a very

Speaker 4no-detail error page.

Speaker 1An error has occurred.

Speaker 4Exactly.

Speaker 2Yeah, just a sad dinosaur is all anybody in the world needs to see, right? That's fine.

Speaker 4But what is important on that error page that is facing to the users, you have a request ID, which allows you to go back to your logs in your OpenTelemetry-based tool to find out exactly what happened. That is where you want the stack trace. That is where you want the exception message, etc. To the user, they shouldn't have those details. Right.

Speaker 1Common sense.

Speaker 4A lot of this feels like common sense, but well, unfortunately, sometimes when you're pressed, there's a lot of things to do. Sometimes you don't think of all of this.

Speaker 2Common sense, not that common.

Speaker 1I think we kind of touched on this, but do you think developers are now, you know, the developers that are using AI to write code, you think they're using their AIs to help fortify their code? and find vulnerabilities? Or is that crazy talk?

Speaker 4I know that there's a lot of people using AI to find vulnerabilities. I saw a post on LinkedIn recently by Fredrik Stöck, Swedish security researcher. He said that We have a lot of LLMs and agents now that can find vulnerabilities, but where are the agents that can fix the vulnerabilities? That's the problem right now. We are in a phase where we find a lot more things than we can reliably fix automatically.

Speaker 2But yeah, I mean, exploit. and fixing are not that different from each other, right?

Speaker 4Well, the difference is that to exploit, you need to find one weakness. Right. To be protected, you need to find and fix them all.

Speaker 1Right.

Speaker 2At least in that category of problem space, although eventually you are trying to fix everything. I do feel like all of our software is getting better right now because of these tools. The number of fixed flows everywhere is astonishing. And they were old vulnerabilities. Some of them have been around for decades. They just never got exploited, never got found, and now they're being found.

Speaker 1So we're in the uncanny valley of software security right now, I guess you could say. Somewhere between fixable and fixed.

Speaker 2Well, the one that scares me is what are the patches that are not being brought forward? Because what it's going to take to fix it is going to disrupt workflows enough that a company like Microsoft is just sort of sitting on this going, all right, how are we going to do this? You know, this is another UAC moment or we got to rewrite Entra or something. I just, I don't know what it is, but I just have this sense of dread with these hundreds of patches coming through. It's like, that's all stuff you can fix without having to tell us, just fix it. There's got to be

Speaker 2fixes sitting out there being needed. It's like, no, this is a change in the way we do stuff. How are we going to tell, how are we going to present this?

Speaker 4I'm not sure anyone would dare to do that or I hope not. People do not dare to do that. Previously, you could have a vulnerability and hope that nobody found about it, and you could sit on it. I think it is 10 years ago, I found a vulnerability in. NET Framework and XML signature handling, reported it to MSRC, heard nothing for three months, and tried to ping people about it and find out. And it took them more than six months to deliver a fix. And when they did,

Speaker 4it broke a lot of software.

Speaker 3Oh boy.

Speaker 4And that explained probably why it took so long for them to fix it. Because the problem was that if you inserted in an XML document two elements having the same ID attribute. That is forbidden, but you can still add it. And the vulnerability is that if you could... So one of these nodes element was the correct data payload that was signed, and then you had another element

Speaker 4with the same ID, and you could somehow trick an application to use that other element. So A classical case of you check the signature of one piece of data and then you use another piece of data and incorrectly assume that you used this assigned data. And there were obviously so many XML documents out there that had duplicate IDE attributes and had worked for 15 years in. NET Framework.

Speaker 2Nice.

Speaker 4They had to make a freaking change. Wow.

Speaker 1Unfortunate.

Speaker 4But I think we will see more and more things coming through... There will be breaking changes.

Speaker 2Yeah, I just have a sense that there's, I don't mean they're holding it forever, but how you're trying to get through a code base to collect all the fixes that need to be there and say, well, how are we covering all of them if we have to make this major change? I just can't imagine that every vulnerability being found by these tools right now is just a simple patch. It's like, oh, let's just change this code and we'll be fine. I just feel like sooner or later we're going to find something architecturally wrong that's going to mean major changes, major change in behavior.

Speaker 4Or even if it's just a minor change in behavior, I've learned that the hard way from working with Identity Server or doing Identity Server is that even a minor change that is a bug fix, for sure, there's some reducer somewhere that is dependent on the exact behavior, all that we think is incorrect. And when you fix it, you break the functionality for some customers some way.

Speaker 2Yeah.

Speaker 1Fun times.

Speaker 2I don't envy anyone in that situation, but I mean, I do think it's good news overall that we're making software higher quality. It's just challenging. Yeah.

Speaker 1I mean, when you, when you sit down to, to vibe code, you're not thinking, how can I fortify my application? No, how can I, that's not, that's not the fun part for developers. It's, you know, seeing, seeing your AI develop something quickly that would have taken you months. That's the fun. Just speaking from a pure hedonistic development, that's brainiac here, right?

Speaker 4I mean, Is it only security? Isn't it all the nifty edge cases that take all the time? I mean, doing the happy path, sunny day, part of programming has always been fun and straightforward.

Speaker 2Yeah, the 20% that delivers you 80% of the value. And now you got to do the 80% for that last 20. Exactly.

Speaker 4But that's where security lies. That's where the... quality and handling of exceptional conditions and edge cases lies.

Speaker 2So what is the weak spots in ASP.NET Core? Like you've kind of run down as, hey, that's built into core. You don't have to worry about that. But looking at this 10, I mean, other than like supply chain stuff comes down to, are you being responsible? There's not something to be built in for ASP.NET. Is there really a weakness in. NET Core, ASP.NET Core?

Speaker 4That's a very good question. I would say that Cross-site request forgery protection for APIs backing from a single-page application. It's not built in and not easy to do. It can be easy to do, but it's not a first-class concept that is built in.

Speaker 1Right.

Speaker 4Actually... For me, this is simple to do. You just need to add a custom HTTP header that is required on your API. Because a cross-exquest forgery happens when someone causes a hidden iframe to post a form somewhere. And there's no mechanism to make that include a custom header. So the Duende BFF, for example, has the cross-hatch request for the custom header called XCSERF with a value of 1. Fixed value, constant. And it's secure, because there's no way

Speaker 4to set that from the hidden iframe.

Speaker 2So right away you know if a hidden iframe tries to get up to anything. It's like, that's not us.

Speaker 4Exactly, and then you can block it. But otherwise, I think one of the problems is that the authentication and authorization systems are powerful but somewhat hard to use they are not yeah that each easy to get started with and use correctly once you use them um i'd say it's fairly you just kind of tend to use them correctly because using them incorrectly is even harder but to use them correctly still take some effort and I've seen

Speaker 4that people tend to do something on their own instead. Hey, this standard component is a complex to use. Why not just build something simple ourselves instead?

Speaker 2Yeah, it shouldn't be this hard. Let's just do something simple. The reason it was hard is because security is hard.

Speaker 4Exactly.

Speaker 1As Patrick Hines likes to say, security is the enemy of convenience and vice versa.

Speaker 4Absolutely.

Speaker 1If something's really convenient, then it's probably got attack vectors.

Speaker 3Yeah.

Speaker 4And the sweet spot that we try to achieve is, of course, something that is both convenient to use and convenient for the developer and secure.

Speaker 2Right. Awesome.

Speaker 1Yeah.

Speaker 2This is a good list, Anders. I appreciate going down it with you. I feel smarter.

Speaker 1Definitely. And a little more scared. And that's why we laugh. Yeah. Okay. Well, Anders, is there anything else you want to talk about before we hang up here?

Speaker 4No, I think it was a great conversation on iOS top 10. And even though the list has somewhat changed how it's assembled with these more grouped topics, I still think it's valuable to keep an eye on. And if you are new to AppSec or in general, if you are a web developer, Ovas Top 10 is something that is the first thing you should learn. These threads to name them and understand them because it it will save

Speaker 4you in the long run.

Speaker 1Indeed. Anders, thanks very much for joining us today. It's been a pleasure talking to you.

Speaker 4Thank you for having me.

Speaker 2You bet.

Speaker 1And we'll talk to you next time on. NET Podcasts.

Speaker 3NET Rocks is brought to you by Franklin's Net and produced by Plop Studios, a full-service audio, video, and post-production facility located physically in New London, Connecticut, and, of course, in the cloud, online at pwop.com. Visit our website at dotnetrocks.com for RSS feeds, downloads, mobile apps, comments, and access to the full archives going back to show number one, recorded in September 2002. And make sure you check out our sponsors.

Speaker 3They keep us in business. Now go write some code.

Speaker 1See you next time.

Speaker 4Life is hard.

Speaker 1Pay my taxes with my credit card.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. Modern Mentorship with Ethan Winer

    Nov 12, 202651 minAudio

    What is mentorship like today? Carl and Richard talk to Ethan Winer about his experiences helping people grow in their careers. Ethan talks about growing Crescent Software back in the QuickBasic and Visual Basic days -...

    Credit the people on this episode

  2. The Future We Were Promised Geek Out

    Nov 5, 20261 hr 13 minAudio

    Whatever happened to the future we were promised? Time for a Geek Out! To celebrate the end of the opening history bits, Richard pulls together all the most popular topics of "things we were supposed to get in the...

    Credit the people on this episode

  3. Building System Tray Windows Apps with Joe Finney

    Oct 29, 202657 minAudio

    It's Tray-Tober! Carl and Richard talk to Joe Finney about his latest project - building small, useful Windows apps that live in the system tray. Joe talks about his original project inspiration, Radio Tray - a way to...

    Credit the people on this episode

  4. XAML.io with Giovanni Albani

    Oct 22, 202657 minAudio

    OpenSilver evolves! Carl and Richard talk to Giovanni Albani about how OpenSilver continues to help folks migrate Silverlight apps into a sustainable model not dependent on the plug-in - but now the focus is on WPF!...

    Credit the people on this episode

  5. AI in Live Broadcast with Tim Huckaby

    Oct 15, 20261 hr 7 minAudio

    Can AI tech work in live television broadcasts? Carl and Richard talk to Tim Huckaby about his work building Duff Foreman, an AI-powered avatar for live golf programs. Tim talks about using AI to build AI, using M365...

    Credit the people on this episode