Fix version truncation. Fixes #3492. Closes #3493

This commit is contained in:
dmiller 2026-09-19 15:47:01 +00:00
parent 8a11c8c204
commit 3da280ba11
2 changed files with 15 additions and 0 deletions

View file

@ -2,6 +2,10 @@
o Upgraded included libraries: libpcap 1.10.7, pcre2 10.48, lua 5.4.9
o [NSE][GH#3492] vulners API queries for versions like 4.100 were being
truncated on the server, resulting in false positives. Fixed by encoding as
string. [huuyafwww]
o [Ncat][GH#3489][GH#3498] Ncat in listen mode no longer sends termination
signals to its process group. Ncat inherits the group of whatever launched
it, so a SIGINT, SIGTERM, SIGHUP, or SIGQUIT could also terminate the

View file

@ -60,6 +60,7 @@ local string = require "string"
local table = require "table"
local nmap = require "nmap"
local stdnse = require "stdnse"
local url = require "url"
local api_version="1.2"
local mincvss=stdnse.get_script_args("vulners.mincvss")
@ -132,6 +133,16 @@ function get_results(what, vers, type)
any_af = true,
}
-- numeric versions are type-inferred to be numbers and trailing zeroes are
-- truncated. Submit as a string explicitly.
vers = url.escape(json.generate(vers))
-- Service rejects uri-encoded CPE strings,
-- but also rejects software names with non-uri-encoded spaces.
if type ~= "cpe" then
what = url.escape(what)
end
local response = http.get_url(('%s?software=%s&version=%s&type=%s'):format(api_endpoint, what, vers, type), option)
local status = response.status