Skip to content

v1.44

Latest

Choose a tag to compare

@hermanekt hermanekt released this 28 Nov 02:03
32a3e9a

v1.44 - 2026-11-28

A server that listens on all interfaces serves the clients that reach it by its address again (#112, @omyhub, with a fix for the IP allowlist by @Ankur1911 in #113), the admin portal shows who was refused and why, and the fixes found by a review of the code and of every tool on 5.0 to 8.0. Every fix has a regression test that fails without it.

Upgrading

  • host = "0.0.0.0" without public_url and without allowed_origins (the Docker default, a plain LAN install): clients that address the server by its IP or name are served again; since v1.34 they were answered 421 Invalid Host header and only localhost worked. Nothing to change. The Host / Origin check is off in this setup, as the documentation and the startup log always said; set public_url to switch it on.
  • allowed_hosts (the IP allowlist) no longer switches the Host / Origin check on. A setup with only the IP allowlist refused every request before, so nothing that worked changes. One narrow case does: public_url set, the server's own address also in allowed_hosts, and a client on the server itself addressing it by that bare address on the default port. That request was let through by accident and is now answered 421 like every address other than public_url; use the public_url address or localhost.
  • allowed_origins without public_url on a server other machines reach: only localhost got through before (421 for everybody else), so nothing that worked changes. The Origin is now checked against the list and the Host is not, since the addresses clients use are not known without public_url. Set public_url (and additional_hosts) to have the Host checked too.
  • SLA effective_date given as a date or date-time is now stored as 00:00 UTC of the day written, which is what Zabbix shows and counts from. East of UTC it was stored as the day before. An SLA created through this server with a text date may therefore start one day early: check it with sla_get (effective_date_local now shows the stored UTC day) and correct it with sla_update.
  • A switch written in quotes in config.toml (enabled = "false") was read as on. It is read as written now; a server that relied on "false" meaning on changes behaviour, which only a config with that typo does.
  • install.sh update on a checked-out tag or commit installs that version and no longer moves the tree to the newest code. This is the way back after a bad update: git checkout v1.43 && sudo ./deploy/install.sh update. A clone on main updates as before.
  • public_url set: the same clients are served as before, and a few more: the address with or without the scheme's default port, in the spelling as written, localhost on any port, and the origins of cors_origins. Nothing that was accepted is refused.
  • [oauth] enabled = true without an https address (no https public_url, no TLS, not on a local address) did not start before either; it now says why and exits instead of a traceback.
  • A name in allowed_hosts ("mcp.example.com") stopped the start with a traceback; it is now a configuration error that says the list takes client addresses. A list with addresses and networks is unaffected.
  • install.sh update exits 1 when the server does not answer after the restart (it printed "Update complete" and exited 0), and no longer stops half-way on a ${VAR} in config.toml that is set only in the service's environment. The logrotate rule is rewritten to cover server.log only.
  • host = "127.0.0.1" behind a reverse proxy and stdio behave as before.

Added

  • Admin portal, Dashboard: "Client access". The requests the server refused before they reached a tool, since it started: the address the client used (Host header, HTTP 421), the web origin (Origin header, HTTP 403) and the client address outside the IP allowlist (HTTP 403), each with the value sent, the number of requests and when it was last seen, and one sentence on which setting does it and what to change. A client sees only the status code, and the operator saw nothing outside the log. The card also states what is enforced right now: the listen address, the accepted addresses and origins, the IP allowlist. The record lives in memory, is capped (25 values per kind, 120 characters each) and is fed from request headers, so it is shown escaped.

  • [server].additional_hosts: further addresses clients use to reach the server, next to public_url (["10.1.2.3:8080", "zabbix-mcp"]): the address by IP for clients inside the network, a container's service name. With public_url set, a request addressed to anything else was refused (421) and no setting could add a second address. A name without a port is accepted on any port. Also in the portal (Settings, "Additional addresses"), and the "Client access" card names it when it sees such a refusal.

  • The portal refuses what the server would not start with. Settings are run through the server's own loader before they are saved, plus what the loader does not check (TLS files that are missing or are not a certificate and its key, a portal port equal to the MCP port, a listen address that is not one, numbers typed as 8e3): "Not saved: the server would not start with these settings" and the reason. "Restart" checks config.toml the same way first and stays up when it does not load, since the portal lives in the process that would exit. A file that was already broken can still be edited from the portal.

  • python -m zabbix_mcp.healthcheck [port]: the health probe the image and the compose file now use. It tries http and then https, so a container with tls_cert_file set is no longer unhealthy for good.

Security

  • Admin portal: a request body is limited by route (64 KB for the login form, 1 MB for other forms, 8 MB for uploads and report templates; HTTP 413 above). Nothing limited it: one unauthenticated POST of a few hundred megabytes to /login was read into memory by the process that also serves MCP (measured: 83 MB to 474 MB resident for one request).
  • A failed login with an oversized user name is refused before it is logged (64 characters). The name went to the audit log and the server log in full, a megabyte per attempt, which pushed real audit entries out of the three rotated files.
  • auth_token that resolves to an empty string ("${MCP_AUTH_TOKEN}" with the variable defined but empty, which the compose file always does) meant "no token" without a word. It is said on stderr and in the log at start. Behaviour is unchanged: a deployment that runs this way keeps starting.
  • Deleting the last token says that the next restart leaves the MCP endpoint without authentication.

Fixed

  • A server on 0.0.0.0 answered 421 Invalid Host header to every client that did not use localhost (#112, since v1.34, the move to the MCP SDK 2.0). The listen address was not handed to the SDK, which then took every server for a local one and, with no public_url and no allowed_origins, accepted only localhost as the Host. The startup log said "DNS rebinding protection is OFF" all the while. The listen address is handed on now, and the log says what is enforced: on a local address "ENABLED ... only localhost", on 0.0.0.0 "OFF".
  • The SSE transport ignored public_url and allowed_origins: its app was built without any settings, so it accepted localhost only, whatever was configured. It gets the same settings as the HTTP transport.
  • An IP allowlist ([server].allowed_hosts) made every request fail with "Invalid Host header" (#113, @Ankur1911). The list holds client addresses and networks, but it was also handed to the SDK as the list of valid Host header values, which are the address a client used to reach the server (10.1.2.3:8080). A network never matches a Host value, and a bare address lacks the port. The list is no longer used for the Host check and no longer switches DNS-rebinding protection on by itself; public_url and allowed_origins do, as documented, and the IP allowlist keeps being enforced as before.
  • public_url was compared too literally. https://mcp.example.com:443 accepted only Host: mcp.example.com:443, which no client sends; an IPv6 literal lost its brackets and matched nothing; MCP.Example.com matched only in lower case; and localhost was accepted on the listen port only, so a published Docker port (-p 9000:8080) was refused. Both forms of a default port, the brackets, the spelling as written and localhost on any port are accepted now.
  • cors_origins could not serve an MCP client in a browser. Only Authorization and Content-Type were allowed, so the preflight of every request that carries Mcp-Session-Id or Mcp-Protocol-Version was refused, and the session id of initialize was not exposed to the page. With public_url set, an origin from cors_origins passed CORS and was then refused by the Origin check (403). The MCP headers are allowed and exposed, and a cors_origins entry counts as an allowed origin ("*" does not).
  • host = "::1" or "::" with authentication did not start: the server's URL was built as http://::1:8080. IPv6 literals are bracketed in the URL and in the log. ("::" listens on IPv6 only.)
  • An IP allowlist without 127.0.0.1 made the container unhealthy: /health from the machine itself was refused. A direct request to /health from a loopback address is answered; every other path, and a /health forwarded by a proxy, goes by the list as before.
  • The admin portal behind --host / --transport (the compose file passes --host 0.0.0.0) showed the address and transport of config.toml: the client wizard offered 127.0.0.1 and no address picker. It goes by what the server runs with. Its status dot showed "offline" for a server with TLS (the probe was plain http).
  • Admin portal, token edit: "Never expires" did nothing. The date field is disabled when the box is ticked and was not posted, so the stored date stayed while the form said "Token updated". The date is removed.
  • A token expiry was checked against the local clock and read as UTC at use: "tomorrow" typed in the evening west of UTC made a token that was refused on its first call. Both are UTC now (a date is 00:00 UTC of that day).
  • Admin portal settings: 0 or 2026 typed into a text setting (host, log_file) was written as a number; the lower bound of "Response max chars" was 1024 while the server needs 5000; the login lockout message said 30 seconds for a 5 minute window.
  • Startup log: the SSE endpoint was printed as /mcp; host = "localhost" and "::1" were reported as an unauthenticated, unencrypted network server; with OAuth or [tokens.*] in use the summary still listed auth_token as a disabled feature; stdio printed "Listening on 127.0.0.1:8080".
  • install.sh generate-token <name> was refused as "Unknown argument" in every release that documented it. The name is taken.
  • install.sh test-config printed nothing for an invalid config, only exit code 1. It says what is wrong.
  • install.sh migrated a legacy auth_token wrongly when the line had a trailing comment or the token contained =: the hash written to [tokens.legacy] was of another string. The value is read with a TOML parser.
  • The installer's logrotate rule emptied audit.log every night (*.log with copytruncate), and the portal's audit page reads only that file. The rule covers server.log; the audit log rotates itself by size.
  • An Origin allowlist without a Public URL refused every client on another machine (421, since v1.26): the Host check ran against localhost alone. See Upgrading.
  • sla_create / sla_update: effective_date as a date was stored one day early east of UTC (Europe/Prague: 2026-11-28 became the 27th in the Zabbix frontend), and effective_date_local in the answer hid it. Confirmed on 6.0, 7.2 and 8.0.
  • user.logout could be sent on the server's own connection (zabbix_raw_api_call, or user_logout with an empty auth_sessionid): on a legacy_auth server (5.0 / 5.2) that ended the one session every tool and token shares, and every call failed until a restart. It is refused before anything is sent, with what to use instead.
  • usergroup_update with userdirectoryid: "0" was answered with success while the group stayed on its LDAP directory (confirmed on 6.2, 6.4, 7.2): the "0" was dropped as a default. It is sent.
  • Custom report templates never reached the PDF: report_generate knew the built-in types only, and a built-in file shadowed a custom template of the same name.
  • Availability reports left out problems that began before the period and counted overlapping ones twice; the backup report took any text containing "1" for success.
  • trigger_get with selectDependencies, event_get with selectRelatedObject: the expression of the nested trigger stayed in the stored form ({35867}<{$UP.MIN}); it is expanded like the trigger's own.
  • Zabbix 5.2 / 5.4: 43 properties those releases have were dated "since 6.0" in the read contracts and refused or dropped from compact output (user_get by username on 5.4, login and role missing).
  • Zabbix 5.0 to 5.4: module_get / module_create / module_update / module_delete were refused as "requires Zabbix 6.0"; the API has them from 5.0 (probed without a login on all ten releases).
  • Zabbix 5.0 / 5.2: user_get could not find a user by login (alias): the filter was refused as "silently ignored", which is true from 5.4 on and not before.
  • request_timeout = 0 made user_logout, user_checkauthentication and userdirectory_test with a session fail before anything was sent; it means the 300 s default there too, as for every other call.
  • stdio_allow_raw_json = true never worked (since v1.26): the check imported a function that does not exist and always refused.
  • install.sh request-tls could leave the service unable to start: with TLS on, an http:// public_url is refused by the loader, and the command restarted without checking. A public_url on the same host name is switched to https://, the config is validated before the restart, and put back as it was when it does not load.
  • configuration_import with source_file on Windows raised AttributeError: O_NOFOLLOW and O_NONBLOCK do not exist there. The flags are used where the platform has them, and a symbolic link is refused by an explicit check where it does not (from the fork of Gaven George, @ggeorge-git).
  • legacy_auth (Zabbix 5.0 / 5.2): an expired Zabbix session is no longer the end of the server. A session that Zabbix ended (the user's autologout, a logout, a password change) is answered "Session terminated, re-login, please." as an API error, which the server did not take as a reason to log in again: every call to that server failed until the MCP server was restarted. It now logs in once more and sends the call again (Zabbix refused it, so this holds for writes as well). Only that exact answer counts: any other API error, also one whose text mentions a re-login (a script's output), is passed on as before; token servers are not affected.
  • user_logout and userdirectory_test with auth_sessionid on Zabbix before 6.4. The caller's session went only in the Authorization header, which Zabbix reads from 6.4 on; 5.x to 6.2 answered "Not authorized" and the session stayed open. Before 6.4 the session now goes in the request body; from 6.4, and when the release is unknown, the header as before.
  • user_login on Zabbix 5.0 / 5.2: the account is sent as user, the name those releases know (they refused username: 'unexpected parameter "username"').
  • severity_min outside 0 to 5 (problem_get, event_get) was dropped without a word and the call returned every severity; it is now refused with the range, and nothing is sent to Zabbix.
  • zabbix_raw_api_call: report.* keep active_since / active_till as the "YYYY-MM-DD" strings Zabbix wants (they were turned into Unix time, as report_create / report_update already avoided), and params takes a JSON array for the methods that take one (host.delete: ["10084"], history.clear, user.unblock); an array of reports keeps the dates of each.
  • usermacro_get with globalmacro: the output schema offers the properties of a global macro (globalmacroid, ...) as well. The server checks output against the global macro object in that case and its own description names globalmacroid, but a client that holds the model to the schema could not send it.
  • configuration_import described old uuids wrongly. A copy of a template imported with the old uuids does not answer "already exists": it changes the original (updateExisting) or answers true and creates nothing (createMissing alone), which a model took for a copy that was made. The description now says so and asks to confirm a copy with template_get.

Documentation

  • Zabbix 5.4 with an API token needs skip_version_check = true: zabbix-utils refuses every release below 6.0 and the check is relaxed automatically only for legacy_auth entries. The README said the normal configuration applies.
  • allowed_hosts is the client IP allowlist and has nothing to do with the Host header: SECURITY.md, config.example.toml, the Origin allowlist tooltip and docs/OAUTH.md said or implied otherwise. config.example.toml says next to host that a local listen address accepts only requests addressed to localhost, and that public_url is what a reverse proxy setup needs.
  • config.example.toml: a commented [report_templates.my_custom_report] header sat in the middle of [server], so the server options below it (allowed_hosts, tls_*, ...) landed in the wrong table for anybody who uncommented the header. Docker: ADMIN_PORT only changes the published port, the portal listens on [admin].port (.env.example, INSTALL.md, compose).
  • A reverse proxy in front of a server on 127.0.0.1 needs public_url: README and INSTALL.md ("Option A") did not say so, and a proxy that passes the public name on in Host was answered 421. config.example.toml: the rate limit is per token (all clients without a token share one counter), not per session.
  • [server].strip_write_params = false sends the measured keys as they are; the hand-written write rules (an action's operation IDs and escalation fields, a script's or a maintenance period's fields by type, a host's select echoes, a filter's formula / formulaid) apply either way. README, config.example.toml and the admin portal said "every payload as-is".

Tests

  • tests/test_bind_host_e2e.py starts real servers (all interfaces, with public_url, with only an IP allowlist, on a local address, SSE) and addresses them the way a client on another machine does. The suite and the lab only ever used 127.0.0.1, which is how the 421 stayed unseen for ten releases.
  • The version gate tests follow the zabbix-utils maximum that is installed: 2.0.5 (within the supported >=2.0.2,<3.0) supports 8.0, and the tests that took 8.0.0 as newer than the library failed on a fresh install.