Commit Graph
45 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 dabdedf6c4 ref: Little refactoring 2026-02-10 21:43:58 +01:00
Maksim Eltyshev a82ae49fe4 chore: Unify term types 2026-02-10 21:14:56 +01:00
Maksim Eltyshev d688a64e36 feat: Add OIDC debug mode 2026-01-27 22:34:08 +01:00
Maksim Eltyshev 1264fd5715 feat: Add internal runtime configuration 2026-01-22 18:02:42 +01:00
Maksim Eltyshev a60f8e3c3e chore: Rename for consistency 2026-01-13 17:52:31 +01:00
HUi af8865327a feat: Add Vietnamese translation (#1459) 2025-12-19 20:17:34 +01:00
Roger Clotet 7a05bf2a30 feat: Add Catalan (ca-ES) translation (#1424) 2025-11-12 19:19:29 +01:00
Samuel b4cbd32bf2 feat: Add API key authentication (#1254)
Closes #945
2025-11-06 20:56:48 +01:00
Maksim Eltyshev fee300908c fix: Set detected language on first login, remove auto-detect language option 2025-10-15 00:08:29 +02:00
Maksim Eltyshev 97ddefc236 docs: Correct invalid/missing details in Swagger 2025-09-16 15:51:14 +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 2c716a53c9 docs: Quote example ids in Swagger 2025-09-08 19:14:31 +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 4d77a1f596 feat: Track storage usage 2025-08-23 00:03:20 +02:00
Maksim Eltyshev 2f4bcb0583 feat: Add legal requirements (#1306) 2025-08-21 15:10:02 +02:00
cjmaldonado 57450a7651 fix: Increase max length of OIDC code challenge (#1126)
Closes #1113
2025-05-13 10:56:01 +02:00
Maksim Eltyshev 2ee1166747 feat: Version 2
Closes #627, closes #1047
2025-05-10 02:09:06 +02:00
Derzsi Dániel 480c280ab3 fix: Lazy initialize OIDC client (#947) 2024-11-18 22:38:52 +01:00
iMarKoLiGa fca77c02b3 feat: Ability to configure OIDC claims source (#888)
Closes #884
2024-09-20 16:19:54 +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 0cc9408857 ref: Refactoring, fix linting 2024-07-16 12:33:38 +02:00
aleb_the_flash d45cbeb0fb feat: Improve OIDC support for strict providers (#824) 2024-07-16 12:19:27 +02:00
Maksim Eltyshev 4fe77c305c feat: Automatic logout when session expires
Closes #693
2024-04-09 15:12:46 +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 0fab6075bd ref: Refactoring 2023-10-19 16:05:34 +02:00
Lorenz Brun 9011ee61da feat: Improve OIDC SSO (#524)
The OIDC implementation merged in https://github.com/plankanban/planka/pull/491 is flawed for multiple reasons.

It assumes that the access_token returned by the IDP has to be a JWT parseable by the RP which is not the case [1].
Many major IDPs do issue tokens which are not JWTs and RPs should not rely on the contents of these at all.
The only signed token which has a standardized format for direct RP consumption is the OIDC ID token (id_token), but this by default doesn't contain many claims, especially role claims are omitted from them by default for size reasons. To get these additional claims into the ID token, one needs an IDP with support for the "claims" parameter.

It requires manual specification of the JWKS URL which is mandatory in any OIDC discovery document and thus never needs to be manually specified.

It also makes the questionable decision to use a client-side code flow with PKCE where a normal code flow would be much more appropriate as all user data is processed in the backend which can securely hold a client secret (confidential client). This has far wider IDP support, is safer (due to direct involvement of the IDP in obtaining user information) and doesn't require working with ID tokens and claim parameters.

By using a server-side code flow we can also offload most complexity to the server alone, no longer requiring an additional OIDC library on the web client.

Also silent logout doesn't work on most IDPs for security reasons, one needs to actually redirect the user over to the IDP, which then prompts them once more if they actually want to log out.

This implementation should work with any OIDC-compliant IDP and even OAuth 2.0-only IDPs as long as they serve and OIDC discovery document.

[1] rfc-editor.org/rfc/rfc6749#section-5.1
2023-10-19 17:39:21 +05: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
gorrilla10101 6941500c7b feat: OIDC with PKCE flow (#491) 2023-09-04 20:06:59 +05:00
Maksim Eltyshev 8578883fac fix: Fix saving milliseconds for timestamps 2023-06-12 23:54:57 +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