{"id":"MAL-2026-18184","kind":"package","aliases":["MAL-2026-18184"],"related":[],"title":"Malicious code in formatting-subtitles (npm)","description":"---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (25577370189f57a5678b2f2c45e212abfc79a3675dc7d51581f633e78aba47a6)\npackage.json declares `preinstall: sh./prepare.js && exit 0`. prepare.js is shaped like JavaScript (ending with `console.log('hello world')`) but is executed by /bin/sh, which does not treat `/**... */` as a comment. Inside that block, sh evaluates two `$(...)` command substitutions: one issues a GET to the hardcoded collector https://webhook.site/9e8c8742-3102-4716-aa8b-e150e9e84fe7/stats_1, and the other downloads https://api.github.com/gists/da04f14c93acbe9a7aef827be0a2e91c, extracts a file via jq, writes it to disk as `x`, and runs it with `sh x`. On `npm install`, the installer host fetches and executes arbitrary, unpinned, attacker-controlled content from a mutable GitHub Gist, and the webhook.site beacon discloses the install (and curl-visible metadata such as public IP and user-agent) to the attacker. The JS-comment-wrapping of the shell payload is a deliberate cover story so prepare.js reads as a trivial hello-world when viewed as JavaScript.","summary":null,"severity":"critical","cvss":null,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"formatting-subtitles","fixed":[],"affected":"= 1.0.2","ecosystem":"npm"}],"ecosystems":["npm"],"tags":["malicious","package"],"not_affected_if":[],"how_to_check":null,"fix":null,"status":"open","published_at":"2026-10-22T06:11:06+00:00","first_seen_at":"2026-10-26T20:51:49+00:00","triaged_at":"2026-10-26T20:57:54+00:00","updated_at":"2026-10-26T21:05:48+00:00","category":"package","confidence":null,"triage":null,"analyst_status":null,"analyst_note":null,"search":"'-18184':10A,13A '-2026':9A,12A './prepare.js':37C '/9e8c8742-3102-4716-aa8b-e150e9e84fe7/stats_1,':80C '/bin/sh':54C '/gists/da04f14c93acbe9a7aef827be0a2e91c,':87C '0':39C '25577370189f57a5678b2f2c45e212abfc79a3675dc7d51581f633e78aba47a6':32C 'agent':144C 'amazon':30C 'amazon-inspector':29C 'api.github.com':86C 'api.github.com/gists/da04f14c93acbe9a7aef827be0a2e91c,':85C 'arbitrari':114C 'attack':117C,147C 'attacker-control':116C 'beacon':128C 'block':64C 'code':2A 'collector':77C 'command':68C 'comment':61C,151C 'console.log':47C 'content':119C 'control':118C 'cover':160C 'curl':134C 'curl-vis':133C 'declar':34C 'deliber':159C 'detail':21C 'disclos':129C 'disk':96C 'download':84C 'edit':24C 'end':45C 'evalu':66C 'execut':52C,113C 'exit':38C 'extract':88C 'fetch':111C 'file':90C 'format':5A 'formatting':15A 'formatting-subtitl':4A 'formatting-subtitles':14A 'get':73C 'gist':124C 'github':123C 'hardcod':76C 'hello':48C,169C 'hello-world':168C 'host':110C 'insid':62C 'inspector':31C 'instal':107C,109C,131C 'ip':140C 'issu':71C 'javascript':44C,174C 'jq':92C 'js':150C 'js-comment-wrap':149C 'like':43C 'line':27C 'mal':8A,11A 'malici':1A,17B 'metadata':136C 'mutabl':122C 'npm':7A,106C 'one':70C 'packag':18B 'package.json':33C 'payload':156C 'per':19C 'preinstal':35C 'prepare.js':40C,163C 'public':139C 'read':164C 'run':100C 'sh':36C,65C,103C 'shape':42C 'shell':155C 'sourc':20C,28C 'stori':161C 'substitut':69C 'subtitl':6A 'subtitles':16A 'treat':58C 'trivial':167C 'two':67C 'unpin':115C 'user':143C 'user-ag':142C 'via':91C 'view':172C 'visibl':135C 'webhook.site':79C,127C 'webhook.site/9e8c8742-3102-4716-aa8b-e150e9e84fe7/stats_1,':78C 'world':49C,170C 'wrap':152C 'write':93C 'x':98C,104C","nicknames":[],"mitigations":[],"who_affected":null,"tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-22T06:11:06+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"osv-malicious","external_id":"MAL-2026-18184","url":"https://osv.dev/vulnerability/MAL-2026-18184","severity":"critical","published_at":"2026-10-22T06:11:06+00:00","modified_at":"2026-10-22T06:45:04+00:00","first_seen_at":"2026-10-26T20:51:49+00:00","fetched_at":"2026-10-26T20:51:49+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}