Skip to contentSkip to conversation

ncurses: Mitigate CVE-2023-29491

PATCH In review Marek Vasut 3 participants 8 messages Oct 9, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ncurses: Mitigate CVE-2023-29491

Configure with "--disable-root-environ" to disallow loading of custom terminfo entries in setuid/setgid programs, mitigating the impact of CVE-2023-29491.

This is taken from debian:
https://salsa.debian.org/debian/ncurses/-/commit/1c530aad772f7aeef039b8780d51cd09bd5a08ac

---
Cc: Alexandre Belloni <[email protected]>
Cc: Richard Purdie <[email protected]>

---
 meta/recipes-core/ncurses/ncurses.inc | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/ncurses/ncurses.inc +1 -0
index 367f3b19f4..1bc07ec2d4 100644
@@ -87,6 +87,7 @@ ncurses_configure() {
 	        --enable-sigwinch \
 	        --enable-pc-files \
 	        --disable-rpath-hack \
+	        --disable-root-environ \
 		${EXCONFIG_ARGS} \
 	        --with-manpage-format=normal \
 	        --without-manpage-renames \
Signature · 1 line
2.40.1
#1 lore raw
Quoted 20 lines · Marek Vasut

Configure with "--disable-root-environ" to disallow loading of custom terminfo entries in setuid/setgid programs, mitigating the impact of CVE-2023-29491.

This is taken from debian:
https://salsa.debian.org/debian/ncurses/-/commit/1c530aad772f7aeef039b8780d51cd09bd5a08ac

---
Cc: Alexandre Belloni <[email protected]>
Cc: Richard Purdie <[email protected]>

---
 meta/recipes-core/ncurses/ncurses.inc | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/ncurses/ncurses.inc +0 -0
index 367f3b19f4..1bc07ec2d4 100644

meta/recipes-core/ncurses/ncurses.inc ncurses_configure() { · line 93

Quoted 7 lines
meta/recipes-core/ncurses/ncurses.inc +1 -0
@@ -87,6 +87,7 @@ ncurses_configure() {
 	        --enable-sigwinch \
 	        --enable-pc-files \
 	        --disable-rpath-hack \
+	        --disable-root-environ \
 		${EXCONFIG_ARGS} \
 	        --with-manpage-format=normal \
 	        --without-manpage-renames \

Should the patch add a CVE_STATUS entry as well so the cve tooling can tell we've mitigated this?

Cheers,

Richard

#2 lore raw

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Richard Purdie via lists.openembedded.org
Sent: Monday, October 9, 2023 18:44
To: Marek Vasut <[email protected]>; [email protected]; [email protected]
Cc: Alexandre Belloni <[email protected]>
Subject: Re: [OE-core] [PATCH] ncurses: Mitigate CVE-2023-29491

Quoted 17 lines · Marek Vasut
Quoted 16 lines

Configure with "--disable-root-environ" to disallow loading of custom terminfo entries in setuid/setgid programs, mitigating the impact of CVE-2023-29491.

This is taken from debian:
https://salsa.debian.org/debian/ncurses/-/commit/1c530aad772f7aeef039b
8780d51cd09bd5a08ac

---
Cc: Alexandre Belloni <[email protected]>
Cc: Richard Purdie <[email protected]>

---
 meta/recipes-core/ncurses/ncurses.inc | 1 +
 1 file changed, 1 insertion(+)
Quoted 15 lines

meta/recipes-core/ncurses/ncurses.inc ncurses_configure() { · line 93

Quoted 13 lines
meta/recipes-core/ncurses/ncurses.inc +1 -0
index 367f3b19f4..1bc07ec2d4 100644
@@ -87,6 +87,7 @@ ncurses_configure() {
 	        --enable-sigwinch \
 	        --enable-pc-files \
 	        --disable-rpath-hack \
+	        --disable-root-environ \
 		${EXCONFIG_ARGS} \
 	        --with-manpage-format=normal \
 	        --without-manpage-renames \

Should the patch add a CVE_STATUS entry as well so the cve tooling can tell we've mitigated this?

ncurses 6.4 is not affected and not shown in CVE report, not sure why this is submitted for master. Peter

Quoted 4 lines

Cheers,

Richard

#3 lore raw
Quoted 40 lines · Peter

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Richard Purdie via lists.openembedded.org
Sent: Monday, October 9, 2023 18:44
To: Marek Vasut <[email protected]>; [email protected]; [email protected]
Cc: Alexandre Belloni <[email protected]>
Subject: Re: [OE-core] [PATCH] ncurses: Mitigate CVE-2023-29491

Quoted 17 lines · Marek Vasut
Quoted 16 lines

Configure with "--disable-root-environ" to disallow loading of custom terminfo entries in setuid/setgid programs, mitigating the impact of CVE-2023-29491.

This is taken from debian:
https://salsa.debian.org/debian/ncurses/-/commit/1c530aad772f7aeef039b
8780d51cd09bd5a08ac

---
Cc: Alexandre Belloni <[email protected]>
Cc: Richard Purdie <[email protected]>

---
  meta/recipes-core/ncurses/ncurses.inc | 1 +
  1 file changed, 1 insertion(+)
Quoted 15 lines

meta/recipes-core/ncurses/ncurses.inc ncurses_configure() { · line 93

Quoted 13 lines
meta/recipes-core/ncurses/ncurses.inc +1 -0
index 367f3b19f4..1bc07ec2d4 100644
@@ -87,6 +87,7 @@ ncurses_configure() {
  	        --enable-sigwinch \
  	        --enable-pc-files \
  	        --disable-rpath-hack \
+	        --disable-root-environ \
  		${EXCONFIG_ARGS} \
  	        --with-manpage-format=normal \
  	        --without-manpage-renames \

Should the patch add a CVE_STATUS entry as well so the cve tooling can tell we've mitigated this?

Quoted 2 lines

ncurses 6.4 is not affected and not shown in CVE report, not sure why this is submitted for master. Peter

Just wanted to make sure the configuration is consistent across all the releases.

#4 lore raw

-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Monday, October 9, 2023 18:57
To: Marko, Peter (ADV D EU SK BFS1) <[email protected]>; [email protected]
Cc: Alexandre Belloni <[email protected]>; [email protected]; [email protected]
Subject: Re: [OE-core] [PATCH] ncurses: Mitigate CVE-2023-29491

Quoted 45 lines · Peter
Quoted 44 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Richard Purdie via lists.openembedded.org
Sent: Monday, October 9, 2023 18:44
To: Marek Vasut <[email protected]>; [email protected]; [email protected]
Cc: Alexandre Belloni <[email protected]>
Subject: Re: [OE-core] [PATCH] ncurses: Mitigate CVE-2023-29491

Quoted 33 lines · Marek Vasut
Quoted 23 lines

Configure with "--disable-root-environ" to disallow loading of custom terminfo entries in setuid/setgid programs, mitigating the impact of CVE-2023-29491.

This is taken from debian:
https://salsa.debian.org/debian/ncurses/-/commit/1c530aad772f7aeef03
9b
8780d51cd09bd5a08ac

---
Cc: Alexandre Belloni <[email protected]>
Cc: Richard Purdie <[email protected]>

---
  meta/recipes-core/ncurses/ncurses.inc | 1 +
  1 file changed, 1 insertion(+)
meta/recipes-core/ncurses/ncurses.inc +0 -0
index 367f3b19f4..1bc07ec2d4 100644

meta/recipes-core/ncurses/ncurses.inc ncurses_configure() { · line 93

Quoted 7 lines
meta/recipes-core/ncurses/ncurses.inc +1 -0
@@ -87,6 +87,7 @@ ncurses_configure() {
  	        --enable-sigwinch \
  	        --enable-pc-files \
  	        --disable-rpath-hack \
+	        --disable-root-environ \
  		${EXCONFIG_ARGS} \
  	        --with-manpage-format=normal \
  	        --without-manpage-renames \

Should the patch add a CVE_STATUS entry as well so the cve tooling can tell we've mitigated this?

Quoted 4 lines
Quoted 2 lines

ncurses 6.4 is not affected and not shown in CVE report, not sure why this is submitted for master. Peter

Just wanted to make sure the configuration is consistent across all the releases.

I think that the commit message should be changed.
It's misleading when it only says that it mitigates already fixed CVE.

Peter

#5 lore raw
Quoted 52 lines · Peter

-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Monday, October 9, 2023 18:57
To: Marko, Peter (ADV D EU SK BFS1) <[email protected]>; [email protected]
Cc: Alexandre Belloni <[email protected]>; [email protected]; [email protected]
Subject: Re: [OE-core] [PATCH] ncurses: Mitigate CVE-2023-29491

Quoted 45 lines · Peter
Quoted 44 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Richard Purdie via lists.openembedded.org
Sent: Monday, October 9, 2023 18:44
To: Marek Vasut <[email protected]>; [email protected]; [email protected]
Cc: Alexandre Belloni <[email protected]>
Subject: Re: [OE-core] [PATCH] ncurses: Mitigate CVE-2023-29491

Quoted 33 lines · Marek Vasut
Quoted 23 lines

Configure with "--disable-root-environ" to disallow loading of custom terminfo entries in setuid/setgid programs, mitigating the impact of CVE-2023-29491.

This is taken from debian:
https://salsa.debian.org/debian/ncurses/-/commit/1c530aad772f7aeef03
9b
8780d51cd09bd5a08ac

---
Cc: Alexandre Belloni <[email protected]>
Cc: Richard Purdie <[email protected]>

---
   meta/recipes-core/ncurses/ncurses.inc | 1 +
   1 file changed, 1 insertion(+)
meta/recipes-core/ncurses/ncurses.inc +0 -0
index 367f3b19f4..1bc07ec2d4 100644

meta/recipes-core/ncurses/ncurses.inc ncurses_configure() { · line 93

Quoted 7 lines
meta/recipes-core/ncurses/ncurses.inc +1 -0
@@ -87,6 +87,7 @@ ncurses_configure() {
   	        --enable-sigwinch \
   	        --enable-pc-files \
   	        --disable-rpath-hack \
+	        --disable-root-environ \
   		${EXCONFIG_ARGS} \
   	        --with-manpage-format=normal \
   	        --without-manpage-renames \

Should the patch add a CVE_STATUS entry as well so the cve tooling can tell we've mitigated this?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

ncurses 6.4 is not affected and not shown in CVE report, not sure why this is submitted for master. Peter

Just wanted to make sure the configuration is consistent across all the releases.

I think that the commit message should be changed.
It's misleading when it only says that it mitigates already fixed CVE.

Will do, how does this sound:

"
ncurses: disallow loading of custom terminfo entries in
setuid/setgid programs

Configure with "--disable-root-environ" to disallow loading of custom terminfo entries in setuid/setgid programs. This is related to CVE-2023-29491, even though CVE-2023-29491 itself is fixed in this OE release by a backport patch.

This is taken from debian:

https://salsa.debian.org/debian/ncurses/-/commit/1c530aad772f7aeef039b8780d51cd09bd5a08ac
"

?

#6 lore raw

-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Monday, October 9, 2023 21:28
To: Marko, Peter (ADV D EU SK BFS1) <[email protected]>; [email protected]
Cc: Alexandre Belloni <[email protected]>; [email protected]; [email protected]
Subject: Re: [OE-core] [PATCH] ncurses: Mitigate CVE-2023-29491
<snip>

Quoted 16 lines
Quoted 10 lines
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Should the patch add a CVE_STATUS entry as well so the cve tooling can tell we've mitigated this?

ncurses 6.4 is not affected and not shown in CVE report, not sure why this is submitted for master. Peter

Just wanted to make sure the configuration is consistent across all the releases.

I think that the commit message should be changed.
It's misleading when it only says that it mitigates already fixed CVE.

Will do, how does this sound:

"
ncurses: disallow loading of custom terminfo entries in setuid/setgid programs

Quoted 8 lines

Configure with "--disable-root-environ" to disallow loading of custom terminfo entries in setuid/setgid programs. This is related to CVE-2023-29491, even though CVE-2023-29491 itself is fixed in this OE release by a backport patch.

This is taken from debian:

https://salsa.debian.org/debian/ncurses/-/commit/1c530aad772f7aeef039b8780d51cd09bd5a08ac

Parent commit - https://salsa.debian.org/debian/ncurses/-/commit/93a383681e3da9f385536f9bc98266c5dd7e42cf

Quoted 3 lines

"

?

The commit message seems to be fine now, but...

...looking at Debian, they first changed behavior of "--disable-root-environ" option via custom patch and only afterwards used it. Since Yocto is not changing the behavior of this option, it is probably a wrong thing to enable it by default. This would need a much deeper analysis imho, for all three branches where this is submitted.

Peter

#7 lore raw
In reply to Richard Purdie
Quoted 16 lines · Richard Purdie
Quoted 15 lines · Marek Vasut

Configure with "--disable-root-environ" to disallow loading of custom terminfo entries in setuid/setgid programs, mitigating the impact of CVE-2023-29491.

This is taken from debian:
https://salsa.debian.org/debian/ncurses/-/commit/1c530aad772f7aeef039b8780d51cd09bd5a08ac

---
Cc: Alexandre Belloni <[email protected]>
Cc: Richard Purdie <[email protected]>

---
  meta/recipes-core/ncurses/ncurses.inc | 1 +
  1 file changed, 1 insertion(+)
Quoted 15 lines

meta/recipes-core/ncurses/ncurses.inc ncurses_configure() { · line 93

Quoted 12 lines
meta/recipes-core/ncurses/ncurses.inc +1 -0
index 367f3b19f4..1bc07ec2d4 100644
@@ -87,6 +87,7 @@ ncurses_configure() {
  	        --enable-sigwinch \
  	        --enable-pc-files \
  	        --disable-rpath-hack \
+	        --disable-root-environ \
  		${EXCONFIG_ARGS} \
  	        --with-manpage-format=normal \
  	        --without-manpage-renames \

Should the patch add a CVE_STATUS entry as well so the cve tooling can tell we've mitigated this?

I think I will try to backport the actual fix for this CVE from Kirkstone first.