User-controlled inputs are written to the job log unescaped in add-and-commit, allowing workflow commands to be forged
Description
Improper Output Neutralization for Logs (CWE-117) in add-and-commit, in src/io.ts and src/main.ts, from 2.3.0 before 11.1.0. A party who controls the content of an action input can forge GitHub Actions workflow commands in the job log.
The action prints several inputs through core.info(): message, author_name and author_email, committer_name and committer_email, and the working directory. core.info() is implemented as process.stdout.write(message + EOL) and escapes nothing. core.warning(), core.error() and core.debug() are not implemented that way: they pass through issueCommand() and escapeData(), which replace carriage return and line feed with %0D and %0A. info is the exception.
The runner interprets any line on stdout beginning with ::, so a line feed inside an input ends the action's log line and begins a line the runner reads as a command.
What makes this reachable is that a workflow interpolates event data into one of those inputs, which is what the documented example for message does. The author of an issue title, a pull request title or a commit message then places the line feed.
::stop-commands:: ends command processing for the remainder of the job. An ::add-mask:: registered by a later step of the same job is therefore never applied, and the value it would have masked is written to the log in cleartext. Annotations can be forged the same way, and the action's own log lines suppressed.
From 11.0.0 the project carries a neutralizeLogString() helper whose character class covers the C0 and C1 ranges, DEL and the Unicode bidi controls. The C0 range includes the line feed, so the helper would have closed this. It is applied in the log() helper and not on the path that prints the inputs.
Vulnerability type (CWE)
- CWE-117: Improper Output Neutralization for Logs
Affected versions
add-and-commit from 2.3.0 before 11.1.0. Default status: unaffected.
2.3.0, released 14 December 2019, is the first version that echoes a user-controlled input through an unescaped info path, printing author_name and author_email. The working directory joins at 5.0.0 and message at 5.1.0, both in October 2020. 11.1.0, released 19 August 2026, is the first version in which the inputs go through a neutralising wrapper.
Checked by reading every one of the 51 semantic version tags. The unescaped echo is continuous across all of them, through three refactors of where the logging lives: src/main.ts with core.info up to 4.0.0, src/main.ts with a destructured info from 4.0.1, and src/io.ts from 8.0.0. safeInfo first appears at 11.1.0.
The implementation of info was read out of the bundled lib/index.js at 9.1.4, 11.0.0 and 11.1.0 rather than taken from the report, and is process.stdout.write(e + EOL) in each. escapeData in the same bundle is replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").
Score (CVSS 4.0)
Medium (6.3)
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N
The attack vector is Network because the input arrives as repository event data. The attack complexity is Low, since nothing has to be defeated: a line feed is enough. The attack requirements are Present because the workflow has to interpolate attacker-controlled event data into one of the printed inputs, which is a configuration outside the attacker's control. The privileges required are None, as opening an issue or a pull request on a public repository grants no privilege over the target. The user interaction is None because the workflow runs on the event with nobody acting.
Confidentiality on the vulnerable system is None: nothing of the action's own is read. Integrity on the vulnerable system is Low because the attacker shapes the log the action emits. On the subsequent system, the runner and its job, confidentiality is Low because stopping command processing exposes whatever a later step in the same job would have masked, which is a conditional rather than a general read of the repository's secrets, and integrity is Low because annotations and the job's audit trail can be forged. Availability is None on both.
Solution
Upgrade to add-and-commit 11.1.0 or later.
On an affected version, do not interpolate event data such as a commit message, an issue title or a pull request title directly into message, author_name, author_email, committer_name or committer_email. Pass it through an intermediate environment variable, or sanitise it in a preceding step.
Patch
Commit 60ff4bbc, through pull request #776, released in 11.1.0.
A safeInfo() wrapper is added to src/util.ts and every call that prints an input is routed through it, so neutralizeLogString() runs before the string reaches stdout. The error paths that interpolate input values, among them parsePushAttempts() and the default_author check, call neutralizeLogString() directly.
The character class is extended from - to
-, which brings in the Unicode line and paragraph separators U+2028 and U+2029.
Credits
- Diego Torres Sánchez (6ala) - finder
- Xoán M. Otero Jorge - analyst
- Darío Rivas - analyst
- Secur0 CNA - coordinator
- Federico Grandi @EndBug - remediation developer Discovery source: External
Official record: CVE-2026-142525