5.3medium
AshPostgres empty, atomic, non-bulk actions, policy bypass for side-effects vulnerability.
- Severity
- 5.3medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.51% (higher than 45% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-hf59-7rwq-785m
Description
AshPostgres is the PostgreSQL data layer for Ash Framework. Starting in version 2.0.0 and prior to version 2.4.10, in 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. To be vulnerable, an affected user must have an update action that is on a resource with no attributes containing an "update default" (updated_at timestamp, for example); can be performed atomically; does not have `require_atomic? false`; has at least one authorizer (typically `Ash.Policy.Authorizer`); and has at least one `change` (on the resource's `changes` block or in the action itself). This is where the side-effects would be performed when they should not have been. This problem has been patched in `2.4.10` of `ash_postgres`. Several workarounds are available. Potentially affected users may determine that none of their actions are vulnerable using a script the maintainers provide in the GitHub Security Advisory, add `require_atomic? false` to any potentially affected update action, replace any usage of `Ash.update` with `Ash.bulk_update` for an affected action, and/or add an update timestamp to their action.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| ash-project ash_postgres | >= 2.0.0, < 2.4.10 | CVE List |
| ash_framework ashpostgres | up to 2.0.0, before 2.4.10 | CVE List |
| ash_postgres (Hex) | from 2.0.0 before 2.4.10 | GitHub Advisory Database |
All scores
| GitHub_M | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| GitHub | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
AshPostgres is the PostgreSQL data layer for Ash Framework. Starting in version 2.0.0 and prior to version 2.4.10, in 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. To be vulnerable, an affected user must have an update action that is on a resource with no attributes containing an "update default" (updated_at timestamp, for example); can be performed atomically; does not have `require_atomic? false`; has at least one authorizer (typically `Ash.Policy.Authorizer`); and has at least one `change` (on the resource's `changes` block or in the action itself). This is where the side-effects would be performed when they should not have been. This problem has been patched in `2.4.10` of `ash_postgres`. Several workarounds are available. Potentially affected users may determine that none of their actions are vulnerable using a script the maintainers provide in the GitHub Security Advisory, add `require_atomic? false` to any potentially affected update action, replace any usage of `Ash.update` with `Ash.bulk_update` for an affected action, and/or add an update timestamp to their action.
GitHub Advisory Database
Impact
What kind of vulnerability is it? Who is impacted?
In 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.
You must have an update action that:
- Is on a resource with no attributes containing an "update default" (updated_at timestamp, for example)
- can be performed atomically.
- Does not have
require_atomic? false - Has at least one authorizer (typically
Ash.Policy.Authorizer) - Has at least one
change(on the resource'schangesblock or in the action itself) This is where the side-effects would be performed when they should not have been.
- Is there ever a place where you call this action manually, using
Ash.update. Note that AshGraphql and AshJsonApi action calls are not affected as they useAsh.bulk_update. - If so, is there ever a case where you call the action with zero inputs, and have it produce zero changing fields.
- If so, could it then produce a side effect. This means you'd have an after_action hook that calls some other resource.
- If so, does that side effect bypass another resource's policies, i.e using
authorize?: false, or not providing the same actor.
Everything 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.
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.
Patches
This problem has been patched in 2.4.10 of ash_postgres.
Workarounds
You could:
- Determine that none of your actions are vulnerable using the script.
- Add
require_atomic? falseto any potentially affected update action - Replace any usage of
Ash.updatewithAsh.bulk_updatefor an affected action - add an update timestamp to your action.
Might I be affected
This gist provides a script you can run to detect if you are potentially vulnerable.
https://gist.github.com/zachdaniel/e49166b765978c48dfaf998d06df436e
References
Original Report/discovery: https://elixirforum.com/t/empty-update-action-with-policies/66954 Fix commit: https://github.com/ash-project/ash_postgres/commit/1228fcd851f29a68609e236f7d6a2622a4b5c4ba
NVD (es)
AshPostgres es la capa de datos PostgreSQL para Ash Framework. A partir de la versión 2.0.0 y antes de la versión 2.4.10, en ciertas situaciones muy específicas, era posible omitir las políticas de una acción de actualización. Esto solo ocurría en acciones de actualización "vacías" (sin campos de cambio) y permitía que se ejecutaran sus ganchos (efectos secundarios) cuando no deberían haberse realizado. Tenga en cuenta que esto no permite leer datos nuevos a los que el usuario no debería haber tenido acceso, solo activa un efecto secundario que un usuario no debería haber podido activar. Para ser vulnerable, un usuario afectado debe tener una acción de actualización que se encuentre en un recurso sin atributos que contengan un "valor predeterminado de actualización" (por ejemplo, marca de tiempo update_at); se puede realizar de forma atómica; no tiene `require_atomic? false`; tiene al menos un autorizador (normalmente `Ash.Policy.Authorizer`); y tiene al menos un `change` (en el bloque `changes` del recurso o en la acción misma). Aquí es donde se realizarían los efectos secundarios cuando no deberían haberse realizado. Este problema se ha corregido en `2.4.10` de `ash_postgres`. Hay varios workarounds disponibles. Los usuarios potencialmente afectados pueden determinar que ninguna de sus acciones es vulnerable utilizando un script que los fabricantes proporcionan en el Aviso de seguridad de GitHub, agregar `require_atomic? false` a cualquier acción de actualización potencialmente afectada, reemplazar cualquier uso de `Ash.update` con `Ash.bulk_update` para una acción afectada y/o agregar una marca de tiempo de actualización a su acción.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-49756 changed 2024-10-24 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-hf59-7rwq-785m changed 2025-12-10 | CC-BY-4.0 |
| NVD | CVE-2024-49756 changed 2026-06-17 | Public domain |