Filebeat Improper Validation of Specified Index, Position, or Offset in Input
Description
Improper Validation of Specified Index, Position, or Offset in Input (CWE-1285) in Filebeat Syslog parser and the Libbeat Dissect processor can allow a user to trigger a Buffer Overflow (CAPEC-100) and cause a denial of service (panic/crash) of the Filebeat process via either a malformed Syslog message or a malicious tokenizer pattern in the Dissect configuration.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/elastic/beats/v7Go | >= 7.7.0, < 8.19.9 | 8.19.9 |
github.com/elastic/beats/v7Go | >= 9.0.0, < 9.1.9 | 9.1.9 |
github.com/elastic/beats/v7Go | >= 9.2.0, < 9.2.3 | 9.2.3 |
github.com/elastic/beats/v7Go | < 7.0.0-alpha2.0.20251204214633-dd3af18220bf | 7.0.0-alpha2.0.20251204214633-dd3af18220bf |
github.com/elastic/beatsGo | <= 7.6.2 | — |
Affected products
1- Range: <= 7.6.2
Patches
327a168fb1c59fix(filebeat): prevent panic in dissect processor with invalid field name (#47839) (#47929)
4 files changed · +67 −8
changelog/fragments/1764614942-fix-panic-in-dissect-processor-with-invalid-field-name.yaml+45 −0 added@@ -0,0 +1,45 @@ +# REQUIRED +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: bug-fix + +# REQUIRED for all kinds +# Change summary; a 80ish characters long description of the change. +summary: Prevent panic during startup if dissect processor has invalid field name in tokenizer + +# REQUIRED for breaking-change, deprecation, known-issue +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# description: + +# REQUIRED for breaking-change, deprecation, known-issue +# impact: + +# REQUIRED for breaking-change, deprecation, known-issue +# action: + +# REQUIRED for all kinds +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: filebeat + +# AUTOMATED +# OPTIONAL to manually add other PR URLs +# PR URL: A link the PR that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +# pr: https://github.com/owner/repo/1234 + +# AUTOMATED +# OPTIONAL to manually add other issue URLs +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +# issue: https://github.com/owner/repo/1234
libbeat/processors/dissect/const.go+1 −0 modified@@ -61,4 +61,5 @@ var ( errEmptyKey = errors.New("empty key") errInvalidDatatype = errors.New("invalid data type") errMissingDatatype = errors.New("missing data type") + errInvalidFieldName = errors.New("invalid field name") )
libbeat/processors/dissect/dissect_test.go+10 −5 modified@@ -87,20 +87,25 @@ func TestDissectConversion(t *testing.T) { }, Fail: false, }, + { + Name: "Invalid field name should fail gracefully", + Tok: "%{\n}", + Msg: "test message", + Expected: map[string]interface{}{}, + Fail: true, + }, } for _, test := range tests { t.Run(test.Name, func(t *testing.T) { d, err := New(test.Tok) - if !assert.NoError(t, err) { - return - } - if test.Fail { - _, err := d.DissectConvert(test.Msg) assert.Error(t, err) return } + if !assert.NoError(t, err) { + return + } r, err := d.DissectConvert(test.Msg) if !assert.NoError(t, err) {
libbeat/processors/dissect/field.go+11 −3 modified@@ -239,7 +239,10 @@ func newField(id int, rawKey string, previous delimiter) (field, error) { return newSkipField(id), nil } - key, dataType, ordinal, length, greedy := extractKeyParts(rawKey) + key, dataType, ordinal, length, greedy, err := extractKeyParts(rawKey) + if err != nil { + return nil, err + } // rawKey will have | as suffix when data type is missing if strings.HasSuffix(rawKey, dataTypeIndicator) { @@ -331,9 +334,14 @@ func newNormalField(id int, key string, dataType string, ordinal int, length int } } -func extractKeyParts(rawKey string) (key string, dataType string, ordinal int, length int, greedy bool) { +func extractKeyParts(rawKey string) (key string, dataType string, ordinal int, length int, greedy bool, err error) { m := suffixRE.FindAllStringSubmatch(rawKey, -1) + // check if we have at least one match otherwise the field is invalid. + if len(m) == 0 { + return "", "", 0, 0, false, errInvalidFieldName + } + if m[0][3] != "" { ordinal, _ = strconv.Atoi(m[0][3]) } @@ -348,5 +356,5 @@ func extractKeyParts(rawKey string) (key string, dataType string, ordinal int, l dataType = m[0][8] - return m[0][1], dataType, ordinal, length, greedy + return m[0][1], dataType, ordinal, length, greedy, nil }
339fa3f887a1fix(filebeat): prevent panic in dissect processor with invalid field name (#47839) (#47928)
4 files changed · +67 −8
changelog/fragments/1764614942-fix-panic-in-dissect-processor-with-invalid-field-name.yaml+45 −0 added@@ -0,0 +1,45 @@ +# REQUIRED +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: bug-fix + +# REQUIRED for all kinds +# Change summary; a 80ish characters long description of the change. +summary: Prevent panic during startup if dissect processor has invalid field name in tokenizer + +# REQUIRED for breaking-change, deprecation, known-issue +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# description: + +# REQUIRED for breaking-change, deprecation, known-issue +# impact: + +# REQUIRED for breaking-change, deprecation, known-issue +# action: + +# REQUIRED for all kinds +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: filebeat + +# AUTOMATED +# OPTIONAL to manually add other PR URLs +# PR URL: A link the PR that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +# pr: https://github.com/owner/repo/1234 + +# AUTOMATED +# OPTIONAL to manually add other issue URLs +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +# issue: https://github.com/owner/repo/1234
libbeat/processors/dissect/const.go+1 −0 modified@@ -61,4 +61,5 @@ var ( errEmptyKey = errors.New("empty key") errInvalidDatatype = errors.New("invalid data type") errMissingDatatype = errors.New("missing data type") + errInvalidFieldName = errors.New("invalid field name") )
libbeat/processors/dissect/dissect_test.go+10 −5 modified@@ -87,20 +87,25 @@ func TestDissectConversion(t *testing.T) { }, Fail: false, }, + { + Name: "Invalid field name should fail gracefully", + Tok: "%{\n}", + Msg: "test message", + Expected: map[string]interface{}{}, + Fail: true, + }, } for _, test := range tests { t.Run(test.Name, func(t *testing.T) { d, err := New(test.Tok) - if !assert.NoError(t, err) { - return - } - if test.Fail { - _, err := d.DissectConvert(test.Msg) assert.Error(t, err) return } + if !assert.NoError(t, err) { + return + } r, err := d.DissectConvert(test.Msg) if !assert.NoError(t, err) {
libbeat/processors/dissect/field.go+11 −3 modified@@ -239,7 +239,10 @@ func newField(id int, rawKey string, previous delimiter) (field, error) { return newSkipField(id), nil } - key, dataType, ordinal, length, greedy := extractKeyParts(rawKey) + key, dataType, ordinal, length, greedy, err := extractKeyParts(rawKey) + if err != nil { + return nil, err + } // rawKey will have | as suffix when data type is missing if strings.HasSuffix(rawKey, dataTypeIndicator) { @@ -331,9 +334,14 @@ func newNormalField(id int, key string, dataType string, ordinal int, length int } } -func extractKeyParts(rawKey string) (key string, dataType string, ordinal int, length int, greedy bool) { +func extractKeyParts(rawKey string) (key string, dataType string, ordinal int, length int, greedy bool, err error) { m := suffixRE.FindAllStringSubmatch(rawKey, -1) + // check if we have at least one match otherwise the field is invalid. + if len(m) == 0 { + return "", "", 0, 0, false, errInvalidFieldName + } + if m[0][3] != "" { ordinal, _ = strconv.Atoi(m[0][3]) } @@ -348,5 +356,5 @@ func extractKeyParts(rawKey string) (key string, dataType string, ordinal int, l dataType = m[0][8] - return m[0][1], dataType, ordinal, length, greedy + return m[0][1], dataType, ordinal, length, greedy, nil }
2f971a057eeafix(filebeat): prevent panic in dissect processor with invalid field name (#47839) (#47927)
4 files changed · +67 −8
changelog/fragments/1764614942-fix-panic-in-dissect-processor-with-invalid-field-name.yaml+45 −0 added@@ -0,0 +1,45 @@ +# REQUIRED +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: bug-fix + +# REQUIRED for all kinds +# Change summary; a 80ish characters long description of the change. +summary: Prevent panic during startup if dissect processor has invalid field name in tokenizer + +# REQUIRED for breaking-change, deprecation, known-issue +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# description: + +# REQUIRED for breaking-change, deprecation, known-issue +# impact: + +# REQUIRED for breaking-change, deprecation, known-issue +# action: + +# REQUIRED for all kinds +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: filebeat + +# AUTOMATED +# OPTIONAL to manually add other PR URLs +# PR URL: A link the PR that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +# pr: https://github.com/owner/repo/1234 + +# AUTOMATED +# OPTIONAL to manually add other issue URLs +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +# issue: https://github.com/owner/repo/1234
libbeat/processors/dissect/const.go+1 −0 modified@@ -61,4 +61,5 @@ var ( errEmptyKey = errors.New("empty key") errInvalidDatatype = errors.New("invalid data type") errMissingDatatype = errors.New("missing data type") + errInvalidFieldName = errors.New("invalid field name") )
libbeat/processors/dissect/dissect_test.go+10 −5 modified@@ -87,20 +87,25 @@ func TestDissectConversion(t *testing.T) { }, Fail: false, }, + { + Name: "Invalid field name should fail gracefully", + Tok: "%{\n}", + Msg: "test message", + Expected: map[string]interface{}{}, + Fail: true, + }, } for _, test := range tests { t.Run(test.Name, func(t *testing.T) { d, err := New(test.Tok) - if !assert.NoError(t, err) { - return - } - if test.Fail { - _, err := d.DissectConvert(test.Msg) assert.Error(t, err) return } + if !assert.NoError(t, err) { + return + } r, err := d.DissectConvert(test.Msg) if !assert.NoError(t, err) {
libbeat/processors/dissect/field.go+11 −3 modified@@ -239,7 +239,10 @@ func newField(id int, rawKey string, previous delimiter) (field, error) { return newSkipField(id), nil } - key, dataType, ordinal, length, greedy := extractKeyParts(rawKey) + key, dataType, ordinal, length, greedy, err := extractKeyParts(rawKey) + if err != nil { + return nil, err + } // rawKey will have | as suffix when data type is missing if strings.HasSuffix(rawKey, dataTypeIndicator) { @@ -331,9 +334,14 @@ func newNormalField(id int, key string, dataType string, ordinal int, length int } } -func extractKeyParts(rawKey string) (key string, dataType string, ordinal int, length int, greedy bool) { +func extractKeyParts(rawKey string) (key string, dataType string, ordinal int, length int, greedy bool, err error) { m := suffixRE.FindAllStringSubmatch(rawKey, -1) + // check if we have at least one match otherwise the field is invalid. + if len(m) == 0 { + return "", "", 0, 0, false, errInvalidFieldName + } + if m[0][3] != "" { ordinal, _ = strconv.Atoi(m[0][3]) } @@ -348,5 +356,5 @@ func extractKeyParts(rawKey string) (key string, dataType string, ordinal int, l dataType = m[0][8] - return m[0][1], dataType, ordinal, length, greedy + return m[0][1], dataType, ordinal, length, greedy, nil }
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-2mj3-6grc-px38ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-68383ghsaADVISORY
- discuss.elastic.co/t/filebeat-8-19-9-9-1-9-and-9-2-3-security-update-esa-2025-32/384180ghsaWEB
- github.com/elastic/beats/commit/27a168fb1c598d4a16748e9a7382bc0d197335a5ghsaWEB
- github.com/elastic/beats/commit/2f971a057eea68e057b47829950cd8c26805df30ghsaWEB
- github.com/elastic/beats/commit/339fa3f887a14c91e0c955b50a3b8819393bd632ghsaWEB
News mentions
0No linked articles in our index yet.