Fix remember-me token signature forgery and expected signature leak#3
Draft
Fix remember-me token signature forgery and expected signature leak#3
Conversation
… remove signature leak from error messages Two security fixes in TokenBasedRememberMeServices2: 1. makeTokenSignature() no longer returns the literal string "no-prop" when UserSeedProperty is null. Instead, "no-prop" is used as a seed value and the HMAC is still computed, making the signature unpredictable without knowledge of the server-side secret keys. 2. processAutoLoginCookie() no longer includes the expected valid HMAC signature in the InvalidCookieException error message. The old message leaked the exact server-computed signature that an attacker would need to forge a valid remember-me cookie for any user. Co-authored-by: DominicBreuker <[email protected]>
… fix Co-authored-by: DominicBreuker <[email protected]>
Copilot
AI
changed the title
[WIP] Fix critical authentication bypass vulnerability in code base
Fix remember-me token signature forgery and expected signature leak
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two auth bypass vulnerabilities in
TokenBasedRememberMeServices2: the token signature could be forged using a known constant, and the valid signature was leaked in error messages.Predictable token signature bypass
makeTokenSignature()returned the literal string"no-prop"whenUserSeedPropertywas null, completely bypassing HMAC computation. An attacker could forge a remember-me cookie for any affected user:Fix: Use
"no-prop"as a seed input to the HMAC rather than returning it directly, so the signature always depends on server-side secrets.Expected signature disclosure in error message
processAutoLoginCookie()included the server-computed HMAC in theInvalidCookieExceptionmessage — the exact value needed to forge a valid cookie. Replaced with a generic message.Tests
forgedRememberMeCookie_withNoPropSignature_shouldBeRejected— verifies "no-prop" forgery is rejectedmakeTokenSignature_shouldAlwaysComputeHMAC— verifies signature is never the literal constantWarning
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/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 test -pl test -Dtest=hudson.security.TokenBasedRememberMeServices2Test -Dsurefire.useFile=false -Dmaven.test.redirectTestOutputToFile=false(dns block)www.jenkins.io/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.