CWE-125
Weakness AllowedOut-of-bounds Read
Abstraction: Base · Status: Draft
The product reads data past the end, or before the beginning, of the intended buffer.
Dimensions
- Behavior-Type: Read
- Resource-Type: Memory Buffer
- Resource-Property: Out-of-bounds
Mapping guidance
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
Relationships and members
Modes of introduction
Detection methods
Fuzzing
Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs - either randomly or algorithmically - and dynamically invoking the code with those inputs. Even with random inputs, it is often capable of generating unexpected results such as crashes, memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases that clearly indicate bugs, which helps developers to diagnose the issues.
Effectiveness: High
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Effectiveness: High
Automated Dynamic Analysis
Use tools that are integrated during compilation to insert runtime error-checking mechanisms related to memory safety errors, such as AddressSanitizer (ASan) for C/C++ [REF-1518].
Effectiveness: Moderate
Crafted inputs are necessary to reach the code containing the error, such as generated by fuzzers. Also, these tools may reduce performance, and they only report the error condition - not the original mistake that led to the error.
Content history
Provided diagram to improve CWE usability
updated Applicable_Platforms, Relationships, Taxonomy_Mappings, Weakness_Ordinalities
updated Description
updated Relationships
updated Common_Consequences
updated Demonstrative_Examples, References, Relationships
updated Related_Attack_Patterns
updated Relationships, Taxonomy_Mappings
updated Relationships
updated Causal_Nature, Observed_Examples, Taxonomy_Mappings
updated Description
updated Relationships
updated Description, Related_Attack_Patterns
updated Common_Consequences, Observed_Examples, Potential_Mitigations, References, Relationships
updated Potential_Mitigations, Relationships, Taxonomy_Mappings
updated Observed_Examples, Potential_Mitigations
updated Observed_Examples, Potential_Mitigations, Relationships
updated Related_Attack_Patterns, Relationships
updated Observed_Examples, Relationships
updated Research_Gaps
updated Observed_Examples, Relationships
updated Applicable_Platforms, Relationships, Taxonomy_Mappings
updated Description
updated Detection_Factors, References, Relationships
updated Mapping_Notes, Relationships
updated Observed_Examples
updated Alternate_Terms, Common_Consequences, Description, Diagram, Weakness_Ordinalities
updated Observed_Examples, Relationships
updated Affected_Resources, Demonstrative_Examples, Functional_Areas
updated Applicable_Platforms, Detection_Factors, References, Relationships
updated Applicable_Platforms, Demonstrative_Examples, Dimensions, Observed_Examples, References, Relationships, Taxonomy_Mappings
14401 vulnerabilities reference this CWE, most recent first.
GHSA-3542-5G2C-WPGM
Vulnerability from github – Published: 2022-05-17 00:19 – Updated: 2022-05-17 00:19There is an illegal address access in the _lou_getALine function in compileTranslationTable.c:346 in Liblouis 3.2.0.
{
"affected": [],
"aliases": [
"CVE-2017-13738"
],
"database_specific": {
"cwe_ids": [
"CWE-125"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-08-29T06:29:00Z",
"severity": "HIGH"
},
"details": "There is an illegal address access in the _lou_getALine function in compileTranslationTable.c:346 in Liblouis 3.2.0.",
"id": "GHSA-3542-5g2c-wpgm",
"modified": "2022-05-17T00:19:04Z",
"published": "2022-05-17T00:19:04Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-13738"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2017:3111"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=1484297"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/100607"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-354M-Q546-G336
Vulnerability from github – Published: 2023-06-23 18:30 – Updated: 2024-04-04 05:07The issue was addressed with improved checks. This issue is fixed in iOS 16.5 and iPadOS 16.5, macOS Ventura 13.4, watchOS 9.5. Photos belonging to the Hidden Photos Album could be viewed without authentication through Visual Lookup
{
"affected": [],
"aliases": [
"CVE-2023-32390"
],
"database_specific": {
"cwe_ids": [
"CWE-125"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-06-23T18:15:12Z",
"severity": "LOW"
},
"details": "The issue was addressed with improved checks. This issue is fixed in iOS 16.5 and iPadOS 16.5, macOS Ventura 13.4, watchOS 9.5. Photos belonging to the Hidden Photos Album could be viewed without authentication through Visual Lookup",
"id": "GHSA-354m-q546-g336",
"modified": "2024-04-04T05:07:51Z",
"published": "2023-06-23T18:30:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-32390"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/HT213757"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/HT213758"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/HT213764"
},
{
"type": "WEB",
"url": "https://support.apple.com/kb/HT213761"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:P/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-355F-MVMJ-JR2R
Vulnerability from github – Published: 2026-09-14 21:31 – Updated: 2026-09-15 18:32An out-of-bounds read was addressed with improved bounds checking. This issue is fixed in macOS Golden Gate 27, macOS Sequoia 15.8, macOS Tahoe 26.7. Connecting to a malicious SMB share may disclose kernel memory.
{
"affected": [],
"aliases": [
"CVE-2026-65365"
],
"database_specific": {
"cwe_ids": [
"CWE-125"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-09-14T21:17:21Z",
"severity": "MODERATE"
},
"details": "An out-of-bounds read was addressed with improved bounds checking. This issue is fixed in macOS Golden Gate 27, macOS Sequoia 15.8, macOS Tahoe 26.7. Connecting to a malicious SMB share may disclose kernel memory.",
"id": "GHSA-355f-mvmj-jr2r",
"modified": "2026-09-15T18:32:19Z",
"published": "2026-09-14T21:31:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-65365"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/149035"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/149042"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/149043"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-355H-Q75C-4JJ6
Vulnerability from github – Published: 2022-05-24 16:59 – Updated: 2022-05-24 16:59Adobe Acrobat and Reader versions , 2019.012.20040 and earlier, 2017.011.30148 and earlier, 2017.011.30148 and earlier, 2015.006.30503 and earlier, and 2015.006.30503 and earlier have an out-of-bounds read vulnerability. Successful exploitation could lead to information disclosure .
{
"affected": [],
"aliases": [
"CVE-2019-8222"
],
"database_specific": {
"cwe_ids": [
"CWE-125"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-10-17T21:15:00Z",
"severity": "HIGH"
},
"details": "Adobe Acrobat and Reader versions , 2019.012.20040 and earlier, 2017.011.30148 and earlier, 2017.011.30148 and earlier, 2015.006.30503 and earlier, and 2015.006.30503 and earlier have an out-of-bounds read vulnerability. Successful exploitation could lead to information disclosure .",
"id": "GHSA-355h-q75c-4jj6",
"modified": "2022-05-24T16:59:26Z",
"published": "2022-05-24T16:59:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-8222"
},
{
"type": "WEB",
"url": "https://helpx.adobe.com/security/products/acrobat/apsb19-49.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-355X-F7FP-PFW3
Vulnerability from github – Published: 2022-01-14 00:01 – Updated: 2022-01-16 00:00Adobe InCopy version 16.4 (and earlier) is affected by an out-of-bounds read vulnerability when parsing a crafted file, which could result in a read past the end of an allocated memory structure. An attacker could leverage this vulnerability to execute code in the context of the current user. Exploitation of this issue requires user interaction in that a victim must open a malicious file.
{
"affected": [],
"aliases": [
"CVE-2021-45055"
],
"database_specific": {
"cwe_ids": [
"CWE-125"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-01-13T21:15:00Z",
"severity": "HIGH"
},
"details": "Adobe InCopy version 16.4 (and earlier) is affected by an out-of-bounds read vulnerability when parsing a crafted file, which could result in a read past the end of an allocated memory structure. An attacker could leverage this vulnerability to execute code in the context of the current user. Exploitation of this issue requires user interaction in that a victim must open a malicious file.",
"id": "GHSA-355x-f7fp-pfw3",
"modified": "2022-01-16T00:00:59Z",
"published": "2022-01-14T00:01:58Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-45055"
},
{
"type": "WEB",
"url": "https://helpx.adobe.com/security/products/incopy/apsb22-04.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-3585-3W46-J654
Vulnerability from github – Published: 2022-05-14 03:04 – Updated: 2025-04-20 03:39The snd_msndmidi_input_read function in sound/isa/msnd/msnd_midi.c in the Linux kernel through 4.11.7 allows local users to cause a denial of service (over-boundary access) or possibly have unspecified other impact by changing the value of a message queue head pointer between two kernel reads of that value, aka a "double fetch" vulnerability.
{
"affected": [],
"aliases": [
"CVE-2017-9985"
],
"database_specific": {
"cwe_ids": [
"CWE-125"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-06-28T06:29:00Z",
"severity": "HIGH"
},
"details": "The snd_msndmidi_input_read function in sound/isa/msnd/msnd_midi.c in the Linux kernel through 4.11.7 allows local users to cause a denial of service (over-boundary access) or possibly have unspecified other impact by changing the value of a message queue head pointer between two kernel reads of that value, aka a \"double fetch\" vulnerability.",
"id": "GHSA-3585-3w46-j654",
"modified": "2025-04-20T03:39:36Z",
"published": "2022-05-14T03:04:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-9985"
},
{
"type": "WEB",
"url": "https://github.com/torvalds/linux/commit/20e2b791796bd68816fa115f12be5320de2b8021"
},
{
"type": "WEB",
"url": "https://bugzilla.kernel.org/show_bug.cgi?id=196133"
},
{
"type": "WEB",
"url": "https://usn.ubuntu.com/3754-1"
},
{
"type": "WEB",
"url": "http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=20e2b791796bd68816fa115f12be5320de2b8021"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/99335"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-358W-W75H-X6RX
Vulnerability from github – Published: 2026-11-10 15:56 – Updated: 2026-11-10 15:56Summary
gopacket decodes SCTP (IP protocol 132) by walking the chunk chain through per-chunk-type decoder functions (decodeSCTPInit, decodeSCTPShutdown, decodeSCTPError, decodeSCTPSack, in layers/sctp.go). Each of these reads fixed-size header fields and runs count-driven loops without validating the chunk's declared length against the minimums those reads require. A single crafted SCTP segment causes a runtime panic (out-of-bounds slice read, or inverted slice from unsigned length arithmetic) on any decode path that does not install gopacket's per-packet panic recovery (gopacket.DecodeOptions.SkipDecodeRecovery: true); with the default API the same input degrades to a per-packet decode error.
The defect is present in every released version through v1.7.1 and at current master (18c5805). It is the SCTP component named - but not remediated - in CVE-2026-65819 (GHSA-8mcr-459q-5mx2, "Multiple layer decoders panic …", patched per advisory metadata in v1.7.1). The v1.7.1 hardening commit b772f56 ("layers:various: add protocol decoder length checks (#163)") added generic bounds to the chunk dispatcher and decodeSCTPChunk, but left every chunk sub-decoder without a per-type minimum-length check. The advisory's own description lists "SCTP chunk/parameter decoders (sctp.go)" among items "being confirmed; they should be remediated together with the above" - this report demonstrates that, at v1.7.1 and HEAD, that remediation still does not exist.
Patches
Fixed in v1.7.2 by commit 5080443 ("layers/sctp: bound chunk sub-decoders and parameters"). INIT/INIT-ACK, SACK and SHUTDOWN now check their chunk type's minimum length, SACK rejects gap-ack and duplicate-TSN counts the chunk can't hold, and decodeSCTPParameter rejects TLV lengths below 4 or beyond the buffer. Each case returns a decode error instead of panicking. The same commit fixes a panic on valid input, where a final parameter's padding lies outside the chunk length (RFC 9260 3.2). Regression tests: TestDecodeSCTPChunkRegression and TestDecodeSCTPParameterPadding in layers/decode_oob_test.go.
Upgrade with go get github.com/gopacket/gopacket@v1.7.2.
Workarounds
Before v1.7.2, keep panic recovery on: use gopacket.NewPacket without SkipDecodeRecovery, and DecodingLayerParser with IgnorePanic: false. The crafted packet then fails to decode instead of crashing the process.
Vulnerability Details
All line numbers refer to layers/sctp.go at commit 18c5805028329a6a8944f054d8d3f64ebc0f1373 (master, 2026-09-01; v1.7.1-1-g18c5805).
The shared entry point already present in v1.7.1 validates only that a chunk is present and that its declared length is ≥ 4 and covered by real bytes:
// sctp.go:129
func decodeSCTPChunk(data []byte) (SCTPChunk, error) {
if len(data) < 4 { ... }
length := binary.BigEndian.Uint16(data[2:4])
if length < 4 { ... }
actual := roundUpToNearest4(int(length))
ct := SCTPChunkType(data[0])
if ct == SCTPChunkTypeData && length < 16 { ... } // only DATA gets a 16-byte minimum
if len(data) < actual { ... }
...
The Data-chunk minimum of 16 bytes is never applied to the other chunk types, and none of the sub-decoders re-check before indexing. Four independent panic paths result (each reproduced at HEAD):
Defect 1 - INIT / INIT-ACK chunks (decodeSCTPInit, sctp.go:423): reads data[4:8], data[8:12] (line 431), data[12:14], data[14:16], data[16:20] (line 434), then slices paramData := data[20:sc.ActualLength] (line 436).
- Declared length 8–11, actual 8–12 -> data[8:12] reads past the chunk:
panic: runtime error: slice bounds out of range [:12] with capacity 8
- Declared length 15, actual 16 -> data[16:20] past the chunk:
panic: runtime error: slice bounds out of range [:20] with capacity 16
- Declared length ≤ 19 -> the data[20:ActualLength] slice is inverted (panic) or the subsequent parameter loop runs on attacker data without the decodeSCTPParameter length check (Defect 3).
Defect 2 - SHUTDOWN chunks (decodeSCTPShutdown, sctp.go:670): reads binary.BigEndian.Uint32(data[4:8]) (line 677) on a chunk whose declared length is only validated as ≥ 4:
panic: runtime error: slice bounds out of range [:8] with capacity 4 (4-byte chunk).
Defect 3 - ERROR (and HEARTBEAT/INIT) parameter decoder (decodeSCTPParameter, sctp.go:193): the crafted Length field is used to slice with no bound against the parameter buffer:
// sctp.go:193
func decodeSCTPParameter(data []byte) SCTPParameter {
length := binary.BigEndian.Uint16(data[2:4])
return SCTPParameter{
...
Value: data[4:length], // line 198: no check length >= 4 or length <= len(data)
ActualLength: roundUpToNearest4(int(length)),
}
}
length < 4-> inverted slice:panic: runtime error: slice bounds out of range [4:0](reached fromdecodeSCTPErrorline 632paramData := data[4:sc.Length], and from the INIT (438) / HEARTBEAT (578) parameter loops).length > len(data)-> slice-bounds-check panic (Go's slice bounds check panics; the read never silently over-reads).
Defect 4 - SACK chunk count loops (decodeSCTPSack, sctp.go:484): NumGapACKs / NumDuplicateTSNs (attacker-controlled uint16 fields) drive loops that slice the remaining bytes with no bound:
// sctp.go:512
bytesRemaining := data[16:]
for i := 0; i < int(sc.NumGapACKs); i++ { // line 513
sc.GapACKs = append(sc.GapACKs, binary.BigEndian.Uint16(bytesRemaining[:2])) // line 514
bytesRemaining = bytesRemaining[2:]
}
for i := 0; i < int(sc.NumDuplicateTSNs); i++ { // line 517
sc.DuplicateTSNs = append(sc.DuplicateTSNs, binary.BigEndian.Uint32(bytesRemaining[:4])) // line 518
bytesRemaining = bytesRemaining[4:]
}
A 16-byte SACK chunk declaring NumGapACKs = 1 with no following bytes:
panic: runtime error: slice bounds out of range [:2] with capacity 0
Note this is not the sFlow/Diameter "unbounded allocation" family already covered by CVE-2026-54332/CVE-2026-54345; the SACK make() capacities are already capped against ActualLength (lines 505–510) - the loop iteration counts are not, so the panic is an out-of-bounds read, not an allocation.
History / version range. decodeSCTPInit and the chunk sub-decoders were introduced in commit 2fca351 (original full-featured SCTP implementation; at the time the file was named layer_sctp.go - the current sctp.go path dates from the rename in dea6b39). The sinks are present in every release from v1.0.0 through v1.7.1 and at HEAD (also confirmed at v1.6.0). b772f56 (2026-07-08, included in v1.7.1) touched layers/sctp.go but only hardened the dispatcher (decodeWithSCTPChunkTypePrefix) and the generic decodeSCTPChunk/decodeSCTPDataChunk bounds; the four sub-decoder paths above are unchanged by it. The v1.7.1 regression-test commit 2220269 covers the advisory's other decoders, not SCTP chunk sub-decoders. Affected range is therefore every gopacket version: <= 1.7.1, plus current master 18c5805. (Maintainer update: fixed in v1.7.2, commit 5080443; see Patches.)
Relationship to the published advisory (dedup context). CVE-2026-65819 / GHSA-8mcr-459q-5mx2 (published 2026-07-27) declares vulnerable_version_range: <= 1.7.0 / patched_versions: 1.7.1. Its description explicitly names "SCTP chunk/parameter decoders (sctp.go)" among decoder families "(on the recovering path only) … being confirmed; they should be remediated together with the above". Because the advisory metadata tells consumers that upgrading to 1.7.1 remediates the advisory, and this SCTP component was not actually fixed, the practical status of this finding is incomplete remediation of a published advisory: consumers of the 1.7.1 "patched" version remain exposed to the SCTP panic path. The finding is reported here so the maintainers can either complete the SCTP fix under the existing advisory or track it separately.
Impact
An unauthenticated remote attacker can crash a gopacket-based decoder with a single crafted SCTP segment (IP protocol 132). A 54-byte Ethernet frame (Ethernet -> IPv4 -> SCTP with an 8-byte INIT chunk) is enough (see Reproduction Steps). Panic escapes for consumers that disable gopacket's built-in recovery:
gopacket.NewPacket(data, layerType, DecodeOptions{SkipDecodeRecovery: true})- panic propagates to the caller, terminating the process if uncaught.- Direct use of the registered SCTP decode chain without recovery.
Two gopacket entry points install recovery by default and are therefore NOT crash surfaces for this bug: gopacket.NewPacket with default options (deferred recover wraps the whole decode chain, converting the panic into a per-packet error, demonstrated in case B below), and DecodingLayerParser.DecodeLayers when IgnorePanic is false (parser.go:306 - if !l.IgnorePanic { defer panicToError(&err) }); in both cases the packet simply fails to decode. Panic escape - and process crash - requires the non-recovering settings above. This mirrors exactly the reachability of the sibling advisories in the same family (GHSA-6h9g MPTCP, GHSA-8mcr): CVE-2026-65819 itself is scored with the same AV:N/AC:L/PR:N/UI:N vector while noting (per the GHSA advisory text) ~5.3 (Medium) for recovering-path-only consumers; the reporter scored the non-recovering consumer set at 7.5, which is the configuration used by high-throughput packet-analysis engines that set SkipDecodeRecovery to detect decode failures themselves.
The default API (gopacket.NewPacket(..., gopacket.Default)) installs defer recover and converts the panic into a per-packet decode error, so crash exposure is limited to non-recovering consumers (packet-analysis engines, IDS/NDR pipelines, capture-processing tools that set SkipDecodeRecovery or call decoders directly - the same consumer set described in the CVE-2026-65819 and CVE-2026-54332/54345 advisories).
Impact is availability only: no memory disclosure, no code execution, no allocation amplification. Severity: CVSS 3.1 5.9 Medium - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H (reporter proposed 7.5 with AC:L; maintainers set AC:H because a crash needs the consumer to disable panic recovery), primary CWE-125 (out-of-bounds read), secondaries CWE-129 (improper validation of array index for the inverted slices).
Per-metric justification (primary vector): - Attack Vector (AV): Network - a single crafted SCTP segment (IP protocol 132) delivered over the wire triggers the panic path; no local access needed. - Attack Complexity (AC): High - the input is trivial (a 54-byte frame with an 8-byte INIT chunk), but a crash depends on a condition outside the attacker's control: the target must have disabled gopacket's panic recovery. Default configurations only produce a decode error. - Privileges Required (PR): None - the decoding library processes untrusted captured/live packets with no authentication. - User Interaction (UI): None - no victim action; the crash occurs during automated decode. - Scope (S): Unchanged - the impacted security authority is the decoder's own process (the caller's application). - Confidentiality (C): None - no data disclosure. - Integrity (I): None - no data modification. - Availability (A): High - non-recovering consumer process terminates (panic); the ~5.3 recovering-path-only alternative is disclosed above.
Reproduction Steps
Environment: Go 1.25 toolchain (module requires go 1.25.0), github.com/gopacket/gopacket at HEAD 18c5805028329a6a8944f054d8d3f64ebc0f1373 (v1.7.1 + 1 commit). The same output is produced at tag v1.7.1.
// repro_sctp.go - single static input, one deterministic observable (decode panic)
package main
import (
"fmt"
"github.com/gopacket/gopacket"
"github.com/gopacket/gopacket/layers"
)
func main() {
// One 54-byte frame: Ethernet -> IPv4(proto 132) -> SCTP -> INIT chunk (declared length 8)
frame := []byte{
// Ethernet
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x08, 0x00,
// IPv4, protocol 132 (SCTP), total length 40
0x45, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x84,
0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0x02,
// SCTP common header (12 bytes)
0x11, 0x11, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// INIT chunk: type=1, flags=0, length=8 (declared), body 4 bytes
0x01, 0x00, 0x00, 0x08, 0xaa, 0xbb, 0xcc, 0xdd,
}
// same bytes as hex:
// ffffffffffff00112233445508004500002800000000008400840a0000010a000002
// 1111222200000000000000000100000008aabbccdd
// A) Non-recovering decode (SkipDecodeRecovery: true) -> panic escapes
func() {
defer func() {
if r := recover(); r != nil {
fmt.Printf("A) SkipDecodeRecovery=true -> PANIC: %v\n", r)
}
}()
p := gopacket.NewPacket(frame, layers.LayerTypeEthernet,
gopacket.DecodeOptions{Lazy: false, SkipDecodeRecovery: true})
_ = p.Dump()
fmt.Println("A) no panic (unexpected)")
}()
// B) Default (recovering) API -> per-packet error, process survives
p := gopacket.NewPacket(frame, layers.LayerTypeEthernet, gopacket.Default)
fmt.Printf("B) Default (recovering) -> err=%v layers=%d\n", p.ErrorLayer(), len(p.Layers()))
}
Build and run (module file go.mod):
module repro
go 1.25.0
require github.com/gopacket/gopacket v1.7.1
replace github.com/gopacket/gopacket => /path/to/clone/of/gopacket/gopacket # at 18c5805 (or tag v1.7.1)
$ go build -o repro_sctp repro_sctp.go
$ ./repro_sctp
A) SkipDecodeRecovery=true -> PANIC: runtime error: slice bounds out of range [:12] with capacity 8
B) Default (recovering) -> err=Packet decoding error: runtime error: slice bounds out of range [:12] with capacity 8 layers=4
Observed stack (case A): layers.decodeSCTPInit at layers/sctp.go:431 <- SCTPChunkType.Decode <- decodeWithSCTPChunkTypePrefix (sctp.go:57) <- decodeSCTP (sctp.go:38) <- NewPacket.
Additional one-input repros for the other three defect classes (same harness shape, decode root LayerTypeSCTP with SkipDecodeRecovery: true):
| Input | Panic (observed) | Sink |
|---|---|---|
| INIT-ACK chunk type 2, declared length 8 | slice bounds out of range [:12] with capacity 8 |
sctp.go:431 |
| INIT chunk declared length 15, 12-byte body | slice bounds out of range [:20] with capacity 16 |
sctp.go:434 |
SACK chunk type 3, length 16, NumGapACKs=1, NumDuplicateTSNs=1, no trailing bytes |
slice bounds out of range [:2] with capacity 0 |
sctp.go:514 |
| SHUTDOWN chunk type 7, declared length 4 | slice bounds out of range [:8] with capacity 4 |
sctp.go:677 |
| ERROR chunk type 9, length 8, 4-byte "parameter" with Length field 0 | slice bounds out of range [4:0] |
sctp.go:198 |
Recommendations
Complete the v1.7.1 remediation by validating each chunk subtype's declared length against the fixed-size fields and loops that consume it, immediately after decodeSCTPChunk succeeds in each sub-decoder. Minimal correct changes in layers/sctp.go:
decodeSCTPInit: requiresc.ActualLength >= 20before readingdata[4:20](return a decode error otherwise), then bound the parameter loop:paramData := data[20:sc.ActualLength]is safe once the chunk length is ≥ 20 anddecodeSCTPParameteris hardened (below).decodeSCTPShutdown: requiresc.ActualLength >= 8.decodeSCTPSack: requiresc.ActualLength >= 16, and cap the loops - iteratemin(NumGapACKs, remaining/2)andmin(NumDuplicateTSNs, remaining/4), returning an error (or silently stopping withSetTruncated) when a count exceeds the bytes available.decodeSCTPParameter(shared by INIT/HEARTBEAT/ERROR): rejectlength < 4andlength > len(data)before thedata[4:length]slice, mirroring the bound style already used for TCP options (tcp.godefaultbranch) - this closes Defect 3 at its root regardless of which loop calls it.
Optionally add regression tests in the style of 2220269 covering short INIT/SHUTDOWN/SACK/ERROR chunks.
Resources
- Source at pin:
layers/sctp.go@ https://github.com/gopacket/gopacket/blob/18c5805028329a6a8944f054d8d3f64ebc0f1373/layers/sctp.go (lines 129–136 dispatcher/chunk guard, 193–202decodeSCTPParameter, 423–442decodeSCTPInit, 484–521decodeSCTPSack, 670–678decodeSCTPShutdown, 623–636decodeSCTPError) - Fix commit that missed the sub-decoders: https://github.com/gopacket/gopacket/commit/b772f566a3ecc53c099bdd44eab4718088c4e866 (PR #163, "layers:various: add protocol decoder length checks")
- Regression-test commit: https://github.com/gopacket/gopacket/commit/2220269 (v1.7.1, "test(layers): add regression tests for the decoder panic advisories")
- Advisory that names the unfixed SCTP component: https://github.com/gopacket/gopacket/security/advisories/GHSA-8mcr-459q-5mx2 (CVE-2026-65819, "Multiple layer decoders panic on crafted packets …, including (on the recovering path only) … SCTP chunk/parameter decoders (sctp.go)"); NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-65819
- Sibling advisory with identical reachability framing (High 7.5): https://github.com/gopacket/gopacket/security/advisories/GHSA-6h9g-cjv3-pg2c (TCP MPTCP option decoder)
- Introduced in: https://github.com/gopacket/gopacket/commit/2fca351 (original SCTP implementation)
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.7.1"
},
"package": {
"ecosystem": "Go",
"name": "github.com/gopacket/gopacket"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.7.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-119299"
],
"database_specific": {
"cwe_ids": [
"CWE-125",
"CWE-129"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-10T15:56:49Z",
"nvd_published_at": "2026-10-30T17:17:18Z",
"severity": "MODERATE"
},
"details": "## Summary\n\ngopacket decodes SCTP (IP protocol 132) by walking the chunk chain through per-chunk-type decoder functions (`decodeSCTPInit`, `decodeSCTPShutdown`, `decodeSCTPError`, `decodeSCTPSack`, in `layers/sctp.go`). Each of these reads fixed-size header fields and runs count-driven loops **without validating the chunk\u0027s declared length against the minimums those reads require**. A single crafted SCTP segment causes a runtime panic (out-of-bounds slice read, or inverted slice from unsigned length arithmetic) on any decode path that does not install gopacket\u0027s per-packet panic recovery (`gopacket.DecodeOptions.SkipDecodeRecovery: true`); with the default API the same input degrades to a per-packet decode error.\n\nThe defect is present in every released version through `v1.7.1` and at current `master` (18c5805). It is the SCTP component named - but not remediated - in CVE-2026-65819 (`GHSA-8mcr-459q-5mx2`, \"Multiple layer decoders panic \u2026\", patched per advisory metadata in `v1.7.1`). The `v1.7.1` hardening commit `b772f56` (\"layers:various: add protocol decoder length checks (#163)\") added generic bounds to the chunk dispatcher and `decodeSCTPChunk`, but left every chunk *sub-decoder* without a per-type minimum-length check. The advisory\u0027s own description lists \"SCTP chunk/parameter decoders (`sctp.go`)\" among items \"being confirmed; they should be remediated together with the above\" - this report demonstrates that, at `v1.7.1` and `HEAD`, that remediation still does not exist.\n\n## Patches\n\nFixed in **v1.7.2** by commit [`5080443`](https://github.com/gopacket/gopacket/commit/5080443) (\"layers/sctp: bound chunk sub-decoders and parameters\"). INIT/INIT-ACK, SACK and SHUTDOWN now check their chunk type\u0027s minimum length, SACK rejects gap-ack and duplicate-TSN counts the chunk can\u0027t hold, and `decodeSCTPParameter` rejects TLV lengths below 4 or beyond the buffer. Each case returns a decode error instead of panicking. The same commit fixes a panic on valid input, where a final parameter\u0027s padding lies outside the chunk length (RFC 9260 3.2). Regression tests: `TestDecodeSCTPChunkRegression` and `TestDecodeSCTPParameterPadding` in `layers/decode_oob_test.go`.\n\nUpgrade with `go get github.com/gopacket/gopacket@v1.7.2`.\n\n## Workarounds\n\nBefore v1.7.2, keep panic recovery on: use `gopacket.NewPacket` without `SkipDecodeRecovery`, and `DecodingLayerParser` with `IgnorePanic: false`. The crafted packet then fails to decode instead of crashing the process.\n\n## Vulnerability Details\n\nAll line numbers refer to `layers/sctp.go` at commit `18c5805028329a6a8944f054d8d3f64ebc0f1373` (master, 2026-09-01; `v1.7.1-1-g18c5805`).\n\nThe shared entry point already present in `v1.7.1` validates only that a chunk is present and that its declared length is \u2265 4 and covered by real bytes:\n\n```go\n// sctp.go:129\nfunc decodeSCTPChunk(data []byte) (SCTPChunk, error) {\n\tif len(data) \u003c 4 { ... }\n\tlength := binary.BigEndian.Uint16(data[2:4])\n\tif length \u003c 4 { ... }\n\tactual := roundUpToNearest4(int(length))\n\tct := SCTPChunkType(data[0])\n\tif ct == SCTPChunkTypeData \u0026\u0026 length \u003c 16 { ... } // only DATA gets a 16-byte minimum\n\tif len(data) \u003c actual { ... }\n\t...\n```\n\nThe Data-chunk minimum of 16 bytes is never applied to the other chunk types, and none of the sub-decoders re-check before indexing. Four independent panic paths result (each reproduced at `HEAD`):\n\n**Defect 1 - INIT / INIT-ACK chunks (`decodeSCTPInit`, sctp.go:423):** reads `data[4:8]`, `data[8:12]` (line 431), `data[12:14]`, `data[14:16]`, `data[16:20]` (line 434), then slices `paramData := data[20:sc.ActualLength]` (line 436).\n- Declared length 8\u201311, actual 8\u201312 -\u003e `data[8:12]` reads past the chunk:\n `panic: runtime error: slice bounds out of range [:12] with capacity 8`\n- Declared length 15, actual 16 -\u003e `data[16:20]` past the chunk:\n `panic: runtime error: slice bounds out of range [:20] with capacity 16`\n- Declared length \u2264 19 -\u003e the `data[20:ActualLength]` slice is inverted (panic) or the subsequent parameter loop runs on attacker data without the `decodeSCTPParameter` length check (Defect 3).\n\n**Defect 2 - SHUTDOWN chunks (`decodeSCTPShutdown`, sctp.go:670):** reads `binary.BigEndian.Uint32(data[4:8])` (line 677) on a chunk whose declared length is only validated as \u2265 4:\n`panic: runtime error: slice bounds out of range [:8] with capacity 4` (4-byte chunk).\n\n**Defect 3 - ERROR (and HEARTBEAT/INIT) parameter decoder (`decodeSCTPParameter`, sctp.go:193):** the crafted `Length` field is used to slice with no bound against the parameter buffer:\n\n```go\n// sctp.go:193\nfunc decodeSCTPParameter(data []byte) SCTPParameter {\n\tlength := binary.BigEndian.Uint16(data[2:4])\n\treturn SCTPParameter{\n\t\t...\n\t\tValue: data[4:length], // line 198: no check length \u003e= 4 or length \u003c= len(data)\n\t\tActualLength: roundUpToNearest4(int(length)),\n\t}\n}\n```\n\n- `length \u003c 4` -\u003e inverted slice: `panic: runtime error: slice bounds out of range [4:0]` (reached from `decodeSCTPError` line 632 `paramData := data[4:sc.Length]`, and from the INIT (438) / HEARTBEAT (578) parameter loops).\n- `length \u003e len(data)` -\u003e slice-bounds-check panic (Go\u0027s slice bounds check panics; the read never silently over-reads).\n\n**Defect 4 - SACK chunk count loops (`decodeSCTPSack`, sctp.go:484):** `NumGapACKs` / `NumDuplicateTSNs` (attacker-controlled uint16 fields) drive loops that slice the remaining bytes with no bound:\n\n```go\n// sctp.go:512\nbytesRemaining := data[16:]\nfor i := 0; i \u003c int(sc.NumGapACKs); i++ { // line 513\n\tsc.GapACKs = append(sc.GapACKs, binary.BigEndian.Uint16(bytesRemaining[:2])) // line 514\n\tbytesRemaining = bytesRemaining[2:]\n}\nfor i := 0; i \u003c int(sc.NumDuplicateTSNs); i++ { // line 517\n\tsc.DuplicateTSNs = append(sc.DuplicateTSNs, binary.BigEndian.Uint32(bytesRemaining[:4])) // line 518\n\tbytesRemaining = bytesRemaining[4:]\n}\n```\n\nA 16-byte SACK chunk declaring `NumGapACKs = 1` with no following bytes:\n`panic: runtime error: slice bounds out of range [:2] with capacity 0`\n\nNote this is not the sFlow/Diameter \"unbounded allocation\" family already covered by CVE-2026-54332/CVE-2026-54345; the SACK `make()` capacities are already capped against `ActualLength` (lines 505\u2013510) - the *loop iteration counts* are not, so the panic is an out-of-bounds read, not an allocation.\n\n**History / version range.** `decodeSCTPInit` and the chunk sub-decoders were introduced in commit `2fca351` (original full-featured SCTP implementation; at the time the file was named `layer_sctp.go` - the current `sctp.go` path dates from the rename in `dea6b39`). The sinks are present in every release from v1.0.0 through v1.7.1 and at `HEAD` (also confirmed at v1.6.0). `b772f56` (2026-07-08, included in v1.7.1) touched `layers/sctp.go` but only hardened the dispatcher (`decodeWithSCTPChunkTypePrefix`) and the generic `decodeSCTPChunk`/`decodeSCTPDataChunk` bounds; the four sub-decoder paths above are unchanged by it. The v1.7.1 regression-test commit `2220269` covers the advisory\u0027s other decoders, not SCTP chunk sub-decoders. Affected range is therefore every gopacket version: `\u003c= 1.7.1`, plus current master `18c5805`. *(Maintainer update: fixed in v1.7.2, commit `5080443`; see Patches.)*\n\n**Relationship to the published advisory (dedup context).** CVE-2026-65819 / GHSA-8mcr-459q-5mx2 (published 2026-07-27) declares `vulnerable_version_range: \u003c= 1.7.0` / `patched_versions: 1.7.1`. Its description explicitly names \"SCTP chunk/parameter decoders (`sctp.go`)\" among decoder families \"(on the recovering path only) \u2026 being confirmed; they should be remediated together with the above\". Because the advisory metadata tells consumers that upgrading to 1.7.1 remediates the advisory, and this SCTP component was not actually fixed, the practical status of this finding is *incomplete remediation of a published advisory*: consumers of the 1.7.1 \"patched\" version remain exposed to the SCTP panic path. The finding is reported here so the maintainers can either complete the SCTP fix under the existing advisory or track it separately.\n\n## Impact\n\nAn unauthenticated remote attacker can crash a gopacket-based decoder with a single crafted SCTP segment (IP protocol 132). A 54-byte Ethernet frame (`Ethernet -\u003e IPv4 -\u003e SCTP` with an 8-byte INIT chunk) is enough (see Reproduction Steps). Panic escapes for consumers that disable gopacket\u0027s built-in recovery:\n\n- `gopacket.NewPacket(data, layerType, DecodeOptions{SkipDecodeRecovery: true})` - panic propagates to the caller, terminating the process if uncaught.\n- Direct use of the registered SCTP decode chain without recovery.\n\nTwo gopacket entry points install recovery by default and are therefore NOT crash surfaces for this bug: `gopacket.NewPacket` with default options (deferred `recover` wraps the whole decode chain, converting the panic into a per-packet error, demonstrated in case B below), and `DecodingLayerParser.DecodeLayers` when `IgnorePanic` is false (`parser.go:306` - `if !l.IgnorePanic { defer panicToError(\u0026err) }`); in both cases the packet simply fails to decode. Panic escape - and process crash - requires the non-recovering settings above. This mirrors exactly the reachability of the sibling advisories in the same family (GHSA-6h9g MPTCP, GHSA-8mcr): CVE-2026-65819 itself is scored with the same `AV:N/AC:L/PR:N/UI:N` vector while noting (per the GHSA advisory text) ~5.3 (Medium) for recovering-path-only consumers; the reporter scored the non-recovering consumer set at 7.5, which is the configuration used by high-throughput packet-analysis engines that set `SkipDecodeRecovery` to detect decode failures themselves.\n\nThe default API (`gopacket.NewPacket(..., gopacket.Default)`) installs `defer recover` and converts the panic into a per-packet decode error, so crash exposure is limited to non-recovering consumers (packet-analysis engines, IDS/NDR pipelines, capture-processing tools that set `SkipDecodeRecovery` or call decoders directly - the same consumer set described in the CVE-2026-65819 and CVE-2026-54332/54345 advisories).\n\nImpact is availability only: no memory disclosure, no code execution, no allocation amplification. Severity: **CVSS 3.1 5.9 Medium - `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`** (reporter proposed 7.5 with AC:L; maintainers set AC:H because a crash needs the consumer to disable panic recovery), primary **CWE-125** (out-of-bounds read), secondaries CWE-129 (improper validation of array index for the inverted slices).\n\nPer-metric justification (primary vector):\n- **Attack Vector (AV): Network** - a single crafted SCTP segment (IP protocol 132) delivered over the wire triggers the panic path; no local access needed.\n- **Attack Complexity (AC): High** - the input is trivial (a 54-byte frame with an 8-byte INIT chunk), but a crash depends on a condition outside the attacker\u0027s control: the target must have disabled gopacket\u0027s panic recovery. Default configurations only produce a decode error.\n- **Privileges Required (PR): None** - the decoding library processes untrusted captured/live packets with no authentication.\n- **User Interaction (UI): None** - no victim action; the crash occurs during automated decode.\n- **Scope (S): Unchanged** - the impacted security authority is the decoder\u0027s own process (the caller\u0027s application).\n- **Confidentiality (C): None** - no data disclosure.\n- **Integrity (I): None** - no data modification.\n- **Availability (A): High** - non-recovering consumer process terminates (panic); the ~5.3 recovering-path-only alternative is disclosed above.\n\n## Reproduction Steps\n\nEnvironment: Go 1.25 toolchain (module requires `go 1.25.0`), `github.com/gopacket/gopacket` at `HEAD` 18c5805028329a6a8944f054d8d3f64ebc0f1373 (v1.7.1 + 1 commit). The same output is produced at tag `v1.7.1`.\n\n```go\n// repro_sctp.go - single static input, one deterministic observable (decode panic)\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/gopacket/gopacket\"\n\t\"github.com/gopacket/gopacket/layers\"\n)\n\nfunc main() {\n\t// One 54-byte frame: Ethernet -\u003e IPv4(proto 132) -\u003e SCTP -\u003e INIT chunk (declared length 8)\n\tframe := []byte{\n\t\t// Ethernet\n\t\t0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x08, 0x00,\n\t\t// IPv4, protocol 132 (SCTP), total length 40\n\t\t0x45, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x84,\n\t\t0x0a, 0x00, 0x00, 0x01, 0x0a, 0x00, 0x00, 0x02,\n\t\t// SCTP common header (12 bytes)\n\t\t0x11, 0x11, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t\t// INIT chunk: type=1, flags=0, length=8 (declared), body 4 bytes\n\t\t0x01, 0x00, 0x00, 0x08, 0xaa, 0xbb, 0xcc, 0xdd,\n\t}\n\t// same bytes as hex:\n\t// ffffffffffff00112233445508004500002800000000008400840a0000010a000002\n\t// 1111222200000000000000000100000008aabbccdd\n\n\t// A) Non-recovering decode (SkipDecodeRecovery: true) -\u003e panic escapes\n\tfunc() {\n\t\tdefer func() {\n\t\t\tif r := recover(); r != nil {\n\t\t\t\tfmt.Printf(\"A) SkipDecodeRecovery=true -\u003e PANIC: %v\\n\", r)\n\t\t\t}\n\t\t}()\n\t\tp := gopacket.NewPacket(frame, layers.LayerTypeEthernet,\n\t\t\tgopacket.DecodeOptions{Lazy: false, SkipDecodeRecovery: true})\n\t\t_ = p.Dump()\n\t\tfmt.Println(\"A) no panic (unexpected)\")\n\t}()\n\n\t// B) Default (recovering) API -\u003e per-packet error, process survives\n\tp := gopacket.NewPacket(frame, layers.LayerTypeEthernet, gopacket.Default)\n\tfmt.Printf(\"B) Default (recovering) -\u003e err=%v layers=%d\\n\", p.ErrorLayer(), len(p.Layers()))\n}\n```\n\nBuild and run (module file `go.mod`):\n\n```\nmodule repro\n\ngo 1.25.0\n\nrequire github.com/gopacket/gopacket v1.7.1\n\nreplace github.com/gopacket/gopacket =\u003e /path/to/clone/of/gopacket/gopacket # at 18c5805 (or tag v1.7.1)\n```\n\n```\n$ go build -o repro_sctp repro_sctp.go\n$ ./repro_sctp\nA) SkipDecodeRecovery=true -\u003e PANIC: runtime error: slice bounds out of range [:12] with capacity 8\nB) Default (recovering) -\u003e err=Packet decoding error: runtime error: slice bounds out of range [:12] with capacity 8 layers=4\n```\n\nObserved stack (case A): `layers.decodeSCTPInit` at `layers/sctp.go:431` \u003c- `SCTPChunkType.Decode` \u003c- `decodeWithSCTPChunkTypePrefix` (`sctp.go:57`) \u003c- `decodeSCTP` (`sctp.go:38`) \u003c- `NewPacket`.\n\nAdditional one-input repros for the other three defect classes (same harness shape, decode root `LayerTypeSCTP` with `SkipDecodeRecovery: true`):\n\n| Input | Panic (observed) | Sink |\n|---|---|---|\n| INIT-ACK chunk type 2, declared length 8 | `slice bounds out of range [:12] with capacity 8` | sctp.go:431 |\n| INIT chunk declared length 15, 12-byte body | `slice bounds out of range [:20] with capacity 16` | sctp.go:434 |\n| SACK chunk type 3, length 16, `NumGapACKs=1`, `NumDuplicateTSNs=1`, no trailing bytes | `slice bounds out of range [:2] with capacity 0` | sctp.go:514 |\n| SHUTDOWN chunk type 7, declared length 4 | `slice bounds out of range [:8] with capacity 4` | sctp.go:677 |\n| ERROR chunk type 9, length 8, 4-byte \"parameter\" with Length field 0 | `slice bounds out of range [4:0]` | sctp.go:198 |\n\n## Recommendations\n\nComplete the `v1.7.1` remediation by validating each chunk subtype\u0027s declared length against the fixed-size fields and loops that consume it, immediately after `decodeSCTPChunk` succeeds in each sub-decoder. Minimal correct changes in `layers/sctp.go`:\n\n1. **`decodeSCTPInit`**: require `sc.ActualLength \u003e= 20` before reading `data[4:20]` (return a decode error otherwise), then bound the parameter loop: `paramData := data[20:sc.ActualLength]` is safe once the chunk length is \u2265 20 *and* `decodeSCTPParameter` is hardened (below).\n2. **`decodeSCTPShutdown`**: require `sc.ActualLength \u003e= 8`.\n3. **`decodeSCTPSack`**: require `sc.ActualLength \u003e= 16`, and cap the loops - iterate `min(NumGapACKs, remaining/2)` and `min(NumDuplicateTSNs, remaining/4)`, returning an error (or silently stopping with `SetTruncated`) when a count exceeds the bytes available.\n4. **`decodeSCTPParameter`** (shared by INIT/HEARTBEAT/ERROR): reject `length \u003c 4` and `length \u003e len(data)` before the `data[4:length]` slice, mirroring the bound style already used for TCP options (`tcp.go` `default` branch) - this closes Defect 3 at its root regardless of which loop calls it.\n\nOptionally add regression tests in the style of `2220269` covering short INIT/SHUTDOWN/SACK/ERROR chunks.\n\n## Resources\n\n- Source at pin: `layers/sctp.go` @ https://github.com/gopacket/gopacket/blob/18c5805028329a6a8944f054d8d3f64ebc0f1373/layers/sctp.go (lines 129\u2013136 dispatcher/chunk guard, 193\u2013202 `decodeSCTPParameter`, 423\u2013442 `decodeSCTPInit`, 484\u2013521 `decodeSCTPSack`, 670\u2013678 `decodeSCTPShutdown`, 623\u2013636 `decodeSCTPError`)\n- Fix commit that missed the sub-decoders: https://github.com/gopacket/gopacket/commit/b772f566a3ecc53c099bdd44eab4718088c4e866 (PR #163, \"layers:various: add protocol decoder length checks\")\n- Regression-test commit: https://github.com/gopacket/gopacket/commit/2220269 (v1.7.1, \"test(layers): add regression tests for the decoder panic advisories\")\n- Advisory that names the unfixed SCTP component: https://github.com/gopacket/gopacket/security/advisories/GHSA-8mcr-459q-5mx2 (CVE-2026-65819, \"Multiple layer decoders panic on crafted packets \u2026, including (on the recovering path only) \u2026 SCTP chunk/parameter decoders (sctp.go)\"); NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-65819\n- Sibling advisory with identical reachability framing (High 7.5): https://github.com/gopacket/gopacket/security/advisories/GHSA-6h9g-cjv3-pg2c (TCP MPTCP option decoder)\n- Introduced in: https://github.com/gopacket/gopacket/commit/2fca351 (original SCTP implementation)",
"id": "GHSA-358w-w75h-x6rx",
"modified": "2026-11-10T15:56:49Z",
"published": "2026-11-10T15:56:49Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/gopacket/gopacket/security/advisories/GHSA-358w-w75h-x6rx"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-119299"
},
{
"type": "WEB",
"url": "https://github.com/gopacket/gopacket/commit/508044327cc2c065b3db753c010a027e7d1ca621"
},
{
"type": "PACKAGE",
"url": "https://github.com/gopacket/gopacket"
},
{
"type": "WEB",
"url": "https://github.com/gopacket/gopacket/releases/tag/v1.7.2"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "gopacket: SCTP chunk sub-decoder out-of-bounds panics on crafted segments"
}
GHSA-359G-PJXC-2JRM
Vulnerability from github – Published: 2022-07-16 00:00 – Updated: 2022-07-16 00:00Adobe Acrobat Reader versions 22.001.20142 (and earlier), 20.005.30334 (and earlier) and 17.012.30229 (and earlier) are affected by an out-of-bounds read vulnerability when parsing a crafted file, which could result in a read past the end of an allocated memory structure. An attacker could leverage this vulnerability to execute code in the context of the current user. Exploitation of this issue requires user interaction in that a victim must open a malicious file.
{
"affected": [],
"aliases": [
"CVE-2022-34226"
],
"database_specific": {
"cwe_ids": [
"CWE-125"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-07-15T16:15:00Z",
"severity": "HIGH"
},
"details": "Adobe Acrobat Reader versions 22.001.20142 (and earlier), 20.005.30334 (and earlier) and 17.012.30229 (and earlier) are affected by an out-of-bounds read vulnerability when parsing a crafted file, which could result in a read past the end of an allocated memory structure. An attacker could leverage this vulnerability to execute code in the context of the current user. Exploitation of this issue requires user interaction in that a victim must open a malicious file.",
"id": "GHSA-359g-pjxc-2jrm",
"modified": "2022-07-16T00:00:29Z",
"published": "2022-07-16T00:00:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-34226"
},
{
"type": "WEB",
"url": "https://helpx.adobe.com/security/products/acrobat/apsb22-32.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-35C4-9R57-7GQJ
Vulnerability from github – Published: 2023-11-17 18:30 – Updated: 2023-11-25 03:30Liblisp through commit 4c65969 was discovered to contain a out-of-bounds-read vulnerability in unsigned get_length(lisp_cell_t * x) at eval.c
{
"affected": [],
"aliases": [
"CVE-2023-48025"
],
"database_specific": {
"cwe_ids": [
"CWE-125"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-11-17T17:15:07Z",
"severity": "HIGH"
},
"details": "Liblisp through commit 4c65969 was discovered to contain a out-of-bounds-read vulnerability in unsigned get_length(lisp_cell_t * x) at eval.c",
"id": "GHSA-35c4-9r57-7gqj",
"modified": "2023-11-25T03:30:32Z",
"published": "2023-11-17T18:30:51Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-48025"
},
{
"type": "WEB",
"url": "https://github.com/howerj/liblisp/issues/1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-35C5-GV44-R3Q7
Vulnerability from github – Published: 2022-05-24 17:08 – Updated: 2022-05-24 17:08Adobe Acrobat and Reader versions 2019.021.20061 and earlier, 2017.011.30156 and earlier, 2017.011.30156 and earlier, and 2015.006.30508 and earlier have an out-of-bounds read vulnerability. Successful exploitation could lead to information disclosure .
{
"affected": [],
"aliases": [
"CVE-2020-3747"
],
"database_specific": {
"cwe_ids": [
"CWE-125"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2020-02-13T16:15:00Z",
"severity": "MODERATE"
},
"details": "Adobe Acrobat and Reader versions 2019.021.20061 and earlier, 2017.011.30156 and earlier, 2017.011.30156 and earlier, and 2015.006.30508 and earlier have an out-of-bounds read vulnerability. Successful exploitation could lead to information disclosure .",
"id": "GHSA-35c5-gv44-r3q7",
"modified": "2022-05-24T17:08:58Z",
"published": "2022-05-24T17:08:58Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-3747"
},
{
"type": "WEB",
"url": "https://helpx.adobe.com/security/products/acrobat/apsb20-05.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
Mitigation MIT-5
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- To reduce the likelihood of introducing an out-of-bounds read, ensure that you validate and ensure correct calculations for any length argument, buffer size calculation, or offset. Be especially careful of relying on a sentinel (i.e. special character such as NUL) in untrusted inputs.
Mitigation
Strategy: Language Selection
Use a language that provides appropriate memory abstractions.
CAPEC-540: Overread Buffers
An adversary attacks a target by providing input that causes an application to read beyond the boundary of a defined buffer. This typically occurs when a value influencing where to start or stop reading is set to reflect positions outside of the valid memory location of the buffer. This type of attack may result in exposure of sensitive information, a system crash, or arbitrary code execution.