Commit Graph
178 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 47133fdf3b fix(mail): escape angularJS directive for description 2026-08-10 19:34:25 +02:00
Hivert Quentin 1fdb4d3026 i18n(pt): Add Greek (partial) 2026-03-02 15:01:52 +01:00
Hivert Quentin 16ab99e7cf fix(vulnerability): prevent sogo to execute scripts pass in theme query 2025-11-26 13:22:38 +01:00
Hivert Quentin c8dd5535b3 fix(sieveà: Sieve use the correct imap auth mechanism 2025-07-24 15:03:30 +02:00
Hivert Quentin f5f8f112cd chore(language): Add Thai language 2025-07-03 16:59:56 +02:00
Hivert Quentin 08bc6aff3f chore(language): Add Korean language 2025-07-03 09:35:50 +02:00
Hivert Quentin 665861d830 i181(gl_ES) add Galician language support 2023-06-12 08:56:30 +02:00
smizrahi 8001e3f6ab feat(alarms): Add possibility to use SMTP master account for system alarms. Fixes #5565. 2023-02-16 18:51:28 +01:00
smizrahi 656807b77d feat(password-recovery): Add password recovery with secret question or secondary email 2022-10-03 08:56:41 +02:00
adetk d1971b76e2 i18n(kk): Add Kazakh translation by Nazym Idrissova 2022-07-25 07:39:28 -04:00
Francis Lachapelle 0130803cd4 chore(core): remove UIxModuleAccessDenied 2022-05-16 17:43:35 -04:00
Francis Lachapelle 07b4ad6c72 i18n(bs_BA): add Bosnian translation 2022-01-05 17:33:55 -05:00
Francis Lachapelle eb18249d2b i18n(bg): add Bulgarian translation 2021-08-16 13:57:34 -04:00
Francis Lachapelle 3cc29b4018 i18n(sr_SR): add Montenegrin translation 2021-08-09 11:30:36 -04:00
Francis Lachapelle 9dbb77047e chore: remove SOGoUI/UIxJSClose 2021-06-14 11:38:43 -04:00
Francis Lachapelle 8e98af0e9f fix(web): allow to change expired password from login page 2021-05-11 15:03:02 -04:00
Francis Lachapelle 8386bb2c08 i18n(sr_SR): add Serbian (Latin) translation 2020-12-18 19:41:37 -05:00
Nicolas Höft 8507204e0d fix(core): fix GCC 10 compatibility
With GCC 10, SOGoAptFormatter.m FTBS with the following error:

    SOGoAptFormatter.m: In function ‘-[SOGoAptFormatter setPrivateTitleOnly]’:
    SOGoAptFormatter.m:104:56: error: expected ‘)’ before ‘::’ token
      104 |   self->formatAction = @selector(titleOnlyForPrivateApt::);

Simply name the second argument, so gcc is happy.

Also add the `external` keyword to a header declared variable.

Fixes #5029
2020-08-19 12:28:30 -04:00
Francis Lachapelle f0c8aa884c (i18n) Add Indonesian (id) translation 2019-06-14 10:58:29 -04:00
Francis Lachapelle e79494c43c Reflect active locale in HTML lang attribute
Fixes #4660
2019-01-28 10:04:55 -05:00
Francis Lachapelle 237ac4a330 Fix folder export when XSRF validation is enabled
Fixes #4502
2018-11-23 14:20:33 -05:00
Francis Lachapelle fccbdb3076 (js) Dynamically load localizable strings 2018-08-02 17:59:52 -04:00
Francis Lachapelle 6020f6ae83 (i18n) Add Romanian (ro) translation 2018-07-30 12:05:14 -04:00
Francis Lachapelle 0af459abf7 (i18n) Add Japanese (ja) translation 2018-06-06 12:18:38 -04:00
Francis Lachapelle 0149d7400d (i18n) Add Japanese (ja) translation 2018-06-01 13:22:10 -04:00
Francis Lachapelle 9310a289f6 Fix decoding of spaces in URL-encoded parameters 2018-02-06 11:04:21 -05:00
Francis Lachapelle 77f9f60276 New events list view 2017-09-08 13:35:31 -04:00
Francis Lachapelle 34a6a8960a Add Latvian (lv) translation 2017-05-30 16:19:44 -04:00
Francis Lachapelle fcfbc50139 Add Hebrew translation (cont'd) 2017-01-27 12:58:31 -05:00
Ludovic Marcotte a30d620502 (fix) avoid using for now the XSRF code for proxy-auth (fixes #3668) 2016-05-11 08:55:05 -04:00
Ludovic Marcotte e1ced4ac65 (fix) moved SOGoDirectAction from CommonUI to SOGoUI 2016-05-04 09:43:27 -04:00
Ludovic Marcotte 582baf2960 (feat) added AngularJS's XSRF support (#3246) 2016-04-26 11:07:22 -04:00
Ludovic Marcotte adc227a7eb (fix) avoid broken redirects on sessions expiration 2016-04-11 14:53:17 -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
Euan Thoms 3c62cc744e Stage 1 of clang compiler warning patches. 2015-10-31 14:10:03 +08:00
Ludovic Marcotte fdad1e061a (fix) set default's module path name to SOGo 2015-09-21 12:02:33 -04:00
Ludovic Marcotte 1c666e8ead (fix) simplified logic and improved code readability 2015-09-21 08:59:36 -04:00
Ludovic Marcotte 258f5e0b25 (fix) correctly handle module name for "folder less" SOGo modules 2015-09-18 20:30:35 -04:00
Francis Lachapelle 8d66f62cad [fix] JS syntax error on login page 2015-06-12 11:42:37 -04:00
Francis Lachapelle 516e5fd303 Add current date in top bar 2015-06-12 11:35:54 -04:00
Francis Lachapelle 8c7846a1fa Propagate theme in modules relative URLs 2015-06-11 15:38:16 -04:00
Francis Lachapelle 77b80e27c6 Add support for themes 2015-06-11 15:25:24 -04:00
Francis Lachapelle e1ecf797f5 Use double-quotes for setTimeout of UIxJSClose.wox 2015-06-10 09:09:01 -04:00
Jeroen Dekkers 6ded9e95b3 Put private libraries in /usr/lib/sogo 2014-10-01 20:36:42 +02:00
Alexandre Cloutier 6ad87052ba bugFix #0002616 : change the behavior of ApplicationBaseURL. Now the object return a standard path(without a slash at the end of the path) That means every string added the URL ApplicationBaseURL must start with a Slash. 2014-03-06 14:47:54 -05:00
Wolfgang Sourdeau 3f58b6bfd1 Use the output of "gnustep-config --base-libs" to determine which libs our libraries must be linked against 2012-11-07 09:50:32 -05:00
Wolfgang Sourdeau e31f809849 Use the system defaults when the user defaults are not availble 2012-11-01 10:27:27 -04:00