/

CVE-2025-68931

Severity:

HIGH RISK

(7.5)

Cryptographic Weakness in Jervis Jenkins Library

CVE-2025-68931

Analyzed

Vulnerability type

Category:

Cryptographic Weakness

CWE:

CWE-287, CWE-327

Impact:

Confidentiality and Integrity 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

Jervis, a library for Job DSL plugin scripts and shared Jenkins pipeline libraries, used AES/CBC/PKCS5Padding without any form of authentication or integrity protection before version 2.2.

This design allows attackers to perform padding oracle attacks and manipulate ciphertext, potentially altering or revealing protected data when they can interact with the encryption/decryption workflow.

Affected context

The vulnerability affects environments where Jervis is used to handle sensitive values within Jenkins Job DSL scripts or shared pipeline libraries and relies on AES/CBC/PKCS5Padding for "secure" storage or transmission.

It is most relevant when encrypted data is processed in workflows where an attacker can supply or influence ciphertext and observe success/failure or error differences coming from decryption attempts.

In such contexts, data expected to be protected by encryption may be partially disclosed or silently modified.

Exploit preconditions

  • Attack surface: Interfaces or workflows where Jervis-based logic encrypts and decrypts values (e.g., configuration, secrets, parameters) and where results are reflected in build behavior or error responses.
  • Required access: Ability to submit or tamper with ciphertext used by Jervis (for example, by modifying stored pipeline configuration, intercepting and altering data at rest or in transit, or influencing encrypted parameters).
  • Trigger point: Each time the vulnerable AES/CBC/PKCS5Padding decryption is invoked and the system exposes timing, error messages, or behavioral differences based on padding validity.
  • Why exploitation is possible: The encryption is unauthenticated—it lacks a MAC, signature, or AEAD mode—so padding validity leaks information and altered ciphertext may be accepted as valid, enabling padding oracle attacks and targeted ciphertext manipulation.

Why this happens

The underlying issue is the use of AES in CBC mode with PKCS5 padding without any accompanying integrity or authenticity mechanism, such as an HMAC or an authenticated encryption mode.

This maps to CWE-327: Use of a Broken or Risky Cryptographic Algorithm because CBC without authentication is a known insecure pattern: padding oracles can reveal information about plaintext, and bit-flipping can systematically change decrypted values.

In practice, Jervis treated encryption as sufficient to protect data without enforcing integrity checks, allowing adversaries who can interact with the decryption process to exploit cryptographic weaknesses in CBC mode.

Potential impact

  • Attackers may recover sensitive plaintext values (e.g., configuration secrets or tokens) via padding oracle techniques.
  • Encrypted configuration parameters or policy values can be altered without detection, potentially changing Jenkins pipeline behavior.
  • Pipelines may execute with attacker-controlled parameters, expanding opportunities for privilege misuse or lateral movement.
  • Security assumptions about the confidentiality and integrity of encrypted data within Jervis-based workflows can be invalidated.

General mitigation guidance

Mitigation focuses on replacing unauthenticated CBC encryption with modern, integrity-protecting schemes and tightening assumptions about encrypted data.

Recommended design patterns include:

  • Using authenticated encryption modes (e.g., AES-GCM, AES-CCM, or other AEAD constructions) instead of raw AES/CBC/PKCS5Padding.
  • If CBC must be retained for compatibility, wrapping it with a robust encrypt-then-MAC scheme so that any decryption attempt first validates an independent MAC.
  • Ensuring decryption routines run in a way that does not reveal padding or format errors through distinguishable messages, status codes, or timing differences.
  • Treating all externally supplied or indirectly influenced ciphertext as untrusted input, and validating it before using the decrypted values in security-sensitive logic.
  • Applying least-privilege principles to any Jenkins jobs or pipelines that depend on decrypted data, so compromised values have limited blast radius.

How teams detect issues like this

Detection typically involves reviewing cryptographic usage patterns and enforcing secure-by-default policies:

  • Static analysis: Search for AES/CBC/PKCS5Padding usage without accompanying MAC or AEAD constructs; flag decryption paths that accept external ciphertext.
  • Code review: Examine cryptographic helpers or utility classes used by Jervis integrations to confirm that encryption includes integrity and authenticity guarantees.
  • Configuration and policy checks: Enforce organizational rules that disallow unauthenticated encryption schemes in CI/CD tooling and require approved crypto primitives.
  • Automated tooling: Integrate security scanners or SAST tools into the Jenkins pipeline itself to identify risky cryptographic APIs and highlight padding-sensitive error paths.

Sources

SourceLink
github.comgithub.com/samrocketman/jervis/commit/c3981ff71de7b0f767dfe7b37a2372cb2a51974a
github.comgithub.com/samrocketman/jervis/security/advisories/GHSA-gxp5-mv27-vjcj

Frequently asked

questions

Exploitability depends on how Jervis is integrated into your Jenkins environment. If attackers can influence or inject ciphertext that Jervis will decrypt and can observe any difference in behavior or errors, the risk of practical exploitation increases significantly.

Often some level of access is needed—such as the ability to edit job configurations, pipeline libraries, or parameters—but the exact requirement depends on your access controls and how encrypted values are stored or consumed. In weaker setups, lower-privileged users might still reach the vulnerable code paths.

The most robust fix is to adopt an authenticated encryption scheme, such as AES-GCM or an encrypt-then-MAC construction, and ensure that decryption verifies integrity before acting on any plaintext. All legacy CBC-based code paths should be systematically retired or wrapped with strong integrity checks.

Standardize on vetted cryptographic libraries and patterns, mandate AEAD or encrypt-then-MAC for new development, and incorporate cryptography-focused security reviews into CI/CD changes. Automated checks in pull requests and security training on common crypto pitfalls help prevent reintroduction of unauthenticated encryption.

Find out what's already
exploitable in your codebase.