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.
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_environmentprovider that returnedENVIRONMENT_TRIGGER_YESdid not reject the login: Nauthilus did not register the result factsnauthilus.auth.lua.environment.<name>.*for configured Lua sources, soauthn/standard_authgenerated no rule for them. Withauthn/standard_authalone, 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
plansruns before theauthn/standard_authfallback at the same checkpoint and may deny, tempfail, or permit a triggered request. Such rules can now reference the facts; before, they failed withpolicy rule fact mismatch. - The side effects of a trigger follow the decision: the environment name in the log, brute-force learning, and the
environment_rejectedflag 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_FAILis logged and does not tempfail; only a raised Lua error does.
Policy rules
- A
tempfailordenyrule keeps itsresponse_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_messagewithfrom: attribute_detailon attributes of Lua registry scripts compiles. Before, Nauthilus refused to start withpolicy rule fact mismatch.- Configured rules at
auth_backend,subject_analysis, andaccount_providersee the attributes emitted at or before their checkpoint;run_ifandskip_ifguards there as well. Before, onlypre_authandauth_decisiondid. Rules that never fired at these checkpoints can start firing after the upgrade. --config-checkcompiles 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: luaprovider by its configured key, for exampleuse: vpn/office_hours.
Lua runtime
nauthilus_backend_add_totpreceivesrequest.totp_secretagain, and the WebAuthn save and delete callbacks receiverequest.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-accountswithtext/plainorapplication/x-www-form-urlencodedreturns every account; before, only the first. Accounts of a Lua backend keep the order of the Lua list. Nauthilus warns when no Lua backendsearchentry contains the protocolaccount-provider.- The bundled
lua-plugins.d/backend/backend.luacloses its prepared statements; before, MariaDB refused logins aftermax_prepared_stmt_countcalls. 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, andaccount_provider, and run--config-checkagainst 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
requirefrom the configuredpackage_pathis compiled once when the configuration is loaded. Before, everyrequireparsed 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 asnauthilus_utilbenefit 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_connectionaccepts 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, plusnauthilus_mail,nauthilus_dns,nauthilus_soft_whitelist, andnauthilus_ldapwhen an LDAP backend is configured. - Metrics and registration:
create_summary_vec,create_counter_vec,create_histogram_vec, andcreate_gauge_vecofnauthilus_prometheus;register_connection_targetofnauthilus_psnet; the custom toleration functions ofnauthilus_brute_force;wait_randomofnauthilus_misc. - Backend server selection in subject sources:
get_backend_servers,select_backend_server,get_selected_backend_server, andcheck_backend_connection. A selected server sets the nginxAuth-ServerandAuth-Portresponse headers again. - HTTP response:
nauthilus_http_responsein 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, andchannel, includingos.getenv, and the base functionsprint,load,loadstring,collectgarbage,getfenv,setfenv,module, andnewproxy. - Helper libraries: all bundled libraries, not only
json:strings,base64,template,tcp,http,regexp,yaml,db,inspect,crypto, and the others.timeaccepts any time zone again. requirewith a computed module name.
Further changes:
dofileandloadfileare 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, andnauthilus_redis_poolload in every runtime. - Every bundled environment source, subject source, and action can be configured under top-level
policyagain. The repository fileserver/lua-plugins.d/POLICY_VM_COMPATIBILITY.mdno longer marks any of themreference-only. - A POST-Action still runs after the response left the server. Its
nauthilus_http_responsefunctions 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 arequireof 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 asstring, and globals assigned by a module loaded withrequireare therefore visible to later requests of the same callback. Do not keep request data there.
Unchanged:
requireresolves Lua modules from the files that were read from the configuredpackage_pathwhen the configuration was loaded. A changed or added module file becomes active with the next configuration reload.nauthilus_i18n.register_catalogbelongs 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
lokisource 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 sourcetimeout: the source answeredLOKI_TIMEOUTand its findings readunknown. Counted symptoms are unchanged.