From 61dbad5b9af07315dee8b5534cb7eca847afc121 Mon Sep 17 00:00:00 2001 From: "advisory-database[bot]" <45398580+advisory-database[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:23:34 +0000 Subject: [PATCH] Publish GHSA-hf59-7rwq-785m --- .../GHSA-hf59-7rwq-785m.json | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 advisories/github-reviewed/2024/10/GHSA-hf59-7rwq-785m/GHSA-hf59-7rwq-785m.json diff --git a/advisories/github-reviewed/2024/10/GHSA-hf59-7rwq-785m/GHSA-hf59-7rwq-785m.json b/advisories/github-reviewed/2024/10/GHSA-hf59-7rwq-785m/GHSA-hf59-7rwq-785m.json new file mode 100644 index 00000000000..3a088c596e7 --- /dev/null +++ b/advisories/github-reviewed/2024/10/GHSA-hf59-7rwq-785m/GHSA-hf59-7rwq-785m.json @@ -0,0 +1,69 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-hf59-7rwq-785m", + "modified": "2024-10-23T17:22:30Z", + "published": "2024-10-23T17:22:30Z", + "aliases": [ + "CVE-2024-49756" + ], + "summary": "In AshPostgres, empty, atomic, non-bulk actions, policy bypass for side-effects vulnerability.", + "details": "### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nIn certain *very specific* situations, it was possible for the policies of an update action to be skipped. This occurred only on \"empty\" update actions (no changing fields), and would allow their hooks (side effects) to be performed when they should not have been. Note that this does not allow reading new data that the user should not have had access to, only triggering a side effect a user should not have been able to trigger.\n\nYou must have an update action that:\n\n- Is on a resource with no attributes containing an \"update default\" (updated_at timestamp, for example)\n- can be performed atomically. \n- Does *not* have `require_atomic? false`\n- Has at least one authorizer (typically `Ash.Policy.Authorizer`)\n- Has at least one `change` (on the resource's `changes` block or in the action itself)\n This is where the side-effects would be performed when they should not have been.\n\n--- \n\n- Is there ever a place where you call this action manually, using `Ash.update`. \n Note that AshGraphql and AshJsonApi action calls are *not* affected as they use `Ash.bulk_update`. \n- If so, is there ever a case where you call the action with zero inputs, and have it produce zero changing fields.\n- If so, could it then produce a side effect. This means you'd have an after_action hook that calls some other resource.\n- If so, does that side effect bypass another resource's policies, i.e using `authorize?: false`, or not providing the same actor.\n\n\nEverything above the line can be checked with the provided script. Everything below it, must be checked manually. The script for checking this is available in the \"Might I be affected\" section. \n\n**The script can have false *positives*, but will not have any false *negatives*. So if you run the script, and it says \"No potential vulnerabilities found\", then all you need to do is update ash_postgres.** \n\n\n### Patches\nThis problem has been patched in `2.4.10` of `ash_postgres`.\n\n### Workarounds\n\nYou could:\n\n1. Determine that none of your actions are vulnerable using the script.\n2. Add `require_atomic? false` to any potentially affected update action\n3. Replace any usage of `Ash.update` with `Ash.bulk_update` for an affected action\n4. add an update timestamp to your action.\n\n### Might I be affected\n\nThis gist provides a script you can run to detect if you are potentially vulnerable.\n\nhttps://gist.github.com/zachdaniel/e49166b765978c48dfaf998d06df436e\n\n### References\n\nOriginal Report/discovery: https://elixirforum.com/t/empty-update-action-with-policies/66954\nFix commit: https://github.com/ash-project/ash_postgres/commit/1228fcd851f29a68609e236f7d6a2622a4b5c4ba\n", + "severity": [ + { + "type": "CVSS_V3", + "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N" + } + ], + "affected": [ + { + "package": { + "ecosystem": "Hex", + "name": "ash_postgres" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "2.0.0" + }, + { + "fixed": "2.4.10" + } + ] + } + ] + } + ], + "references": [ + { + "type": "WEB", + "url": "https://github.com/ash-project/ash_postgres/security/advisories/GHSA-hf59-7rwq-785m" + }, + { + "type": "WEB", + "url": "https://github.com/ash-project/ash_postgres/commit/1228fcd851f29a68609e236f7d6a2622a4b5c4ba" + }, + { + "type": "WEB", + "url": "https://elixirforum.com/t/empty-update-action-with-policies/66954" + }, + { + "type": "WEB", + "url": "https://gist.github.com/zachdaniel/e49166b765978c48dfaf998d06df436e" + }, + { + "type": "PACKAGE", + "url": "https://github.com/ash-project/ash_postgres" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-552" + ], + "severity": "MODERATE", + "github_reviewed": true, + "github_reviewed_at": "2024-10-23T17:22:30Z", + "nvd_published_at": null + } +} \ No newline at end of file