Skip to content

Fix remember-me cookie forgery via predictable signature bypass#2

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-authentication-bypass-vulnerability-again
Draft

Fix remember-me cookie forgery via predictable signature bypass#2
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-authentication-bypass-vulnerability-again

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 18, 2026

TokenBasedRememberMeServices2.makeTokenSignature() returns the static string "no-prop" when UserSeedProperty is null, completely bypassing HMAC computation. An attacker can forge a valid remember-me cookie for any affected user with just base64(username:expiryTime:no-prop).

Vulnerability

// BEFORE: short-circuits past HMAC, signature is a known constant
if (userSeedProperty == null) {
    return "no-prop";
}

The processAutoLoginCookie path compares the attacker-supplied signature against the output of makeTokenSignature(). When both are the literal string "no-prop", authentication succeeds — no secret material involved.

CVSS 9.8 — Network-exploitable, no auth required, no user interaction, full impersonation of any user whose UserSeedProperty is absent.

Fix

  • TokenBasedRememberMeServices2.java: Replace return "no-prop" with userSeed = "no-prop" so the value flows through MAC.mac(token) like all other code paths. The signature now always requires the server-side HMAC key.
// AFTER: "no-prop" used as seed, HMAC always computed
if (userSeedProperty == null) {
    userSeed = "no-prop";
} else {
    userSeed = userSeedProperty.getSeed();
}
// Always reached:
return MAC.mac(String.join(":", username, ..., userSeed, getKey()));
  • TokenBasedRememberMeServices2Test.java: Added test that crafts a forged cookie with "no-prop" as the signature and asserts it is rejected.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repo.jenkins-ci.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -Xmx1400m -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/jenkins/jenkins org.codehaus.plexus.classworlds.launcher.Launcher -pl core -am compile -q -DskipTests 5sum md5sum nfig/composer/vendor/bin/md5sum md5sum (dns block)
  • www.jenkins.io
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…akeTokenSignature

When UserSeedProperty is null, the method previously returned the static
string "no-prop" directly, bypassing HMAC signature computation entirely.
This allowed attackers to forge remember-me cookies by using "no-prop" as
the signature for any user whose UserSeedProperty was absent.

Fix: Use "no-prop" as the seed value but still compute the HMAC signature,
ensuring the token always includes cryptographic material that cannot be
predicted without knowledge of the server-side secret key.

Co-authored-by: DominicBreuker <[email protected]>
Copilot AI changed the title [WIP] Fix critical authentication bypass vulnerability in code base Fix remember-me cookie forgery via predictable signature bypass Feb 18, 2026
Copilot AI requested a review from DominicBreuker February 18, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants