{"answers":{"affected":"3 open source packages ship an affected version, including sharks.","exploited":"There is no known exploitation of GHSA-jp37-5qhw-mffw in the wild and no public exploit code.","fix":"No fix has been published for GHSA-jp37-5qhw-mffw yet. Limit exposure of the affected software until one is available.","what":"GHSA-jp37-5qhw-mffw is a vulnerability in sharks, published on 16 Nov 2024."},"fix_prompt":"Check this codebase for GHSA-jp37-5qhw-mffw and fix it if it is affected.\n\nWhat it is: GHSA-jp37-5qhw-mffw is a vulnerability in sharks, published on 16 Nov 2024. \nExploitation: There is no known exploitation of GHSA-jp37-5qhw-mffw in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- sharks (crates.io): affected all versions up to 0.5.0; no fix listed\n- sharks (crates.io): affected all versions up to 0.5.0; no fix listed\n- sharks (crates.io): affected from 0.0.0-0; no fix listed\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-jp37-5qhw-mffw/ (Markdown: https://insights.sbomify.com/GHSA-jp37-5qhw-mffw/index.md)","id":"GHSA-jp37-5qhw-mffw","markdown":"https://insights.sbomify.com/GHSA-jp37-5qhw-mffw/index.md","name":"GHSA-jp37-5qhw-mffw","record":{"aliases":["RUSTSEC-2024-0398"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"unknown","non_default_config":false,"product_category":"Rust secret sharing library","requires_auth":"none","summary":"A bias in polynomial coefficient generation allows attackers to recover shared secrets if the same secret is shared multiple times, compromising confidentiality.","user_interaction":"not_required","vuln_class":"weak_cryptography"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"Affected versions of this crate allowed for a bias when generating random polynomials for Shamir Secret Sharing, where instead of being within the range `[0, 255]` they were instead in the range `[1, 255]`. A description from Cure53, who originally found the issue, is available:\n\n\u003e The correct method to select a random polynomial would be to select all coefficients (including the most significant coefficient) uniformly in the range 0..255 (inclusive). Otherwise, knowledge that a coefficient in a polynomial cannot be 0 permits the exclusion of single byte values for the shared secret given one share less than required. [...] Exploiting this weakness necessitates sharing the same secret multiple times. In this scenario, an attacker could exclude an exponential number of values for each of the shared bytes until sufficiently few values remain for brute forcing.  Cure53 estimates that under ideal circumstances (e.g., a 2-out-of-N scheme) a shared secret can be reconstructed if the same secret has been distributed 500-1500 times.\n\nSecrets that have been shared a low amount of times (ideally, once) would not be impacted. However, secrets that are repeatedly shared may be vulnerable, especially if the shares are still available, and should be rotated.\n\nThe vulnerability does not impact reconstitution of secrets: secrets that have already been split can be recombined without issue.\n\nThe flaw can be corrected by changing the lower bound of the polynomial coefficient range in the `sharks::math::random_polynomial` function to `0`. The `blahaj` crate has been made available with a fixed version of the code, after attempts to reach the maintainer of the `sharks` crate were unsuccessful.","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":false,"headline":"Sharks has a Bias of Polynomial Coefficients in Secret Sharing","id":"GHSA-jp37-5qhw-mffw","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"weak_cryptography","year":"2024"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":[],"introduced":["0"],"last_affected":["0.5.0"],"package":"sharks","purl":null,"source":"GHSA-jp37-5qhw-mffw"},{"ecosystem":"crates.io","fixed":[],"introduced":["0"],"last_affected":["0.5.0"],"package":"sharks","purl":"pkg:cargo/sharks","source":"GHSA-jp37-5qhw-mffw"},{"ecosystem":"crates.io","fixed":[],"introduced":["0.0.0-0"],"last_affected":[],"package":"sharks","purl":"pkg:cargo/sharks","source":"RUSTSEC-2024-0398"}],"products":null,"published":"2024-11-16","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"A bias in polynomial coefficient generation allows attackers to recover shared secrets if the same secret is shared multiple times, compromising confidentiality.","url":"https://insights.sbomify.com/GHSA-jp37-5qhw-mffw/"}