Commit Graph
232 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
smizrahi 6f86506b28 feat(mail): Deletion of mail older than x. Closes #6023. 2024-11-20 16:50:15 +01:00
smizrahi 9eb8039698 feat(mail): Improve mail search (advanced search) 2024-05-21 09:25:20 +02:00
smizrahi e92fb8f52d feat(core): Update to ckeditor 5. Fixes #5920. 2024-02-27 14:29:59 +01:00
Hivert Quentin d0b4b50456 feat(core): add SOGoDisableExport option to disable export for mail, calendar and contacts 2023-11-03 18:20:12 +01:00
smizrahi 0a9b3d6adf feat(mail): Add punycode (RFC 3492) to encode domain with special characters 2023-03-21 10:19:32 +01:00
smizrahi 435495f007 feat(core): Add SOGoDisableSharing option to disable sharing for mail, contacts and calendar 2022-12-12 12:03:59 +01:00
Francis Lachapelle dd0730947f web: update window title depending on active module
Fixes #4982
2022-05-16 17:43:35 -04:00
Francis Lachapelle c986422a3d feat(mail(web)): Templates folder for pre-defined drafts
To create a template, the user needs to:

 - define a mailbox as the Templates folder;
 - move a draft to this special folder.

Fixes #4320
Fixes #5363
2022-02-11 10:06:57 -05:00
Francis Lachapelle f9ed6391e6 fix(mail): allow to directly empty junk folder
Fixes #5224
2021-12-03 16:56:57 -05:00
Francis Lachapelle 145f221552 fix(mail(js)): fix height of mailboxes list items 2021-08-23 10:30:37 -04:00
Francis Lachapelle 0eae8296a3 fx(css): reduce list height of mailboxes
Fixes #5145
2020-11-16 12:15:08 -05:00
Francis Lachapelle 6e2d652e38 fix(web): restore menu separators in sidenav of Calendars & Mailer 2020-07-14 14:32:13 -04:00
Francis Lachapelle 07c06db69d refactor(mail(js)): replace ckEditor directive by sgCkeditor component
This refactoring

 1. simplifies updating the CKEditor source code;
 2. allows many instances of the CKEditor on the same page;
 3. fixes the cursor positioning on focus.
2020-05-15 11:37:56 -04:00
Francis Lachapelle 03716f3c3e (css) Fix printing of long mails
Fixes #3731
2019-01-08 15:25:25 -05:00
Francis Lachapelle c1ed49d4ba (js) Fix handling of collapsed/expanded accounts
Fixed #4541
2018-11-13 14:59:09 -05:00
Francis Lachapelle 894769ef6f (web) New menu option to move mailboxes
Fixes #644
Fixes #3511
Fixes #4479
2018-07-27 15:21:35 -04:00
Francis Lachapelle 69ae9d752a (css) Improve display of advanced mail search 2018-06-28 10:45:11 -04:00
Francis Lachapelle a69a5b77be (js) Fix some operations in advanced mail search
Fixes #4478
2018-06-14 22:34:38 -04:00
Francis Lachapelle 28ae2fd58a (js) Review Mail module to decrease watchers 2017-05-18 15:31:38 -04:00
Francis Lachapelle b463fd4eda (js) Drop sgTransformOnBlur directive
The md-chips component has now a functional "md-add-on-blur" functionality.

Fixes #3944
2017-03-22 15:35:05 -04:00
Francis Lachapelle 75aaef0f3d (js) Restrict special mailboxes to the top level
Fixes #6963
2017-03-22 14:53:07 -04:00
Francis Lachapelle 48b2008da4 (js) Localize mailbox names everywhere
Fixes #4041
2017-02-19 21:13:44 -05:00
Francis Lachapelle a78621add4 (css,html) Improve display of mailboxes list
(cont'd)
2016-11-10 09:42:28 -05:00
Francis Lachapelle c596bacccb (css,html) Improve display of mailboxes list 2016-11-09 10:18:12 -05:00
Francis Lachapelle 81ff9e7f04 (css,js) Update md to v1.1.1-master-70cecda 2016-11-01 15:54:56 -04:00
Francis Lachapelle 36c5f72317 Fix some unlocalized strings
Fixes #3858
2016-10-21 10:55:59 -04:00
Francis Lachapelle 508550d677 Add ARIA label for mail accounts toggle buttons 2016-09-30 12:23:22 -04:00
Francis Lachapelle 5e76627641 Revert "(js) Drop sgTransformOnBlur directive"
This reverts commit 67258fe337.

Fixes #3815
2016-09-28 13:50:44 -04:00
Ludovic Marcotte 42127c51ab (feat) added IMAP folders subscriptions management (fixes #255) 2016-09-14 15:57:49 -04:00
Francis Lachapelle 67258fe337 (js) Drop sgTransformOnBlur directive
The md-chips component has now the md-add-on-blur functionality.

See https://github.com/angular/material/issues/3364
2016-09-02 10:20:12 -04:00
Francis Lachapelle 0d1f7a90ce (html) Cleanup 2016-08-10 09:52:28 -04:00
Francis Lachapelle 84a2c70c87 (js) DnD of messages in the Mail module
Fixes #3497, #3586, #3734, #3788
2016-08-04 17:34:29 -04:00
Francis Lachapelle 080c4f27e6 (css) Fix mouse hover visual effect in Mail module 2016-07-11 14:19:15 -04:00
Francis Lachapelle 8f417cb10b Update for latest md changes 2016-06-03 09:01:26 -04:00
Francis Lachapelle 06f596f821 (js) Collapsable mail accounts
Fixes #3493
2016-05-26 15:48:15 -04:00
Francis Lachapelle ce1fb708a0 (js) Fix navigation in Mail advanced search mode 2016-05-18 14:47:33 -04:00
Francis Lachapelle 87fbedb89d (css) Improve subheader with icon buttons 2016-05-17 15:10:09 -04:00
Francis Lachapelle 8c4d4e0e2d (js) Fix usage of the "export" reserved word 2016-05-17 14:31:31 -04:00
Francis Lachapelle 7d5255f762 Fix display of contextual menu of selected mailbox 2016-05-10 14:29:03 -04:00
Ludovic Marcotte de0540c784 (fix) completed the required modifications for XSRF in the mail module 2016-05-04 11:12:30 -04:00
Francis Lachapelle 64ce63d812 (js) Add support for XSRF token with downloads
Initial support to download a file from an Ajax query. This allows the
XSRF token to be sent and verified by the server.
2016-05-03 12:57:36 -04:00
Francis Lachapelle fba40c43d6 (css) Adapt to md changes and improve multi-select 2016-04-21 13:40:47 -04:00
Francis Lachapelle 42c780dd5d (html) Improve initial display of mailboxes 2016-04-05 22:10:38 -04:00
Francis Lachapelle bd1fae0baf (css) Adapt to latest md changes 2016-04-01 16:05:55 -04:00
Francis Lachapelle 632ecfce2c (html) Fix reference to UIxTopnavToolbar 2016-03-29 21:59:21 -04:00
Francis Lachapelle 19d22cdcfb Adapt to latest md changes 2016-03-08 13:21:11 -05:00
Francis Lachapelle 12f4f236e8 (html) Cleanup old inline CSS 2016-02-26 16:14:48 -05:00
Francis Lachapelle 99e5c1b93c (feature) Convert a message to an event or task
Resolves #1722
2016-02-10 16:15:00 -05:00
Ludovic Marcotte 693f80dc9a (feat) now supports RFC6154 and NoInferiors IMAP flag 2016-02-10 10:00:59 -05:00