# GHSA-cf4g-fcf8-3cr9: `pnet_packet` buffer overrun in `set_payload` setters

- Severity: Medium 6.0 (CVSS:3.0, scored by GitHub) `CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2020-06-19T12:00:00.000Z
- Modified: 2023-11-08T04:18:24.874Z
- Also known as: RUSTSEC-2020-0167

## Description

As indicated by this [issue](https://github.com/libpnet/libpnet/issues/449#issuecomment-663355987), a buffer overrun is possible in the `set_payload` setter of the various mutable "Packet" struct setters. The offending `set_payload` functions were defined within the struct `impl` blocks in earlier versions of the package, and later by the `packet` macro.

Fixed in the `packet` macro by [this](https://github.com/libpnet/libpnet/pull/455) PR.

(As written by GitHub Advisory Database.)

## Affected

- pnet_packet (crates.io): before 0.27.2; from 0.0.0-0 before 0.27.2

## Every score

- GitHub: CVSS:3.0 6.0 Medium `CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H`
- RustSec Advisory Database: CVSS:3.0 6.0 Medium `CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H`

## References

- <https://github.com/libpnet/libpnet/issues/449> (report, web)
- <https://github.com/libpnet/libpnet> (package)
- <https://rustsec.org/advisories/RUSTSEC-2020-0167.html> (advisory, web)
- <https://crates.io/crates/pnet_packet> (package)

## Sources

- GitHub Advisory Database: [GHSA-cf4g-fcf8-3cr9](https://github.com/advisories/GHSA-cf4g-fcf8-3cr9), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2020-0167](https://rustsec.org/advisories/RUSTSEC-2020-0167.html), CC0-1.0, modified 2023-11-08

---

Page: https://cve.day/GHSA-cf4g-fcf8-3cr9 · Whole record: https://cve.day/GHSA-cf4g-fcf8-3cr9.json · Rebuilt by cve.day 2026-11-25T22:56:43.011Z
