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:
require_atomic? false
Ash.Policy.Authorizer
)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.Ash.update
.
Note that AshGraphql and AshJsonApi action calls are not affected as they use Ash.bulk_update
. 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.
This problem has been patched in 2.4.10
of ash_postgres
.
You could:
require_atomic? false
to any potentially affected update actionAsh.update
with Ash.bulk_update
for an affected actionThis gist provides a script you can run to detect if you are potentially vulnerable.
https://gist.github.com/zachdaniel/e49166b765978c48dfaf998d06df436e
Original Report/discovery: https://elixirforum.com/t/empty-update-action-with-policies/66954 Fix commit: https://github.com/ash-project/ash_postgres/commit/1228fcd851f29a68609e236f7d6a2622a4b5c4ba