Commit Graph
93 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
Vincent Bonamy a99a848064 Revert cleanup of usesCASAuthentication on c3234882eb - useful for CAS-specific frontend recovery logic 2026-06-15 08:56:23 +02: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 458d39d48a feat(openID): first stable version 2025-03-13 15:24:03 +01:00
smizrahi 49879efbc6 fix(ui): Change active user name on top left with primary identity 2022-11-23 14:44:07 +01:00
smizrahi 26b9429396 fix(ui): Change active user name on top left with primary identity 2022-11-23 13:33: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 a3277eb65a fix(login): fix localizabled strings when changing language 2020-11-30 16:59:33 -05:00
Francis Lachapelle fccbdb3076 (js) Dynamically load localizable strings 2018-08-02 17:59:52 -04:00
Francis Lachapelle 162206b934 Fix SAML2 session timeout during XHR requests 2018-04-17 15:14:48 -04:00
Francis Lachapelle 663a0b60dd (feat) Configurable Web animation level 2017-04-25 16:35:39 -04:00
Francis Lachapelle 0a0f8a8d89 (css) Custom CSS for IE 2017-03-09 12:16:51 -05:00
Francis Lachapelle 793be51d14 Restore auto-reply indicator in top toolbar 2016-07-20 14:24:15 -04:00
Ludovic Marcotte adc227a7eb (fix) avoid broken redirects on sessions expiration 2016-04-11 14:53:17 -04:00
Francis Lachapelle 65f56f47b5 (js) Improve Preferences module
- Added constraint to timezone;
- Enable save button only if form is dirty and valid;
- Confirm unsaved changes before leaving.
2016-03-29 15:07:04 -04:00
Ludovic Marcotte 916806cc2c (feat) new SOGoHelpURL preference to set a custom URL for SOGo help (fixes #2768) 2016-03-22 14:25:55 -04:00
Francis Lachapelle 70fbeab27a (js) Improve sg-search directive
Will now respect the "listRequiresDot" source parameter and uses
ng-messages to show an error if the minimum number of characters is not
reached.

Fixes #438, #3464
2016-02-24 21:41:03 -05:00
Patrice Levesque 7c25b53fdf Remove pointless #imports from .m and .h files
This was done with a brute-force approach, ensuring no additional
warnings from GCC 4.9 under x86_64.
2016-02-13 16:11:52 -05:00
Francis Lachapelle 6bfc44fb53 (js) Add support for %p in date formatting
Fixes #3480
2016-02-01 20:54:37 -05:00
Francis Lachapelle b09e7163dd (fix) Show user's default email address
Fixes #3473
2016-02-01 10:41:22 -05:00
Francis Lachapelle b19d894f27 Don't try to translate "SOGo" 2016-01-05 14:00:43 -05:00
Francis Lachapelle 2720aebf04 Initial popup view for messages 2015-09-04 17:31:16 -04:00
Ludovic Marcotte b72a9383a4 (feat) major rework of the sidenav and top toolbars 2015-08-14 12:14:15 -04:00
Ludovic Marcotte 1ae7cddf09 Silenced NSLog calls 2015-07-03 10:22:48 -04:00
Francis Lachapelle 305c13d720 Add common template UIxTopnavToolbarTemplate.wox 2015-06-12 11:45:09 -04:00
Francis Lachapelle 0fc027e5e9 Set the doctype to HTML5 2015-06-12 11:42:37 -04:00
Francis Lachapelle 2446677172 [fix] Add definition of UIxSidenavToolbarTemplate 2015-06-12 11:41:27 -04:00
Ludovic Marcotte 5c3f0138f5 First pass at the v3 pref module
The UI needs to be styled. We also need to properly load "default"
values from the system/domain/user defaults and save them correctly
too.
2015-06-12 11:17:49 -04:00
Francis Lachapelle 86a6f5c67b Add Angular module assignation in page frame 2015-06-11 15:26:35 -04:00
Francis Lachapelle c8ea3da5bc Improve detection of theme-specific JavaScript 2015-06-11 15:25:28 -04:00
Francis Lachapelle 77b80e27c6 Add support for themes 2015-06-11 15:25:24 -04:00
Francis Lachapelle fbe412db08 Allow js/img/css subfolders in WebServerResources 2015-06-11 15:25:22 -04:00
Francis Lachapelle 0f9d8cdd2c Remove xml tag before doctype declaration 2014-01-23 14:48:36 -05:00
Wolfgang Sourdeau aeabd85c90 Finalized support for SAML2 logon 2012-11-02 15:31:49 -04:00
Francis Lachapelle 0181ec606d Cleanup months and weeks translations
Removed the translations of months and weeks from the Scheduler bundle
since they were already translated in Locale files.
 - The a3_<month> strings were removed (replaced by
   NSShortMonthNameArray)
- The months strings were removed (replaced by NSMonthNameArray)
- The weeks strings were removed (replaced by NSWeekDayNameArray)

Moved the a2_<weekday> strings to the Common bundle and added a new
method [UIxComponent commonLabelForKey:].
2012-09-21 21:48:39 -04:00
Ludovic Marcotte 6d745e0f4b See ChangeLog
Monotone-Parent: aadc4759a64f724760d38bbdfd92715182856439
Monotone-Revision: 5e99e6ac2d5684eba786f2ce14295f3a3b5267a3

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2012-06-21T23:32:18
2012-06-21 23:32:18 +00:00
Wolfgang Sourdeau 7ec440bbc1 Monotone-Parent: 8641791497cbe0e199fc4b68731683dd533ce48e
Monotone-Revision: 8d583d2e8977d0d63e028818f6f961246d256bdd

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-12-09T14:53:44
2011-12-09 14:53:44 +00:00
Francis Lachapelle 4359f406cb See ChangeLog
Monotone-Parent: 517b0b095f30f6f2f92a4da5dfe0155872190daa
Monotone-Revision: b28dce204bf84148d4bd3df3df8b289cdd7a4168

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-09-27T20:15:06
Monotone-Branch: ca.inverse.sogo
2011-09-27 20:15:06 +00:00
Francis Lachapelle f630dd1c83 See ChangeLog.
Monotone-Parent: b3af4618e267496536ae158c684a391e497913f0
Monotone-Revision: 85f004835cf5ba09158bc317c859435dd12fe5bf

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-03-30T15:21:27
Monotone-Branch: ca.inverse.sogo
2011-03-30 15:21:27 +00:00
Ludovic Marcotte 5477457271 See ChangeLog
Monotone-Parent: ada8e59dc2acdffd7634acc70f3387a0f8e4e671
Monotone-Revision: d61deeadebd9f79f9603928dca395cad83167394

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2010-12-09T19:15:02
Monotone-Branch: ca.inverse.sogo
2010-12-09 19:15:02 +00:00
Wolfgang Sourdeau b90a3f76b4 Monotone-Parent: eb9d7b5fce99d3950d29b0b3737f3463547818d7
Monotone-Revision: 756755f35a7b0415c98a7a403ba3c57bc62a635a

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-09-14T14:06:20
Monotone-Branch: ca.inverse.sogo
2010-09-14 14:06:20 +00:00
Ludovic Marcotte 45c653d990 Removed the browser limitation for Opera. We don't do any version check numbers - use at your own risk\!
Monotone-Parent: 8cb90e9b9131045b60db27358a0651385c689a42
Monotone-Revision: 1a442265f5943bf4d60fcf33caf909bbff76bd38

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2010-09-03T19:20:02
Monotone-Branch: ca.inverse.sogo
2010-09-03 19:20:02 +00:00
Wolfgang Sourdeau 5c4964bc55 Monotone-Parent: 4bda58ef38f5ccda5b874a0271bc6fd1168c8d2e
Monotone-Revision: 4931dae72f1ad88e9b719cf79ec472271ce13836

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-08-12T17:34:32
Monotone-Branch: ca.inverse.sogo
2010-08-12 17:34:32 +00:00
Wolfgang Sourdeau 43ef41eeb7 Monotone-Parent: cbf125640f6348895aa302fdfc58f2a13c96cc80
Monotone-Revision: 9f129d083b11ce7ac964a083c351d2a15f16fbdb

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-08-11T13:31:59
Monotone-Branch: ca.inverse.sogo
2010-08-11 13:31:59 +00:00
Wolfgang Sourdeau 308de80e6a Monotone-Parent: 0bad93574cbb34f80f8e581a8347fec75a28f612
Monotone-Revision: 31bbff0f57dce6334191e5cabb61c655e5022a37

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-08-09T14:17:22
Monotone-Branch: ca.inverse.sogo
2010-08-09 14:17:22 +00:00
Wolfgang Sourdeau 41fe0341a3 Monotone-Parent: ebbadbdb3549dd7264241be0a6c21ab9a481341f
Monotone-Revision: 1fb8a3cbc4132cfe8736e6233d540222301c0485

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-06-10T21:57:14
Monotone-Branch: ca.inverse.sogo
2010-06-10 21:57:14 +00:00
Wolfgang Sourdeau b1a7398de1 Monotone-Parent: 227d08b1bace5a1e7b0760cc82dc7381016175ae
Monotone-Revision: a1b9a10da6c763d93711deaf538e81314618e5e7

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-06-10T18:42:26
Monotone-Branch: ca.inverse.sogo
2010-06-10 18:42:26 +00:00
Wolfgang Sourdeau 586e5f5642 Monotone-Parent: 42e55c8292b29dad1cd5260453c22ca05fb07f6e
Monotone-Revision: 5ca4f59d87c4968d9506582dbf635a39d0ac2f55

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-02-19T16:45:07
Monotone-Branch: ca.inverse.sogo
2010-02-19 16:45:07 +00:00
Wolfgang Sourdeau 126651b6a7 Monotone-Parent: 775b7e4fea80568033b5c8bf9b7c5220c7d36041
Monotone-Revision: ff12d30f9bf1800bb0b1bcbefba9493cdeeeccaf

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-01-28T21:42:03
Monotone-Branch: ca.inverse.sogo
2010-01-28 21:42:03 +00:00
Wolfgang Sourdeau 33777d04bc Monotone-Parent: 2977eee44dc8cb28a84d3198502b07eacfaf2472
Monotone-Revision: 41c1c07c9e64afed10d305ba098bdffb69a7e77d

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-12-14T14:37:24
Monotone-Branch: ca.inverse.sogo
2009-12-14 14:37:24 +00:00