Repository navigation
fix: harden sign-in, inventory script, verification, scan targets and hostile-server limits - #62
Open
khalid-offset wants to merge 6 commits into
Open
khalid-offset wants to merge 6 commits into
khalid-offset wants to merge 6 commits into
Conversation
…not pass the lock A burst of wrong passwords sent at once could all pass the lock and rate limit checks before any of them was counted, and a right password in the same burst was then accepted although the account had reached its limit. - Each sign-in now reads the account, checks its lock, verifies the password and records a failure in one turn per account name. Other accounts never wait on it, and unknown names still spend the time of one password check. - The per-address and per-address-and-account limits check and count an attempt in one step; an attempt holds its place while it is checked and gives it back unless it fails. Setup-code, password-change and sign-in-off confirmations use the same counting. - SECURITY.md now states the address limits the code enforces.
The Linux inventory engine ran its fixed queries in the folder it was started from. python3 -c put that folder first on the module path, so a planted ssl.py ran under the operator's (usually root's) account, and go version read a go.mod there and could switch to, and download, a different toolchain. Queries now run from /, Python runs isolated (-I) and go version keeps the local toolchain (GOTOOLCHAIN=local). Engine version 3.0.1. Signatures that read whole setting families collected settings whose values are secrets: Dovecot ssl_key_password, PostgreSQL ssl_passphrase_command, Postfix smtp_sasl_password_maps (in main.cf and in postconf -n), a TSIG secret on a BIND algorithm line, and MySQL passphrase settings. Their match patterns now leave those settings out (signature database 2026.11.22). Facts parsing now withholds the value of any setting, attribute, flag or registry value named for a password, passphrase, shared secret or inline private key, keeping the name with "(value withheld)", so a facts file from an older engine cannot carry such values into a CBOM either. Password policy settings (PasswordAuthentication, password_encryption, DisablePasswordChange, ...) and references to files keep their values.
…ck observed it A finding now counts as gone only when the later scan ran its check and found nothing: checks under a stage that ran but proved nothing (no certificate seen, no host key read) read not-checked, and verification waits on them. An SSH scan that did not read an advertised host key is marked incomplete, and the checks made on fetched keys read not-checked. The SSH baseline no longer reads meets when an RSA host key algorithm is offered but its key was not read: the size rule is not assessed, and with nothing else to change the baseline is not judged. --fail-on baseline now fails any server not seen to meet the baseline. A certificate renewal must be shown on every endpoint any scan saw presenting the old certificate, whenever that scan was made. The set is kept on the work (new table work_endpoints, migration 21), filled when the work is created and by every later scan, so deleting an endpoint or pruning its scans cannot shrink it; a deleted endpoint makes the result not verifiable. Evaluation rules move to eval/18.
tlsprobe.ParseTarget and sshprobe.ParseTarget now refuse a host that is neither an IP literal nor a valid host name, so the CLI, the MCP scan tools and the server all apply the rule the web API already applied. An IPv6 address with a zone, or a host with spaces or control characters, is refused before any connection. The web API's label check and the scope's domain check now share tlsprobe.IsHostName instead of keeping two copies. The HSTS check also refuses to send its request when the host contains spaces or control characters, so it can never send more than one GET. The scan guard judges an IP literal by its address with or without a zone: such a string never counts as a name under a scope domain, the add-time check tests the address against the scope, and every connection of its scan stays inside the scope's networks. Only a valid host name can be under a scope domain.
Cap a served chain at pki.MaxServedCerts where it enters the scanner (the raw-flight loop, before parsing, and describeChain), and note when a chain was cut. The weak-key tests take the scan's context and stop when it ends; untested keys are left without results and the report is marked incomplete. RSA keys over 8192 bits, the limit crypto/tls applies, are not weak-key tested and are never used to check a chain, CRL or OCSP signature. Give the CRL cache a byte budget (128 MiB) weighted by what each parsed CRL keeps in memory. Expired entries are released first, then the oldest; a CRL heavier than the whole budget is used but not kept. The unused deprecated copy of the revoked entries is dropped after parsing. Record whether a completed handshake showed each certificate chain (keyUnproven; chains from raw flights are always unproven, also in older reports). A certificate an endpoint only presented proposes a system join for a person to confirm but never confirms one, and a key it shows with SSLv2 raises the cross-endpoint DROWN finding at low severity instead of high. The graph projection version is bumped so stored scans are re-projected with the new attribute.
…for the next release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security hardening from an internal review of v0.10.0 (SEC-REVIEW-2026-11, internal). Five independent fixes, one commit each, plus the changelog.
What changes
internal/server). Sign-in attempts for one account are decided one at a time, and the per-address limits check and count an attempt in one step, so requests sent at once can no longer get past the five-failure lock or the per-address limits. The setup code, password change and the confirmation for turning sign-in off use the same counting. Different accounts never wait on each other.SECURITY.mdnow states the real limits (50 per address, 10 per address and account).internal/machinefacts,internal/signatures). The Linux script runs each query from/, runs Python with-Iandgo versionwithGOTOOLCHAIN=local, so the folder it is started from cannot change what runs (engine 3.0.1). Signatures stop collecting password and passphrase settings, and the server withholds the value of any such setting in an uploaded facts file, including files from older scripts (signature database 2026.11.22).internal/server,internal/store,internal/eval,internal/sshprobe). A fix, renewal or SSH baseline is met only when a scan's check actually ran. A scan that saw no certificate, or could not read an advertised host key or the RSA host key, leaves the item waiting. A renewal must be shown on every endpoint that ever served the old certificate, including endpoints added later; one deleted since reads not verifiable.internal/tlsprobe,internal/sshprobe,internal/server/guard.go). One host rule everywhere: an IP address without a zone, or a valid host name, as the web API already required. Scope domains match host names only. The HSTS request refuses a host containing control characters.internal/tlsprobe,internal/pki,internal/weakkey,internal/revocation,internal/estate). Chains are cut to 16 certificates before analysis, weak-key tests stop on cancel or timeout, and RSA keys over 8192 bits are not tested or used to check signatures. The CRL cache has a 128 MiB budget by retained size. A certificate seen without a completed handshake (keyUnproven) never joins a system on its own and raises the shared-key DROWN finding at Low.Behaviour changes
--fail-on baselinealso fails a server that could not be judged.eval/18; the latest stored scans are re-evaluated on upgrade.tls scan,ssh scanand the MCP scan tools refuse zoned IPv6 addresses and non-ASCII host names (usexn--).Upgrade notes
work_endpoints, filled once from existing scan observations.Validation
gofmt,go vet ./...,go test -count=1 ./...,golangci-lint run ./...andnode --checkon the UI scripts: clean locally on Windows.-racewas not run locally (no cgo); CI runs it.Not checked
web/static/js/views/report-ssh.jsandhelp.jstext changes were not looked at in a browser.