News

20,000 GitHub projects at risk from Node.js ‘standard-version’ library vulnerability

More than 20,000 GitHub projects rely on the Node.js standard-version utility to implement semantic versioning (semver) and for generating CHANGELOG files for their builds.

A Proof-of-Concept (PoC) published by the GitHub Security Labs team this month reveals the presence of a code injection flaw in standard-versions, which means developers using this library could have inadvertently introduced vulnerabilities in their components.

“The standardVersion function has a command injection vulnerability. Clients of the standard-version library are unlikely to be aware of this, so they might unwittingly write code that contains a vulnerability,” read GitHub’s original PoC advisory.

Dubbed GHSL-2020-111 for lack of CVE, the flaw resides in the fact how commit messages are passed onto the `runExec` function. When passing user-controllable arguments, such as “releaseCommitMessageFormat”, arbitrary code can be injected and passed right into `runExec`, leading to command execution.

The vulnerable code with the runExec call using releaseCommitMessageFormat argument / via GitHub

GitHub considers this vulnerability carrying a “moderate” severity. Their spokesperson told The Daily Swig, “It is hard to create a complete exploit for this vulnerability because it is a library function that is vulnerable. A complete exploit requires that some client uses that specific library function with user-controlled inputs.”

And yes, they are correct. However, the severity of code injection vulnerabilities really depends on the context and how a vulnerable application is being used in the developer’s environment. 

Should a user-supplied input be passed to “standard-version” without much friction or checks in between, there is potential for some serious compromise.

Users and developers using standard-version are advised to upgrade to version 8.0.1 or above to mitigate this vulnerability.

To fix the flaw, the project has replaced calls to runExec with a more secure runExecFile command and added additional validations to the code.

Fix replaces runExec calls with runExecFile

The same GitHub advisory also published a list of CVEs and vulnerabilities similar to this one, as identified in other JS libraries:
CVE-2020-7646,
CVE-2020-7614,
CVE-2020-7597,
CVE-2019-10778,
CVE-2019-10776,
CVE-2018-16462,
CVE-2018-16461,
CVE-2018-16460,
CVE-2018-13797,
CVE-2018-3786,
CVE-2018-3772,
CVE-2018-3746,
CVE-2017-16100,
CVE-2017-16042.

“We have written a CodeQL query, which automatically detects this vulnerability. You can see the results of the query on the standard-version project here,” read the advisory.

Given the wide potential for use and abuse of open source components, developers are encouraged to stay on top of these security advisories and implement fixes as they are released, in their applications.

Ax Sharma

Ax Sharma is an Indian-origin British security researcher, journalist and TV subject matter expert with a focus on malware analysis and cybercrime investigations. His areas of interest include open source software security, threat intel analysis, and reverse engineering. Frequently featured by leading media outlets like the BBC, Channel 5, Fortune, WIRED, The Register, among others, Ax is an active community member of the OWASP Foundation and the British Association of Journalists (BAJ).

Recent Posts

Sea Turtle Cyber Espionage Campaign Targets Telecommunication and IT Companies in the Netherlands

Telecommunication, media, internet service providers (ISPs), information technology (IT)-service providers, and Kurdish websites in the…

12 months ago

Rogue WordPress plugin: Threat hunters uncover credit card skimming campaign targeting e-commerce sites

Rogue WordPress Plugin Found to Steal Credit Card Information in Magecart Campaign Threat hunters have…

12 months ago

Albanian Parliament and telco ‘One Albania’ suffer cyber attacks

The Assembly of the Republic of Albania and telecom company One Albania have recently fallen…

12 months ago

Carbanak Banking Malware Resurfaces with Updated Tactics in Ransomware Attacks

The banking malware Carbanak has resurfaced with updated tactics, incorporating attack vendors and techniques to…

12 months ago

Theme park giant Parques Reunidos hit by a ransomware cyber attack

One of the world's largest theme park operators, Parques Reunidos has disclosed a cybersecurity incident.…

2 years ago

Phishing kit screenshots your email domain on the fly to appear real

Phishing kit used by multiple hacked sites generates a log in page on the fly…

2 years ago

This website uses cookies.