Commit Graph
90 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 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
smizrahi 656807b77d feat(password-recovery): Add password recovery with secret question or secondary email 2022-10-03 08:56:41 +02: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 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 9310a289f6 Fix decoding of spaces in URL-encoded parameters 2018-02-06 11:04:21 -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 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
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
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 e31f809849 Use the system defaults when the user defaults are not availble 2012-11-01 10:27:27 -04:00
Wolfgang Sourdeau 6d8c328910 Fixed most build warnings 2012-10-22 10:09:13 -04:00
Wolfgang Sourdeau bde8f662a3 removed (apparently) useless +version from classes, due to problems with the ObjC2 runtime on OpenBSD (thanks to Sebastian Reitenbach) 2012-10-18 10:33:20 -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
Francis Lachapelle 95e42d38f7 Monotone-Parent: b4900cbcd7c48cfd36bb5a262eec357e3ac1033a
Monotone-Revision: 533c5fea139373885b136bf6d41275a80a56967b

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-12-09T16:34:11
2011-12-09 16:34:11 +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 03625e4aae See ChangeLog.
Monotone-Parent: 1ea08f6ec84d602c5e78b6c440e2f7d6297a82cd
Monotone-Revision: 61b12be970a9603306d37277ee431b6fd5ab89cd

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-12-02T07:22:47
2011-12-02 07:22:47 +00:00
Ludovic Marcotte 12856abe4d See ChangeLog
Monotone-Parent: be9e28d5d42ed05605b27d2127cf29b07678495b
Monotone-Revision: 5de6a9584cf27a2c1dad8d1ab8b84fc9ddab2720

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2011-04-25T10:31:08
Monotone-Branch: ca.inverse.sogo
2011-04-25 10:31:08 +00:00
Wolfgang Sourdeau 2b03a58b9d Monotone-Parent: 9b3a8a4c66cfa9329c941f7789f248573edff6ac
Monotone-Revision: bcb224398f8aef1d62aad42e31635b91c0c993f7

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-03-09T20:29:17
Monotone-Branch: ca.inverse.sogo
2010-03-09 20:29:17 +00:00
Wolfgang Sourdeau bb13d2b0b5 Monotone-Parent: d5640b6a541fb6bc6c0cdd32d499796291e09473
Monotone-Revision: f69c7f912f9958f232e0641fbdf872d37a2aa9bd

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-02-18T22:08:48
Monotone-Branch: ca.inverse.sogo
2010-02-18 22:08:48 +00:00
Wolfgang Sourdeau 1e5155e1a2 build warnings
Monotone-Parent: 45249fe68411e1b5ecd968fb87f91801d6882115
Monotone-Revision: 9ea936d2bbff9184d4e2df3779bdc267702b6996

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-01-22T16:33:35
Monotone-Branch: ca.inverse.sogo
2010-01-22 16:33:35 +00:00
Wolfgang Sourdeau b79a7e5a00 Monotone-Parent: 2fdf0ead0781ef2362dd389811d5db44ca4cc84a
Monotone-Revision: c91eef7edcfd08d414664c25a590b6268a7e58e2

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-11-29T04:19:32
Monotone-Branch: ca.inverse.sogo
2009-11-29 04:19:32 +00:00
Wolfgang Sourdeau fb9ac84533 Monotone-Parent: f9a04cc4832d7c1ca8d70b594faba3c5a0eda334
Monotone-Revision: f3dd7372c4f74c5e1e309b528107e222964ca70b

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-11-10T21:39:40
Monotone-Branch: ca.inverse.sogo
2009-11-10 21:39:40 +00:00
Wolfgang Sourdeau f1d38a52b3 Monotone-Parent: 02bca191f3d6f22210597517ed2f42a870e492cc
Monotone-Revision: c4cc03e458ff714a9414efcd7a3b1bd9e5a74b88

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-07-19T17:11:37
Monotone-Branch: ca.inverse.sogo
2009-07-19 17:11:37 +00:00
Francis Lachapelle 13f621c453 Improved login page
Monotone-Parent: 6b9f81899aec0db3909c9b036a5cb7166a9185bc
Monotone-Revision: 298cdcf2f6c47c075aa3da6b45deb9784730194d

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-07-14T17:20:49
Monotone-Branch: ca.inverse.sogo
2009-07-14 17:20:49 +00:00
Wolfgang Sourdeau 79d23608d4 Monotone-Parent: 6485cacb283ff7fd9905e8d9e8d097a761fc9c39
Monotone-Revision: ceeb01446ec3ddc689505cb7bb9f3110f23ad06d

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-07-01T19:27:34
Monotone-Branch: ca.inverse.sogo
2009-07-01 19:27:34 +00:00
Wolfgang Sourdeau b4fe7d040c Monotone-Parent: fbaf51f1b9944aee510a816b001f424db9802648
Monotone-Revision: 9b5d407f9ae321995a0df2c39bcac77dc375d302

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-06-04T15:08:03
Monotone-Branch: ca.inverse.sogo
2009-06-04 15:08:03 +00:00
Francis Lachapelle 16f3e7146a See ChangeLog
Monotone-Parent: bb4fd38c86aee6bed3b4f6bd3ca7dcebe0310c2a
Monotone-Revision: 1c1858472d2b9c6f86a8b53da8c5710cf0d6eecd

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-02-06T01:15:24
Monotone-Branch: ca.inverse.sogo
2009-02-06 01:15:24 +00:00
Francis Lachapelle 7a2eff59ea Fix for bug #2969
Monotone-Parent: 34dbce3026b164b07c558711781fcfb5cde0fcff
Monotone-Revision: 1d653d4f984b0eeefbcd5014a68753ef3d761b3c

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-11-04T19:55:50
Monotone-Branch: ca.inverse.sogo
2008-11-04 19:55:50 +00:00
Wolfgang Sourdeau 6300e62937 Monotone-Parent: 5391b9be06e00255b931f3a5c6535e3527ebd405
Monotone-Revision: 2d2d47c8c2a7874ff16e8677d2bb7c3607c56d5c

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-09-02T02:53:34
Monotone-Branch: ca.inverse.sogo
2008-09-02 02:53:34 +00:00
Wolfgang Sourdeau 5876989e1d Monotone-Parent: 47b9620ce14470cae0697918adc94344f3f07b0e
Monotone-Revision: b4d23e0ff0b98727a952a0a09a9cb7e312f3562a

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-08-26T17:42:03
Monotone-Branch: ca.inverse.sogo
2008-08-26 17:42:03 +00:00
Wolfgang Sourdeau acfedae126 Monotone-Parent: 0e8b32d9c70c2ce26b1625a032639e96a5e907a9
Monotone-Revision: 3edbc90046db007b2cea7d85505ba6bcecec6dd7

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-07-04T16:06:09
Monotone-Branch: ca.inverse.sogo
2008-07-04 16:06:09 +00:00
Wolfgang Sourdeau 061ac2aa45 Monotone-Parent: 040674761c27c58b25e81406da993b3e7189cf9c
Monotone-Revision: 7f5165a92f3e95ebbe203abdc6531d84a48f20af

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-05-02T22:51:49
Monotone-Branch: ca.inverse.sogo
2008-05-02 22:51:49 +00:00
Wolfgang Sourdeau cfee388173 Monotone-Parent: 7c28642f36f4c3feb073eabc686174075951ac84
Monotone-Revision: 2faf999531ce61df1885728986fff22f2b832e2c

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-03-10T15:04:01
Monotone-Branch: ca.inverse.sogo
2008-03-10 15:04:01 +00:00