Skip to content

[Windows system.security] IPv6 gsub causes invalid IPs #9650

@ethack

Description

@ethack

The following processor can turn valid IPv6 address into invalid ones.

- gsub:
field: source.ip
pattern: "::ffff:"
replacement: ""
ignore_missing: true

Examples:

  • fe80::ffff:ffff:fffe -> fe80ffff:fffe
  • fe80::ffff:ffff:ffff:ffff -> fe80ffff:ffff:ffff

Which then later causes errors such as 'fe80ffff:ffff:ffff' is not an IP string literal. in other processors. It also causes other issues.
image

I believe this processor's intent is to transform IPs such as ::ffff:192.168.1.1 into 192.168.1.1. In which case, the pattern should be ^::ffff: to anchor the pattern at the beginning of the string. (See my below comment for a better proposed solution.)

  - gsub:
      field: source.ip
      pattern: "^::ffff:"
      replacement: ""
      ignore_missing: true

I tested this in a simulated pipeline using both fe80::ffff:ffff:fffe and ::ffff:192.168.1.1 values. It correctly left the former untouched and correctly stripped the prefix from the latter.

References:

Metadata

Metadata

Assignees

Labels

Integration:windowsWindowsTeam:Security-Windows PlatformSecurity Windows Platform team [elastic/sec-windows-platform]bugSomething isn't working, use only for issues

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions