CVE-2023-42446: Pow Pow Mnesia Cache Doesn't Invalidate Vulnerability
MODERATECVE-2023-42446 is a MODERATE (CVSS 6.5) pow mnesia cache doesn't invalidate vulnerability (CWE-672: Operation on a Resource after Expiration or Release) affecting Pow libraries in the Hex ecosystem. The issue involves pow mnesia cache doesn't invalidate all expired keys on startup. Remediation is available by upgrading affected packages to version 1.0.34.
CVE-2023-42446 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2023-42446
To remediate this vulnerability, upgrade all affected Pow dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade pow to 1.0.34
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for pow
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-42446, inspect your project dependencies for Pow:
inspect dependencies for pow
Analyze the terminal output to locate any version of Pow in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.34), 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-672: Operation on a Resource after Expiration or Release, where the product uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked. In Pow, 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
CVE-2023-42446 Affected Pow Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pow
|
Hex |
≥ 1.0.14
< 1.0.34
|
1.0.34
|
References
Frequently Asked Questions
What is CVE-2023-42446?
Which Pow versions are affected?
What version fixes CVE-2023-42446?
Is pow affected?
What is the CVSS score of CVE-2023-42446?
What CWE is associated with CVE-2023-42446?
How can I check Hex dependencies for CVE-2023-42446?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3cjh-p6pw-jhv9",
"modified" : "2023-09-19T17:00:08Z",
"published" : "2023-09-19T17:00:08Z",
"aliases" : [ "CVE-2023-42446" ],
"summary" : "Pow Mnesia cache doesn't invalidate all expired keys on startup",
"details" : "Use of `Pow.Store.Backend.MnesiaCache` is susceptible to session hijacking as expired keys are not being invalidated correctly on startup. A cache key may become expired when all `Pow.Store.Backend.MnesiaCache` instances have been shut down for a period that is longer than the keys' remaining TTL and the expired key won't be invalidated on startups.\n\n### Workarounds\n\nThe expired keys, including all expired sessions, can be manually invalidated by running:\n\n```elixir\n:mnesia.sync_transaction(fn ->\n Enum.each(:mnesia.dirty_select(Pow.Store.Backend.MnesiaCache, [{{Pow.Store.Backend.MnesiaCache, :_, :_}, [], [:\"$_\"]}]), fn {_, key, {_value, expire}} ->\n ttl = expire - :os.system_time(:millisecond)\n if ttl < 0, do: :mnesia.delete({Pow.Store.Backend.MnesiaCache, key})\n end)\nend)\n```\n\n### References\nhttps://github.com/pow-auth/pow/commit/15dc525be03c466daa5d2119ca7acdec7b24ed17\nhttps://github.com/pow-auth/pow/issues/713\nhttps://github.com/pow-auth/pow/pull/714\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Hex",
"name" : "pow"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.14"
}, {
"fixed" : "1.0.34"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pow-auth/pow/security/advisories/GHSA-3cjh-p6pw-jhv9"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-42446"
}, {
"type" : "WEB",
"url" : "https://github.com/pow-auth/pow/issues/713"
}, {
"type" : "WEB",
"url" : "https://github.com/pow-auth/pow/pull/714"
}, {
"type" : "WEB",
"url" : "https://github.com/pow-auth/pow/commit/15dc525be03c466daa5d2119ca7acdec7b24ed17"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pow-auth/pow"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-298", "CWE-672" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-09-19T17:00:08Z",
"nvd_published_at" : "2023-09-18T22:15:47Z"
}
}