CVE-2025-59339

4.4 MEDIUM

📋 TL;DR

CVE-2025-59339 is a vulnerability in The Bastion's session recording encryption script that fails to sign encrypted SSH session files when configured to do so. This affects organizations using The Bastion for SSH access management with session recording enabled and the osh-encrypt-rsync script configured for file rotation and encryption.

💻 Affected Systems

Products:
  • The Bastion
Versions: All versions before the fix commit 9bc85ec3f4b724f903773ba64909777c4826a13f
Operating Systems: All operating systems running The Bastion
Default Config Vulnerable: ✅ No
Notes: Only affects systems where session recording is enabled and the osh-encrypt-rsync script is configured with signing enabled.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

If exploited, unsigned session recordings could be tampered with without detection, compromising audit integrity and potentially allowing attackers to cover tracks or insert malicious content into audit trails.

🟠

Likely Case

Session recordings lack cryptographic signatures despite configuration, reducing the reliability of audit trails for forensic investigations and compliance requirements.

🟢

If Mitigated

With proper monitoring and integrity checks, the impact is limited to reduced cryptographic assurance of session recording files.

🌐 Internet-Facing: LOW - This vulnerability requires access to the encrypted session files and affects audit integrity rather than direct system access.
🏢 Internal Only: MEDIUM - Internal attackers with access to encrypted session files could potentially tamper with audit trails without detection.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires access to encrypted session files and knowledge of the signing failure. No authentication bypass or remote code execution is involved.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Version containing commit 9bc85ec3f4b724f903773ba64909777c4826a13f

Vendor Advisory: https://github.com/ovh/the-bastion/security/advisories/GHSA-h66q-g57p-rgg6

Restart Required: No

Instructions:

1. Update The Bastion to the latest version containing the fix commit. 2. Verify the osh-encrypt-rsync script properly signs files when configured to do so. 3. Re-encrypt existing session recordings if needed for consistency.

🔧 Temporary Workarounds

Manual signing verification

all

Manually verify signatures on encrypted session files after rotation

gpg --verify [encrypted-file].sig [encrypted-file]

Disable signing requirement

all

Temporarily disable signing in the osh-encrypt-rsync configuration if not required for compliance

Edit configuration to remove signing options from osh-encrypt-rsync script

🧯 If You Can't Patch

  • Implement manual verification of session recording file integrity using checksums or hashes
  • Store session recordings in write-protected storage with access controls to prevent tampering

🔍 How to Verify

Check if Vulnerable:

Check if osh-encrypt-rsync script is configured to sign files and verify that generated .sig files are created and valid for recent session recordings.

Check Version:

Check The Bastion version or verify presence of fix commit 9bc85ec3f4b724f903773ba64909777c4826a13f in the installation.

Verify Fix Applied:

After patching, run the osh-encrypt-rsync script and verify that .sig files are generated and can be validated with gpg --verify.

📡 Detection & Monitoring

Log Indicators:

  • Missing or invalid signature files for session recordings
  • osh-encrypt-rsync script running without generating signature files when configured to

Network Indicators:

  • None - this is a local file handling issue

SIEM Query:

Search for failed signature generation events in The Bastion logs or file system monitoring alerts for missing .sig files

🔗 References

📤 Share & Export