Skip to content

v3.81.3: Security hardening - #24

Merged
agit8or1 merged 2 commits into
mainfrom
security/3.81.3-hardening
Nov 12, 2026
Merged

agit8or1 merged 2 commits into
mainfrom
security/3.81.3-hardening

Conversation

@agit8or1

Copy link
Copy Markdown
Owner

Security hardening release. See CHANGELOG.md (3.81.3) for the full list.

Highlights:

  • Escaping and validation of firewall-reported values in the UI
  • Auto-update passes the verified package checksum
  • Two-factor attempt limits; lockout per (username, address)
  • Enrolment never rewrites an existing firewall; first claim bound to the token's hardware ID
  • Tunnel listeners on loopback; customer scope enforced on firewall and tunnel pages
  • Narrow sudo wrapper (deploy/opnmgr-nginx-wrapper, deploy/sudoers-opnsense-manager) replacing broad rules
  • Removed unused endpoints

New regression suite: tests/hardening_3_81_3_test.php (added to CI). All CI suites pass locally against a test database, including the clean-install end-to-end test.

No agent change (1.8.2 unchanged), no schema change.

🤖 Generated with Claude Code

web-flow and others added 2 commits November 10, 2026 18:08
… page

twofactor_setup.php stores the TOTP secret as hex, but verify2fa.php
passed it to TwoFactorAuth::verify(), which base32-decodes its input.
Decoding hex as base32 yields the wrong key, so enrolment succeeded and
every login code was then rejected. Add TwoFactorAuth::verifyStored(),
which decodes the stored hex, and use it at login.

The challenge page now matches the login screen instead of rendering
inside the app layout. Login styles move to assets/css/auth.css, shared
by both pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Escape firewall-reported values where they are rendered (firewall list
  tooltips, command log, command output, diagnostics, health monitor) and
  validate the network fields at check-in. Event handlers pass values as
  JSON instead of HTML-escaped strings inside JavaScript quotes.
- Agent auto-update passes the staged package's SHA-256 to the installer
  and offers nothing when no verified package is staged.
- Limit two-factor attempts and count them toward the account lockout;
  lock out per (username, address) with an address-wide limit; require a
  current code to disable 2FA; the MFA-enrolment exemption checks
  SCRIPT_NAME.
- First agent check-in must match the hardware ID reported when the token
  was redeemed, and the bind checks it won. Enrolment tokens never rewrite
  an existing firewall.
- Per-session tunnel listeners bind to loopback; cleanup reports what it
  actually removed. Ownerless tunnel sessions are admin-only; tunnel
  cookies are no longer logged.
- Enforce customer scope on firewall pages, tunnels, command log, request
  queue and AI scans. Agent endpoints only update the authenticated
  firewall's rows.
- CSRF checks on the security scanner, documentation trigger, tunnel start
  and AI scan.
- Onboarding deploys the firewall's own key instead of a built-in one;
  public keys are validated and shell-quoted. Reinstall commands keep the
  API key out of URLs and argv and verify TLS.
- Deployment packages download through Package Builder; nginx snippet
  denies /packages/, /config/, /sql/, /download/ and stray root files.
  Pushover token is no longer rendered into the page.
- Replace broad sudo rules with deploy/opnmgr-nginx-wrapper and a shipped
  deploy/sudoers-opnsense-manager.
- Remove unused tunnel_auto_login.php, tunnel_direct.php,
  get_firewall_id.php, api/setup_reverse_proxy.php and ajax/certbot.php;
  download_agent.php returns 410.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@agit8or1
agit8or1 merged commit 18bc7a4 into main Nov 12, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants