AIDependency ManagementPodcastSecurity

Foojay Podcast #105: Security Is Your Job: OWASP, AI and Safer Java Dependencies with Jim Manico

Foojay Podcast #105: Security Is Your Job: OWASP, AI and Safer Java Dependencies with Jim Manico

How safe is your Java application, and how safe are the dependencies it ships with? If you build software that handles sensitive data and you have no security process, Jim Manico has a blunt word for it: negligent.

In this episode, Jim Manico, founder of Manicode Security, Java Champion and OWASP project leader, explains what OWASP actually is and which of its projects matter to a Java developer. He recently brought three nearly abandoned libraries back to life, the OWASP Java Encoder, the OWASP Java HTML Sanitizer and the OWASP JSON Sanitizer, using AI-assisted workflows, and he shares what that taught him.

We cover when to use the encoder and the sanitizer, why untrusted input must be checked on both the client and the server, how a few kilobytes of nested CSS can cause a denial-of-service, and why small vulnerabilities become a major one when an attacker chains them together. Jim also argues for radically fewer third-party libraries, explains how to keep the ones you have up to date, and ends with what to do on Monday morning if your team has no security process yet.

YouTube

Podcast Apps

You can listen and subscribe to the Foojay Podcast on:

Guests

Content

  • 00:00 Introduction of topic and guest
  • 02:11 What is OWASP?
  • 04:10 How AI influences the speed of OWASP changes. Who contributes.
  • 06:30 Which OWASP projects you should know as a Java developer
  • 07:30 How Jim uses AI to evolve his libraries
  • 08:28 When to use OWASP Java Encoder and OWASP Java HTML Sanitizer
  • 13:58 User input needs to be checked in all steps (UI and backend)
  • 16:07 Man-in-the-middle attacks (eMuhdra)
  • 17:17 How to keep your systems up-to-date + minimize your dependencies
  • 22:34 How CSS can cause a denial-of-service problem
  • 24:52 How multiple small security issues can be combined into a major issue
  • 26:36 How to handle the growing number of discovered vulnerabilities
  • 29:13 The era of coding is coming to an end but you can still be a master developer
  • 32:45 How to automate upgrading with Maven, Gradle, and other tools
  • 36:42 What Java developers can learn from recent security problems (like PHP and eMuhdra)
  • 38:42 You must have a security process! Make your managers aware…
  • 43:53 How to get involved in OWASP
  • 46:08 What to remember from this podcast: security is your responsibility!

Transcript

Automatically generated from the audio, so it can contain errors in names and technical terms. Suggest a correction.

[0:00] How safe is your Java application and the dependencies you are using?

[0:04] Welcome to the Foojay podcast. All your news about OpenJDK.

[0:11] Welcome to another episode of the Foojay podcast. Let’s talk about security again. Two weeks ago I talked with Simon Ritter in Foojay podcast episode 104 about the runtime site, a record number of fixes in the October Java updates, two emergency releases within a week, and why running unsupported OpenJDK has become a security risk. Most of these issues were found by AI, of course, these days, and some got exploited within hours, so keeping your runtime code and dependencies up to date is more critical than ever. And speaking of dependencies, today we look at the other side, the libraries and the code you write yourself. My guest is Jim Manico, founder of Manicode Security, Java champion, and OWASP project leader.

[1:02] Welcome to the podcast, Jim, and thank you for your article on Foojay. So you asked everyone to update the OWASP Java Encoder and the Java HTML Sanitizer. With the security news of the last weeks, I think the timing could not be better. So for people who don’t know you, what’s the work you’re doing related to application security?

[1:26] Well, I’ve been a Java programmer since the late ’90s. I began writing Java applets with Java 1.02 back in the late ’90s, so I’ve been a fan of Java and a Java programmer most of my life. But I switched primarily to security about 15 years ago where I work with my customers to build, review, architect all secure software as a focus. I got involved in a lot of like high-risk type situations, so I had to learn about secure coding at a time when there wasn’t much literature in that area. So

[1:59] Yeah.

[2:00] So last like 15 years I’ve either been writing secure code, reviewing secure code, or being as an educator, my main job now teaching developers how to write secure software.

[2:11] Okay. And by the way, is it OWASP or is it O-double-U-ASP?

[2:16] The Open Web Application Security Project, OWASP.

[2:21] I heard about it. It has one of those rule sets you should know and apply to projects, but can you explain it in two sentences?

[2:31] OWASP is an international charity that has conferences, documentation, and code libraries and tools to help developers build and assess software for the sake of security.

[2:46] Okay. But most people may know it from the top 10 and those are applicable to everything in software development? Is it web development? What are those rules?

[2:56] OWASP went from the Open Web Application Security Project to the Open Worldwide Application Security Project, a big name change because now we have mobile software, API software, web front ends and web software and all software. We’re now expanding our nonprofit to handle any kind of software security topic. And it’s it’s there’s not really a set of rules per se. It ’s a variety of projects with different projects that site rules. Like there’s once there’s the OWASP top 10 which is really made for awareness. That’s for education. But then there’s the ASVS, the Application Security Verification Standard. That’s more of a set of secure coding requirements. And I founded the AI SVS, the Artificial Intelligence Security Verification Standard around deploying and building your own AI models and agents. And so and just to be honest with you, OWASP is a little bit chaotic. It’s a nonprofit.

[4:01] It’s not like a formal group like NIST. It’s more like a big group of smart cats doing all kinds of wild things.

[4:10] With AI, isn’t that very hard to catch up with your rule set and how you should build something with AI that’s secure? Is it not evolving too fast?

[4:22] Well, it’s a combination Well, the Artificial Intelligence Security Verification Standard, it’s bleeding edge, but the it’s I don’t do it by myself. I work with Dr. Russ, who’s a PhD in machine learning. I work with Rico Carmeda out of Germany and Otto Sallen out of Finland. All three of them have been deep in the AI, like literally building training models level of AI for many years now. And this is something I studied for about four years. So and between the four of us, we came up with Like I did the initial set of requirements. Rico and Otto jumped in and began issuing PRs. So I made them co-leads. They’re brilliant. And then we had Because it’s such an interesting topic, I’ve had contributors It’s from Apple, contributors from other very large areas who who’ve contributed issues and PRs because we’re not doing this as like a secret cabal in the basement somewhere. We’re doing this on GitHub in public where we’re getting slammed by other contributors helping us make it better.

[5:27] The other thing is that AI SVS, Artificial Intelligence Security Verification Standard, we’re at version 1.02. And we’re working on that now. This is our third like small version of it. We agree that trying to put this out now, it’s going to be very imperfect, but Frank, you got This is so important to get right. We have got to start somewhere. And the more we put out and the more contribution we get, the more we fine-tune it. And we already agreed that we’re at the 1.02 making point releases to fine-tune the original version. When we move to AI SVS 2.0, we’re going to re-reshuffle the deck based on how things change. And think of the ASVS. That’s like 300 plus requirements for web and API security. They’re on version five. And that’s just they keep refining it every version. We intend to do the same, but we got to start somewhere. And so

[6:25] Yeah, start somewhere. And it moves fast, so you have to keep up. so this podcast is mainly for people doing Java development. so AI is, yeah, a broad topic. So I guess it also applies to any Java application which uses AI. Are there other OWASP projects I should know about as a Java developer?

[6:49] Well, Michael Samuel from Google and Jeff Ikinouski, who was a robotics expert and a and two of the best programmers in Java I’ve ever met in my life. I kind of corralled them like 15 years ago to build two projects, the OWASP Java Encoder and the OWASP HTML Sanitizer, which we’ll talk about in a bit. There’s another project called the OWASP JSON Sanitizer, which is being used as a preprocessor before you hit a JSON parser, which can have security vulnerabilities. And all three of these libraries had become defunct, but yet they were still being used in security products and high risk situations around the world. So as I study it and I don’t have time to like properly maintain three libraries, but then AI shows up.

[7:38] And with respect, I use AI at like with spectrum in development, with multiple model reviews. I say with respect, I have a mature workflow in using these tools. I’m not a vibe coder. I’m an AI-native engineer, not because my genius, because of other geniuses who have taught me along the way. So I went back to the OWASP Java Encoder, the OWASP HTML Sanitizer, and the OWASP JSON Sanitizer, and have issued a modernization releases and a lot of security bugs that I found with Daybreak, Blue, and Mythos and pushed new versions of all three of those libraries, which are already in frequent use in the Java ecosystem.

[8:20] Yeah. And that’s the blog post you wrote, so you ask people, please try them out. These are the new versions. Let me know what you think about it. So if you go through these these libraries, what do they actually do like the OWASP Java encoder? What problem does it solve?

[8:36] This is meant for user interface technology to stop cross-site scripting. This is especially important when you’re doing more of the server-side user interface construction. These days, the client we’re using like React and Angular and Svelte and Vue on the client, which does a lot of that defense within the client in the browser. But especially for and there’s still a lot of struts out there for that matter. There’s a lot of like what I call legacy Java frameworks or just folks who are doing server-side UI development where they need to build the user interface for the web securely on the server and then push it down to the browser. This is what the OWASP Java encoder is for. It does contextual output encoding.

[9:27] So if you’re putting data in a JavaScript string like as a variable in an HTML attribute or other areas of an HTML document that you’re assigning that data dynamically, we have to output encode that data so it’s displayed properly and it doesn’t break the HTML and doesn’t execute markup or JavaScript or similar. It’s treated as display data, not actually modifying the HTML or underlying code structure.

[10:00] Yeah. And it can I guess there’s a lot of side steps you can take there and people trying to break a system like that. And that’s what you will try to fix with this library. And then the HTML sanitizer does a bit of the same in the other direction.

[10:16] Well, it’s it’s there’s a very different library. So imagine that you’re using like Froala or TinyMCE as a web as a web application. Those are components that are WYSIWYG editors. So you want to let your users do pretty stuff, do bold, do bullet points, all all your pretty markup is like a you know as a WYSIWYG editor within the web. When you hit submit on that form field, it’s a big chunk of HTML that WYSIWYG built for you. I use Froala and TinyMCE in my work. How do I verify that big block of untrusted user-driven HTML is safe to render on a page? And in the world of client-side JavaScript, the top library is called DOM Purify. You give it a string, it outputs safe HTML. And the HTML sanitizer is doing this server-side. I recommend both to have a complete security workflow. And this is a hard library to build. I burned billions of tokens updating it and cleaning it up and making sure it was secure. I’m doing literally like like millions of unit tests that are testing if I can bypass certain policies. I was very proud of my work and put it out and I got four violations reported to me right away and

[11:37] I right away fixed them, celebrated. The hackers said you guys are great. I’m going to take I’m going to take this seriously and fix it right now. And by the way, you hackers, is that all you got? I dare you to break it again. And they were like, oh, we like a lot of often when a hacker shows up and shows us a bypass, they’re giving a lot of grief. I know better. I celebrated them. I said thank you. I took their work seriously. I put them in the Hall of Fame in the library. I thanked them repeatedly. And guess what they want to do? They want to give me more free security testing. And the moment I get a report, I verify it, fix it. So that’s why there’s a lot of new versions of the HTML sanitizer that I’ve been putting out as I get these reports to make it better. It’s a hard library. Take a string of arbitrary untrusted HTML and make it safe to render. But it’s a critical use case for cross-site scripting defense in the user interface world.

[12:41] But I can imagine with Java that you can build something very reliable. You say you have thousands or more unit tests. I guess that every vulnerability or any way that you can abuse the sanitization can become a unit test. So you can prove really that is that your library is working.

[13:02] Absolutely. And I have several cross-site scripting fuzzers that are built in. So one unit test will fire off a fuzzer and dump 100,000 tests against a live library. My unit tests take a long time to run by design cuz this is going into security products. People depend on this. So those my initial release was I think it was very my initial modern release was very solid. The bypasses they found were really weird edge cases that helped me learn. And I didn’t just fix their bugs. I went back and fixed the root cause of that kind of problem. So they’d find two bypasses and I would fix like 20 areas in code that are addressing the whole root cause of that class of bypass that I wasn’t aware of or that Mythos or Daybreak Blue wasn’t aware of.

[13:57] But we are now.

[13:58] Yeah. Something you mentioned is you should have a check on both sides. So indeed you have your UI. So you can already try to fix SQL injection in the input box where someone is typing it in. But yeah, it goes over the wire. That means that this gets called on the server side. So you need really the validation and the fix and the checks on both sides.

[14:22] Well, the workflows is slightly different. And first of all, just the problem in general of accepting untrusted markup HTML from a user and rendering it to another user safely, that’s a brutally hard problem. And there are other ways to do it, like converting to markdown and similar. I’m not going to talk about that in depth, but so first of all, the user uses a WYSIWYG editor like TinyMCE, and they submit a chunk of HTML as part of a standard form submission. On the server, we collect that string and run it through the HTML sanitizer before persisting it in your database or similar. Then later, someone’s going to render that page. They’re going to pull that chunk of sanitized HTML and want to render it in a web page. And if it’s like a modern framework like React, I have to use the function in React. Are you ready? Dangerously set inner HTML.

[15:20] Hey Frank, if you’re using in React dangerously set inner HTML to render untrusted data, then Frank, what kind of life are you living? I’ll I’ll I’ll answer for you. You’re living dangerously. So I I’m going to use another library on the client that does the same thing as the Java HTML sanitizer meant for server side. I’m going to use DOMPurify on the client. So the attacker is going to need to bypass both of those sanitizers in order to get XSS on that web page. That’s why I recommend both. Again, once when the server receives the input and a second time, anytime the client is trying to render that sanitized HTML, we’ll sanitize it again on the client.

[16:06] Mhm. Yeah. And eventually also solving man in the middle attack, that’s yeah, someone can be between you. That’s the problem we had with the Eumudra certificates that yeah, we were not sure where the data was coming from.

[16:21] Did you see the value of their private key, by the way?

[16:25] Yeah, it was only the first four or eight bits that they were using of a long key, something like that?

[16:30] It was the literally their private key for a certificate authority was the number four. And so now we have like we have like man in the middle ability that’s going to persist for months if not years for people don’t update their framework. That’s horrific. And by the way, these are great tools, but if there’s man in the middle against https, you’re done. None of this is going to save you. I’ll just hijack the JSON web token and similar if you’re not binding that token to the client, which is pretty new tech anyway. So this is yeah, that mudra issue, that’s the death to software. There’s no there’s no good compensating control to stop that and how much damage can be done with that.

[17:17] That’s also what you ask people to do in your blog post is to update the dependencies, but yeah, nowadays we need to be able to update everything that we push into production. It’s it’s the runtime, it’s it’s our own code, it’s dependencies. How much of a challenge is this now?

[17:37] I do not like third-party libraries anymore at all. And the thing is to build your own Java encoder, that takes mammoth amount of effort to get right in my opinion. To build your own HTML sanitizer, these are security libraries, this is mammoth amount of effort to get these right. But the little libraries that you really don’t need, I think you should get rid of them. I built a little AI open source tool under GitHub J Manico called the Trim Reaper. This is meant to be used in like a frontier model. And it’s number one is any library that’s in your project that you’re not using, get rid of it. The next stage is any library that I can replace with a native function easily, we’ll get rid of those next. Any library that I can replace with like one or two lines of code, get rid of those next.

[18:28] And it gets more and more difficult, but I think that one of the best strategies, especially if you’re mature and ambitious in using AI for development, is to radically minimize your use of third-party libraries and keep it to the essential. The Java ecosystem, because we were some of the earliest ecosystems at having a mature family of third-party libraries, we are the worst when it comes to third-party library gone wild. Any use, oh, I could write one line of code or I could bring in a library with 10 dependencies, people tend to do that bring the dependencies in instead. But I think we need to rethink this very much and minimize third-party libraries, use native Java functions when you can, get rid of the libraries when you can, or just full on write the code yourself if it’s a small utility library.

[19:23] Because, Frank, when you have a third-party library, you’re not really reviewing that code. You’re looking up a CVE. And I would much rather now that I have AI, I got mature AI code review processes, I’d rather write the code myself so I can analyze it for security and functionality. So I think the era of using too many third-party libraries should come to an end if you want to minimize your update cost and have have better visibility into that code you’re pushing to production.

[19:58] Yeah. And if you have dependencies, keep them up to date, but like your encoder, there was a change in 160. it had some improvements, but no fixes, no vulnerability fixes. Should I then update my library always follow to the latest?

[20:16] You know, this is a difficult one. I tend to say yes only because And by the way, version 1.6, I was encoding too much. And someone came in and said, please, can you please? One of the reasons we like your library is because your encoding is the minimal necessary to get security right, and that’s difficult to figure out. So I did my research, did my review, and they were right. Like we could pull back some characters. So the 1.6 release was a reduction of encoding, not your typical increase. The reason I prefer people to upgrade to it is so you have less upgrade debt. Because in my opinion, the longer you wait to update a non-security update, the more difficult it’s going to be when you’re forced to update it down the road. This is like third-party dependency debt. Oh, that library It’s a 1.62 is not a security I’ll skip it.

[21:16] 1.68 is not security I’ll skip it. 1.7 is not security I’ll skip it. Then eventually 1.82 is a major security bug. You have an updated in many versions. The more versions away from the main release the more versions away you are from the main release, typically the more difficult that upgrade’s going to be. So it’s up to the It’s like this, Frank. Hey, Frank, how do you like your pain? Do you like your pain little by little over the course of like several like over a year, or do you like a lot of pain all at once? But seriously, I don’t like to have the pain all at once. I’d rather take the hit little by little so I’m not shocked with the major update that’s going to require a lot of refactoring. That’s just my take on it.

[22:02] I air on the side of updating.

[22:04] It It’s the pain that people have that are still on Java 8. And yeah, which will be really end of life in a few years. And that’s that’s the real pain then if you have to move on.

[22:17] And I feel their pain. So all these libraries, they’re Java 8 and above. I went through the I went through the challenge of making a library that works all way from Java 8 up to Java 27 and that took a little that took a little finesse to get that right.

[22:32] I can’t imagine. in the sanitizer there was an issue with deeply nested CSS exhausting the thread stack. That’s something I picked up from the post. how can something in the CSS cause a security issue?

[22:50] So this is a denial of service vector on the library. They could provide deeply nested CSS expressions like RGB paren RGB paren and do that thousands and thousands of times and I have to represent that as I’m parsing the HTML and that’s causing like exponential growth of CPU use and most places in the library I’m limiting how far your DOM stack is allowed to be. But there’s a couple little edge cases as I was building more support where I did not do that properly and so this was to make sure that the problem was about 60 k kilobytes of malicious CSS could completely shut down a whole thread stack and around 5 k of CSS could exhaust a 250 256 kilobyte stack. That’s bad and more stack overflows and similar. So when I did the release that was September like 24th 25th September 24th I addressed this by rejecting CSS declarations that were nested more than 16 function levels deep. Most markup doesn’t even get close to that. If you’re doing 16 levels deep of CSS declarations you’re doing some crazy stuff.

[24:10] Or doing something wrong.

[24:11] Yeah something’s wrong I dare say. I also fixed a separate quadratic time parsing problem around unmatched brackets. So these are just these are not like your traditional injection CSS problems. They were denial of service problems and I got to be I got to admit this is not me being a brilliant coder. This is using artificial intelligence workflows that I that literally hey, let’s test it. It’s opening up the browser, building a fake web page, testing, testing, testing. Like it is blows my mind what I can do with mature AI to make sure I can fine tune this library for the community.

[24:52] It blows up your mind, but it’s also pretty scary. I learned from Simon Ritter in the previous podcast. So like you have CVEs in Java in the runtime.

[25:03] Oh yeah.

[25:03] And actually you have a few CVEs which are not that high scored, so they’re not a big issue. But AI is really capable of combining these small problems into one major problem by combining security issues. Is that also the thing that you are discovering now that several small problems can become a big one?

[25:27] What I’m learning from my friends is it’s not so much that breaches and problems are getting more frequent. What I’m finding is that attackers are able to go deeper. So the breaches that we’re seeing there’s a lot of data that shows breaches or breaches and real security problems are not increasing, but the depth of these problems, those are increasing. And that’s exactly what you’re talking about where a seasoned attacker can chain multiple small vulnerabilities together to cause a lot of damage. And artificial intelligence accelerates the ability of a mature attacker to do this. So I think the next six months are going to be very telling. If we don’t see a radical increase in real breach damage in the next six months, then I’m wrong. But I think we’re going to see it based on early intel of what’s been happening the last couple of months where just like you’re saying, AI can chain together multiple problems and a chain of attacks to do incredibly destructive operations, absolutely.

[26:35] Yeah. As I explained in the previous podcast, I do the release notes of for Azul. I don’t know of any CVE issue until the day I need to publish it. Not the day, the minute I need to publish it. That’s when I get the list. but in these so I cannot predict anything for the future. I don’t I just don’t know. But like indeed we normally have every three months about seven, eight security issues in Java releases. October was 53, so it’s indeed

[27:02] Exactly.

[27:04] It started growing in July, so I can only hope that we’ll reach some kind of level of knowledge in these AI systems that they are now finding the hard problems and finding them all at once and the next months will be more relaxed, but probably not.

[27:23] You know, I can’t perfectly predict the future, but I think the next six months to 18 months is going to be a wild ride when it comes to security and patching and breaches and my only advice is, you know, don’t fear the Reaper. Learn how to use AI, register for the cyber models, and do and for the first time in a long time frame, we can use these modern tools to do mass remediation in our own code. So when you see like the JDK patching 56 bugs in one month, I recommend you use the same techniques to do the same to your own code bases. And this it’s not just using AI like any tool, it requires sophistication. It requires maturity. And I’m on the Java Champions list with you and I talk a lot smack, right? I’m like I had a post like, hey you Java Luddites who are afraid to use AI and I’m doing a little webinar for the Java Champion community without marketing my BS just to show them what I think is a mature workflow to try to lend support to the community. Because I know if I can affect like a couple hundred champions of Java, they’ll ripple that out to their communities.

[28:40] But I think no question about it, Frank, this is a whole new era. This is not the same by a wide margin. This is one of the greatest technology leaps in mankind’s history. No joke. And security if security matters, I would get my pause on OpenAI professional account, at least for one developer. I’d get my hands on an Anthropic professional account, sign up for the cyber verification program on both of those accounts, and use them together to do mass remediation of critical vulnerabilities in your code. And I say this to some people, they get upset, they get offended. I don’t want to touch AI. I pride myself on coding. But you know what, Frank? The era of coding is quickly coming to an end. And that’s hurtful for a lot of people to hear. But that’s the reality. The era of coding, as we’ve known it, is rapidly coming to an end. So I would be I would learn to use AI as part of mature software flows. And especially, even if you don’t want to do that, I would use AI today to do mass security remediation of your codebase as best you can. I think that’s critical today.

[29:51] Yeah. One thing I learned from I think a blog post was that a tool like Clot can perfectly use JFR. So create a recording file of your application and investigate the logs that are created. I find my first Java Evix issue in the code of Java Evix. I don’t know anything about what’s happening inside the Java Evix code. It’s it’s it’s C code. I don’t know that. I’ve never touched it. But still, I was able Now Clot was able to debug an application and I wrote and found an issue in the rendering on Mac OS systems by using the tools that we as developers use. So we use Visual VM to check our GFR recording files. And actually there was a threat issue there which seems to be related to how macOS visualizes some stuff.

[30:46] I was never be able to find this myself. I’m not I’m not experienced enough deep technical in some of these things, but these tools are and if you know what to ask, how to start I modified my application so it could be started from a tool and open a specific file and do this and do this and do this so that it could record these these these log files and find specific issues. So indeed coding as it has been existing for many years is gone.

[31:23] Yes.

[31:23] But if you are a good coder and you know how to use your tools and you know how to instruct your AI tools and work together with them I think you can be one hell of a developer still.

[31:37] Absolutely. I’m I’m still even though I’m not doing nearly as much coding, I’m still a developer. I’m building more software than I have ever before and I’m not just vibing it. I’m using a technique called spec driven development.

[31:48] Mhm.

[31:49] I set up my requirements, my architecture file, my security rules, my design templates before and then I and then I threat model carefully those specifications before I even begin to write one line of code. So using AI maturely is not just like throwing up a tool and asking questions. There’s processes around it that’s I call it AI native software development. It still requires a lot of expertise and those of us who are who have been writing code since the 90s and have a lot of experience writing software you take an a very experienced architect and developer and you show them mature processes and give them powerful AI models they can do more than ever before and that combination goes very well. There’s a of citizen coders entering the world. That’s great.

[32:40] But those senior developers with AI, that’s magic. That’s absolutely magic.

[32:45] Yeah. One thing I finds difficult with AI tools is upgrading. So we talk about your libraries, for instance. If I have a project where I use use one of your libraries, what I found out a few months ago, Claude is not aware of what is the latest version. And it tries to upgrade it, but actually goes back a version or it breaks some of the implementation because the new version has a new new API. What is the best way to upgrade the project? Is it just Maven commands? What should I use?

[33:20] Well, what I do is go look at the GitHub repo jmanico, j m a n i c o / trim - reaper. One of the artifacts there is a set of rules around third-party libraries that you can put into Agents MD. So when you open up Claude code or you open up Codex in a repository and I don’t even use Visual I’m I’m back to using like a terminal. I love it. Like I don’t I don’t I never was a fan of IDEs. I’m one of those guys. I like VI and Emacs. And now I’m back. I love it. Yeah. Come on. IDEs IDEs are like phoning it in. Let’s do some real work. Get a terminal. I’m just kidding. Just kidding. But I put my rules inside of Agents MD that says go look, go research and look up every third-party library to make sure it’s up to date, minimize their use, minimize transitive dependencies. So I put in my Agents MD or my Claude MD specific rules to encourage it to do better dependency management. I’ve had a lot better luck with that.

[34:28] But you yes, you can absolutely use Maven. You go Maven dependency tree - d includes equals for the H mode sanitizer, you would say MVM dependency colon tree - d includes equals com.google.code.os-java-html-sanitizer. By the way, Google code, that’s the original builders put it there. I’m I’m going to Sonotype and registering owasp.org that HTML sanitizer and I want to move it to a different namespace, but that has a big impact on everyone’s codebase, but I’m going to wait for it to stabilize, which it almost I’m there now, and then move the namespace to get out of Google code cuz that’s dead. For Gradle, you would use like dot slash Gradle EW dependency insight - - dependency org.owasp.encoder - configuration runtime class path. So those are like and these commands will identify which version is actually selected, how it entered your dependency graph.

[35:34] And with Gradle, you can expect the relevant configurations like runtime class path and test runtime class path. And with Maven, you can look at the runtime dependency tree and any applicable dependency management. And also look at your packaged application, especially if you’re building a fat jar, like a or a WAR or a container image. The final artifact is what matters. I also recommend you run all these checks in CI and use dependency scanning to identify outdated runnable libraries. I’m changing what security rule tools I use, but using like a Dependabot or Renovate Bot to double check my libraries that they’re not known vulnerabilities. I think that tool is absolutely critical.

[36:24] Okay. I will, by the way, add the links that you mentioned, like your repository, on the show notes of this podcast. So on YouTube, you find them in the description in your podcast app, and of course also on Foojay, because yeah, there’s a lot that you share that people should find easily. now in the past weeks, we had two PHP vulnerabilities. Also some I think it was also memory overload thing. In very old versions is there something we as Java developers can learn from PHP the that we should be more careful and use longer keys and stuff like that?

[37:05] I think the lesson’s simple, right? Unsupported, out of date software is a major security liability. And Java developers, they face the same problem with outdated JDKs, outdated third-party libraries and frameworks. And when a serious vulnerability appears you need to know what you’re running. Is it supported and how quickly you can upgrade? And if you’re using end-of-life software or abandoned libraries that is horrifically bad for you because you’re in a situation where you have to upgrade fast but there is no upgrade, right? And one important like I think really critical nuance here is that older PHP releases, they get a lot of vendor backports even without upstream support. But you got to verify that protection instead of assuming that it even even exists. And some of the older JDKs, they’re not getting and older frameworks and older third-party libraries, there is no vendor fixing, right?

[38:11] Like I decided to update these libraries because I had my name on it, right? If I didn’t have my name on it, I wouldn’t I probably wouldn’t have touched them. Like I ’m helpful but not that helpful. And so there is a good chance that these three libraries which are in like 30,000 pieces of software around the world that nobody was going to update it. So you got to do this analysis carefully and use the right stack and keep it up to date with to avoid this major security liability.

[38:42] Yeah. So good question is if my Java team doesn’t have some kind of security process or an upgrade process, what’s the first thing they should do when this podcast is finished?

[38:55] First of all, if you’re building Java software that’s handling sensitive data or that’s handling like regulated data or doing financial data and security matters and you don’t have a security program, you’re negligent. Like what have you Where have you been the last 15 years? You’re building Java software that’s risking people’s privacy, financial well-being and safety and you’re just you’re just like coding without a security program. Let’s start with that. What the hell is wrong with you? You’re negligent. Stop it. So let’s I don’t want to be nice here because it not having a security program as a Java team in on November 9th, 2026, what the hell is wrong with you? And you can blame me. Get mad at me. And then when you’re done getting mad at me for being a smack-talking big-mouth Sicilian-American, which I am I’m not just Sicilian, I’m American. And you can get mad at me. Go ahead. When you’re done being mad at me, start doing security assessment. Run Like if you are in GitHub, go run CodeQL and run Dependabot and go fix and go fix that backlog. And it’s going to be painful because you’ve not been doing security

[40:07] And now you’re running security tools and finding all these problems. That’s painful. Fix your security bugs. The other thing you want to do is probably go back and do architectural review for like just the overall architecture of your software to avoid things like business logic problems, to avoid things like client-side access control. And I put out another project, open source MIT license that went viral called It’s also under JManico called the Grim Prompter so you can threat model your entire architecture using AI with the threat modeling framework. And so I would start with that. Like review your architecture, run some basic tools to fix your security bugs, then get your hands on one of the frontier models with the cyber verification program and do even more in-depth research. And I would go back to your C-level staff or go to your board and confess your sins that you have massive security problems and you now believe in the age of AI that you got to fix all this stuff.

[41:15] That’s going to be let’s be clear, blood, sweat, and tears. First you do the analysis, you have major security problems, there’s the tears. And there’s blood on the ground because you now have mammothly insecure software that people are depending on you to get right. And then there’s the sweat. You got to fix these bugs. And if you’ve not been doing security for years, going back and fixing those security problems, Frank, there’s no way around it. It’s painful. One way to make it a little less painful is Entropic, if you’re a Claude Code user, they have a plugin for free not for free, you’re paying for tokens, but they have a plugin called the Code Modernizer. So if you have like a really old Java stack, you can run the Code Modernizer plugin across that application and update to modern stack in waves. This used to be like a multi-year project.

[42:14] Now I can do it in a matter of a couple days to modernize my stack up. But this is difficult, right? I do some static analysis, I do some third-party library scanning. I would do some threat modeling on my architecture and then use the cyber verification models to do even deeper security analysis and let your board know and let your C-level staff know it’s painful when you haven’t been doing security to remediate older code bases.

[42:43] If I need to convince my boss, C-level, that there is a problem, is there some tool that I can run easily like code analysis tool and get some kind of readable report. There’s so many issues in your code and you definitely need to fix these. What would be the easiest way there?

[43:03] If if you’re in GitHub, I like the tools like CodeQL and I like the tool on Dependabot. I like the vendor Veracode as a code scanning tool. I like the vendor Semgrep as a code scanning tool. There’s it’s the I would I it’s the class of tool. One is called a static analysis tool, which is like a specialized compiler with the rule system that will find security bugs in your code.

[43:28] Mhm.

[43:29] Is called a software composition analysis tool, the big one being Dependabot and Renovate Bot. They’re going to find third-party libraries in your codebase that have known security vulnerabilities. That’s a great place to start.

[43:44] Okay. And then you have something that you can show to your boss that you need time to fix it now because yeah, the problem will only get worse. So you have an open source project where you try to help people fix stuff. Now imagine I find a problem in your repository, in your project, in your library. What do I do? Just go to GitHub and create a ticket? Is that the best way to help these libraries?

[44:08] Just open up an issue and I’m I’m watching and I’ll fix it.

[44:13] Mhm. What I’ve seen I have some open source projects, none of them security related. I’m not that smart. I’m not smart enough to do that kind of stuff, but like like rendering Java fix animation stuff like that. What I see the last months is that tickets are getting better because people are using AI to find a problem. They are trying to find a solution and then when they create a ticket, it’s with a clear explanation and is AI also helping us there to improve open source projects?

[44:49] Absolutely. I manage like like six different open I’m an open source big So I work on a lot of open source projects. And so I’ve seen a combination of two things. I’ve seen some submissions that are incredibly detailed and incredibly sophisticated. And I’m proud of them for doing that. I also see a bunch of AI slop garbage where there’s called their slop canning me with stuff they know nothing about. They didn’t review it. And even I made some of these mistakes in the early stage of my AI use. So I try to be forgiving of them but explain to them, hey look, use this maturely. And what I’m doing now is I’m putting like in my open source projects, I’m putting a file called agents MD in my project. So if they clone my repo and open up an AI tool in my repo, I inform the AI tool how to do a proper submission to minimize what I call their slop cannons, AI garbage submissions. And after a developer gives me a couple of those, I block them out of the repo. Not to be a jerk but because they’re causing we’re volunteers and they’re causing us harm.

[45:58] So I see both. Both a great deal more sophistication and some real like sloppy garbage from AI at the same time. Both are happening.

[46:08] I’m nearly at the end of my list of questions. So I invite everyone to check your OASP libraries and on all the tools that you’re creating there and then the security stuff and guidelines. If there’s one thing that the people should remember from this podcast or from your work or from your libraries or your blog posts, what should it be?

[46:27] Building software with security is our responsibility as Java developers. It’s not anyone else’s responsibility. It’s ours. And so learning how to do some good security architecture, learning how to use tools to review your code, and studying what security really means in software, that’s not the security team’s job. It’s our job. And so I feel like we should endeavor to learn these skills because it’s only getting worse in the upcoming AI era. And why do we do this? We do this for the people that trust us, for their privacy, for their safety, to protect their money, to protect their well-being. There’s a there’s a positive mission here and it requires us as engineers to step up our game and like I asked a big team of developers I was teaching and at the end of the class I’m like, who in this room takes responsibility for security of their software? And every single person in the room raised their hand and that’s the right answer. It’s my duty, it’s your duty, all of us as Java developers, it’s our duty to protect our users and everyone else by writing secure software.

[47:37] Okay. And maybe while you’re waiting as a developer for your AI session to finish, maybe start the second one and ask a security question. Please check my software. What did I do wrong?

[47:48] Absolutely. Absolutely.

[47:51] Okay. Thanks a lot. So as mentioned in the show notes, all the links to your projects and the libraries. That’s it for this episode of the Foojay podcast. Thank you Jim for sharing your knowledge and for keeping the Java ecosystem safer with the OWASP projects. And thank you listeners for staying until the end. Go and check which versions of the OWASP libraries your application is using or if they’re not using it yet, please do so wherever you touch HTML and other strings that should be sanitized. If you like this episode, please subscribe on YouTube or in your favorite podcast app so you don’t miss the next episode. And if you have something to share with the Java community, become a Foojay author and join us on Slack. See you in the next episode.

[48:36] Give me a Foojay, give me a Jay, give me the friends of OpenJDK.

Share this page

Found a mistake, or something to add? Edit this page on GitHub

Written by

Frank Delporte

Frank Delporte is a Java Champion, Java Developer, Senior Technical Writer at Azul, Host of the Foojay Podcast, Blogger, Author of "Java Programming for Raspberry Pi - A Hands-On Guide to Electronics and IoT Projects", and Open-Source Contributor for Pi4J, …

Written by

Jim Manico

Jim Manico is the founder of Manicode Security, where he trains developers on secure coding and security engineering. He is a Java Champion and an OWASP project leader.

Related posts

Join the discussion