GHSA-cf4g-fcf8-3cr9: Pnet packet `pnet_packet` Buffer Overrun Vulnerability

MODERATE
CVSS 6.0
Published
Advisory Summary

GHSA-cf4g-fcf8-3cr9 is a MODERATE (CVSS 6.0) `pnet_packet` buffer overrun vulnerability (General Security Weakness) affecting Pnet packet libraries in the crates.io ecosystem. The issue involves `pnet_packet` buffer overrun in `set_payload` setters. Remediation is available by upgrading affected packages to version 0.27.2.

GHSA-cf4g-fcf8-3cr9 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-cf4g-fcf8-3cr9
Severity MODERATE
CVSS v3.1 Base Score 6.0
CWE Classification General Security Weakness
Affected Product Pnet packet
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 6.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-cf4g-fcf8-3cr9

To remediate this vulnerability, upgrade all affected Pnet packet dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pnet_packet fixed: 0.27.2
Upgrade pnet_packet to 0.27.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for pnet_packet

How to Check if You Are Affected

To determine whether your application is affected by GHSA-cf4g-fcf8-3cr9, inspect your project dependencies for Pnet packet:

inspect dependencies for pnet_packet

Analyze the terminal output to locate any version of Pnet packet in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.27.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Pnet packet, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

GHSA-cf4g-fcf8-3cr9 Affected Pnet packet Versions

1 component(s)
Fixed Versions:
0.27.2
Product / Package Ecosystem Affected Versions Fixed Version
pnet_packet
crates.io
< 0.27.2
0.27.2

References

Frequently Asked Questions

What is GHSA-cf4g-fcf8-3cr9?
GHSA-cf4g-fcf8-3cr9 is a security vulnerability in Pnet packet involving `pnet_packet` buffer overrun in `set_payload` setters under General Security Weakness.
Which Pnet packet versions are affected?
Affected versions include releases prior to 0.27.2 across affected packages: pnet_packet.
What version fixes GHSA-cf4g-fcf8-3cr9?
Upgrading to 0.27.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pnet_packet affected?
Yes, pnet_packet is affected in releases prior to 0.27.2. Upgrade your dependency to 0.27.2 or later.
What is the CVSS score of GHSA-cf4g-fcf8-3cr9?
GHSA-cf4g-fcf8-3cr9 has a CVSS v3.1 base score of 6.0 (MODERATE) with vector string CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H.
What CWE is associated with GHSA-cf4g-fcf8-3cr9?
GHSA-cf4g-fcf8-3cr9 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-cf4g-fcf8-3cr9?
Run the dependency tree command: 'inspect dependencies for pnet_packet'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-cf4g-fcf8-3cr9",
  "modified" : "2023-02-09T19:27:57Z",
  "published" : "2023-02-09T19:27:57Z",
  "aliases" : [ ],
  "summary" : "`pnet_packet` buffer overrun in `set_payload` setters",
  "details" : "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.\n\nFixed in the `packet` macro by [this](https://github.com/libpnet/libpnet/pull/455) PR.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "pnet_packet"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.27.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/libpnet/libpnet/issues/449"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/libpnet/libpnet"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2020-0167.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-09T19:27:57Z",
    "nvd_published_at" : null
  }
}