Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 6 Feb 2020 15:04:18 +0100
From: Solar Designer <>
Cc: Amadeusz Slawinski <>
Subject: GNU screen "out of bounds access when setting w_xtermosc after OSC 49"


GNU screen 4.8.0 was released yesterday with a documented security fix
in it:

From: 	Amadeusz Slawinski
Subject: 	[screen-devel] GNU Screen v.4.8.0
Date: 	Wed, 5 Feb 2020 21:45:35 +0100

Hello everyone,
I'm announcing availability of GNU Screen v.4.8.0

Screen is a full-screen window manager that multiplexes a physical
terminal between several processes, typically interactive shells. 

This release
  * Improves startup time by only polling for already open files to
  * Fixes:
       - Fix for segfault if termcap doesn't have Km entry
       - Make screen exit code be 0 when checking --version
       - Fix potential memory corruption when using OSC 49

As last fix, fixes potential memory overwrite of quite big size (~768
bytes), and even though I'm not sure about potential exploitability of
that issue, I highly recommend everyone to upgrade as soon as possible.
This issue is present at least since v.4.2.0 (haven't checked earlier).
Thanks to pippin who brought this to my attention.

For full list of changes see

For more information about GNU screen visit:

Release is available for download at:
or your closest mirror (may have some delay)

Please report any bugs or regressions.

Amadeusz on behalf of GNU Screen Team

The fix commit is:

commit 68386dfb1fa33471372a8cd2e74686758a2f527b
Author: Amadeusz Slawinski <>
Date:   Thu Jan 30 17:56:27 2020 +0100

    Fix out of bounds access when setting w_xtermosc after OSC 49
    echo -e "\e]49\e;                                    \n\ec"
    crashes screen.
    This happens because 49 is divided by 10 and used as table index
    resulting in access to w_xtermosc[4], which is out of bounds with table
    itself being size 4. Increase size of table by 1 to 5, which is enough
    for all current uses.
    As this overwrites memory based on user input it is potential security
    Signed-off-by: Amadeusz Slawinski <>

This is followed by another related commit:

commit 0dd53533e20d2948351a99ec5336fbc9b82b226a
Author: Amadeusz Slawinski <>
Date:   Wed Feb 5 21:05:28 2020 +0100

    Increase permitted length of OSC
    hyperlink feature used by some terminals requires lots of characters
    mentions around 2083 characters, set it to a bit more.
    Bug: 57718
    Signed-off-by: Amadeusz Slawinski <>

Combined, these two commits change:

  char   w_xtermosc[4][MAXSTR]; /* special xterm/rxvt escapes */

(where MAXSTR is 768) to:

  char   w_xtermosc[5][2560];   /* special xterm/rxvt escapes */

These are as seen on the screen-v4 branch.  On that branch, and thus in
all screen releases so far, the bug appears to be exposed only when
building with the "--enable-rxvt_osc" option.  Builds and packages made
without that option appear to be safe.  Amadeusz, can you confirm this?

On master branch, the functionality is always enabled (and the option is
dropped), thus (not too ancient) builds from that branch are vulnerable
(until the above fixes, which were also made to that branch).


Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.