From f001977d93ab083f9157d82f4726e9ef35efac80 Mon Sep 17 00:00:00 2001 From: nnposter Date: Sun, 11 Oct 2026 00:38:59 +0000 Subject: [PATCH] Fix IPv4 pattern for 192.0.2/24. Close #3536 --- CHANGELOG | 3 +++ nselib/ipOps.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 89990ba93..774ba7fba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -89,6 +89,9 @@ o [Zenmap][GH#3431] Fix "KeyError: 'vl_6_logo'" crash in Zenmap 7.991. o [NSE] Added DHX2 authentication method to afp.lua [Daniel Miller] +o [NSE][GH#3536] Function ipOps.isPrivate() was incorrectly treating all IPv4 + addresses starting with 192.0.2x or 192.0.2xx as private. [Pasi Abe] + o [NSE][GH#3494] Malformed TPKT header could have caused parser infinite loop in library iec61850mms. Truncated data were silently ignored. [Zasnit1, nnposter] diff --git a/nselib/ipOps.lua b/nselib/ipOps.lua index 35312886c..25c022c8d 100644 --- a/nselib/ipOps.lua +++ b/nselib/ipOps.lua @@ -91,7 +91,7 @@ isPrivate = function( ip ) return true, '192.168/16' elseif ip:match('^192%.[0][0]?[0]?%.[0][0]?[0]?%.') then return true, '192.0.0/24' - elseif ip:match('^192%.[0][0]?[0]?%.[0]?[0]?2') then + elseif ip:match('^192%.[0][0]?[0]?%.[0]?[0]?2%.') then return true, '192.0.2/24' end