CVE-2024-41657: Github.com/casdoor/casdoor Casdoor CORS Misconfiguration (GHSL-2024-035) Vulnerability

HIGH
Advisory Identifier: GHSA-mchx-7j67-8mcf
CVSS 8.1
CWE-942
Published
Advisory Summary

CVE-2024-41657 is a HIGH (CVSS 8.1) casdoor cors misconfiguration (ghsl-2024-035) vulnerability (CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains) affecting Github.com/casdoor/casdoor libraries in the Go ecosystem. The issue involves casdoor cors misconfiguration (ghsl-2024-035). Remediation is available in the latest vendor maintenance releases.

CVE-2024-41657 at a Glance

CVE Identifier CVE-2024-41657
GHSA Identifier GHSA-mchx-7j67-8mcf
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains
Affected Product Github.com/casdoor/casdoor
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.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:U/C:H/I:H/A:N).

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

How to Fix CVE-2024-41657

To remediate this vulnerability, upgrade all affected Github.com/casdoor/casdoor 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/casdoor/casdoor fixed: Latest secure release
Upgrade github.com/casdoor/casdoor to Latest secure release
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/casdoor/casdoor

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-41657, inspect your project dependencies for Github.com/casdoor/casdoor:

inspect dependencies for github.com/casdoor/casdoor

Analyze the terminal output to locate any version of Github.com/casdoor/casdoor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), 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-942: Permissive Cross-domain Security Policy with Untrusted Domains, where the product uses a web-client protection mechanism such as a content security policy (csp) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate. In Github.com/casdoor/casdoor, 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

Casdoor is a UI-first Identity and Access Management (IAM) / Single-Sign-On (SSO) platform. In Casdoor 1.577.0 and earlier, a logic vulnerability exists in the beego filter CorsFilter that allows any website to make cross domain requests to Casdoor as the logged in user. Due to the a logic error in checking only for a prefix when authenticating the Origin header, any domain can create a valid subdomain with a valid subdomain prefix (Ex: localhost.example.com), allowing the website to make requests to Casdoor as the current signed-in user.

CVE-2024-41657 Affected Github.com/casdoor/casdoor Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
github.com/casdoor/casdoor
Go
≤ 1.557.0

References

Frequently Asked Questions

What is CVE-2024-41657?
CVE-2024-41657 is a security vulnerability in Github.com/casdoor/casdoor involving Casdoor CORS misconfiguration (GHSL-2024-035) under CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains.
Which Github.com/casdoor/casdoor versions are affected?
Affected versions include releases prior to current release patches across affected packages: github.com/casdoor/casdoor.
What version fixes CVE-2024-41657?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/casdoor/casdoor affected?
Yes, github.com/casdoor/casdoor is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-41657?
CVE-2024-41657 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2024-41657?
CVE-2024-41657 is classified under CWE-942: Permissive Cross-domain Security Policy with Untrusted Domains (The product uses a web-client protection mechanism such as a Content Security Policy (CSP) or cross-domain policy file, but the policy includes untrusted domains with which the web client is allowed to communicate.).
How can I check Go dependencies for CVE-2024-41657?
Run the dependency tree command: 'inspect dependencies for github.com/casdoor/casdoor'. 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-mchx-7j67-8mcf",
  "modified" : "2024-08-22T17:16:39Z",
  "published" : "2024-08-22T17:16:39Z",
  "aliases" : [ "CVE-2024-41657" ],
  "summary" : "Casdoor CORS misconfiguration (GHSL-2024-035)",
  "details" : "Casdoor is a UI-first Identity and Access Management (IAM) / Single-Sign-On (SSO) platform. In Casdoor 1.577.0 and earlier, a logic vulnerability exists in the beego filter CorsFilter that allows any website to make cross domain requests to Casdoor as the logged in user. Due to the a logic error in checking only for a prefix when authenticating the Origin header, any domain can create a valid subdomain with a valid subdomain prefix (Ex: localhost.example.com), allowing the website to make requests to Casdoor as the current signed-in user.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/casdoor/casdoor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.557.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-41657"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/casdoor/casdoor"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/casdoor/casdoor/blob/v1.577.0/routers/cors_filter.go#L45"
  }, {
    "type" : "ADVISORY",
    "url" : "https://securitylab.github.com/advisories/GHSL-2024-035_GHSL-2024-036_casdoor"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-942" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-08-22T17:16:39Z",
    "nvd_published_at" : "2024-08-20T21:15:13Z"
  }
}