Commit Graph
643 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 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
Jamie Curnow 47c9bfba4f Update dependencies 2026-11-09 11:55:20 +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 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
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
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 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 5457ca0965 Merge pull request #5979 from seaeagle1/develop
Add certbot plugin for Scaleway DNS
2026-11-05 08:57:44 +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
Jamie Curnow f915ca2462 Update all deps, and cypress 2026-11-04 20:54:23 +10:00
jc21 4aab1f50a4 Merge pull request #6001 from mikeyhenein/backend-deps
Backend: refresh yarn.lock within the declared ranges (fixes 15 of 16 advisories, incl. body-parser DoS)
2026-11-04 14:40:53 +10:00
jc21 44ada6ad5a Merge pull request #6003 from mikeyhenein/permissions-schema
Reject unknown keys in PUT /api/users/:id/permissions (an extra key crashes the backend)
2026-11-04 14:34:24 +10:00
jc21 e3631e88c6 Merge pull request #6004 from mikeyhenein/certbot-errors
Show certbot's failure reason in the UI instead of "Internal Error"
2026-11-04 14:33:39 +10:00
jc21 fdf51a654c Merge pull request #6005 from mikeyhenein/certificate-delete-files
Remove a certificate's certbot files on delete even when revoking fails
2026-11-04 14:30:08 +10:00
wikrie 044d093ec5 Update dns-multi plugin version to 5.6.0
update needed as used version 4.9 did not exists anymore
2026-11-03 21:27:47 +01:00
mikeyheneinandClaude Opus 5.5 d7a79a547f Remove a certificate's certbot files on delete even when revoking fails
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 20:28:39 -08:00
mikeyheneinandClaude Opus 5.5 d131419907 Show certbot's failure reason in the UI instead of "Internal Error"
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 20:28:38 -08:00
mikeyheneinandClaude Opus 5.5 5aed3a5539 Reject unknown keys in PUT /api/users/:id/permissions (an extra key crashes the backend)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 20:28:37 -08:00
mikeyheneinandClaude Opus 5.5 c214a49afb Backend: refresh yarn.lock within the declared ranges (fixes 15 of 16 advisories, incl. body-parser DoS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 20:28:36 -08:00
鹏鹏 c19ce19f90 Update package name and version for Baidu DNS plugin
The previous PyPi package has stopped being updated and is unavailable, rewrite one
2026-11-02 15:44:09 +08:00
seaeagle1 d2e8e5650a Add Scaleway DNS 2026-10-28 13:29:10 +01:00
Роман Саркисян 26e27e3503 updated beget target plugin 2026-10-28 02:09:01 +07:00
Junker der ProvinzandPascaru 9780e22792 Skip propagation seconds option for Route 53 DNS challenge
certbot deprecated --dns-route53-propagation-seconds in 2.5.0 and
removed it in 3.0.0, so requesting a Route 53 certificate with a
propagation value fails with "unrecognized arguments". The plugin
waits for the record through the AWS GetChange API instead.

Fixes #4702
Fixes #5414

Co-authored-by: Pascaru <23747773+pascaruchan@users.noreply.github.com>
2026-10-24 19:17:37 +02:00
Juice-de-Orange 076c522ccc fix: apply the HSTS sub-domains setting per host
_hsts_map.conf defined $hsts_header with the host's own value in every
host config. A map is global to nginx, so one definition won for all
hosts and the "HSTS Sub-domains" switch of the others was ignored.

Define two fixed maps instead and let _hsts.conf pick one per host.
They get new names, so configs generated before this change, which
still define $hsts_header, can't override them. The maps keep HSTS
limited to https.

Fixes #5947
2026-10-24 16:38:10 +02:00
capitain-schos 518dd04679 added ipp certbot definitions 2026-10-24 14:15:25 +02:00
Lindsay Roberts d9c4d33a7c fix(certbot): update Hetzner plugin to v4.0.0 2026-10-18 21:19:53 +03:00
Alexis Loskoutoff b6e9038f0c Update infomaniak plugin to 0.3.3 2026-10-18 19:42:35 +02:00
CnpPt a57ffb0ea9 Update certificate.js 2026-10-17 12:20:45 +08:00
CnpPt b7d1e99e8c Reload Nginx after renewing SSL certificate 2026-10-17 11:50:38 +08:00
lennondotw c50c06530b Merge remote-tracking branch 'upstream/develop' into fix/preserve-host-port 2026-10-14 14:37:17 +08:00
jc21 1aca775cb9 Merge pull request #5944 from jeezat/develop
fix(certbot): update Akamai Edge DNS plugin and credentials for v0.3.0
2026-10-14 07:10:53 +10:00
Alexis Loskoutoff 82529d6402 Require certificates:create permission to validate certificates 2026-10-13 18:34:20 +02:00