Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-3cjh-p6pw-jhv9

Опубликовано: 19 сент. 2023
Источник: github
Github: Прошло ревью
CVSS3: 6.5

Описание

Pow Mnesia cache doesn't invalidate all expired keys on startup

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

Пакеты

Наименование

pow

Затронутые версииВерсия исправления

>= 1.0.14, < 1.0.34

1.0.34

EPSS

Процентиль: 34%
0.00134
Низкий

6.5 Medium

CVSS3

Дефекты

CWE-298
CWE-672

Связанные уязвимости

CVSS3: 6.5
nvd
больше 2 лет назад

Pow is a authentication and user management solution for Phoenix and Plug-based apps. Starting in version 1.0.14 and prior to version 1.0.34, use of `Pow.Store.Backend.MnesiaCache` is susceptible to session hijacking as expired keys are not being invalidated correctly on startup. A session may expire when all `Pow.Store.Backend.MnesiaCache` instances have been shut down for a period that is longer than a session's remaining TTL. Version 1.0.34 contains a patch for this issue. As a workaround, expired keys, including all expired sessions, can be manually invalidated.

EPSS

Процентиль: 34%
0.00134
Низкий

6.5 Medium

CVSS3

Дефекты

CWE-298
CWE-672