Package managers have an integrity problem
A test of popular package managers found that most fail to detect malicious code injected into legitimate packages, leaving them vulnerable to tampering.
Overview
A researcher tested 25 popular package managersA developer tool that downloads, installs, and updates software libraries from a central registry to see if they could detect malicious codeSoftware built to steal data, spy on users, lock files, or take control of a computer injected into legitimate packages by a compromised repositoryA central storage place where a software project's source code, change history, and configuration files are kept. Fewer than half of these tools used lockfiles to check for tampering by default, and only two verified the integrityThe property that data was not changed of every package they downloaded. This gap in security matters because attackers may shift their focus to package repositories if they successfully stop targeting individual developers. The story explains that cryptographic hashesA short, fixed-length fingerprint of data, made by a hash algorithm with no key and signaturesA known byte pattern or hash that antivirus tools match against files, or a cryptographic proof of origin are the standard ways to verify that downloaded code has not been altered. However, many implementations fail to provide full protection due to design choices or the complexity of making these tools easy for developers to use. As a result, ordinary users and organizations remain vulnerable to supply-chain attacksBreaking into a software maker or vendor so their trusted product or update infects their customers where malicious code is delivered through standard software updates.
Terms in this story
- Package managers
- A developer tool that downloads, installs, and updates software libraries from a central registry. Every major programming language has a package manager, and supply chain attackers target them by uploading trojanized libraries that install automatically when developers build an app.
- malicious code
- Software built to steal data, spy on users, lock files, or take control of a computer. News reports use malware as the umbrella term for viruses, ransomware, spyware, and trojans that criminals install on phones, laptops, or servers without permission. Security+ objective 2.4 lists the term
- repository
- A central storage place where a software project's source code, change history, and configuration files are kept. Software teams collaborate by pushing code to a shared repository, and attackers scan public repositories for accidentally committed API keys or try to poison popular projects.
- integrity
- The property that data was not changed. File checksums and digital signatures protect integrity so you know a downloaded software update or bank wire instruction was not altered in transit by an attacker. From the CYBR 101 room CYBR 101: What is a hash?
- hashes
- A short, fixed-length fingerprint of data, made by a hash algorithm with no key. Security reports list file hashes so defenders can check whether a suspicious program on their network matches known malware, and servers store password hashes instead of plain passwords. From the CYBR 101 room CYBR 101: Ciphers and encryption (part 2); Security+ objective 1.4 lists the term
- signatures
- A known byte pattern or hash that antivirus tools match against files, or a cryptographic proof of origin. In security news, a signature means either a pattern that scanners use to recognize known malware or a cryptographic signature that proves a software update was not altered.
- Supply-chain attacks
- Breaking into a software maker or vendor so their trusted product or update infects their customers. Instead of attacking a hundred companies one by one, an intruder compromises a single software library or update server that all of those companies already trust. Security+ objective 2.2 lists the term
- mitigation
- A defensive step or setting change that lowers the risk of a flaw before patching. When a software vendor has not finished a patch yet, its advisory often lists a mitigation such as turning off an optional feature or blocking a specific URL path at the firewall. Security+ objective 2.5 lists the term
- configuration
- A text file that stores settings, network addresses, and options for how a program or server runs. Attackers who gain read access to a server look for its configuration file first because it often contains database passwords, API keys, and internal server paths.
- verification code
- A short one-time sequence of digits sent by text, email, or authenticator app to confirm a login. When a website sends a verification code to your phone during login, scammers may try to trick you into reading that code out loud or typing it into a fake proxy page.
- harness
- A small wrapper program written to feed test inputs into a software library and watch for crashes. Security researchers write a test harness around a file parser or network library so a fuzzing tool can feed it millions of mutated inputs per hour.
This page is a short description made for this site. The article itself, with its author's name and its own link, is on the Trail of Bits website. Cite the article, not this page.
Read the full article on Trail of Bits (opens in a new tab)
Course connections
Each line below connects this story to a Security+ objective (a skill on CompTIA's Security+ exam, a common first cybersecurity certification), a CYBR 101 week, or a cybersecurity job, and quotes the words that made the connection.
- Kind of story: Research and reports
"I tested 25 of the most popular package managers..." Found by reading the article; these exact words are in it - Security+ 1.4 Explain the importance of using appropriate cryptographic solutions.
"......code integrity problem could be solved using cryptographic hashes or signatures, but many package managers..." Found in the opening sentences - Security+ 2.2 Explain common threat vectors and attack surfaces.
"......managers to check whether they detect a compromised package repository injecting malicious code into legitimate packages...." Found in the opening sentences - Security+ 2.3 Explain various types of vulnerabilities.
"......code integrity problem could be solved using cryptographic hashes or signatures, but many package managers..." Found in the opening sentences - Security+ 2.4 Given a scenario, analyze indicators of malicious activity.
"......they detect a compromised package repository injecting malicious code into legitimate packages. This code integrity problem..." Found in the opening sentences - CYBR 101 week 4: encoding, ciphers, symmetric and asymmetric encryption
"......code integrity problem could be solved using cryptographic hashes or signatures, but many package managers..." Found in the opening sentences - CYBR 101 week 5: hashes, how passwords are stored and cracked, Linux basics
"......integrity problem could be solved using cryptographic hashes or signatures, but many package managers are..." Found in the opening sentences - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Manage dependencies and risks.
"...fewer than half used lockfiles that checked for tampering by default..." Found by reading the article; these exact words are in it - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Perform secure program testing, review, and/or assessment to identify potential flaws in codes and mitigate vulnerabilities.
"...automatic verification was the default behavior in about half of the package managers..." Found by reading the article; these exact words are in it
How a story is connected to the course, and every objective, week and job role