# False Positive In SID 2072593, SID 2072598 (ET HUNTING \* Header Set to localhost)

**URL:** <https://community.emergingthreats.net/t/false-positive-in-sid-2072593-sid-2072598-et-hunting-header-set-to-localhost/3534>\
**Category:** Rule Signatures\
**Tags:** etopen, false-positives\
**Created:** [November 13, 2026, 6:17am UTC](https://community.emergingthreats.net/t/false-positive-in-sid-2072593-sid-2072598-et-hunting-header-set-to-localhost/3534 "2026-11-13T06:17:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jurgis.gregov](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jurgis.gregov](https://community.emergingthreats.net/u/jurgis.gregov)\
**Post date:** [November 13, 2026, 6:17am UTC](https://community.emergingthreats.net/t/false-positive-in-sid-2072593-sid-2072598-et-hunting-header-set-to-localhost/3534/1 "2026-11-13T06:17:20Z")

</div>

Hello,

wanted to report about:

- ET HUNTING X-Forward-For Header Set to localhost
- ET HUNTING X-Real-IP Header Set to localhost

expected rules should match when IP is 127._\*_.\*.\*,  
actual rules match when IP contains 127, e.g. 172.71.127.87

cannot make heads and tails out of rule’s pcre, which is:

pcre:“/^.\*(?:127(?:(\x2e0){1,}?\x2e1|(\x2e[0-9]{1,3}){1,3})|0177.?0000.?0000.?0001|7f000001|2130706433|01111111.?00000000.?00000000.?00000001|\x3a\x3a1|169\x2e254\x2e169\x2e254|ec2\x3a\x3a254|localhost)/Ri”;

but possible fix with minimal side effects, could be:  
pcre:“/^.\*(?:(?\<![0-9.])127(?:(\x2e0){1,}?\x2e1|(\x2e[0-9]{1,3}){1,3})|0177.?0000.?0000.?0001|7f000001|2130706433|01111111.?00000000.?00000000.?00000001|\x3a\x3a1|169\x2e254\x2e169\x2e254|ec2\x3a\x3a254|localhost)/Ri”;

Best Regards,  
Jurgis

---

<div class="post-metadata">

**Author:** ![christopherdavis](https://avatars.discourse-cdn.com/v4/letter/c/2bfe46/32.png) [@christopherdavis](https://community.emergingthreats.net/u/christopherdavis)\
**Post date:** [November 13, 2026, 8:15pm UTC](https://community.emergingthreats.net/t/false-positive-in-sid-2072593-sid-2072598-et-hunting-header-set-to-localhost/3534/2 "2026-11-13T20:15:22Z")

</div>

Your lookbehind fixes the reported substring case, but it only guards the literal 127 branch. The other alternatives (0177…, 7f000001, ::1, etc.) are still unanchored, so similar false positives could remain for those forms. Consider adding a common delimiter/start boundary around the entire alternation and an end boundary after it, rather than only before 127. Also test comma-separated X-Forwarded-For values, since matching any occurrence in a list can produce unexpected hits.

---

<div class="post-metadata">

**Author:** ![trobinson667](https://sea2.discourse-cdn.com/flex016/user_avatar/community.emergingthreats.net/trobinson667/32/544_2.png) [@trobinson667](https://community.emergingthreats.net/u/trobinson667)\
**Post date:** [November 19, 2026, 8:05pm UTC](https://community.emergingthreats.net/t/false-positive-in-sid-2072593-sid-2072598-et-hunting-header-set-to-localhost/3534/3 "2026-11-19T20:05:53Z")

</div>

Hello! This rule is one of mine. I ended up modifying the regex to this:

`pcre:"/^[^\x2e]*(?:127(?:(\x2e0){1,}?\x2e1|(\x2e[0-9]{1,3}){1,3})|0177.?0000.?0000.?0001|7f000001|2130706433|01111111.?00000000.?00000000.?00000001|\x3a\x3a1|169\x2e254\x2e169\x2e254|ec2\x3a\x3a254|localhost)/Ri";`

The purpose of this regex is to catch a bunch of different funky ways that different servers can parse `127.0.0.1`.

for example:

```auto
127.1
127.0.1
127.0.0.1 

```

are all valid notations for the IP address `127.0.0.1`

but also, I’m trying to capture other IP address in `127.0.0.0/8` as well in a somewhat quick and dirty manner. the other formats you see are [decimal, octal, hex, and binary notations for 127.0.0.1](https://www.silisoftware.com/tools/ipconverter.php?convert_from=127.0.0.1). Additionally we’re looking for `169.254.169.254` (or the equivalent ipv6 address containing the string `ec2::254`) to capture strange CSRF requests for [AWS metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html). We’re also looking for the literal string `localhost`, case-insensitive.

Some might notice that I’m using the period wildcard character for some of the other notation types (hex, binary, octal, etc.) that is because sometimes these address can specify periods, spaces or NO separation characters at all for the different octets, and different web applications can and WILL honor those weird notations. That’s why `.?` is present in so many of them and not something like `\x2e?`

The regular expression change I made should be going live in tonight’s rule release and should help to relieve the false positives you’re experiencing. Should this continue to be a problem, please let me know and I’ll try to address any problems from there.

**Note:** this new modification probably won’t work for XFF headers that have multiple comma separated values. so keep that in mind.

Thanks,

-Tony

---

<div class="post-metadata">

**Author:** ![CroisanaLoiser](https://avatars.discourse-cdn.com/v4/letter/c/a9adbd/32.png) [@CroisanaLoiser](https://community.emergingthreats.net/u/CroisanaLoiser)\
**Post date:** [November 25, 2026, 4:30pm UTC](https://community.emergingthreats.net/t/false-positive-in-sid-2072593-sid-2072598-et-hunting-header-set-to-localhost/3534/4 "2026-11-25T16:30:31Z")

</div>

This post was flagged by the community and is temporarily hidden.
