Commit Graph
102 Commits
Author SHA1 Message Date
Jordi Mallach a863283680 feat(web): add optional Content Security Policy
AngularJS (EOL since 2022-01) and AngularJS Material no longer receive
security fixes, so any new vulnerability in them will stay unpatched.
In AngularJS, templates are code: any attacker-controlled text that
ends up in a compiled template is evaluated as an expression, and
since 1.6 there is no expression sandbox, so a single
{{constructor.constructor('...')()}} gives full script execution.
SOGo renders untrusted data (mail bodies, invitations, attachment
names, contact fields) into such templates and currently relies on
server-side filtering, like stripping "{{" and "}}", to prevent this.
Any gap in that filtering, or a bypass of $sanitize/ng-bind-html,
would mean XSS in the webmail session: reading and sending mail as
the user, and access to calendars and contacts.

A Content Security Policy adds a second layer in the browser that
doesn't depend on catching every injection. The new
SOGoContentSecurityPolicy system default ("report-only" or "enforce",
disabled when unset) sends a strict policy with the pages of the web
interface:

  script-src 'self' 'nonce-<random>'   (no 'unsafe-inline'/'unsafe-eval')
  style-src 'self' 'unsafe-inline'     (Angular Material, CKEditor 5)
  object-src 'none'; base-uri 'self'; frame-ancestors 'self'; ...

The policy is generated by sogod, since a fresh 128-bit nonce is needed
per response: it is shared by all components of the response and set
on the inline configuration scripts of the page frame and module views.
The page also gets ng-csp="no-unsafe-eval", so AngularJS evaluates
expressions with its interpreter instead of Function().

With the policy enforced, an expression injected into a compiled
template, such as {{constructor.constructor('...')()}}, can no longer
reach Function() and fails with an EvalError, and injected inline
scripts are blocked. Injected expressions are limited to calling
functions available on the scope.

Tested with Chromium in both modes on login, Mail (HTML messages,
remote content, invitations, compose), Calendar and Contacts editors,
Preferences and Administration: no violations from SOGo's own code.
With the default unset, the generated output is unchanged.

form-action is deliberately not restricted, so SAML2/CAS/OpenID
logins posting to an external IdP keep working. Scripts listed in
SOGoUIAdditionalJSFiles are served from WebServerResources and allowed,
but must not load scripts from other origins, use eval() or rely on
inline handlers; their dependencies have to be installed and listed
alongside them.
2026-11-06 16:22:03 +01:00
Hivert Quentin a077512e34 fix(ui): add css class for login page 2025-09-19 09:50:15 +02:00
Hivert Quentin a1f2670485 revert: feat add url for creating account on login page 2025-03-13 15:47:16 +01:00
Hivert Quentin c3234882eb feat(openID): second part with a lot of fixes and cleaning 2025-03-13 15:25:56 +01:00
Hivert Quentin 5cba10ccff fix(totp): correctly send a string and leading zero 2025-03-07 09:03:41 +01:00
André Rodier b48704e7ff Update SOGoRootPage.wox
Ensure the TOTP input field only accept number, so it is quicker to type on mobile devices.
Disable history of the TOTP input, which is not necessary.

See https://bugs.sogo.nu//view.php?id=5524
2025-03-04 14:10:03 +01:00
smizrahi 178b1a3a0e feat(core): Check password strength on login (SQL Source). Closes #6025. 2024-12-02 11:08:39 +01:00
smizrahi f2ba6870d5 feat(core): Add new SOGoURLCreateAccount option to add a create account link below login form 2024-10-22 16:03:50 +02:00
smizrahi 63248772c1 feat(core): Add message of the day. Fix theming issue. 2024-01-31 15:05:42 +01:00
smizrahi eee50697b0 feat(core): Add message of the day 2024-01-22 14:34:22 +01:00
Marvin 7b15327b19 Use vpn_key icon 2023-11-28 15:47:35 +01:00
Marvin 6734b4ea16 design(RootPage): Use lock icon for password field
https://pictogrammers.com/library/mdi/icon/key/
2023-11-18 15:46:46 +01:00
smizrahi d802b92a13 Revert "fix(UI): Make the login page honor the color theme"
This reverts commit 607bc08c92.
2023-05-03 15:02:11 +02:00
Alex Vogt 607bc08c92 fix(UI): Make the login page honor the color theme
partial solution by specifying the theme and accent color manually

Fixes #5687 (partially)
2023-01-31 19:43:42 +01:00
smizrahi 7bfa900ae1 feat(login): Add button to discover password 2022-11-09 15:40:29 +01:00
smizrahi 18c92dac31 feat(password-recovery): Add loader for password recovery - when requests are slow, the UI does not display anything. 2022-10-26 16:23:55 +02:00
smizrahi 33940b14ea feat(password-recovery): Improve password lost link style 2022-10-18 16:19:20 +02:00
smizrahi 656807b77d feat(password-recovery): Add password recovery with secret question or secondary email 2022-10-03 08:56:41 +02:00
Francis Lachapelle 56a6f246d6 fix(login(js)): input focus on TOTP field 2021-12-07 16:31:28 -05:00
Francis Lachapelle d4da1facf9 fix(web): use a distinct salt for TOTP authentication
If TOTP is enabled for a user, it will be disabled until the user
configure it again, which will generate a new private salt.
2021-10-15 16:18:23 -04:00
Francis Lachapelle 20b2fd5e45 refactor(web): replace SOGoGoogleAuthenticatorEnabled with
SOGoTOTPEnabled

Fixes #5294
2021-06-16 14:59:02 -04:00
olivierperes 9ae9fa094e refactor(mail): replace "Google Authenticator" with more general vocabulary
The 2FA feature is not specific to one application, rewording makes this more clear.

Fixes #5294
2021-06-16 09:49:30 -04:00
Francis Lachapelle 0c1f9fdb02 fix(web): restore support of ppolicy OpenLDAP overlay 2021-05-05 12:41:08 -04:00
Francis Lachapelle 1579ebd233 chore: remove deprecated files and templates 2020-07-22 15:04:12 -04:00
Francis Lachapelle e8f0471bcf feat(core(js)): improve Google Authenticator on login page, add QR code
Closes #2722
2020-05-07 16:45:37 -04:00
Ludovic Marcotte f78300a12e feat(core): initial Google Authenticator support for 2FA 2020-05-07 07:22:24 -04:00
Francis Lachapelle 23690cb223 (js) Escape saved username in cookie
Fixes #4810
2019-10-21 14:07:03 -04:00
Francis Lachapelle cb2ab9152f (js) Don't change user language when not changed
Fixes #4244
2017-08-30 14:18:23 -04:00
Francis Lachapelle 41967d3eec Respect languages preferences on login page
Fixes #4169
2017-05-18 22:28:05 -04:00
Francis Lachapelle 4c78d81bf7 Formatting & Comments 2016-12-19 11:15:35 -05:00
André Peters 56c9f9d288 Disable auto-correct on iOS for username 2016-11-20 11:16:29 +01:00
Daniel Jagszent a402272f9d Change active state of "Remember username" switch
If you activate "Remember username" on the login screen the switch would have the same color as the background. This makes the active state of the switch not really visible.

This changes the theming of this switch to use the same color as the login button.
2016-09-20 17:44:17 +02:00
Francis Lachapelle ab4118fb29 Show user's name upon successful login 2016-08-31 14:32:30 -04:00
Francis Lachapelle c2a0994aed Fix ripple blocking login form
Fixes #3808
2016-08-31 11:29:30 -04:00
Francis Lachapelle 0ec79e0411 (html,css) Use fab button on login page 2016-08-01 12:13:11 -04:00
Francis Lachapelle 6bbb56c386 (css,js) Improve progress feedback
This ads a "ripple" effect that blocks the context when login in or
sending a message. Generic enough to be used elsewhere.

Fixes #3765
2016-07-15 14:03:16 -04:00
Francis Lachapelle 045013bc74 (js) Fix breakpoints consistency 2016-05-18 14:35:24 -04:00
Francis Lachapelle 19d22cdcfb Adapt to latest md changes 2016-03-08 13:21:11 -05:00
Francis Lachapelle 40d9fa059f (html) Fix select menus of login page 2015-12-18 16:35:30 -05:00
Francis Lachapelle 5020e3658b (html) Fix login page for mobile devices 2015-12-09 15:15:22 -05:00
Francis Lachapelle 8d115733c3 (css) Fix language select menu of login page 2015-12-08 14:11:36 -05:00
Francis Lachapelle fdb36970d4 (css) Adapt to new breakpoints and layout-align 2015-11-30 14:13:15 -05:00
Ludovic Marcotte 6d29e50f22 (fix) replace .md-actions with md-dialog-actions 2015-11-27 13:00:39 -05:00
Francis Lachapelle dc3741f436 (html,js) Adjust padding of dialogs
Following this commit:
https://github.com/angular/material/commit/d2140b1565b7e91d4f0b11b6c3983b976abd00f8
2015-10-14 10:31:15 -04:00
Francis Lachapelle c4ad8a64fa (html) Improve login page 2015-09-15 11:42:47 -04:00
Francis Lachapelle 9db633cada (html) Replace md-layout-fill by layout-fill 2015-08-24 11:21:17 -04:00
Ludovic Marcotte b7af83f7e3 (feat) pimped the login window 2015-08-10 20:47:58 -04:00
Francis Lachapelle fb7d5b628f (js) Make use of 'controllerAs' in MainUI module 2015-08-07 11:04:04 -04:00
Francis Lachapelle b966fd3e30 (js) Move *.app.js files to their directories 2015-08-07 09:56:47 -04:00
Francis Lachapelle a330ff7320 (js) Move Settings to a value in Common ng module
Also removed explicit settings and defaults that were imported in
various app modules. We now always use the Preferences ng service.
2015-08-03 11:57:04 -04:00