CVE-2023-48703: RobotsAndPencils go-saml Authentication Bypass Vulnerability

Summary

05/08/2024
No i
High
7.5

CVE-2023-48703: RobotsAndPencils go-saml authentication bypass vulnerability. Affects github.com/RobotsAndPencils/go-saml versions < 0.0.0-20230606195814-29020529affc. No fix is published. 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

RobotsAndPencils go-saml is a SAML client library written in Go. It provides functionality for SAML authentication and assertion verification. The library is widely used in projects that require SAML support. However, all known versions of go-saml are vulnerable to an authentication bypass vulnerability.

Vulnerability Detail

The vulnerability in go-saml is due to the insecure usage of the xmlsec1 command line tool for verifying the signature of SAML assertions. When xmlsec1 is called without defining the enabled key data, the origin of the public key used for signature verification is not restricted. This allows an attacker to sign SAML assertions themselves and provide a malicious public key embedded in the SAML token. As a result, the attacker can bypass the authentication process and gain unauthorized access to the system. The impact of this vulnerability can be significant, as it compromises the integrity and security of SAML-based authentication.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

A possible workaround for this vulnerability is to modify the go-saml library by adding the --enabled-key-data command line argument when calling the xmlsec1 binary in the verify function. Here is an example of how the code can be modified:

def verifySignature(xml string) bool {
    // Add the --enabled-key-data argument
    cmd := exec.Command("xmlsec1", "--enabled-key-data", "x509", "--verify", "--pubkey-cert-pem", "public_key.pem")
    cmd.Stdin = strings.NewReader(xml)
    output, err := cmd.CombinedOutput()
    if err != nil {
        log.Fatal(err)
    }
    // Process the output and return the verification result
}

Please note that this workaround should be carefully implemented and tested.

Conclusion

The RobotsAndPencils go-saml library is vulnerable to an authentication bypass issue, allowing attackers to bypass SAML authentication and gain unauthorized access. It is recommended to migrate to another SAML library or apply the provided workaround to mitigate this vulnerability.

See every vulnerability recorded for github.com/RobotsAndPencils/go-saml →

Share this vulnerability

FAQ

go-saml is a SAML client library written in Go. It provides functionality for SAML authentication and assertion verification.

The vulnerability allows an attacker to bypass SAML authentication and gain unauthorized access to the system.

To fix this vulnerability, it is recommended to migrate to another SAML library or apply the provided workaround.

Yes, a temporary fix is available by modifying the go-saml library as described in the workaround section.

Yes, all known versions of go-saml are affected by this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/RobotsAndPencils/go-saml.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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