Vulnerabilities in pkg:pypi/hail

PACKAGE
Advisory Identifier: GHSA-487p-qx68-5vjw
Advisory Summary

CVE-2023-51663 is a MODERATE (CVSS 5.3) hail relies on oidc email vulnerability (CWE-289: Authentication Bypass by Alternate Name) affecting Hail libraries in the PyPI ecosystem. The issue involves hail relies on oidc email claims to verify the validity of a user's domain.. Remediation is available by upgrading affected packages to version 0.2.127.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/hail

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/hail. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-487p-qx68-5vjw CVE-2023-51663 MODERATE Hail relies on OIDC email claims to verify the validity of a user's domain.

CVE-2023-51663 at a Glance

CVE Identifier CVE-2023-51663
GHSA Identifier GHSA-487p-qx68-5vjw
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-289: Authentication Bypass by Alternate Name
Affected Product Hail
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:N/S:U/C:N/I:N/A:L).

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

How to Fix CVE-2023-51663

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

hail fixed: 0.2.127
pip install hail>=0.2.127
Verify Direct and Transitive Dependencies

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

pip show hail

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2023-51663, inspect your installed packages using pip:

pip show hail

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

Note: The pip show hail command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-289: Authentication Bypass by Alternate Name, where the product performs authentication based on the name of a resource being accessed, or the name of the actor performing the access, but it does not properly check all possible names for that resource or actor. In Hail, 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 All Hail Batch clusters are affected. An attacker is able to: 1. Create one or more accounts with Hail Batch without corresponding real accounts in the organization. For example, a user could create a Microsoft or Google account and then change their email to "inconspicuous@example.org". This Microsoft or Google account can then be used to create a Hail Batch account in Hail Batch clusters whose organization domain is "example.org". In Google, this attack is partially mitigated because Google requires users to verify ownership of their Google account. However, a valid user is able to create multiple distinct Hail Batch accounts by creating multiple distinct Google accounts using email addresses of the form "real_user_email_name+random_id@example.org". In Microsoft, this attack requires Azure AD Administrator access to an Azure AD Tenant. The Azure AD Administrator is permitted to change the email address of an account to any other email address without verification. An attacker can create an Azure Tenant for free. 1. The attacker *does not* have access to any private data (because the new service principals or service accounts are not granted any privileges). 3. If trial Hail Batch billing projects are enabled, the attacker *does* have the ability to run jobs and thus spend money. An attacker can create as many accounts as Microsoft or Google permit. 4. The attacker *cannot* impersonate another user because, in Azure, we use the `sub` from the OAuth2 response, and, in Google, Google does an email verification. ### Remediation 1. Apply this patch to prevent third-party attackers from creating accounts. 2. Audit your users list https://auth.example.org/users for user accounts whose login ids are not valid login ids with your identity provider. Delete such users. A forthcoming change will prevent users from creating multiple accounts using Google's `+` email redirection. ### Workarounds None. ### References 1. https://trufflesecurity.com/blog/google-oauth-is-broken-sort-of/ 2. https://www.descope.com/blog/post/noauth 4. https://developers.google.com/identity/openid-connect/openid-connect#an-id-tokens-payload 5. https://learn.microsoft.com/en-us/entra/identity-platform/access-token-claims-reference#payload-claims [1] Hail Batch must separately stop using emails and start using the OAuth2 `sub` in Google. This is a known deficiency. In particular, if an email is re-used by the organization for a new user, the new user could access the old user's Hail Batch account.

CVE-2023-51663 Affected Hail Versions

1 component(s)
Fixed Versions:
0.2.127
Product / Package Ecosystem Affected Versions Fixed Version
hail
PyPI
< 0.2.127
0.2.127

References

Frequently Asked Questions

What is CVE-2023-51663?
CVE-2023-51663 is a security vulnerability in Hail involving Hail relies on OIDC email claims to verify the validity of a user's domain. under CWE-289: Authentication Bypass by Alternate Name.
Which Hail versions are affected?
Affected versions include releases prior to 0.2.127 across affected packages: hail.
What version fixes CVE-2023-51663?
Upgrading to 0.2.127 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hail affected?
Yes, hail is affected in releases prior to 0.2.127. Upgrade your dependency to 0.2.127 or later.
What is the CVSS score of CVE-2023-51663?
CVE-2023-51663 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2023-51663?
CVE-2023-51663 is classified under CWE-289: Authentication Bypass by Alternate Name (The product performs authentication based on the name of a resource being accessed, or the name of the actor performing the access, but it does not properly check all possible names for that resource or actor.).
How can I check PyPI dependencies for CVE-2023-51663?
Run the dependency tree command: 'pip show hail'. 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-487p-qx68-5vjw",
  "modified" : "2024-11-22T17:59:30Z",
  "published" : "2024-01-02T16:40:58Z",
  "aliases" : [ "CVE-2023-51663" ],
  "summary" : "Hail relies on OIDC email claims to verify the validity of a user's domain.",
  "details" : "### Impact\n\nAll Hail Batch clusters are affected. An attacker is able to:\n\n1. Create one or more accounts with Hail Batch without corresponding real accounts in the organization.\n\nFor example, a user could create a Microsoft or Google account and then change their email to \"inconspicuous@example.org\". This Microsoft or Google account can then be used to create a Hail Batch account in Hail Batch clusters whose organization domain is \"example.org\".\n\nIn Google, this attack is partially mitigated because Google requires users to verify ownership of their Google account. However, a valid user is able to create multiple distinct Hail Batch accounts by creating multiple distinct Google accounts using email addresses of the form \"real_user_email_name+random_id@example.org\".\n\nIn Microsoft, this attack requires Azure AD Administrator access to an Azure AD Tenant. The Azure AD Administrator is permitted to change the email address of an account to any other email address without verification. An attacker can create an Azure Tenant for free.\n\n1. The attacker *does not* have access to any private data (because the new service principals or service accounts are not granted any privileges).\n3. If trial Hail Batch billing projects are enabled, the attacker *does* have the ability to run jobs and thus spend money. An attacker can create as many accounts as Microsoft or Google permit.\n4. The attacker *cannot* impersonate another user because, in Azure, we use the `sub` from the OAuth2 response, and, in Google, Google does an email verification.\n\n### Remediation\n\n1. Apply this patch to prevent third-party attackers from creating accounts.\n2. Audit your users list https://auth.example.org/users for user accounts whose login ids are not valid login ids with your identity provider. Delete such users.\n\nA forthcoming change will prevent users from creating multiple accounts using Google's `+` email redirection.\n\n### Workarounds\nNone.\n\n### References\n1. https://trufflesecurity.com/blog/google-oauth-is-broken-sort-of/\n2. https://www.descope.com/blog/post/noauth\n4. https://developers.google.com/identity/openid-connect/openid-connect#an-id-tokens-payload\n5. https://learn.microsoft.com/en-us/entra/identity-platform/access-token-claims-reference#payload-claims\n\n[1] Hail Batch must separately stop using emails and start using the OAuth2 `sub` in Google. This is a known deficiency. In particular, if an email is re-used by the organization for a new user, the new user could access the old user's Hail Batch account.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "hail"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.127"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/hail-is/hail/security/advisories/GHSA-487p-qx68-5vjw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-51663"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hail-is/hail/commit/0dcc17ff24564b6f5592261d7975e8afd0f95de7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hail-is/hail"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/hail/PYSEC-2023-271.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-289" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-02T16:40:58Z",
    "nvd_published_at" : "2023-12-29T17:16:07Z"
  }
}