{"answers":{"affected":"6 open source packages ship an affected version, including commonground-api-common, vng-api-common and vng-api-common-utrecht.","exploited":"There is no known exploitation of GHSA-c4cm-r9fh-jgj9 in the wild and no public exploit code.","fix":"No fix has been published for GHSA-c4cm-r9fh-jgj9 yet. Limit exposure of the affected software until one is available.","what":"GHSA-c4cm-r9fh-jgj9 is a vulnerability in commonground-api-common, published on 9 Feb 2024."},"fix_prompt":"Check this codebase for GHSA-c4cm-r9fh-jgj9 and fix it if it is affected.\n\nWhat it is: GHSA-c4cm-r9fh-jgj9 is a vulnerability in commonground-api-common, published on 9 Feb 2024. \nExploitation: There is no known exploitation of GHSA-c4cm-r9fh-jgj9 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- commonground-api-common (PyPI): affected all versions up to 1.12.1; no fix listed\n- commonground-api-common (PyPI): affected all versions up to 1.12.1; no fix listed\n- vng-api-common (PyPI): affected all versions up to 2.0.5; no fix listed\n- vng-api-common (PyPI): affected all versions up to 2.0.5; no fix listed\n- vng-api-common-utrecht (PyPI): affected all versions up to 1.3.2; no fix listed\n- vng-api-common-utrecht (PyPI): affected all versions up to 1.3.2; 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-c4cm-r9fh-jgj9/ (Markdown: https://insights.sbomify.com/GHSA-c4cm-r9fh-jgj9/index.md)","id":"GHSA-c4cm-r9fh-jgj9","markdown":"https://insights.sbomify.com/GHSA-c4cm-r9fh-jgj9/index.md","name":"GHSA-c4cm-r9fh-jgj9","record":{"aliases":[],"analysis":null,"analysis_generated_by":null,"assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Impact\n\nThis is a privilege escalation vulnerability. The impact is negligible and entirely theoretical.\n\nA non-exploitable weakness was found in how the client-supplied JWTs are verified. Because an explicit allow-list\nof known algorithms is used in the PyJWT library, user-supplied (invalid) algorithms are rejected.\n\nIf this was not the case, then the client JWTs could be tampered with, resulting in privilege escalation which\nwould allow the attacker to perform any operation as any client (impersonation) without leaving a trace of\nthe real user/client.\n\n### Patches\n\nWill be fixed in 1.12.2\n\n### Workarounds\n\nNone needed. But be careful when updating PyJWT. Check that the used PyJWT has no algorithms specified with a name in \"\", \"HS25\", \"HS2\", \"HS\", \"H\", or that those algorithms are acceptable.\n\n### Details\n\nThe header and payload of JSON Web Tokens (JWTs) are cryptographically signed with an algorithm. A JWT has a header field `alg` that specifies the algorithm used in the signature.\n\nThe `vng-api-common.middleware.AuthMiddleware` uses PyJWT to check the validity of JWT and indicates it should be \"HS256\", otherwise an attacker could construct a token with a cryptographically weak token. It should indicate this with a list of acceptable algorithms  `[\"HS256\"]`, but instead the string `\"HS256\"` is passed to PyJWT.  PyJWT does not check the type of the argument and checks if the `alg` string in the header exists in the acceptable algorithms value with the `in` operator. Any substring of `\"HS256\"` passes this `in` check. It is not exploitable because there is no such substring in de set of algorithms PyJWT supports.","ecosystems":["PyPI"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":false,"headline":"commonground-api-common unexploitable privilege escalation in JWT authentication middleware","id":"GHSA-c4cm-r9fh-jgj9","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"PyPI","product":null,"products":[],"type":null,"year":"2024"},"n_packages":6,"n_references":null,"packages":[{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["1.12.1"],"package":"commonground-api-common","purl":null,"source":"GHSA-c4cm-r9fh-jgj9"},{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["1.12.1"],"package":"commonground-api-common","purl":"pkg:pypi/commonground-api-common","source":"GHSA-c4cm-r9fh-jgj9"},{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["2.0.5"],"package":"vng-api-common","purl":null,"source":"GHSA-c4cm-r9fh-jgj9"},{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["2.0.5"],"package":"vng-api-common","purl":"pkg:pypi/vng-api-common","source":"GHSA-c4cm-r9fh-jgj9"},{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["1.3.2"],"package":"vng-api-common-utrecht","purl":null,"source":"GHSA-c4cm-r9fh-jgj9"},{"ecosystem":"PyPI","fixed":[],"introduced":["0"],"last_affected":["1.3.2"],"package":"vng-api-common-utrecht","purl":"pkg:pypi/vng-api-common-utrecht","source":"GHSA-c4cm-r9fh-jgj9"}],"products":null,"published":"2024-02-09","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":null,"url":"https://insights.sbomify.com/GHSA-c4cm-r9fh-jgj9/"}