GHSA-hf59-7rwq-785m
MEDIUMIn AshPostgres, empty, atomic, non-bulk actions, policy bypass for side-effects vulnerability.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Blast Radius
ash_postgresReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Hex packages — download data is not available via public APIs for these ecosystems.
Description
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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💧Hex | ash_postgres | ≥ 2.0.0&&< 2.4.10 | 2.4.10 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for ash_postgres. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update ash_postgres to 2.4.10 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-hf59-7rwq-785m is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-hf59-7rwq-785m is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-hf59-7rwq-785m. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-hf59-7rwq-785m in your dependencies?
O3 detects GHSA-hf59-7rwq-785m across Hex dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.