Skip to main content
Version: 4.2

Nauthilus 4.1 Patch Releases

This page lists the changes of the patch releases that follow Nauthilus 4.1.0, newest first.

All patch releases keep the v4 configuration model. Read the entries between your installed version and the target version; the items marked Action need an operator step.

Native plugins

Rebuild every private native plugin against the exact source and Go toolchain of the release you deploy, with the server PGO profile. pluginapi/v1 is unchanged since 4.1.0.

4.1.3​

Published as tag v4.1.3 on November 24, 2026. Lua policy sources decide through the policy again. The defects were found with the tested recipes of the Lua Cookbook.

Security: Lua environment sources reject again​

  • In 4.0.0 to 4.1.2 a configured lua_environment provider that returned ENVIRONMENT_TRIGGER_YES did not reject the login: Nauthilus did not register the result facts nauthilus.auth.lua.environment.<name>.* for configured Lua sources, so authn/standard_auth generated no rule for them. With authn/standard_auth alone, a trigger is now denied, a raised Lua error answers with a temporary failure, and an abort ends the pre-auth checkpoint.
  • The trigger is a fact; the policy decides. A configured rule bound in the target's plans runs before the authn/standard_auth fallback at the same checkpoint and may deny, tempfail, or permit a triggered request. Such rules can now reference the facts; before, they failed with policy rule fact mismatch.
  • The side effects of a trigger follow the decision: the environment name in the log, brute-force learning, and the environment_rejected flag for Lua actions, plugin hooks, and request snapshots are set only after the policy selected a pre-auth deny. This also applies to native environment sources.
  • Lua subject sources get the same facts and generated rules. A rejection is still denied; the answer may now carry the script's status message.
  • Unchanged: a script that returns ENVIRONMENT_RESULT_FAIL is logged and does not tempfail; only a raised Lua error does.

Policy rules​

  • A tempfail or deny rule keeps its response_message. Before, a Lua attribute with a registered public response detail made its checkpoint fail, and the answer was the generic temporary-failure text.
  • response_message with from: attribute_detail on attributes of Lua registry scripts compiles. Before, Nauthilus refused to start with policy rule fact mismatch.
  • Configured rules at auth_backend, subject_analysis, and account_provider see the attributes emitted at or before their checkpoint; run_if and skip_if guards there as well. Before, only pre_auth and auth_decision did. Rules that never fired at these checkpoints can start firing after the upgrade.
  • --config-check compiles the policy catalog like the server start and loads native plugins, so configurations that passed before can now fail the check. It still does not contact Redis.
  • A domain plan references a generic kind: lua provider by its configured key, for example use: vpn/office_hours.

Lua runtime​

  • nauthilus_backend_add_totp receives request.totp_secret again, and the WebAuthn save and delete callbacks receive request.webauthn_credential. Lua backends that stored an empty value now store the real secret or credential.
  • A custom hook that sets the status or headers and returns a Lua table answers with that table as JSON and the status it set. Before, the body was empty and a JSON answer always had status 200.
  • mode=list-accounts with text/plain or application/x-www-form-urlencoded returns every account; before, only the first. Accounts of a Lua backend keep the order of the Lua list. Nauthilus warns when no Lua backend search entry contains the protocol account-provider.
  • The bundled lua-plugins.d/backend/backend.lua closes its prepared statements; before, MariaDB refused logins after max_prepared_stmt_count calls.
  • nauthilus_backend.get_current_backend_result() in subject sources returns what earlier subject sources applied, not the attributes of the password backend; the documentation now says so.

Action:

  • Review configured rules at auth_backend, subject_analysis, and account_provider, and run --config-check against your configuration before the upgrade.
  • If a login must pass despite a Lua environment trigger, add a rule that permits it.
  • Apply the prepared-statement fix to copies of the bundled MySQL backend script.

4.1.2​

Published as tag v4.1.2 on November 22, 2026. Lua modules are compiled once.

  • A Lua module that a script loads with require from the configured package_path is compiled once when the configuration is loaded. Before, every require parsed and compiled the module source again, in every request and in every Lua runtime: environment sources, subject sources, actions, custom hooks, Lua backends, and the cache-flush script. The module is still executed for every request; only the compilation is shared. Behavior is unchanged.
  • Measured with the repository benchmark BenchmarkCallEnvironmentLuaSourceWithSharedModules: an environment source request that loads four bundled shared modules dropped from about 1.65 ms to 0.29 ms and from about 1.9 MiB to 0.25 MiB of allocations per request. Deployments whose scripts load shared modules such as nauthilus_util benefit most.
  • Documentation: the first version of the 4.1.1 notes said that every global variable a callback script sets stays in its pooled VM. A global that the script assigns is request-local; explicit writes to _G, changes to shared tables, and globals of required modules persist. See Global variables and pooled VMs.

Action: none is required.

4.1.1​

Published as tag v4.1.1 on November 22, 2026. Full Lua API for environment sources, subject sources, and actions.

Lua callbacks run with the full API again​

Nauthilus 4.0.0 to 4.1.0 ran Lua environment sources, subject sources, and actions in a restricted "Policy VM" and rejected a configuration whose callback used a function outside a small read-only set. That limit was never intended and broke callbacks that worked on Nauthilus 3. Version 4.1.1 removes it: these callbacks use the same Lua API as custom hooks and Lua backends. See Lua runtimes and capabilities.

Available again in environment sources, subject sources, and actions:

  • Redis: write commands, pipelines, scripts (redis_run_script, redis_upload_script), and named pools (register_redis_pool). get_redis_connection accepts named pools and returns a writable handle.
  • Cache: cache_set, cache_delete, cache_update, cache_flush, cache_push, cache_pop_all.
  • Outbound connections: HTTP through glua_http, plus nauthilus_mail, nauthilus_dns, nauthilus_soft_whitelist, and nauthilus_ldap when an LDAP backend is configured.
  • Metrics and registration: create_summary_vec, create_counter_vec, create_histogram_vec, and create_gauge_vec of nauthilus_prometheus; register_connection_target of nauthilus_psnet; the custom toleration functions of nauthilus_brute_force; wait_random of nauthilus_misc.
  • Backend server selection in subject sources: get_backend_servers, select_backend_server, get_selected_backend_server, and check_backend_connection. A selected server sets the nginx Auth-Server and Auth-Port response headers again.
  • HTTP response: nauthilus_http_response in environment sources and subject sources, not only in synchronous response actions. Response headers set there reach the client; status and body of an authentication response stay with the server.
  • Standard library: os, io, debug, coroutine, and channel, including os.getenv, and the base functions print, load, loadstring, collectgarbage, getfenv, setfenv, module, and newproxy.
  • Helper libraries: all bundled libraries, not only json: strings, base64, template, tcp, http, regexp, yaml, db, inspect, crypto, and the others. time accepts any time zone again.
  • require with a computed module name.

Further changes:

  • dofile and loadfile are available again in every Lua runtime, including custom hooks, Lua backends, init scripts, and the cache-flush script.
  • Policy registry scripts run with the complete Lua standard library again.
  • The static source check is gone. A script is no longer rejected because a forbidden name appears in it, in a shared module it requires, or in a string such as "os".
  • The shared modules nauthilus_util, nauthilus_keys, and nauthilus_redis_pool load in every runtime.
  • Every bundled environment source, subject source, and action can be configured under top-level policy again. The repository file server/lua-plugins.d/POLICY_VM_COMPATIBILITY.md no longer marks any of them reference-only.
  • A POST-Action still runs after the response left the server. Its nauthilus_http_response functions now exist and have no effect; on 4.0.0 to 4.1.0 calling one raised an error.
  • Loading the configuration compiles every configured callback and no longer executes any of them. A script is rejected when it does not compile, or when the name of its entry point occurs neither in the script nor in a Lua module found through the configured package_path. Module-level code runs only with a request, and a require of a module that does not exist fails at that point.
  • Each callback has its own pool of pre-built Lua VMs. The callback script still runs in a fresh request environment: a global variable the script assigns lives only for that request. Nauthilus 4.0.0 to 4.1.0 also rebuilt the VM's base global table for every request; 4.1.1 keeps it, as custom hooks and Nauthilus 3 do. Explicit writes to _G, changes to shared tables such as string, and globals assigned by a module loaded with require are therefore visible to later requests of the same callback. Do not keep request data there.

Unchanged:

  • require resolves Lua modules from the files that were read from the configured package_path when the configuration was loaded. A changed or added module file becomes active with the next configuration reload.
  • nauthilus_i18n.register_catalog belongs to init scripts, as in Nauthilus 3.
  • Generic Policy providers (kind: lua) keep their separate sandbox.

Action: none is required. If you moved logic into a Lua backend, a custom hook, or a native plugin only to work around the limit, you can keep that setup or move it back.

Operational diagnostics​

  • The loki source of the operational diagnostics filters every profile query by its message literal (|= "<literal>") before it applies the message pattern. Before, Loki ran the pattern over every line of the window, so a window with many lines, for example the 15 minutes after a restart with debug logging, exceeded the source timeout: the source answered LOKI_TIMEOUT and its findings read unknown. Counted symptoms are unchanged.