Skip to main content

Malicious code in formatting-subtitles (npm)

0
High
Published: 10/22/2026 (10/22/2026, 06:11:06 UTC)
Source: GCVE Database
Product: formatting-subtitles

Description

The npm package 'formatting-subtitles' version 1.0.2 contains malicious code in its preinstall script. The script masquerades as JavaScript but is executed by the shell, which runs attacker-controlled commands. During installation, it fetches and executes arbitrary code from a mutable GitHub Gist and sends installation metadata to an attacker-controlled webhook. This behavior allows remote code execution and data leakage during npm install.

Affected software

npmghsa
formatting-subtitles
Affected versions
=1.0.2

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/22/2026, 17:43:02 UTC

Technical Analysis

The 'formatting-subtitles' npm package version 1.0.2 includes a preinstall script declared as 'sh ./prepare.js && exit 0'. Although prepare.js appears to be JavaScript, it is executed by /bin/sh, which does not recognize JavaScript comments. Inside a JavaScript-style comment block, shell command substitutions are executed: one sends a GET request to a hardcoded webhook URL leaking installation metadata, and another downloads a file from a GitHub Gist, extracts it using jq, writes it to disk as 'x', and executes it with sh. This results in the installer host executing arbitrary, attacker-controlled code fetched during installation.

Potential Impact

This vulnerability enables remote code execution on any system that installs the affected package version. It also leaks installation metadata such as public IP and user-agent to the attacker via the webhook. The attacker can run arbitrary commands on the victim's machine during npm install, potentially leading to system compromise or further malicious activity.

Mitigation Recommendations

No official patch or remediation is currently documented. Users should avoid installing version 1.0.2 of the 'formatting-subtitles' package. Verify package integrity before installation and consider using trusted package sources or lockfiles to prevent automatic installation of malicious dependencies. Monitor vendor advisories for updates or official fixes.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-18184
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6ada450d4d27ba8daa6a5b6e

Added to database: 10/22/2026, 17:17:01 UTC

Last enriched: 10/22/2026, 17:43:02 UTC

Last updated: 10/22/2026, 17:43:02 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses