Skip to content

malicious screen output can make mosh-server assertion fail at terminal.cc line 122 #667

@kcwu

Description

@kcwu

How to reproduce:
Inside mosh, run following code

echo -e '0\e[1J\xcc\xb4'

then mosh-server will crash

Assertion failed: (this_cell == combining_cell), function print, file terminal.cc, line 122.

from gdb, the call stack

#0  0x00000008020c83ca in thr_kill () from /lib/libc.so.7
#1  0x00000008020c8378 in raise () from /lib/libc.so.7
#2  0x00000008020c6b99 in abort () from /lib/libc.so.7
#3  0x00000008020a6fe1 in __assert () from /lib/libc.so.7
#4  0x000000000041e43e in Terminal::Emulator::print (this=0x7fffffffe4c0, act=0x802c1b140) at terminal.cc:122
#5  0x000000000044a9dd in Parser::Print::act_on_terminal (this=0x802c1b140, emu=0x7fffffffe4c0) at parseraction.cc:56
#6  0x000000000044cd55 in Terminal::Complete::act (this=0x7fffffffe4a8, str=...) at completeterminal.cc:56

this issue is found by afl-fuzz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions