{"id":"CVE-2026-129947","kind":"vulnerability","aliases":["CVE-2026-129947"],"related":[],"title":"Contentlayer core: file names inject JavaScript into generated modules","description":"Contentlayer @contentlayer/core through 0.3.4 contains a code injection vulnerability that allows attackers to inject JavaScript by embedding single quotes in content file names. Attackers can add a content file whose name breaks out of the import specifier in makeDataExportFile(), executing injected code when contentlayer dev or a Next.js dev server imports the generated module.","summary":"Contentlayer's core package builds an import line from content file names without escaping single quotes. An attacker who can add a content file can break out of that import and run JavaScript when the dev server imports the generated module.","severity":"high","cvss":8.6,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["contentlayer","next.js","node","package"],"not_affected_if":["production-only","trusted-content-authors"],"how_to_check":"- Find the installed version with `npm ls @contentlayer/core`\n- Check whether the project runs `contentlayer dev` or a Next.js dev server that uses Contentlayer\n- Check whether untrusted users can add files to the content directory","fix":"- Move `@contentlayer/core` past `0.3.4`; the sources do not name the fixed version","status":"open","published_at":"2026-11-16T15:17:29+00:00","first_seen_at":"2026-11-16T15:37:56+00:00","triaged_at":"2026-11-16T15:40:10+00:00","updated_at":"2026-11-16T15:40:10+00:00","category":"package","confidence":0.6,"triage":{"at":"2026-11-16T15:40:10Z","model":"claude-haiku-5-5","output":{"fix":"- Move `@contentlayer/core` past `0.3.4`; the sources do not name the fixed version","reach":"unknown","title":"Contentlayer core: file names inject JavaScript into generated modules","impact":"high","summary":"Contentlayer's core package builds an import line from content file names without escaping single quotes. An attacker who can add a content file can break out of that import and run JavaScript when the dev server imports the generated module.","audience":"developers","category":"package","nicknames":[],"who_cares":["contentlayer","next.js","node"],"confidence":0.6,"fix_status":"unknown","needs_auth":"unknown","worst_case":"Attacker code runs in the developer's dev server process","analyst_note":"Find the fixed version of @contentlayer/core and whether production builds are affected; check the NVD entry and the VulnCheck advisory.","how_to_check":"- Find the installed version with `npm ls @contentlayer/core`\n- Check whether the project runs `contentlayer dev` or a Next.js dev server that uses Contentlayer\n- Check whether untrusted users can add files to the content directory","plain_action":"","product_name":"","needs_analyst":true,"not_affected_if":["production-only","trusted-content-authors"],"who_is_affected":"Projects that use Contentlayer's core package through version 0.3.4 and run its dev server, where a file name in the content directory is attacker-controlled. Production builds and projects where only trusted authors add content are less exposed. The sources do not say whether production builds are affected.","user_interaction":"yes","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000735,"input_tokens":4599,"output_tokens":551,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-129947':12A,15A '-2026':11A,14A '0.3.4':64C 'add':40B,86C 'allow':71C 'attack':37B,72C,84C 'break':45B,92C 'build':24B 'code':67C,102C 'contain':65C 'content':29B,42B,81C,88C 'contentlay':1A,16B,20B,61C,104C 'contentlayer/core':62C 'core':2A,22B 'cve':10A,13A 'dev':55B,105C,109C 'embed':77C 'escap':33B 'execut':100C 'file':3A,30B,43B,82C,89C 'generat':8A,59B,113C 'import':26B,49B,57B,96C,111C 'inject':5A,68C,74C,101C 'javascript':6A,52B,75C 'line':27B 'makedataexportfil':99C 'modul':9A,60B,114C 'name':4A,31B,83C,91C 'next.js':17B,108C 'node':18B 'packag':19B,23B 'quot':35B,79C 'run':51B 'server':56B,110C 'singl':34B,78C 'specifi':97C 'vulner':69C 'whose':90C 'without':32B","nicknames":[],"mitigations":[],"who_affected":"Projects that use Contentlayer's core package through version 0.3.4 and run its dev server, where a file name in the content directory is attacker-controlled. Production builds and projects where only trusted authors add content are less exposed. The sources do not say whether production builds are affected.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"unknown","audience":"developers","plain_action":null,"pkeys":[],"ptokens":[],"labels":["contentlayer","high","nextjs","node","package"],"campaign_type":null,"search_a":"'-129947':12A,15A '-2026':11A,14A 'contentlay':1A 'core':2A 'cve':10A,13A 'file':3A 'generat':8A 'inject':5A 'javascript':6A 'modul':9A 'name':4A","search_b":"'add':40B 'attack':37B 'break':45B 'build':24B 'content':29B,42B 'contentlay':16B,20B 'core':22B 'dev':55B 'escap':33B 'file':30B,43B 'generat':59B 'import':26B,49B,57B 'javascript':52B 'line':27B 'modul':60B 'name':31B 'next.js':17B 'node':18B 'packag':19B,23B 'quot':35B 'run':51B 'server':56B 'singl':34B 'without':32B","search_c":"'0.3.4':64C 'add':86C 'allow':71C 'attack':72C,84C 'break':92C 'code':67C,102C 'contain':65C 'content':81C,88C 'contentlay':61C,104C 'contentlayer/core':62C 'dev':105C,109C 'embed':77C 'execut':100C 'file':82C,89C 'generat':113C 'import':96C,111C 'inject':68C,74C,101C 'javascript':75C 'makedataexportfil':99C 'modul':114C 'name':83C,91C 'next.js':108C 'quot':79C 'server':110C 'singl':78C 'specifi':97C 'vulner':69C 'whose':90C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-11-16T15:17:29+00:00","kev":null,"cvss_vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"disclosure@vulncheck.com","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-129947","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-129947","severity":null,"published_at":"2026-11-16T15:17:29+00:00","modified_at":"2026-11-16T15:17:29+00:00","first_seen_at":"2026-11-16T15:37:56+00:00","fetched_at":"2026-11-16T15:37:56+00:00","note":null}],"documents":[{"id":170630,"url":"https://www.vulncheck.com/advisories/contentlayer-contentlayer-core-through-0.3.4-code-injection-via-generated-index-mjs","title":"Third-party advisory: www.vulncheck.com","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: www.vulncheck.com"}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}