aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2020-08-07 21:16:12 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2020-08-07 21:16:12 -0400
commit2f6cd3f85497b10d495d213a125cabcea371d682 (patch)
treea6a757d402cedd017579cc84a3003e10fa556143
parentfixes for CVE-2020-17367 and CVE-2020-17368 (diff)
downloadfirejail-2f6cd3f85497b10d495d213a125cabcea371d682.tar.gz
firejail-2f6cd3f85497b10d495d213a125cabcea371d682.tar.zst
firejail-2f6cd3f85497b10d495d213a125cabcea371d682.zip
patches form Debian (firejail 0.9.64-4, sid): element-profile.patch, usrsharedoc.patch, pathnames.patch, usr-share-firefox.patch
-rw-r--r--RELNOTES6
-rw-r--r--etc/devhelp.profile2
-rw-r--r--etc/disable-programs.inc2
-rw-r--r--etc/evince.profile1
-rw-r--r--etc/firefox-esr.profile2
-rw-r--r--etc/firefox.profile3
-rw-r--r--etc/yelp.profile1
-rw-r--r--src/firecfg/firecfg.config1
-rw-r--r--src/firejail/macros.c49
9 files changed, 56 insertions, 11 deletions
diff --git a/RELNOTES b/RELNOTES
index 6cf627aa0..97e3214f0 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -2,6 +2,12 @@ firejail (0.9.62.2) baseline; urgency=low
2 * work in progress 2 * work in progress
3 * patches from Debian (firejail 0.9.62-3, sid): 3 * patches from Debian (firejail 0.9.62-3, sid):
4 profile-fixes.patch, apparmor-include.patch 4 profile-fixes.patch, apparmor-include.patch
5 * patches form Debian (firejail 0.9.64-4, sid)
6 CVE-2020-17367 reported by Tim Starling
7 CVE-2020-17368 reported by Tim Starling
8 * patches form Debian (firejail 0.9.64-4, sid)
9 element-profile.patch, usrsharedoc.patch,
10 pathnames.patch, usr-share-firefox.patch
5 -- netblue30 <netblue30@yahoo.com> Fri, 7 Aug 2020 08:00:00 -0500 11 -- netblue30 <netblue30@yahoo.com> Fri, 7 Aug 2020 08:00:00 -0500
6 12
7firejail (0.9.62) baseline; urgency=low 13firejail (0.9.62) baseline; urgency=low
diff --git a/etc/devhelp.profile b/etc/devhelp.profile
index 5c1935835..cc9553e73 100644
--- a/etc/devhelp.profile
+++ b/etc/devhelp.profile
@@ -16,6 +16,8 @@ include disable-programs.inc
16include disable-xdg.inc 16include disable-xdg.inc
17 17
18whitelist /usr/share/devhelp 18whitelist /usr/share/devhelp
19whitelist /usr/share/doc
20whitelist /usr/share/gtk-doc/html
19include whitelist-common.inc 21include whitelist-common.inc
20include whitelist-usr-share-common.inc 22include whitelist-usr-share-common.inc
21 23
diff --git a/etc/disable-programs.inc b/etc/disable-programs.inc
index ce0c5de43..a489a8fbb 100644
--- a/etc/disable-programs.inc
+++ b/etc/disable-programs.inc
@@ -71,6 +71,8 @@ blacklist ${HOME}/.config/Code
71blacklist ${HOME}/.config/Code - OSS 71blacklist ${HOME}/.config/Code - OSS
72blacklist ${HOME}/.config/Code Industry 72blacklist ${HOME}/.config/Code Industry
73blacklist ${HOME}/.config/Cryptocat 73blacklist ${HOME}/.config/Cryptocat
74blacklist ${HOME}/.config/Element
75blacklist ${HOME}/.config/Element (Riot)
74blacklist ${HOME}/.config/Enox 76blacklist ${HOME}/.config/Enox
75blacklist ${HOME}/.config/Franz 77blacklist ${HOME}/.config/Franz
76blacklist ${HOME}/.config/FreeCAD 78blacklist ${HOME}/.config/FreeCAD
diff --git a/etc/evince.profile b/etc/evince.profile
index 0ace1dc3e..ba68e45b4 100644
--- a/etc/evince.profile
+++ b/etc/evince.profile
@@ -17,6 +17,7 @@ include disable-passwdmgr.inc
17include disable-programs.inc 17include disable-programs.inc
18include disable-xdg.inc 18include disable-xdg.inc
19 19
20whitelist /usr/share/doc
20whitelist /usr/share/evince 21whitelist /usr/share/evince
21whitelist /usr/share/poppler 22whitelist /usr/share/poppler
22whitelist /usr/share/tracker 23whitelist /usr/share/tracker
diff --git a/etc/firefox-esr.profile b/etc/firefox-esr.profile
index 6c1d77986..5e69fdb51 100644
--- a/etc/firefox-esr.profile
+++ b/etc/firefox-esr.profile
@@ -6,5 +6,7 @@ include firefox-esr.local
6# added by included profile 6# added by included profile
7#include globals.local 7#include globals.local
8 8
9whitelist /usr/share/firefox-esr
10
9# Redirect 11# Redirect
10include firefox.profile 12include firefox.profile
diff --git a/etc/firefox.profile b/etc/firefox.profile
index 50f40a039..4a2cb260f 100644
--- a/etc/firefox.profile
+++ b/etc/firefox.profile
@@ -14,6 +14,9 @@ mkdir ${HOME}/.mozilla
14whitelist ${HOME}/.cache/mozilla/firefox 14whitelist ${HOME}/.cache/mozilla/firefox
15whitelist ${HOME}/.mozilla 15whitelist ${HOME}/.mozilla
16 16
17whitelist /usr/share/doc
18whitelist /usr/share/firefox
19whitelist /usr/share/gtk-doc/html
17whitelist /usr/share/mozilla 20whitelist /usr/share/mozilla
18whitelist /usr/share/webext 21whitelist /usr/share/webext
19include whitelist-usr-share-common.inc 22include whitelist-usr-share-common.inc
diff --git a/etc/yelp.profile b/etc/yelp.profile
index 41138cd17..acd483209 100644
--- a/etc/yelp.profile
+++ b/etc/yelp.profile
@@ -18,6 +18,7 @@ include disable-xdg.inc
18 18
19mkdir ${HOME}/.config/yelp 19mkdir ${HOME}/.config/yelp
20whitelist ${HOME}/.config/yelp 20whitelist ${HOME}/.config/yelp
21whitelist /usr/share/doc
21whitelist /usr/share/help 22whitelist /usr/share/help
22whitelist /usr/share/yelp 23whitelist /usr/share/yelp
23whitelist /usr/share/yelp-xsl 24whitelist /usr/share/yelp-xsl
diff --git a/src/firecfg/firecfg.config b/src/firecfg/firecfg.config
index 5cd6a602c..97148c6b6 100644
--- a/src/firecfg/firecfg.config
+++ b/src/firecfg/firecfg.config
@@ -165,6 +165,7 @@ easystroke
165ebook-viewer 165ebook-viewer
166electron-mail 166electron-mail
167electrum 167electrum
168element-desktop
168elinks 169elinks
169empathy 170empathy
170enchant 171enchant
diff --git a/src/firejail/macros.c b/src/firejail/macros.c
index 9ed6b9715..ef64178b5 100644
--- a/src/firejail/macros.c
+++ b/src/firejail/macros.c
@@ -258,6 +258,28 @@ char *expand_macros(const char *path) {
258 return rv; 258 return rv;
259} 259}
260 260
261// replace control characters with a '?'
262static char *fix_control_chars(const char *fname) {
263 assert(fname);
264
265 size_t len = strlen(fname);
266 char *rv = malloc(len + 1);
267 if (!rv)
268 errExit("malloc");
269
270 size_t i = 0;
271 while (fname[i] != '\0') {
272 if (iscntrl((unsigned char) fname[i]))
273 rv[i] = '?';
274 else
275 rv[i] = fname[i];
276 i++;
277 }
278 rv[i] = '\0';
279
280 return rv;
281}
282
261void invalid_filename(const char *fname, int globbing) { 283void invalid_filename(const char *fname, int globbing) {
262// EUID_ASSERT(); 284// EUID_ASSERT();
263 assert(fname); 285 assert(fname);
@@ -275,19 +297,24 @@ void invalid_filename(const char *fname, int globbing) {
275 return; 297 return;
276 } 298 }
277 299
278 int len = strlen(ptr); 300 size_t i = 0;
279 301 while (ptr[i] != '\0') {
280 if (globbing) { 302 if (iscntrl((unsigned char) ptr[i])) {
281 // file globbing ('*?[]') is allowed 303 fprintf(stderr, "Error: \"%s\" is an invalid filename: no control characters allowed\n",
282 if (strcspn(ptr, "\\&!\"'<>%^(){};,") != (size_t)len) { 304 fix_control_chars(fname));
283 fprintf(stderr, "Error: \"%s\" is an invalid filename\n", ptr);
284 exit(1); 305 exit(1);
285 } 306 }
307 i++;
286 } 308 }
287 else { 309
288 if (strcspn(ptr, "\\&!?\"'<>%^(){};,*[]") != (size_t)len) { 310 char *reject;
289 fprintf(stderr, "Error: \"%s\" is an invalid filename\n", ptr); 311 if (globbing)
290 exit(1); 312 reject = "\\&!\"'<>%^{};,"; // file globbing ('*?[]') is allowed
291 } 313 else
314 reject = "\\&!?\"'<>%^{};,*[]";
315 char *c = strpbrk(ptr, reject);
316 if (c) {
317 fprintf(stderr, "Error: \"%s\" is an invalid filename: rejected character: \"%c\"\n", fname, *c);
318 exit(1);
292 } 319 }
293} 320}