Commit Graph
2716 Commits
Author SHA1 Message Date
Jamie Curnow 5b7e34eb67 Fix second round of review findings from PR #6029
Security
- Check advanced_config permissions before creating a certificate on
  host update (proxy, redirection and 404 hosts). A refused request
  previously requested a Let's Encrypt certificate first, leaving an
  orphan certificate and using up rate limit.
- Only trust X-NPM-Peer-Addr when it comes with a secret generated at
  container start. The admin nginx sends both headers. Any proxy host or
  stream forwarding to 127.0.0.1:3000 was also a loopback peer, so it
  could forge the header and get a fresh rate-limit bucket on every
  request. Without the secret (dev, or a mounted production.conf), the
  header is ignored.
- Add a login limit per IP across all accounts (30 failed attempts a
  minute) alongside the per-account one. Before this, one address could
  spray passwords over any number of accounts. Behind a shared proxy,
  everyone using that proxy shares this limit.
- Stop trusting X-Real-IP from loopback. It was only there for an older
  version of the rate limiter, and it let a stream host forwarding to a
  local proxy host forge the client IP and get past IP access lists.
  Loopback now behaves as it does on master.

Correctness
- Refuse to delete a certificate that hosts still use (400, with counts
  per host type). Their configs include its files, and a successful
  revoke deleted them anyway, which broke nginx -t. Otherwise the
  certificate is revoked and its files are removed even if the revoke
  fails.
- Let non-admins clear a location's advanced config. Deleting the
  location was already allowed and has the same effect, and a location
  deleted and re-added at the same path arrives with an empty config,
  which was refused.
- Clear proxy host grants (meta.proxy_host_ids) when visibility isn't
  "user" or proxy hosts are hidden, and drop ids of deleted hosts.
  Before, hidden grants came back when proxy hosts were shown again.
  The backend enforces this; the permissions modal also stops sending
  them.
- 404 host and redirection host modals now wait for the current user
  to load, so an admin's advanced config change isn't dropped if they
  submit before it loads.

Tests
- NonAdminHosts.cy.js: refused change doesn't create a certificate,
  location rename and clear rules, grant clearing.
- Certificates.cy.js: deleting a certificate that is in use.
2026-11-09 23:39:26 +10:00
Jamie Curnow 04c1f5ae76 Fix review findings from PR #6029
Security
- Redact certbot output before it reaches the API: strip the
  certificate's DNS credential values, URL query strings and userinfo,
  secret-looking key=value pairs and Bearer/Basic tokens. DNS plugins
  can echo request URLs carrying API keys. The raw CommandError is no
  longer attached as `previous`, since the error handler returns
  `previous` to the client on certificate routes.
- Rate limit login/2FA on the admin nginx's real TCP peer, passed as
  X-NPM-Peer-Addr ($realip_remote_addr), instead of X-Forwarded-For.
  nginx trusts X-Real-IP from private ranges, so a client on the LAN or
  Docker network could get a fresh bucket on every request. Behind
  another proxy, limits now apply per account through that proxy.
- Bound rate limiter memory: hash keys over 128 chars and cap each store
  at 50k entries, removing expired entries first and then the oldest.

Correctness
- Proxy host modal: send location advanced configs unchanged for
  non-admins instead of looking them up by path, which dropped the
  config from a renamed location.
- Location advanced config: locations that omit advanced_config now get
  a config only after explicit ones are matched, so a new location at
  an old path can't take the config from the renamed location.
- Certificate upload: check that the certificate matches the private
  key (uploaded or stored) before writing, so a mismatched pair can't
  break nginx -t.
- Certificate delete: keep the Let's Encrypt files when revoke fails and
  hosts still use the certificate, so their configs still load.

Cleanup
- Make the rate-limit certbot hint first in the list, as its comment
  says.
- Proxy host getCount uses the permissions access has already loaded
  instead of querying user_permission again.
- Rate limiter: register the success refund listener in one place and
  call it a fixed window, not a sliding one.
2026-11-09 22:53:53 +10:00
Jamie Curnow 0792a5e24f Linting fixes 2026-11-09 22:33:10 +10:00
Jamie Curnow 779927c995 Fix getHostsWithDomains eager loading unnecessarily 2026-11-09 22:28:50 +10:00
Jamie Curnow 87b77d9461 Optimise isAdmin lookups 2026-11-09 22:25:07 +10:00
Jamie Curnow 8342713d45 Fix a non-admin can now rename a location that has admin-written
advanced config, and still can't change or add advanced config
2026-11-09 22:21:40 +10:00
Jamie Curnow 4175cf66c9 Fix: deleting a certificate now returns success even when some of its files
can't be removed
2026-11-09 22:17:07 +10:00
Jamie Curnow af54d2e346 Fix nginx reloading too much when cert renewal for multiple certs 2026-11-09 22:15:17 +10:00
Jamie Curnow 9b1566aa6b Fix for the broad Cloudflare hint regex (bare numbers
6003/6111/9103/9109/10000, plus 'Authentication error' and 'Invalid
access token') is checked before the rate-limit, DNS and HTTP hints, so
non-Cloudflare failures get a misleading Cloudflare message.
2026-11-09 22:14:07 +10:00
Jamie Curnow fff2b0d097 Fix for changing the upstream Host from $host to $forward_host
($http_host) forwards the raw client Host header, including the port and
any absolute-form URI mismatch, to every upstream and into the asset
cache key
2026-11-09 22:09:34 +10:00
Jamie Curnow 99678969b3 Fix a proxy host whose access list can't be loaded is now denied to
everyone instead of being served with no restrictions
2026-11-09 22:04:32 +10:00
Jamie Curnow 0cde59a8ad Fix for rate limiter only trusts X-Forwarded-For when the socket is
loopback, and the admin nginx sets that header to its own $remote_addr
2026-11-09 22:00:26 +10:00
Jamie Curnow 36b3434b9c Fix for adding meta.certificate_key to omissions()
means upload() now reads a row with no private key, so an upload that
leaves out certificate_key wipes the stored key and writeCustomCert
writes undefined to privkey.pem.
2026-11-09 21:57:00 +10:00
jc21 71be654418 Merge branch 'master' into develop 2026-11-09 14:01:11 +10:00
Jamie Curnow 47c9bfba4f Update dependencies 2026-11-09 11:55:20 +10:00
jc21 7c767f43b0 Merge pull request #6028 from occultsound/zh-tw-locale
Add Traditional Chinese (Taiwan) translation
2026-11-09 07:42:44 +10:00
occultsound 15beff767d Add Traditional Chinese (Taiwan) translation 2026-11-09 02:16:59 +08:00
jc21 53ee436e35 Merge pull request #6026 from Stephan-P/patch-1
Update nl.json
2026-11-08 18:53:40 +10:00
Stephan Paternotteandgreptile-apps[bot] e824d353f0 Update frontend/src/locale/src/nl.json
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-11-07 15:55:09 +01:00
Stephan Paternotte 3f2c186771 Update nl.json
Lang: Dutch translation file updated + some minor corrections
2026-11-07 15:47:16 +01:00
jc21 ea7e7468df Merge pull request #6023 from Alexis-Loskoutoff/fix-authentication-oracle
Fix authentication oracle
2026-11-06 08:58:10 +10:00
Alexis Loskoutoff e93b771ff5 Check a dummy hash when a login names no account
Without a password to check, a login for an unknown account skipped bcrypt
and answered far sooner than one with a wrong password, which still told
which emails have an account.
2026-11-05 18:29:52 +01:00
Alexis Loskoutoff c08f2e65a8 Add test for the same error on every failed login 2026-11-05 17:29:48 +01:00
Alexis Loskoutoff 0d90542119 Give the same error for every failed login
An unknown or passwordless account was rejected without the i18n key that
a wrong password gets, so the response told which emails have an account.
2026-11-05 17:29:48 +01:00
jc21 2f5342b427 Merge pull request #5908 from auzcoder/fix/auth-rate-limit-and-permissions
feat: rate limit auth endpoints and scope user proxy host permissions
2026-11-05 23:05:08 +10:00
Abdulhafiz Davlatov bc8bbf3562 feat: rate limit auth endpoints and scope user proxy host permissions
- Add in-memory sliding window rate limiter for auth token endpoints with CI/test bypass and successful request exclusion
- Add user_permission meta column migration and Objection model configuration
- Support scoping allowed proxy hosts per user when in 'Created Items Only' visibility mode
- Restrict advanced nginx configuration editing on hosts to admin users only
- Fix user permissions route ID parsing and omit id from permission update payloads
- Add allowed proxy hosts selector in permissions modal and display permissions summary badges in users table
2026-11-05 12:16:36 +05:00
Jamie Curnow cc46ce5ab6 Biome schema match to package 2026-11-05 16:43:28 +10:00
Jamie Curnow b5ee4f7b1b Update pull request template 2026-11-05 10:34:33 +10:00
jc21 9be1cb7818 Merge pull request #5917 from nglinh28/feat/vietnamese-locale-update
i18n(vi): complete Vietnamese locale and add vi tests
2026-11-05 10:30:02 +10:00
jc21 fe58b4eba0 Merge pull request #5889 from StopDragon/i18n/ko-missing-keys
Update Korean translation
2026-11-05 10:25:43 +10:00
jc21 18fc758b4f Merge pull request #5934 from lennondotw/fix/preserve-host-port
fix(proxy): preserve client ports in forwarded Host headers
2026-11-05 10:15:05 +10:00
jc21 5795699091 Merge pull request #5939 from hafizahmedzia/fix/http-certificate-result-keys
fix: preserve hostname keys in HTTP certificate test results
2026-11-05 10:05:11 +10:00
jc21 b88ca8e2e5 Merge pull request #5948 from Waterman1997/patch-1
Fix nginx reload after certificate renewal
2026-11-05 10:04:02 +10:00
jc21 d504c2bf25 Merge pull request #5951 from Alexis-Loskoutoff/fix/update-infomaniak-certbot-plugin
Update infomaniak certbot plugin to 0.3.3
2026-11-05 10:03:35 +10:00
jc21 49662bdc91 Merge pull request #5952 from lsr0/certbot-hetzner-fix-4.0.0
Update Hetzner certbot plugin to v4.0.0
2026-11-05 10:02:57 +10:00
jc21 f23dd9bff0 Merge pull request #5969 from capitain-schos/feature/add-dns-provider-ipp
added ip-projects certbot definitions
2026-11-05 09:59:23 +10:00
jc21 2a8b39bdef Merge pull request #5971 from Juice-de-Orange/fix/hsts-subdomains-per-host
fix: apply the HSTS sub-domains setting per host
2026-11-05 09:58:02 +10:00
jc21 23e56e9581 Merge pull request #5972 from junkerderprovinz/fix/route53-propagation
Skip propagation seconds option for Route 53 DNS challenge
2026-11-05 09:56:43 +10:00
jc21 3d09072ea7 Merge pull request #5976 from l1n-x/actualize-beget-package
Changed target plugin for Beget
2026-11-05 09:36:45 +10:00
jc21 4daa54c12e Merge pull request #5977 from mirfalltnixein/fix/unsaved-modal-changes
Prevent data loss when dismissing unsaved forms
2026-11-05 08:58:53 +10:00
jc21 5457ca0965 Merge pull request #5979 from seaeagle1/develop
Add certbot plugin for Scaleway DNS
2026-11-05 08:57:44 +10:00
jc21 1dd0b8fbe8 Merge pull request #5989 from Rip-07/fix/5964-stale-nginx-pid
fix: remove stale nginx pid file before starting nginx
2026-11-05 08:45:23 +10:00
jc21 5db7516f40 Merge pull request #5992 from chenghaopeng/patch-1
Update package name and version for Baidu DNS plugin
2026-11-05 08:44:51 +10:00
jc21 bd34c94222 Merge pull request #5993 from SebZar/feat/certificate-details-tooltip
feat: show certificate details in host tables
2026-11-05 08:42:57 +10:00
Jamie Curnow 9754c4c639 Bump mid version, as Tabler has changed the dark UI it's worth more than a revision change 2026-11-05 08:38:55 +10:00
Jamie Curnow db292e947d Bump version 2026-11-05 08:00:40 +10:00
Jamie Curnow ec0f30106d Migrate cypress to v16 2026-11-05 07:32:24 +10:00
Jamie Curnow 1c76fb76ea install yarn in cypress image 2026-11-04 22:08:48 +10:00
Jamie Curnow f915ca2462 Update all deps, and cypress 2026-11-04 20:54:23 +10:00
jc21 55481adede Merge pull request #6002 from mikeyhenein/frontend-deps
Frontend: refresh dependencies, react-intl 12, vitest 5, happy-dom 21; fix Tabler 1.7 regressions
2026-11-04 20:36:18 +10:00