CVE-2024-49756: Ash postgres Security Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-hf59-7rwq-785m
CVSS 5.3
CWE-552
Published
Advisory Summary

CVE-2024-49756 is a MODERATE (CVSS 5.3) security vulnerability vulnerability (CWE-552: Files or Directories Accessible to External Parties) affecting Ash postgres libraries in the Hex ecosystem. The issue involves in ashpostgres, empty, atomic, non-bulk actions, policy bypass for side-effects vulnerability.. Remediation is available by upgrading affected packages to version 2.4.10.

CVE-2024-49756 at a Glance

CVE Identifier CVE-2024-49756
GHSA Identifier GHSA-hf59-7rwq-785m
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-552: Files or Directories Accessible to External Parties
Affected Product Ash postgres
Package Ecosystem Hex
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-49756

To remediate this vulnerability, upgrade all affected Ash postgres dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ash_postgres fixed: 2.4.10
Upgrade ash_postgres to 2.4.10
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for ash_postgres

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-49756, inspect your project dependencies for Ash postgres:

inspect dependencies for ash_postgres

Analyze the terminal output to locate any version of Ash postgres in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.10), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-552: Files or Directories Accessible to External Parties, where the product makes files or directories accessible to unauthorized actors, even though they should not be. In Ash postgres, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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's `changes` block 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 use `Ash.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: 1. Determine that none of your actions are vulnerable using the script. 2. Add `require_atomic? false` to any potentially affected update action 3. Replace any usage of `Ash.update` with `Ash.bulk_update` for an affected action 4. 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

CVE-2024-49756 Affected Ash postgres Versions

1 component(s)
Fixed Versions:
2.4.10
Product / Package Ecosystem Affected Versions Fixed Version
ash_postgres
Hex
≥ 2.0.0
< 2.4.10
2.4.10

References

Frequently Asked Questions

What is CVE-2024-49756?
CVE-2024-49756 is a security vulnerability in Ash postgres involving In AshPostgres, empty, atomic, non-bulk actions, policy bypass for side-effects vulnerability. under CWE-552: Files or Directories Accessible to External Parties.
Which Ash postgres versions are affected?
Affected versions include releases prior to 2.4.10 across affected packages: ash_postgres.
What version fixes CVE-2024-49756?
Upgrading to 2.4.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ash_postgres affected?
Yes, ash_postgres is affected in releases prior to 2.4.10. Upgrade your dependency to 2.4.10 or later.
What is the CVSS score of CVE-2024-49756?
CVE-2024-49756 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2024-49756?
CVE-2024-49756 is classified under CWE-552: Files or Directories Accessible to External Parties (The product makes files or directories accessible to unauthorized actors, even though they should not be.).
How can I check Hex dependencies for CVE-2024-49756?
Run the dependency tree command: 'inspect dependencies for ash_postgres'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hf59-7rwq-785m",
  "modified" : "2025-04-14T22:10:39Z",
  "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",
  "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" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-49756"
  }, {
    "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" : "2024-10-23T17:15:19Z"
  }
}