# GHSA-W7HM-HMXV-PVHF: HPACK decoder panics on invalid input

- Database: GitHub
- Severity: high (stated by ghsa, no CVSS score)
- Published: 2024-04-05
- Modified: 2024-04-11

## Also published as

- [RUSTSEC-2023-0085](https://cve.now/RUSTSEC-2023-0085.md) (RustSec)

## Affected versions

- hpack (crates.io): through 0.3.0

## Description

Due to insufficient checking of input data, decoding certain data sequences can lead to _Decoder::decode_ panicking rather than returning an error.

Example code that triggers this vulnerability looks like this:

```rust
use hpack::Decoder;

pub fn main() {
  let input = &[0x3f];
  let mut decoder = Decoder::new();
  let _ = decoder.decode(input);
}
```

hpack is unmaintained. A crate with the panics fixed has been published as [hpack-patched](https://crates.io/crates/hpack-patched).

Also consider using [fluke-hpack](https://crates.io/crates/fluke-hpack) or [httlib-huffman](https://crates.io/crates/httlib-huffman) as an alternative.

## References

- https://github.com/mlalic/hpack-rs/issues/11
- https://github.com/sno2/hpack-rs-patched/commit/d669282924a95311599e9e7dd53869ee96b3a2f5
- https://github.com/mlalic/hpack-rs
- https://rustsec.org/advisories/RUSTSEC-2023-0085.html

Page: https://cve.now/GHSA-W7HM-HMXV-PVHF

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
