CVE-2023-45683: Github.com/crewjam/saml Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-267v-3v32-g6q5
CVSS 7.1
CWE-79
Published
Advisory Summary

CVE-2023-45683 is a HIGH (CVSS 7.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Github.com/crewjam/saml libraries in the Go ecosystem. The issue involves cross-site scripting via missing binding syntax validation. Remediation is available by upgrading affected packages to version 0.4.14.

CVE-2023-45683 at a Glance

CVE Identifier CVE-2023-45683
GHSA Identifier GHSA-267v-3v32-g6q5
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Github.com/crewjam/saml
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2023-45683

To remediate this vulnerability, upgrade all affected Github.com/crewjam/saml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/crewjam/saml fixed: 0.4.14
Upgrade github.com/crewjam/saml to 0.4.14
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/crewjam/saml

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-45683, inspect your project dependencies for Github.com/crewjam/saml:

inspect dependencies for github.com/crewjam/saml

Analyze the terminal output to locate any version of Github.com/crewjam/saml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.14), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Github.com/crewjam/saml, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact The package does not validate the ACS Location URI according to the SAML binding being parsed. If abused, this flaw allows attackers to register malicious Service Providers at the IdP and inject Javascript in the ACS endpoint definition, achieving Cross-Site-Scripting (XSS) in the IdP context during the redirection at the end of a SAML SSO Flow. Consequently, an attacker may perform any authenticated action as the victim once the victim’s browser loaded the SAML IdP initiated SSO link for the malicious service provider. Note: The severity is considered “High” because the SP registration is commonly an unrestricted operation in IdPs, hence not requiring particular permissions or publicly accessible to ease the IdP interoperability. ### Patches This issue is fixed in 0.4.14 ### Workarounds Users of the package can perform external validation of URLs provided in SAML metadata, or restrict the ability for end-users to upload arbitrary metadata. ### References This issue was reported by Francesco Lacerenza from Doyensec.

CVE-2023-45683 Affected Github.com/crewjam/saml Versions

1 component(s)
Fixed Versions:
0.4.14
Product / Package Ecosystem Affected Versions Fixed Version
github.com/crewjam/saml
Go
< 0.4.14
0.4.14

References

Frequently Asked Questions

What is CVE-2023-45683?
CVE-2023-45683 is a security vulnerability in Github.com/crewjam/saml involving Cross-site Scripting via missing Binding syntax validation under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Github.com/crewjam/saml versions are affected?
Affected versions include releases prior to 0.4.14 across affected packages: github.com/crewjam/saml.
What version fixes CVE-2023-45683?
Upgrading to 0.4.14 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/crewjam/saml affected?
Yes, github.com/crewjam/saml is affected in releases prior to 0.4.14. Upgrade your dependency to 0.4.14 or later.
What is the CVSS score of CVE-2023-45683?
CVE-2023-45683 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L.
What CWE is associated with CVE-2023-45683?
CVE-2023-45683 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Go dependencies for CVE-2023-45683?
Run the dependency tree command: 'inspect dependencies for github.com/crewjam/saml'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-267v-3v32-g6q5",
  "modified" : "2023-10-24T18:32:14Z",
  "published" : "2023-10-17T14:20:59Z",
  "aliases" : [ "CVE-2023-45683" ],
  "summary" : "Cross-site Scripting via missing Binding syntax validation",
  "details" : "### Impact\n\nThe package does not validate the ACS Location URI according to the SAML binding being parsed.\n\nIf abused, this flaw allows attackers to register malicious Service Providers at the IdP and inject Javascript in the ACS endpoint definition, achieving Cross-Site-Scripting (XSS) in the IdP context during the redirection at the end of a SAML SSO Flow.\n\nConsequently, an attacker may perform any authenticated action as the victim once the victim’s browser loaded the SAML IdP initiated SSO link for the malicious service provider.\n\nNote: The severity is considered “High” because the SP registration is commonly an unrestricted operation in IdPs, hence not requiring particular permissions or publicly accessible to ease the IdP interoperability.\n\n### Patches\n\nThis issue is fixed in 0.4.14\n\n### Workarounds\n\nUsers of the package can perform external validation of URLs provided in SAML metadata, or restrict the ability for end-users to upload arbitrary metadata. \n\n### References\n\nThis issue was reported by Francesco Lacerenza from Doyensec.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/crewjam/saml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.14"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/crewjam/saml/security/advisories/GHSA-267v-3v32-g6q5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-45683"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/crewjam/saml/commit/b07b16cf83c4171d16da4d85608cb827f183cd79"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/crewjam/saml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-10-17T14:20:59Z",
    "nvd_published_at" : "2023-10-16T19:15:11Z"
  }
}