Hello,
While reviewing GNU Screen 5.0.3 for Solaris, I noticed that the
combining-character allocation-failure path in utf8_handle_comb() still
leaves the global combchars pointer dangling. The same code is present
in the 5.0.2 release archive.
Initialization allocates the combchars table and two list roots,
combchars[0x800] and combchars[0x801]. If either root allocation fails,
the error branch frees the allocated roots and the table, then returns
without clearing combchars. A later call sees a non-NULL table pointer,
skips initialization, and accesses freed storage.
The one-line change below sets combchars to NULL after freeing the
table. This preserves the existing error return and allows a subsequent
call to retry initialization. The correction is platform independent.
This matches the defect described in the public CVE-2026-71410 advisory
and in this earlier report:
https://cert.pl/en/posts/2026/11/CVE-2026-71409/
https://gist.github.com/jiejiaodedengdai/fa5038960ca8904f6014680de82f9f09
The advisory says the issue was fixed in 5.0.2, but I still find this
error path in both exact release archives. Could you confirm whether it
is already tracked or corrected upstream, and consider the pointer reset
if it is still needed? This is a follow-up with a proposed fix, not a
claim of a newly discovered vulnerability.
The affected sources were inspected in screen-5.0.2.tar.gz and
screen-5.0.3.tar.gz from https://ftp.gnu.org/gnu/screen/.
This report is based on source inspection; I have not exercised this
allocation-failure path at runtime or demonstrated exploitation.
Thank you.
Petr
Patch (against the 5.0.3 release archive)
----------------------------------------
--- a/encoding.c
+++ b/encoding.c
@@ -1027,6 +1027,7 @@
if (combchars[0x801])
free(combchars[0x801]);
free(combchars);
+ combchars = NULL;
return;
}
combchars[0x800]->c1 = 0x000;