Databento Binary Encoding (DBN) has a heap buffer overflow using c_chars_to_str functionGHSA-pfr9-2p92-qrhq
MEDIUMFix: databento/dbn@339efb9GHSA-pfr9-2p92-qrhq is a medium-severity (CVSS 5.5) remote code execution vulnerability in dbn. A fix is available for dbn — see the affected versions and patch details below.
Real-World Exposure
dbnReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
The heap-buffer-overflow is triggered in the strlen() function when handling the c_chars_to_str function in the dbn crate. This vulnerability occurs because the CStr::from_ptr() function in Rust assumes that the provided C string is null-terminated. However, there is no guarantee that the input chars array passed to the c_chars_to_str function is properly null-terminated.
If the chars array does not contain a null byte (\0), strlen() will continue to read beyond the bounds of the buffer in search of a null terminator. This results in an out-of-bounds memory read and can lead to a heap-buffer-overflow, potentially causing memory corruption or exposing sensitive information.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | dbn | all versions | 0.22.1cargo update -p dbn --precise 0.22.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for dbn, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update dbn to 0.22.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-pfr9-2p92-qrhq is resolved across your whole dependency graph.
Workarounds
Constrain what reaches the vulnerable code: limit the size and shape of untrusted input, isolate the affected component in a sandboxed or least-privileged process, and enable the platform's memory-safety mitigations (ASLR, stack protector, hardened allocator) so an out-of-bounds access is more likely to fail closed than to be exploitable.
Frequently Asked Questions
Is GHSA-pfr9-2p92-qrhq in your dependencies?
Find it across crates.io, including transitive dependencies.