Skip to main content
    Open Source Supply Chain

    ua-parser-js npm Supply Chain Attack (2021)

    Breach Year

    2021

    Breach Type

    Open Source Supply Chain

    TPRM Lesson

    An npm account takeover is a supply chain incident.

    What was the ua-parser-js npm Supply Chain Attack breach?

    The 2021 ua-parser-js attack pushed malicious versions of a package with millions of weekly downloads to npm after the maintainer's account was hijacked.

    ua-parser-js is the case that showed npm package carry breach blast radius far beyond the vendor itself.

    Downstream customers inherited the ua-parser-js incident whether or not they knew ua-parser-js was in their stack.

    The lesson was not that the vendor failed. The lesson was that trust was never verified.

    What Was It?

    ua-parser-js is a widely used npm package for parsing browser user agent strings, downloaded millions of times weekly.

    What Happened?

    Discovery. The incident surfaced in 2021 after unusual activity was identified in the vendor's environment.

    Investigation. External forensics confirmed unauthorised access affecting user agent library.

    Notification. Downstream customers were notified and required to review their own exposure.

    How Did It Happen Technically?

    • Attackers gained access to the vendor environment holding user agent library.
    • Credential, token or software supply chain compromise was central to the intrusion path.
    • Downstream customers had limited visibility into vendor internal controls.
    • Detection was delayed relative to the exposure window.

    Why This Was a TPRM Failure

    • Vendor was under-classified. Data classification did not reflect the volume or sensitivity of user agent library.
    • Concentration risk was invisible. One vendor served many customers in the same sector.
    • Contractual controls were weak. Notification, forensic access and evidence rights were vendor-favourable.
    • Downstream visibility was absent. Customers could not see the vendor environment where their data lived.

    Business Impact

    • Downstream customers issued notifications to their end users.
    • Regulators reviewed the incident under relevant data protection and sector rules.
    • Contract renegotiations followed for affected vendor relationships.

    Consequences

    The ua-parser-js incident became a reference point in TPRM programmes for npm package, driving stronger classification, contractual and monitoring controls across the sector.

    What Most People Miss About This Breach

    The customers who used ua-parser-js did not have a technical failure. They had a trust failure. They trusted the vendor to hold user agent library without ever verifying how.

    Practical TPRM Lessons

    1. Classify npm package as tier-1 by default when they hold user agent library.
    2. Demand contractual notification within hours, not days.
    3. Require independent forensic reports for material incidents.
    4. Rotate credentials, tokens and keys after any vendor breach.
    5. Segment vendor tenants and least-privilege every integration.
    6. Map concentration risk across the sector.
    7. Rehearse downstream customer notification with legal and comms.
    8. Report vendor incident lessons to the board with clear owners.

    Technical Protection Checklist

    A. Identity and Access. Enforce SSO and MFA on every vendor console.

    B. SaaS and API Integrations. Restrict tokens and OAuth scopes to least privilege.

    C. Software Supply Chain. Verify build integrity, signatures and dependency provenance.

    D. File Transfer and Data Exchange. Encrypt in transit, log every transfer, expire endpoints.

    E. Data Protection. Encrypt at rest with tenant-scoped keys and minimise retained data.

    F. Vendor Incident Response. Contractual notification SLAs and joint runbooks.

    G. Fourth-Party Risk. Inventory sub-processors and their cyber posture.

    H. Board and Executive Reporting. Report material vendor incidents and remediation.

    Final TPRM Takeaway

    "Your vendor holds user agent library. Verify how, or inherit the incident."

    Frequently Asked Questions

    What was the ua-parser-js incident?

    A 2021 vendor incident affecting user agent library and downstream customers.

    Why was it a third-party breach?

    Downstream customers relied on ua-parser-js to hold user agent library and inherited the incident.

    What data was exposed?

    Data related to user agent library; specifics varied by downstream customer.

    How many organisations were affected?

    Multiple downstream organisations across the sector.

    What controls could have helped?

    Stronger classification, contractual notification and vendor monitoring.

    What did regulators do?

    Reviewed the incident under applicable data protection and sector rules.

    What is the biggest TPRM lesson?

    Any vendor holding user agent library is tier-1 whether procurement says so or not.

    Did the vendor survive?

    The vendor continued operating with remediation and customer-trust investment.

    TPRM Blog

    Related TPRM analysis from the blog

    Continue learning with the latest breach alerts, regulatory updates, and analyst playbooks from blog.learntprm.com.

    Visit blog.learntprm.com
    Safe Security - founding sponsor of LearnTPRM.comFounding Sponsor
    For CISOs, TPRM leads and vendor risk program owners

    Autonomous TPRM. 90% less manual effort.

    Almost every case here was findable before it happened

    Read enough third-party breaches and the pattern is brutal: an undisclosed fourth party, an expired certification, an exposure that sat on the internet for weeks. Nobody was lazy - the signals simply arrive faster than a human review cycle. The SAFE TPRM AI Co-Worker watches for them continuously.

    This is for you if you own a third-party risk program - roughly 100+ vendors, quarterly reassessments, DORA / NIS2 / OCC pressure and no new headcount coming. The link opens Safe Security's platform page, not a gated form.

    Five correlated data dimensions per vendor, refreshed continuously across the whole portfolio.

    Zero-touch due diligenceContinuous monitoring across 5 dimensionsAI-powered risk scoring workflows
    • The Fourth-Party Discovery agent finds the undisclosed downstream provider before it becomes your incident.
    • The Outside-In agent detects new vulnerabilities, misconfigurations and breaches as they surface.
    • The Threat Intel agent tracks leaked credentials, filings and legal events per vendor.
    Evaluate SAFE for my organization

    For security and risk leaders assessing a TPRM platform. Opens safe.security in a new tab.

    25+

    AI agents

    90%

    Less manual effort

    None

    Additional headcount

    200+

    Organizations globally

    End to end

    Intake to offboarding

    Ready to Prove You're a TPRM Warrior?

    Most people talk about risk management. Few can prove their expertise under pressure.

    Start Your Free Certification