23 Commits
Author SHA1 Message Date
Daniel Hiller de4d768831 fix: close the gaps a security review found in the default install
Reported against 2.2.1 by someone reading the source. Every finding held.

**Sign-in had no ceiling.** Failures were logged with the caller's address
and nothing more. Two counters now — one per address, one per account —
because the two attacks look different: one source working through many
accounts is caught by the first, many sources working on one account by the
second, and behind a proxy only the second still means anything.

The count is kept in the process that serves the request. PLANKA needs no
Redis and the stock deployment is one container; run several and each keeps
its own count, which multiplies the ceiling by their number. That trade is
written where the limits are configured.

**The second factor could be guessed at leisure.** Six digits, and a
pending token that stayed valid for its full ten minutes however many codes
were wrong. Wrong codes are now counted on the session row — in the
database, so the count survives a restart and holds across every process —
and when the budget is spent the session is destroyed. After that even the
right code is refused and the login starts over from the password.

**Avatars, background images and favicons** checked the token's signature
and nothing else, so a revoked session, a deactivated account or a changed
password all kept working there for as long as the signature lasted, which
is a year by default. The five checks the API makes now live in one helper
that both use, rather than the shortened copy that had drifted from it.

**A link attachment's favicon** was fetched from wherever the URL pointed.
Storing a link is harmless — it is a string the user typed — but fetching
its icon is a request the server makes to an address the user chose, and
whether an icon came back reported on what is reachable from inside the
network. Server-side fetches now refuse private, loopback and link-local
addresses, `169.254.169.254` among them. The attachment is still created:
linking to an internal wiki is a legitimate thing to do, and it was the
server's own request that had to stop.

**The signing key.** Our own compose file ships `notsecretkey`, and it is
printed in the documentation — so on any instance that copied it, anyone can
sign a token for any account. PLANKA now says so on every start, and keeps
saying it, along with a key that is missing or shorter than 32 characters.
The placeholder carries the warning inline, where it is copied from.

**The backup script** wrote password hashes, live sessions, TOTP secrets and
SMTP credentials to an unencrypted archive. `BACKUP_PASSPHRASE` now encrypts
it, and without one the script says what it just put on disk. It also says
what it is — an example for the stock compose stack, not a backup concept —
and names the window between the database dump and the file copy, which no
ordering closes.
2026-08-28 20:55:54 +02:00
Daniel Hiller 2e4904f77d feat: Add two-factor authentication via TOTP
Adds TOTP setup with QR code, login challenge, recovery codes and
trusted devices that let a browser skip the second factor for 30
days. Admins can reset another user's second factor by confirming
with their own password.
2026-08-07 20:11:55 +02:00
Daniel Hiller 36aa732fec feat: Remove OIDC and SSO support
Existing SSO accounts have no local password, so the migration
deactivates them before dropping is_sso_user and the
identity_provider_user table.
2026-08-07 19:15:43 +02:00
Maksim Eltyshev c4e2221444 docs: Fix typos in Swagger 2025-09-12 21:01:24 +02:00
Maksim Eltyshev b4979d214f docs: Improve Swagger JSDoc 2025-09-12 12:17:01 +02:00
Maksim Eltyshev 5636cf27c0 docs: Add base path for API endpoints to Swagger 2025-09-08 18:25:26 +02:00
Maksim Eltyshev 5ad3134519 docs: Add full Swagger JSDoc coverage 2025-09-08 16:20:27 +02:00
Maksim Eltyshev 2f4bcb0583 feat: Add legal requirements (#1306) 2025-08-21 15:10:02 +02:00
Maksim Eltyshev 2ee1166747 feat: Version 2
Closes #627, closes #1047
2025-05-10 02:09:06 +02:00
Maksim Eltyshev 50519f1bcd feat: Additional httpOnly token for enhanced security in browsers 2024-09-01 09:31:04 +02:00
Aurélien Troncy ccfc621d51 feat: Ability to show detailed auth errors, set to false by default (#860) 2024-08-30 11:47:29 +02:00
Maksim Eltyshev 5e8027f5d6 feat: Add ability to enforce SSO
Closes #543, closes #545
2024-02-01 00:31:15 +01:00
Maksim Eltyshev 1ef736106c fix: Fix order of checks when logging in 2023-10-18 23:07:57 +02:00
Maksim Eltyshev b9716c6e3a fix: OIDC finalization and refactoring 2023-10-17 19:18:19 +02:00
Maksim Eltyshev 5cd025ffb7 ref: Remove board types, refactoring 2022-12-26 21:10:50 +01:00
Maksim Eltyshev 48ea62c0a0 feat: Invalidate access token on logout 2022-09-07 18:39:33 +05:00
Steven Correia fe5fe5fab7 feat: Modify logger to log to file that supports fail2ban (#284) 2022-08-23 03:42:56 +05:00
SimonTagne 2b4c2b0f49 feat: Improve security of access tokens (#279)
Closes #275
2022-08-09 21:03:21 +05:00
Maksim Eltyshev fe91b5241e Project managers, board members, auto-update after reconnection, refactoring 2021-06-24 01:05:22 +05:00
Maksim Eltyshev 253bdcda7a Allow dots in username. Closes #116 2021-04-13 18:59:02 +05:00
Maksim Eltyshev ce1e1f741d Add username to user 2020-04-03 00:35:25 +05:00
Maksim Eltyshev 7a3805e64c Code formatting with prettier, change eslint config for the server 2019-11-05 18:01:42 +05:00
Maksim Eltyshev 36fe34e8e1 Initial commit 2019-08-31 04:07:25 +05:00