Jenkins allows attackers to determine whether a user exists
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.533 → fixed in 1.5510 → fixed in 1.532.2
Details
The loadUserByUsername function in hudson/security/HudsonPrivateSecurityRealm.java in Jenkins before 1.551 and LTS before 1.532.2 allows remote attackers to determine whether a user exists via vectors related to failed login attempts.
The fix
[FIXED SECURITY-79] Prevent (private security realm)
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java+11 −2
@@ -78,6 +78,8 @@import java.util.ArrayList;import java.util.Collections;import java.util.List;+import java.util.MissingResourceException;+import java.util.ResourceBundle;import java.util.logging.Level;import java.util.logging.Logger;@@ -173,8 +175,15 @@ public Details loadUserByUsername(String username) throws UsernameNotFoundExcept@Overrideprotected Details authenticate(String username, String password) throws AuthenticationException {Details u = loadUserByUsername(username);-if (!u.isPasswordCorrect(password))-throw new BadCredentialsException("Failed to login as "+username);+if (!u.isPasswordCorrect(password)) {+String message;+try {+message = ResourceBundle.getBundle("org.acegisecurity.messages").getString("AbstractUserDetailsAuthenticationProvider.badCredentials");+} catch (MissingResourceException x) {+message = "Bad credentials";+}+throw new BadCredentialsException(message);+}return u;}
References
- ADVISORYhttps://nvd.nist.gov/vuln/detail/CVE-2014-2064
- WEBhttps://github.com/jenkinsci/jenkins/commit/fbf96734470caba9364f04e0b77b0bae7293a1ec
- PACKAGEhttps://github.com/jenkinsci/jenkins
- WEBhttps://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2014-02-14
- WEBhttp://www.openwall.com/lists/oss-security/2014/02/21/2