Security context
Medium· 6.1GHSA-8p3c-m625-wh83 CVE-2016-0789CWE-113CWE-20Published May 14, 2022

Jenkins has CRLF Injection Vulnerability in the CLI

Research this vulnerability

Research is free — Hunters explains how the bug works, the root-cause code pattern, how the fix addresses it, and how to test whether a target is affected, in chat. Investigate & write exploit is a paid run — the engine reads the advisory and fix commits, then builds and validates a working proof-of-concept exploit with reproduction steps.

Affected versions

1.643 → fixed in 1.6500 → fixed in 1.642.2

Details

CRLF injection vulnerability in the CLI command documentation in Jenkins before 1.650 and LTS before 1.642.2 allows remote attackers to inject arbitrary HTTP headers and conduct HTTP response splitting attacks via unspecified vectors.

The fix

[FIX SECURITY-238] Don't echo command name

Daniel Beck· Jan 26, 2016, 10:40 AM+11f5c51fbad2
core/src/main/java/hudson/cli/CLIAction.java+1 1
@@ -78,7 +78,7 @@ public void doCommand(StaplerRequest req, StaplerResponse rsp) throws ServletExc
final String commandName = req.getRestOfPath().substring(1);
CLICommand command = CLICommand.clone(commandName);
if (command == null) {
- rsp.sendError(HttpServletResponse.SC_NOT_FOUND, "No such command " + commandName);
+ rsp.sendError(HttpServletResponse.SC_NOT_FOUND, "No such command");
return;
}

References