SShortSingh.
Back to feed

How npm Typosquatting and Dependency Confusion Attacks Silently Compromise Dev Systems

0
·1 views

In February 2021, security researcher Alex Birsan demonstrated how malicious packages could be pushed to the internal build systems of Apple, Microsoft, PayPal, and dozens of other firms by exploiting package manager resolution logic — a technique known as dependency confusion. Separately, typosquatting attacks target developers who mistype package names, with historically documented cases on npm including fake versions of lodash and cross-env that stole credentials and environment variables. Both attack types rely on npm's automatic execution of postinstall scripts, which can exfiltrate data or install backdoors before a developer reviews the code. Because neither method involves a known software flaw, they carry no CVE and are invisible to conventional vulnerability scanners. Defences include scoping internal packages under private namespaces, auditing install scripts from unknown publishers, and using edit-distance algorithms to flag package names suspiciously similar to popular libraries.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Experiment finds AI mostly refuses company queries without register access, not lies

A developer behind the registry-mcp tool ran a controlled experiment on September 10, 2026, testing how accurately the Claude Sonnet 5 model answered company-related questions with and without access to official national business registers. Without tools, the model hedged or declined to answer on 34 of 45 calls, was confidently wrong on just 3, and gave correct but unsourced responses on 8. However, the study flagged two dangerous failure patterns: the model once fabricated detailed regulatory deadlines for a Norwegian company, and on two trials it appended a specific employee figure after disclaiming register access — a format that automated pipelines could easily misread as factual. With register tools attached, the model passed 18 of 27 eligible test cases under a strict three-trial agreement rule, equating to a 67% pass rate, though per-trial accuracy varied by up to 18 percentage points across identical prompts on the same day.

0
ProgrammingDEV Community ·

Cue: Open-Source Windows Coding Agent Lets Users Freeze Scope Before Execution

Cue is a free, open-source (MIT) coding agent for Windows 11, built with Electron and powered by Codex CLI, designed to give developers tighter control over automated coding tasks. The tool introduces a four-step loop — Describe, Review, Approve, and Inspect — where users define a goal, review the planned scope, grant a single approval, and then monitor progress via a ledger. A key feature is the 'execution envelope,' a human-approved boundary that locks the working directory and permitted actions before any file changes occur and cannot expand after approval. Workspace actions run inside AppContainer sandboxed workers, keeping mutations confined strictly to the approved directory. The project aims to address two common failure modes in desktop agents: unrestricted 'YOLO' execution and tedious per-action approval prompts that lead to oversight fatigue.

0
ProgrammingDEV Community ·

Protocol-First Design Enables Consistent AI Agent SDKs Across Multiple Languages

Modern AI agent systems typically run on polyglot stacks combining Python, TypeScript, Rust, and Go, creating risks of duplicated logic and inconsistent governance. A more sustainable approach treats the capability protocol and schema as the primary artifact, with language-specific SDKs built as implementations on top. Each SDK shares the same conformance tests and produces identical runtime behavior, ensuring validation, approvals, and tracing remain consistent regardless of language. This means a capability written in Rust can be called by a Python agent or exposed via a TypeScript service without reinventing core logic. Experts recommend defining the wire-level protocol and tests first, then layering language-specific ergonomics — a slower start that pays dividends as stacks grow more complex.

0
ProgrammingDEV Community ·

Practical Strategies to Keep Microservices Loosely Coupled in Production

Tight coupling between services — where changing one breaks others — slows development velocity and increases incidents, according to a software engineer's hands-on guide. The author recommends that services depend on stable, intentional contracts rather than each other's internal details, using consumer-defined interfaces and versioned network payloads. Event-driven communication is highlighted as a way to reduce runtime dependency, since publishers need not know which services consume their events. Shared databases, config keys, and retry logic are identified as hidden sources of coupling that can turn a microservices architecture into a distributed monolith. The core principle is to ensure each service can be deployed independently, treating loose coupling as an ongoing practice rather than a one-time architectural decision.