Commit Graph

13 Commits

Author SHA1 Message Date
Claude d88a116fbc
fix: security hardening on synced upstream codebase
Applied security fixes to the latest upstream (usememos/memos):

- Remove hardcoded JWT secret ("usememos") in demo mode; always use instance secret key
- Enforce DisallowPasswordAuth for all roles including admins (was only blocking regular users)
- Add minimum password length validation (8 chars) on CreateUser and UpdateUser password change
- Restrict CORS to same-origin in production (was allowing all origins on both gateway and connect)
- Add HTTP client timeout (10s) to OAuth2 identity provider
- Remove PII logging of OAuth2 user info claims

https://claude.ai/code/session_018iYDVMmBxJLWBvqugc6tNe
2026-03-15 16:51:53 +00:00
memoclaw 8f43e8075b
fix: correct typos in comments, error messages, and identifiers (#5704)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:40:17 +08:00
Johnny f66c750075 chore: simplify attachment file writing 2025-12-31 21:54:37 +08:00
Johnny 1a9bd32cf1 feat(auth): add PKCE support and enhance OAuth security
Implements critical OAuth 2.0 security improvements to protect against authorization code interception attacks and improve provider compatibility:

- Add PKCE (RFC 7636) support with SHA-256 code challenge/verifier
- Fix access token extraction to use standard field instead of Extra()
- Add OAuth error parameter handling (access_denied, invalid_scope, etc.)
- Maintain backward compatibility for non-PKCE flows

This brings the OAuth implementation up to modern security standards as recommended by Auth0, Okta, and the OAuth 2.0 Security Best Current Practice (RFC 8252).

Backend changes:
- Add code_verifier parameter to ExchangeToken with PKCE support
- Use token.AccessToken for better provider compatibility
- Update proto definition with optional code_verifier field

Frontend changes:
- Generate cryptographically secure PKCE parameters
- Include code_challenge in authorization requests
- Handle and display OAuth provider errors gracefully
- Pass code_verifier during token exchange

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 00:04:26 +08:00
johnnyjoy a0f68895ab chore: add more logs for oauth2 2025-05-14 20:38:14 +08:00
johnnyjoy eb33a604b2 feat: support mapping avatar url from oauth2 2025-04-24 10:07:24 +08:00
Steven 43d13a3edc chore: tweak linter 2024-10-11 21:05:07 +08:00
Steven b376a20fb4 chore: tweak linter warnings 2024-08-20 08:25:34 +08:00
Steven cf4db17080 chore: fix linter 2024-04-13 10:53:39 +08:00
Steven c373131b89 chore: migrate idp service 2024-04-13 10:50:25 +08:00
Steven cd0ea6558d chore: update golangci-lint config 2023-09-17 22:55:13 +08:00
boojack 723c444910
chore: update server tests (#2118) 2023-08-10 09:01:38 +08:00
boojack 69726c3925
feat: implement oauth2 plugin (#1110) 2023-02-18 10:50:13 +08:00