GHSA-3CJH-P6PW-JHV9
Vulnerability from github – Published: 2023-09-19 17:00 – Updated: 2023-09-19 17:00
VLAI?
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.
Workarounds
The expired keys, including all expired sessions, can be manually invalidated by running:
:mnesia.sync_transaction(fn ->
Enum.each(:mnesia.dirty_select(Pow.Store.Backend.MnesiaCache, [{{Pow.Store.Backend.MnesiaCache, :_, :_}, [], [:"$_"]}]), fn {_, key, {_value, expire}} ->
ttl = expire - :os.system_time(:millisecond)
if ttl < 0, do: :mnesia.delete({Pow.Store.Backend.MnesiaCache, key})
end)
end)
References
https://github.com/pow-auth/pow/commit/15dc525be03c466daa5d2119ca7acdec7b24ed17 https://github.com/pow-auth/pow/issues/713 https://github.com/pow-auth/pow/pull/714
Severity ?
6.5 (Medium)
{
"affected": [
{
"package": {
"ecosystem": "Hex",
"name": "pow"
},
"ranges": [
{
"events": [
{
"introduced": "1.0.14"
},
{
"fixed": "1.0.34"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-42446"
],
"database_specific": {
"cwe_ids": [
"CWE-298",
"CWE-672"
],
"github_reviewed": true,
"github_reviewed_at": "2023-09-19T17:00:08Z",
"nvd_published_at": "2023-09-18T22:15:47Z",
"severity": "MODERATE"
},
"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\u0027 remaining TTL and the expired key won\u0027t 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 -\u003e\n Enum.each(:mnesia.dirty_select(Pow.Store.Backend.MnesiaCache, [{{Pow.Store.Backend.MnesiaCache, :_, :_}, [], [:\"$_\"]}]), fn {_, key, {_value, expire}} -\u003e\n ttl = expire - :os.system_time(:millisecond)\n if ttl \u003c 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",
"id": "GHSA-3cjh-p6pw-jhv9",
"modified": "2023-09-19T17:00:08Z",
"published": "2023-09-19T17:00:08Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "Pow Mnesia cache doesn\u0027t invalidate all expired keys on startup"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…