Skip to content

fix: [scanmalware] list only browser-contacted hosts, report a degraded CT answer, trailing dot - #935

Merged
adulau merged 3 commits into
MISP:mainfrom
jonaslejon:fix/scanmalware-hosts-and-dot
Oct 15, 2026
Merged

adulau merged 3 commits into
MISP:mainfrom
jonaslejon:fix/scanmalware-hosts-and-dot

Conversation

@jonaslejon

Copy link
Copy Markdown
Contributor

Three small fixes to the ScanMalware expansion module (#803, #806, #916), one commit each. Disclosure: I run ScanMalware and wrote the module.

  • Hosts labelled "contacted by a browser during a scan" were not all contacted. The /hosts endpoint's default sources are observed, scripts and stream, and a stream host was never fetched (a third party asked about it and DNS confirms it exists). The module now asks for sources=observed,scripts, which is what the label and the module description say. Live today, for github.com, 174 hosts carried the label and 18 had been contacted; for example.com, 4 and 0.
  • A degraded Certificate Transparency answer came back as "No ScanMalware results". Under load /ct/dns answers 200 with degraded: true, which the API documents as "we could NOT look": an empty list is an absence of data, not a fact about the domain. The module now adds a partial-result note saying the data could not be read and to retry.
  • A trailing dot on the scanned host. _is_scan_of_host stripped the dot from the attribute's host but not from the scanned URL's host, so a URL on example.com. never matched the host's own scan of https://example.com./. Both sides are now normalized.

Tests: 21 pass (3 new, each failing without its fix). black, isort and flake8 clean.

_is_scan_of_host stripped a trailing dot from the attribute's host but
not from the scanned URL's host, so a URL on example.com. never matched
the host's own scan of https://example.com./ and the module reported no
result. Both hosts are now normalized the same way.
The /hosts endpoint's default sources are observed, scripts and stream.
A stream host was never fetched: a third party asked about it and DNS
confirms it exists. The module labelled every returned host "contacted
by a browser during a scan", so for github.com 156 of the 174 hosts it
added carried a false label. It now asks for sources=observed,scripts,
the two runtime-observed sources, which is what the label and the module
description say.
/ct/dns sheds load under pressure and then answers 200 with
degraded: true. The API documents that as "we could NOT look": an empty
subdomain list is an absence of data, not a fact about the domain. The
module read it as an answer, so a lookup that never happened came back
as "No ScanMalware results for this attribute". It now adds a partial
result note saying the data could not be read and to retry.
@adulau
adulau merged commit da6a01f into MISP:main Oct 15, 2026
7 checks passed
@adulau

adulau commented Oct 15, 2026

Copy link
Copy Markdown
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants