/

CVE-2025-68698

Severity:

HIGH RISK

(7.5)

Use of Weak Cryptography in Jervis Library

CVE-2025-68698

Analyzed

Vulnerability type

Category:

Use of Weak Cryptography

CWE:

CWE-327

Impact:

Confidentiality Compromise of Encrypted Data

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The Jervis library used for Job DSL plugin scripts and shared Jenkins pipeline libraries relied on PKCS#1 v1.5 padding (PKCS1Encoding) for RSA encryption, which is susceptible to Bleichenbacher-style padding oracle attacks.

In environments where an attacker can observe padding error behavior or response differences, this weakness can allow gradual decryption or recovery of sensitive encrypted data that should remain confidential.

Affected context

This issue affects systems that integrate the Jervis library for Jenkins-related scripting and pipelines, where RSA encryption is performed using PKCS1Encoding.

The vulnerability becomes relevant when:

  • RSA encryption is used for protecting sensitive data (e.g., secrets, tokens, or configuration),
  • An attacker can interact with or observe a component that attempts to decrypt attacker-influenced ciphertexts,
  • And the system's error handling or timing behavior reveals whether padding is valid or invalid.

Not every deployment will expose a practical oracle, but those that do are at risk of adaptive chosen-ciphertext attacks.

Exploit preconditions

  • Attack surface: Any service, endpoint, or job that uses Jervis' RSA functionality and exposes distinguishable responses when decryption fails versus succeeds.
  • Required access: Ability to submit or influence ciphertexts that are later decrypted by the vulnerable code, plus the ability to observe the system's responses, timing, or error patterns.
  • Trigger point: Decryption attempts that process attacker-controlled ciphertexts using PKCS1Encoding with RSA.
  • Why exploitation is possible: PKCS#1 v1.5 padding is vulnerable to Bleichenbacher padding oracle attacks, where subtle differences in error handling or response behavior can be iteratively abused to decrypt data without direct access to the private key.

Why this happens

The root cause is the use of a cryptographically weak padding scheme (PKCS#1 v1.5) for RSA operations in a context where padding oracle conditions may arise.

This maps to CWE-327: Use of a Broken or Risky Cryptographic Algorithm, because although RSA itself remains sound, the chosen padding mode is known to enable adaptive chosen-ciphertext attacks.

By continuing to use PKCS1Encoding instead of a more robust scheme such as OAEP, the implementation implicitly trusts that decryption error behavior will never be observable to attackers, which is a fragile and often incorrect assumption in complex CI/CD and automation environments.

Potential impact

  • Attackers could decrypt captured ciphertexts, recovering sensitive information such as secrets, access tokens, or confidential configuration data.
  • Long-term compromise of encrypted data archives or logs if they were protected using the vulnerable scheme.
  • Facilitation of further lateral movement or privilege escalation if decrypted secrets are used for authentication or authorization.
  • Erosion of trust in the integrity of secure provisioning or deployment processes that rely on encrypted values.

General mitigation guidance

Mitigation focuses on adopting stronger cryptographic padding schemes and avoiding error behaviors that leak cryptographic internals.

General defensive patterns include:

  • Prefer OAEP (Optimal Asymmetric Encryption Padding) for RSA encryption, using modern, well-reviewed cryptographic libraries.
  • Design APIs and services so that decryption errors are handled uniformly, without revealing whether a failure was due to padding, key mismatch, or other internal conditions.
  • Limit where and how decryption is performed: centralize cryptographic operations in a minimal, hardened component instead of distributing them broadly across job scripts and pipelines.
  • Apply strict key management practices, ensuring that RSA keys used by build or pipeline systems are rotated periodically and stored in secure hardware-backed or managed key services.
  • When changing padding modes, plan migration paths for existing encrypted data, such as re-encrypting values on first use or through a controlled rotation workflow.

How teams detect issues like this

Effective detection relies on recognizing the use of risky cryptographic primitives and patterns:

  • Static analysis and code scanning: Configure rules to flag uses of PKCS#1 v1.5 padding modes (e.g., PKCS1Encoding, "RSA/ECB/PKCS1Padding") and recommend OAEP-based alternatives.
  • Code review signals: During reviews of pipeline libraries, Jenkins shared libraries, and cryptographic utilities, look for direct cryptographic primitive usage and verify that modern schemes and parameters are used.
  • Policy enforcement: Introduce security guidelines or linters that prevent merging code that introduces deprecated or risky cryptographic algorithms or padding schemes.
  • Runtime monitoring: Where feasible, log and monitor repeated decryption failures or unusual error patterns that could indicate probing for a padding oracle, while still avoiding detailed error disclosure to clients.
  • Automated tooling: Use general-purpose application security testing tools and dependency analyzers that can highlight use of known-weak cryptography in third-party libraries and internal code.

Sources

SourceLink
github.comgithub.com/samrocketman/jervis/commit/c3981ff71de7b0f767dfe7b37a2372cb2a51974a
github.comgithub.com/samrocketman/jervis/security/advisories/GHSA-mqw7-c5gg-xq97

Frequently asked

questions

It can be, depending on deployment. If a remote attacker can feed crafted ciphertexts into a component that uses Jervis' RSA decryption and can observe distinct success/failure behaviors, then a Bleichenbacher-style attack may be mounted remotely.

The attacker needs the ability to influence or supply ciphertexts that are decrypted by the vulnerable code and to observe how the system behaves in response (e.g., error messages, timing, or status codes). Direct access to the private key is not required.

The safest pattern is to replace PKCS#1 v1.5 padding (PKCS1Encoding) with OAEP for all RSA encryption/decryption operations and ensure uniform, non-informative error handling for decryption failures. This reduces both algorithmic and implementation-level oracle risks.

Adopt a cryptography guideline that:

  • Mandates modern, recommended algorithms and modes (such as RSA-OAEP or authenticated symmetric encryption),
  • Centralizes cryptographic operations in well-reviewed libraries or services,
  • Uses static analysis and CI checks to block introduction of deprecated primitives,
  • And includes periodic reviews of cryptographic configurations as part of your security and compliance processes.
Find out what's already
exploitable in your codebase.