<?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: DInesh K</title>
    <description>The latest articles on DEV Community by DInesh K (@dinesh431786).</description>
    <link>https://dev.to/dinesh431786</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%2F3282027%2F57cec0cc-2182-408c-94be-f7facb60a7e6.png</url>
      <title>DEV Community: DInesh K</title>
      <link>https://dev.to/dinesh431786</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dinesh431786"/>
    <language>en</language>
    <item>
      <title>I Built a Python Security Scanner That Doesn't Use AI—It Follows the Data Instead</title>
      <dc:creator>DInesh K</dc:creator>
      <pubDate>Sat, 21 Jun 2025 09:53:45 +0000</pubDate>
      <link>https://dev.to/dinesh431786/q-trace-pro-quantum-inspired-threat-detection-for-python-code-16mf</link>
      <guid>https://dev.to/dinesh431786/q-trace-pro-quantum-inspired-threat-detection-for-python-code-16mf</guid>
      <description>&lt;p&gt;Everyone is racing to add AI into security tooling.&lt;/p&gt;

&lt;p&gt;I decided to build something in the opposite direction.&lt;/p&gt;

&lt;p&gt;Over the last few months I've been building Sinkline, a deterministic security scanner for Python that never sends code to the cloud and never relies on an LLM to decide whether something is malicious.&lt;/p&gt;

&lt;p&gt;Instead of asking "Does this code look dangerous?" it asks:&lt;/p&gt;

&lt;p&gt;Where did this data come from, and where does it end up?&lt;/p&gt;

&lt;p&gt;That single design decision changed everything.&lt;/p&gt;

&lt;p&gt;The Problem&lt;/p&gt;

&lt;p&gt;Most static analyzers are excellent at finding classic vulnerabilities:&lt;/p&gt;

&lt;p&gt;SQL Injection&lt;br&gt;
Command Injection&lt;br&gt;
Weak hashing&lt;br&gt;
Unsafe deserialization&lt;br&gt;
Hardcoded credentials&lt;/p&gt;

&lt;p&gt;Those are solved problems.&lt;/p&gt;

&lt;p&gt;The attacks becoming common today are different.&lt;/p&gt;

&lt;p&gt;Think about things like:&lt;/p&gt;

&lt;p&gt;credentials quietly exfiltrated through multiple modules&lt;br&gt;
install-time payloads&lt;br&gt;
logic bombs&lt;br&gt;
environment-triggered malware&lt;br&gt;
typosquatted dependencies&lt;br&gt;
base64/XOR encoded payloads&lt;/p&gt;

&lt;p&gt;These aren't obvious from a single file.&lt;/p&gt;

&lt;p&gt;Source → Sink&lt;/p&gt;

&lt;p&gt;The name Sinkline comes from taint analysis.&lt;/p&gt;

&lt;p&gt;A source is where sensitive information originates:&lt;/p&gt;

&lt;p&gt;environment variables&lt;br&gt;
secrets&lt;br&gt;
API keys&lt;br&gt;
user input&lt;/p&gt;

&lt;p&gt;A sink is where dangerous actions happen:&lt;/p&gt;

&lt;p&gt;requests.post()&lt;br&gt;
os.system()&lt;br&gt;
subprocess&lt;br&gt;
exec()&lt;/p&gt;

&lt;p&gt;The interesting question isn't whether either exists.&lt;/p&gt;

&lt;p&gt;It's whether there is a path connecting them.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;os.environ["AWS_SECRET"]&lt;br&gt;
        │&lt;br&gt;
        ▼&lt;br&gt;
config.py&lt;br&gt;
        │&lt;br&gt;
        ▼&lt;br&gt;
helper.py&lt;br&gt;
        │&lt;br&gt;
        ▼&lt;br&gt;
telemetry.py&lt;br&gt;
        │&lt;br&gt;
        ▼&lt;br&gt;
requests.post(...)&lt;/p&gt;

&lt;p&gt;Every file can look perfectly harmless.&lt;/p&gt;

&lt;p&gt;The dangerous behavior only appears when you connect them together.&lt;/p&gt;

&lt;p&gt;Why No AI?&lt;/p&gt;

&lt;p&gt;Recent research has shown that LLM-powered scanners can themselves become attack targets.&lt;/p&gt;

&lt;p&gt;If malicious packages know they're being inspected by an AI, they can attempt prompt injection inside source code or comments.&lt;/p&gt;

&lt;p&gt;Instead of trying to outsmart that problem, I removed it.&lt;/p&gt;

&lt;p&gt;The detection engine is:&lt;/p&gt;

&lt;p&gt;deterministic&lt;br&gt;
offline&lt;br&gt;
explainable&lt;br&gt;
reproducible&lt;/p&gt;

&lt;p&gt;Same input.&lt;/p&gt;

&lt;p&gt;Same output.&lt;/p&gt;

&lt;p&gt;Every time.&lt;/p&gt;

&lt;p&gt;What It Detects&lt;/p&gt;

&lt;p&gt;Besides common OWASP issues, Sinkline looks for:&lt;/p&gt;

&lt;p&gt;cross-file credential exfiltration&lt;br&gt;
probabilistic logic bombs&lt;br&gt;
encoded payloads&lt;br&gt;
install/import-time execution&lt;br&gt;
typosquatted dependencies&lt;br&gt;
import-correlated secrets&lt;br&gt;
environment-gated malware&lt;/p&gt;

&lt;p&gt;The goal isn't more alerts.&lt;/p&gt;

&lt;p&gt;The goal is higher-value alerts.&lt;/p&gt;

&lt;p&gt;A Built-in Demo&lt;/p&gt;

&lt;p&gt;One thing I disliked about security tools is that they often demonstrate themselves on tiny 3-line examples.&lt;/p&gt;

&lt;p&gt;Real attacks aren't like that.&lt;/p&gt;

&lt;p&gt;So the repository includes a realistic multi-file demo project where:&lt;/p&gt;

&lt;p&gt;every individual file looks normal&lt;br&gt;
the malicious behavior only appears after tracing data across modules&lt;/p&gt;

&lt;p&gt;That's a much better test of whether taint analysis actually works.&lt;/p&gt;

&lt;p&gt;Design Decisions&lt;/p&gt;

&lt;p&gt;Some principles that guided the project:&lt;/p&gt;

&lt;p&gt;Local-first&lt;br&gt;
No telemetry&lt;br&gt;
No cloud processing&lt;br&gt;
No LLM dependency&lt;br&gt;
Deterministic output&lt;br&gt;
SARIF support&lt;br&gt;
CI-friendly exit codes&lt;br&gt;
Explainable findings&lt;/p&gt;

&lt;p&gt;If a finding cannot be explained, it's difficult to trust.&lt;/p&gt;

&lt;p&gt;Things It Doesn't Try To Do&lt;/p&gt;

&lt;p&gt;Sinkline isn't trying to replace:&lt;/p&gt;

&lt;p&gt;CodeQL&lt;br&gt;
Bandit&lt;br&gt;
Semgrep&lt;/p&gt;

&lt;p&gt;Those tools are excellent.&lt;/p&gt;

&lt;p&gt;Instead, it focuses on areas where deterministic cross-file analysis can provide additional signal, particularly for stealthier supply-chain style attacks.&lt;/p&gt;

&lt;p&gt;Lessons Learned&lt;/p&gt;

&lt;p&gt;Building a security scanner taught me that detection is only half the problem.&lt;/p&gt;

&lt;p&gt;The harder challenge is reducing noise.&lt;/p&gt;

&lt;p&gt;Developers stop trusting tools that constantly cry wolf.&lt;/p&gt;

&lt;p&gt;Finding the right balance between recall and false positives turned out to be far more difficult than implementing another detection rule.&lt;/p&gt;

&lt;p&gt;Open Source&lt;/p&gt;

&lt;p&gt;The project is open source and still evolving.&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/Dinesh431786/sinkline" rel="noopener noreferrer"&gt;https://github.com/Dinesh431786/sinkline&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm particularly interested in feedback on:&lt;/p&gt;

&lt;p&gt;taint propagation&lt;br&gt;
detection strategies&lt;br&gt;
benchmark methodology&lt;br&gt;
false positive reduction&lt;br&gt;
performance optimizations&lt;/p&gt;

&lt;p&gt;If you've built static analysis tools before, I'd love to hear your thoughts.&lt;/p&gt;

&lt;p&gt;Security is one of the few areas where deterministic engineering still has enormous value, and I think there's plenty of room for approaches that don't depend on AI.&lt;br&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%2F0725e2nyv6n8lqj5tskb.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%2F0725e2nyv6n8lqj5tskb.png" alt=" " width="800" height="2040"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>python</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
