Critical Vulnerability in StrongSwan: PKCS#1 Signature Forgery Risk

strongswan Updated 02 Oct 2025

Summary

26/09/2018
N/A
Yes i
High
7.5

ALPINE-CVE-2018-16151: In verify_emsa_pkcs1_signature() in gmp_rsa_public_key.c in the gmp plugin in strongSwan 4.x and 5.x before 5.7.0, the RSA implementation based on GMP does not reject excess data after the encoded algorithm OID during PK... Affects strongswan versions < 5.7.0-r0. Fixed in 5.7.0-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

StrongSwan is an open-source IPsec-based VPN solution that provides secure communication over the internet. It is widely used for establishing secure connections in various environments, including corporate networks and cloud services. The package is known for its flexibility, supporting multiple protocols and authentication methods. However, it is vulnerable to a specific issue in its RSA implementation, which could allow attackers to forge signatures under certain conditions.

Vulnerability Detail

The vulnerability arises from the verify_emsa_pkcs1_signature() function in the gmp_rsa_public_key.c file within the GMP plugin of StrongSwan versions 4.x and 5.x prior to 5.7.0. The RSA implementation does not adequately reject excess data following the encoded algorithm OID during PKCS#1 v1.5 signature verification. This flaw can be exploited by remote attackers using small public exponents to forge signatures, potentially leading to impersonation during IKEv2 authentication. The CVSS score for this vulnerability is 7.5, indicating a high severity level.

How To Fix

Minimum fixed version

5.7.0-r0

This is the first release that contains the fix.

sudo apk add --upgrade strongswan

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, consider using larger public exponents for RSA keys to mitigate the risk of signature forgery until the package can be updated.

Conclusion

The vulnerability in StrongSwan poses a significant risk due to its potential for allowing signature forgery. It is crucial for users to update to the patched version to safeguard against possible impersonation attacks. Utilizing tools like Vulert can further enhance security by monitoring for vulnerabilities in real-time.

See every vulnerability recorded for strongswan →

Share this vulnerability

FAQ

The vulnerability allows attackers to forge RSA signatures due to improper handling of excess data during signature verification.

Check your StrongSwan version against the patched version (5.7.0 or later). If you are using an earlier version, you are at risk.

Exploitation could lead to impersonation attacks, allowing unauthorized access to secure communications.

Yes, you can use Vulert, which monitors open-source vulnerabilities in real-time using a manifest file like package-lock.json.

You can use the Vulert playground at Vulert Scanner to check for vulnerabilities in your application without any signup.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

5.7.0-r0

This is the first release that contains the fix.

sudo apk add --upgrade strongswan

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback