GHSA-3hpf-ff72-j67p is a low-severity (CVSS 3) remote code execution vulnerability in shared_preferences_android. A fix is available for shared_preferences_android — see the affected versions and patch details below.
Real-World Exposure
shared_preferences_androidReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Pub packages — download data is not available via public APIs for these ecosystems.
Description
Impact
Due to some data types not being natively representable for the available storage options, shared_preferences_android serializes and deserializes special string prefixes to store these unrepresentable data types. This allows arbitrary classes to be deserialized leading to arbitrary code execution.
As a result, Files containing the preferences can be overwritten with a malicious one with a deserialization payload that triggers as soon as the data is loaded from the disk.
Patches
2.3.4
Workarounds
Update to the latest version of shared_preferences_android that contains the changes to address this vulnerability.
References
TBD
For more information
See our community page to find ways to contact the team.
Thanks
Thank you so much to Oskar Zeino-Mahmalat from sonarsource for finding and reporting this issue!
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🎯Pub | shared_preferences_android | ≥ 2.3.3&&< 2.3.4 | 2.3.4dart pub upgrade shared_preferences_android |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for shared_preferences_android, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update shared_preferences_android to 2.3.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-3hpf-ff72-j67p is resolved across your whole dependency graph.
Workarounds
Do not deserialise data from untrusted sources: where the format allows it, restrict deserialisation to an explicit allowlist of expected types, and prefer a data-only format (JSON, Protobuf) over one that can reconstruct arbitrary objects until you can upgrade.
Frequently Asked Questions
Is GHSA-3hpf-ff72-j67p in your dependencies?
Find it across Pub, including transitive dependencies.