Registry Mirror
Skip to content

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

zabbix-panel and icinga-panel fingerprint the monitoring frontends by two framework-specific login-page classes under an and-condition, so a generic 200 cannot trip them. strings were verified against current upstream login markup.

zabbix-api-exposure posts the unauthenticated apiinfo.version json-rpc call and matches on status 200 plus a jsonrpc-2.0 dotted-result body, which nothing but apiinfo.version answers with. it does not match on the response content-type: application/json-rpc is a request precondition, ui/api_jsonrpc.php accepts application/json-rpc, application/json or application/jsonrequest and answers 412 otherwise, then always sets header('Content-Type: application/json'). since matchers are and'd, requiring json-rpc back meant the module never fired against a live instance.

the low severity matches the compatible-shape (not product-string) nature of that evidence. the test drives the real application/json response, keeps application/json-rpc as a second firing case for proxies that echo the request type, and pins a json-rpc error body as silent.

@TBX3D
TBX3D requested a review from vmfunc as a code owner July 3, 2026 09:21
@github-actions github-actions Bot added size/m <200 lines changed modules changes to scan modules tests test changes labels Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026 •

Copy link
Copy Markdown

pr summary

4 files changed (+197 -0)

category files
go source 1
tests 1

@codecov-commenter

codecov-commenter commented Jul 3, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.67%. Comparing base (f250590) to head (bfcdd92).
⚠️ Report is 58 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #275      +/-   ##
==========================================
+ Coverage   64.93%   68.67%   +3.74%     
==========================================
  Files          88       89       +1     
  Lines        7908     8913    +1005     
==========================================
+ Hits         5135     6121     +986     
- Misses       2379     2388       +9     
- Partials      394      404      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vmfunc vmfunc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

panels are good, the two-class and-condition on each is specific enough that a generic 200 won't trip them.

the api module i want to hold on. line 27, the header matcher requires the response content-type to contain application/json-rpc. pretty sure that's the request content-type, not the response... real zabbix api_jsonrpc.php answers apiinfo.version with Content-Type: application/json. if that's right, since matchers are and'd this never fires against a live instance and the module is dead. the test doesn't catch it because it hardcodes application/json-rpc on the mock, so it's just asserting the module's own assumption back at itself.

verify against a real zabbix (any 6.x/7.x). if it comes back application/json like i think, either drop the header matcher entirely (status 200 + the jsonrpc-2.0/dotted-result regex is already specific to apiinfo.version, nothing else answers that shape) or make it condition: or with both types. fix that and it's in.

Copilot AI review requested due to automatic review settings July 22, 2026 22:17
@TBX3D

TBX3D commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

you were right and it is worse than a mismatch, the module could never have
fired. checked ui/api_jsonrpc.php upstream:

$allowed_content = [
'application/json-rpc' => 'json-rpc',
'application/json' => 'json-rpc',
'application/jsonrequest' => 'json-rpc'
];
...
header('Content-Type: application/json');

so those three types are a request precondition (412 otherwise) and the response
is always application/json. dropped the response header matcher entirely, as you
suggested: status 200 plus the jsonrpc-2.0 dotted-result regex is already
specific to apiinfo.version.

the test was asserting the bug back at itself, it served the mock as
application/json-rpc and required the real application/json case to produce zero
findings. it now drives the real shape, keeps json-rpc as a second firing case
for proxies that echo the request type, and pins a json-rpc error body as silent.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new reconnaissance/info modules to fingerprint Zabbix and Icinga monitoring frontends, plus a new recon module (and test) to detect unauthenticated Zabbix JSON-RPC version disclosure.

Changes:

  • Added zabbix-api-exposure HTTP module to detect unauthenticated apiinfo.version exposure and extract the leaked version.
  • Added zabbix-panel and icinga-panel HTTP modules to fingerprint the respective login panels using framework-specific markup.
  • Added a Go unit test covering positive/negative cases for zabbix-api-exposure.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
modules/recon/zabbix-api-exposure.yaml New recon module to detect Zabbix JSON-RPC version leak and extract version.
modules/info/zabbix-panel.yaml New info module to identify Zabbix login panel via HTML markers and extract server name.
modules/info/icinga-panel.yaml New info module to identify Icinga Web 2 login panel via HTML markers.
internal/modules/zabbix_api_exposure_test.go New unit test validating the Zabbix API exposure module behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread modules/recon/zabbix-api-exposure.yaml Outdated
Comment on lines +33 to +36
- type: regex
part: body
regex:
- '"jsonrpc"\s*:\s*"2\.0"\s*,\s*"result"\s*:\s*"[0-9]+\.[0-9]+(\.[0-9]+)?"'
@TBX3D
TBX3D force-pushed the feat/monitoring-exposure-modules branch from 985030d to fd8093c Compare July 22, 2026 22:55
@TBX3D

TBX3D commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

one more on the api module: the body regex required "jsonrpc":"2.0" immediately
before "result", which assumes json object key order. that holds for zabbix
today but is not guaranteed by anything, so a reordered body like
{"id":1,"jsonrpc":"2.0","result":"7.0.5"} would have been missed.

split into two and'd patterns so the match is order-insensitive, with a test
case for the reordered shape.

@TBX3D

TBX3D commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

CI on this branch is red for a reason unrelated to the change: main does not
build at 2ce359a, internal/modules/executor.go:197 references MaxBodySize after
#355 moved it into internal/httpx, so every branch merged against main fails the
same way:

internal/modules/executor.go:197:57: undefined: MaxBodySize

#374 fixes it. this branch builds and tests clean with that one-line fix applied
on top; no action needed here.

@TBX3D
TBX3D force-pushed the feat/monitoring-exposure-modules branch from fd8093c to 5be1614 Compare July 22, 2026 23:46
TBX3D added 3 commits August 22, 2026 11:58
zabbix-panel and icinga-panel fingerprint the monitoring frontends by two
framework-specific login-page classes under an and-condition, so a generic 200
cannot trip them. zabbix-api-exposure posts the unauthenticated apiinfo.version
json-rpc call and requires both the json-rpc content-type and a dotted-version
result, so a foreign json-rpc service or a version served under another
content-type stays silent.
drop top-line comments that just restate the id/name fields already
present in the same file
application/json-rpc is a request precondition, not a response type.
ui/api_jsonrpc.php accepts application/json-rpc, application/json or
application/jsonrequest and answers 412 otherwise, then always sets
`header('Content-Type: application/json')`. matchers are and'd, so
requiring json-rpc back meant the module never fired against a live
instance.

the test served the mock as application/json-rpc and asserted the real
application/json case produced no findings, so it locked the dead
behaviour in. it now runs the real shape and keeps json-rpc as a second
firing case for proxies that echo the request type.

status 200 plus the jsonrpc-2.0 dotted-result regex is already specific to
apiinfo.version; a json-rpc error body stays silent.
@TBX3D
TBX3D force-pushed the feat/monitoring-exposure-modules branch from 5be1614 to bfcdd92 Compare August 22, 2026 20:26
@TBX3D

TBX3D commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

you're right — that was the request content-type leaking into the response matcher. dropped the response content-type matcher entirely: Content-Type: application/json-rpc now stays only as the request precondition (zabbix 412s without one of json-rpc/json/jsonrequest on the request), and the module keys on status 200 + two and'd regexes (jsonrpc:2.0 and a dotted result version), which is specific to apiinfo.version.

fixed the test to match real behavior: the mock now answers Content-Type: application/json (real api_jsonrpc.php) and the module still fires; added cases that it also fires on application/json-rpc, and does not fire on a non-version "result":"pong" or on a jsonrpc error object. panels untouched.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at bfcdd92. CI is green and the branch merges cleanly into current main (no zabbix/icinga module ID collisions on main).

The change @vmfunc asked for is in: the response content-type matcher is gone, Content-Type: application/json-rpc is only sent as a request header, and the API module now keys on status 200 plus two and'd regexes. The test now uses the real application/json response. I see no correctness or security problems in the API module.

Remaining suggestions (none blocking):

  1. Panel modules have no tests. zabbix-panel and icinga-panel are the only new modules without fire/silent coverage. Other panels are covered in internal/modules/login_panels_test.go. Please add a case per panel there: one that fires on a minimal real login-page snippet, one that stays silent when only one of the two markers is present (this is what proves the and-condition works), and an assertion that zabbix_server_name gets extracted.
  2. Subtests. TestZabbixAPIExposureModule runs five scenarios in one function. Splitting them into t.Run(...) subtests, as the sibling exposure tests do, would make failures easier to identify.
  3. Duplicate findings on root installs (minor). On zabbix-panel, {{BaseURL}} and {{BaseURL}}/index.php usually serve the same login page on a root-mounted Zabbix, so one host can produce two findings. Other panel modules do this too, so it's fine to keep. Dropping the bare {{BaseURL}} path would remove the duplicate if you'd rather avoid it.

Merge status: still blocked on the existing CHANGES_REQUESTED review. It needs a maintainer to re-review and approve the latest commit.

Written by Devin

condition: and
words:
- 'id="icinga-logo"'
- 'class="login-form"'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pin these two markers with a test fixture taken from real Icinga Web 2 login markup (2.11/2.12). id="icinga-logo" and class="login-form" are plausible, but no test covers them. If upstream renders the form with a different class, the and-condition will never match, which is the same problem the API module had with its content-type matcher.

@vmfunc vmfunc closed this Nov 5, 2026
@vmfunc vmfunc reopened this Nov 5, 2026
@vmfunc
vmfunc merged commit b6b01b5 into vmfunc:main Nov 5, 2026
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modules changes to scan modules size/m <200 lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants