<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Prema Jyothi</title>
    <description>The latest articles on DEV Community by Prema Jyothi (@prema_jyothi).</description>
    <link>https://dev.to/prema_jyothi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4164157%2F1443f88f-c967-4675-8330-5b642f378c26.png</url>
      <title>DEV Community: Prema Jyothi</title>
      <link>https://dev.to/prema_jyothi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prema_jyothi"/>
    <language>en</language>
    <item>
      <title>I Planted 3 Sneaky Security Flaws in a Web App. Could AI Catch Them?</title>
      <dc:creator>Prema Jyothi</dc:creator>
      <pubDate>Tue, 06 Oct 2026 05:01:30 +0000</pubDate>
      <link>https://dev.to/prema_jyothi/i-planted-3-sneaky-security-flaws-in-a-web-app-could-ai-catch-them-20b6</link>
      <guid>https://dev.to/prema_jyothi/i-planted-3-sneaky-security-flaws-in-a-web-app-could-ai-catch-them-20b6</guid>
      <description>&lt;p&gt;Every developer on my team has been talking about using AI for code reviews.&lt;/p&gt;

&lt;p&gt;As an intern at &lt;strong&gt;RakFort&lt;/strong&gt; in Dublin, I've been spending time exploring and testing security tooling. That got me wondering:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can an AI security reviewer actually understand why code is dangerous, or does it just look for suspicious keywords?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So I decided to test it myself.&lt;/p&gt;

&lt;p&gt;I built a small Python application and deliberately planted &lt;strong&gt;three security vulnerabilities&lt;/strong&gt; inside it.&lt;/p&gt;

&lt;p&gt;One hardcoded credential.&lt;br&gt;
One SQL injection.&lt;br&gt;
One command injection.&lt;/p&gt;

&lt;p&gt;I already knew where all three were.&lt;/p&gt;

&lt;p&gt;The real question was:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Could the AI find them too?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That led me to &lt;a href="https://github.com/secfoo-com/secfoo" rel="noopener noreferrer"&gt;SecFoo&lt;/a&gt;, an open-source MIT-licensed CLI tool designed to run structured security reviews using AI coding agents.&lt;/p&gt;

&lt;p&gt;Instead of giving it a clean project, I created my own little security challenge.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Experiment
&lt;/h2&gt;

&lt;p&gt;The goal was simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Give an AI security reviewer a deliberately vulnerable application and see whether it can identify the problems, explain the risks, and provide useful remediation guidance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I created a small Python web application and intentionally introduced three vulnerable patterns.&lt;/p&gt;

&lt;p&gt;I wasn't trying to build a production application. The purpose was to create a controlled experiment where I already knew the expected findings.&lt;/p&gt;
&lt;h3&gt;
  
  
  Trap #1 — Hardcoded Credential
&lt;/h3&gt;

&lt;p&gt;First, I placed a fake credential directly in the source code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;AWS_SECRET_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;FAKE_SECRET_FOR_TESTING&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a real application, credentials should not be committed directly into source code.&lt;/p&gt;

&lt;p&gt;For this experiment, I used a fake value intentionally so that no real secret was exposed.&lt;/p&gt;

&lt;p&gt;The question was whether the security review would recognize that the credential was embedded in application code and explain why that was risky.&lt;/p&gt;




&lt;h3&gt;
  
  
  Trap #2 — SQL Injection
&lt;/h3&gt;

&lt;p&gt;Next, I created a database query using user-controlled input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SELECT * FROM users WHERE id = &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The problem here isn't simply that the code contains an SQL query.&lt;/p&gt;

&lt;p&gt;The important part is &lt;strong&gt;how the input reaches that query&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If &lt;code&gt;user_id&lt;/code&gt; comes from an untrusted user, constructing the query this way can allow the input to alter the SQL statement.&lt;/p&gt;

&lt;p&gt;A useful security review should therefore understand the relationship between the input and the database operation rather than simply searching for the word &lt;code&gt;SELECT&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Trap #3 — Command Injection
&lt;/h3&gt;

&lt;p&gt;Finally, I introduced a command execution pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ping -c 1 &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again, the interesting part is the data flow.&lt;/p&gt;

&lt;p&gt;If &lt;code&gt;host&lt;/code&gt; can be controlled by an untrusted user, passing it directly into a system command can create a command-injection risk.&lt;/p&gt;

&lt;p&gt;This gave me three different types of problems to test:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sensitive information exposed in source code&lt;/li&gt;
&lt;li&gt;Untrusted input reaching a database query&lt;/li&gt;
&lt;li&gt;Untrusted input reaching a system command&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Running SecFoo
&lt;/h1&gt;

&lt;p&gt;Once the intentionally vulnerable application was ready, I ran SecFoo's SAST skill against the project.&lt;/p&gt;

&lt;p&gt;I configured the API key through an environment variable and then ran:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;secfoo run &lt;span class="nt"&gt;--skill&lt;/span&gt; sast &lt;span class="nt"&gt;--agent&lt;/span&gt; api &lt;span class="nt"&gt;--target&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--project-name&lt;/span&gt; vulnerability-challenge &lt;span class="nt"&gt;--app-id&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the review completed, I opened the SecFoo dashboard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;secfoo serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dashboard allowed me to inspect the findings from the security review.&lt;/p&gt;

&lt;h1&gt;
  
  
  So... Did It Catch Them?
&lt;/h1&gt;

&lt;p&gt;This was the part I was actually interested in.&lt;/p&gt;

&lt;p&gt;I wasn't looking for a fancy report.&lt;/p&gt;

&lt;p&gt;I already knew the vulnerabilities existed.&lt;/p&gt;

&lt;p&gt;I wanted to know whether the AI-assisted review could identify them and provide enough context to understand &lt;strong&gt;why&lt;/strong&gt; they were vulnerabilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  Results
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Vulnerability&lt;/th&gt;
&lt;th&gt;Detected?&lt;/th&gt;
&lt;th&gt;What I was looking for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hardcoded credential&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Recognition that sensitive credentials should not be embedded in source code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQL injection&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Understanding that user-controlled input reaches the SQL query&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command injection&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;Understanding that user-controlled input reaches command execution&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;In my test, all three intentionally planted vulnerabilities were identified.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That was more interesting to me than simply getting three green checkmarks.&lt;/p&gt;

&lt;p&gt;The useful part was the context around the findings: the review could point toward the risky code and explain the security concern rather than simply saying that a particular function or keyword was "bad."&lt;/p&gt;

&lt;h1&gt;
  
  
  What I Found Interesting
&lt;/h1&gt;

&lt;p&gt;One thing this experiment reminded me of is that security problems aren't always about individual lines of code.&lt;/p&gt;

&lt;p&gt;Consider this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SELECT * FROM users WHERE id = &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A pattern-based check can flag this code as suspicious.&lt;/p&gt;

&lt;p&gt;But the more interesting security question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where did &lt;code&gt;user_id&lt;/code&gt; come from?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If it came directly from an HTTP request, the risk is very different from a value that was safely generated internally.&lt;/p&gt;

&lt;p&gt;The same idea applies to command execution.&lt;/p&gt;

&lt;p&gt;The security issue isn't simply:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;system&lt;/span&gt;&lt;span class="p"&gt;(...)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's the combination of:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;untrusted input → application logic → dangerous operation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's where AI-assisted analysis becomes interesting.&lt;/p&gt;




&lt;p&gt;Here are the findings from the run:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyssse9oz80zcf9l1ulw5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyssse9oz80zcf9l1ulw5.png" alt=" " width="800" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Hardcoded credential finding
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxheoiq4kmg6byk218wh8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxheoiq4kmg6byk218wh8.png" alt=" " width="800" height="292"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  SQL injection and Command injection finding
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3vdpm1ohjigco6noi7ok.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3vdpm1ohjigco6noi7ok.png" alt=" " width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Is This Replacing Traditional SAST?
&lt;/h1&gt;

&lt;p&gt;I don't think so.&lt;/p&gt;

&lt;p&gt;Traditional SAST tools are still extremely useful. They are fast, predictable, and excellent at detecting many known vulnerability patterns.&lt;/p&gt;

&lt;p&gt;But some security findings require understanding how different pieces of an application interact.&lt;/p&gt;

&lt;p&gt;That's where I think AI-assisted security reviews have an interesting role.&lt;/p&gt;

&lt;p&gt;Instead of asking only:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Does this line match a known vulnerability pattern?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;we can also ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What is this code doing, where does this data come from, and what could happen if that data is malicious?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's a different way of looking at the problem.&lt;/p&gt;

&lt;p&gt;And importantly, it doesn't mean an AI reviewer will always be correct.&lt;/p&gt;




&lt;h1&gt;
  
  
  What I Learned
&lt;/h1&gt;

&lt;h3&gt;
  
  
  1. Context matters
&lt;/h3&gt;

&lt;p&gt;The interesting part wasn't simply detecting suspicious code.&lt;/p&gt;

&lt;p&gt;The review needed to understand how input was being used and why that usage created a security risk.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Controlled experiments are useful
&lt;/h3&gt;

&lt;p&gt;I already knew exactly where the vulnerabilities were.&lt;/p&gt;

&lt;p&gt;That made it much easier to evaluate the result.&lt;/p&gt;

&lt;p&gt;Instead of saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The tool found some security issues."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I could ask a much more specific question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I planted three known vulnerabilities. How many did it find?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's a much better way to test a security tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. AI security reviews still need human validation
&lt;/h3&gt;

&lt;p&gt;Finding a vulnerability is only the beginning.&lt;/p&gt;

&lt;p&gt;A real security review still needs a developer or security engineer to verify the finding, understand the application context, and decide whether the suggested remediation is appropriate.&lt;/p&gt;

&lt;p&gt;AI can help with the investigation, but I wouldn't treat its output as an automatic security approval.&lt;/p&gt;




&lt;h1&gt;
  
  
  What I Want to Test Next
&lt;/h1&gt;

&lt;p&gt;This experiment was intentionally simple.&lt;/p&gt;

&lt;p&gt;The vulnerabilities were placed in obvious locations so that I could measure the result.&lt;/p&gt;

&lt;p&gt;But real applications aren't always like that.&lt;/p&gt;

&lt;p&gt;What happens when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the input flows through several functions?&lt;/li&gt;
&lt;li&gt;the vulnerable code is spread across multiple files?&lt;/li&gt;
&lt;li&gt;the dangerous behavior is hidden behind an abstraction?&lt;/li&gt;
&lt;li&gt;the vulnerability depends on application architecture?&lt;/li&gt;
&lt;li&gt;two individually harmless components become dangerous when combined?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;That's the experiment I'd like to try next.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Three deliberately vulnerable patterns are one thing.&lt;/p&gt;

&lt;p&gt;Finding a vulnerability that requires understanding an entire application is a much harder challenge.&lt;/p&gt;




&lt;h1&gt;
  
  
  Wanna Try It?
&lt;/h1&gt;

&lt;p&gt;If you're interested in experimenting with AI-assisted security reviews, you can check out SecFoo and run your own tests against a project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/secfoo-com/secfoo" rel="noopener noreferrer"&gt;https://github.com/secfoo-com/secfoo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can start with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;secfoo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then try creating your own small security challenge.&lt;/p&gt;

&lt;p&gt;And here's my question for developers:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you had to plant one vulnerability that an AI security reviewer would struggle to find, what would you choose?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Drop your idea in the comments.&lt;/p&gt;

&lt;p&gt;I'd genuinely like to see what other developers come up with.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>security</category>
    </item>
  </channel>
</rss>
