Skip to main content
Vulnerability Database/CVE-2026-12171

CVE-2026-12171: auto-changelog RCE Vulnerability

CVE-2026-12171 is a remote code execution flaw in auto-changelog that allows attackers to execute arbitrary code through untrusted repository configuration. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-12171 Overview

CVE-2026-12171 affects the auto-changelog npm package before version 2.6.1. The tool merges configuration from the target repository (the .auto-changelog file and the auto-changelog key in package.json) into its runtime options and honors security-sensitive settings from that untrusted source. Running auto-changelog over attacker-controlled repository content executes attacker-chosen code with the privileges of the invoking user or CI job. The vulnerability affects continuous integration (CI) workflows that check out untrusted pull request heads and local executions against forked or third-party repositories.

Critical Impact

Attackers achieve arbitrary code execution without any repository dependencies being installed, exposing CI secrets and workflow credentials.

Affected Products

  • auto-changelog npm package versions before 2.6.1
  • CI/CD pipelines invoking auto-changelog against untrusted pull request heads
  • Developer workstations running auto-changelog against forked or third-party repositories

Discovery Timeline

  • 2026-10-05 - CVE CVE-2026-12171 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-12171

Vulnerability Analysis

The root issue is improper trust placed in configuration data sourced from within the target repository. auto-changelog reads options from .auto-changelog and the auto-changelog key in package.json, then merges them with command-line options without distinguishing trusted from untrusted sources. Several of these options are security-sensitive. The handlebarsSetup option is passed directly to require(), loading an attacker-chosen module from the checked-out repository. The plugins option exhibits the same behavior, loading attacker-controlled modules. The appendGitLog and appendGitTag options allow git argument injection, including flags such as --output= to write arbitrary files. The output option writes attacker-influenced content to arbitrary filesystem paths. The template option triggers an outbound HTTPS request to an attacker-chosen URL, enabling data exfiltration or server-side request forgery.

Root Cause

This is a path traversal and untrusted input handling flaw tracked as [CWE-22]. The tool fails to classify in-repository configuration as untrusted, allowing it to override security-relevant parameters that control module loading, subprocess arguments, and file output locations.

Attack Vector

An attacker opens a pull request against a repository that uses auto-changelog in CI. The pull request includes a crafted .auto-changelog file or package.json fragment that sets handlebarsSetup or plugins to a malicious JavaScript file committed in the same pull request. When CI checks out the pull request head and runs auto-changelog, the malicious code executes with access to workflow secrets, repository tokens, and the ability to tamper with downstream artifacts.

javascript
// Patch excerpt - src/run.js
-const { dirname, join } = require('path')
+const { dirname, isAbsolute, join } = require('path')
 const { Command } = require('commander')
 const importCwd = require('import-cwd')
 const { version } = require('../package.json')
 const { fetchRemote } = require('./remote')
 const { fetchTags } = require('./tags')
 const { parseReleases } = require('./releases')
 const { compileTemplate } = require('./template')
-const { parseLimit, readFile, readJson, writeFile, fileExists, updateLog, formatBytes } = require('./utils')
+const { parseLimit, readFile, readJson, writeFile, fileExists, updateLog, formatBytes, isURL } = require('./utils')

Source: GitHub Commit 1d02a48. The patch introduces URL validation helpers and enforces that in-repository configuration cannot set security-sensitive options unless --unsafe-config is explicitly passed.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-12171

Indicators of Compromise

  • Presence of .auto-changelog files or an auto-changelog key in package.json within untrusted pull requests that set handlebarsSetup, plugins, appendGitLog, appendGitTag, output, or template.
  • Unexpected require() calls originating from the auto-changelog process targeting files under the checked-out repository path.
  • Outbound HTTPS requests from CI runners to unexpected hosts during changelog generation.
  • Writes to filesystem paths outside the repository workspace by the auto-changelog process.

Detection Strategies

  • Inspect pull request diffs for additions or modifications to .auto-changelog and the auto-changelog key in package.json.
  • Audit CI logs for auto-changelog invocations that emit git arguments beginning with --output= or other unexpected flags.
  • Monitor child process creation under CI runner identities for node processes loading modules from the checked-out workspace.

Monitoring Recommendations

  • Enable workflow secret masking and review CI audit logs for secret access during auto-changelog runs.
  • Capture outbound network telemetry from CI runners and alert on connections to non-approved domains during build jobs.
  • Record filesystem writes performed by CI jobs and alert on writes outside the designated workspace.

How to Mitigate CVE-2026-12171

Immediate Actions Required

  • Upgrade auto-changelog to version 2.6.1 or later across all projects, CI pipelines, and developer environments.
  • Do not pass the new --unsafe-config flag when running against untrusted repository content.
  • Rotate any CI secrets, tokens, or credentials that may have been exposed to prior auto-changelog runs on untrusted pull requests.
  • Review workflow configurations that check out pull_request_target or untrusted heads with elevated permissions.

Patch Information

Version 2.6.1 treats in-repository configuration as untrusted and refuses to run when it sets the affected options. The fix is documented in GitHub Security Advisory GHSA-xpvr-2hvx-m8q4 and implemented in commit 1d02a48.

Workarounds

  • Restrict CI workflows that run auto-changelog so they never execute against untrusted pull request heads with access to secrets.
  • Remove or ignore in-repository .auto-changelog files and the auto-changelog key in package.json before invoking the tool.
  • Run changelog generation in isolated, ephemeral environments without access to production credentials or write access to protected branches.
bash
# Upgrade auto-changelog to the patched version
npm install --save-dev auto-changelog@^2.6.1

# Verify installed version
npx auto-changelog --version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.