Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Zsh - Multiple DoS Vulnerabilities
- X-seq: zsh-workers 44283
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: David Wells <bughunters@xxxxxxxxxxx>
- Subject: Re: Zsh - Multiple DoS Vulnerabilities
- Date: Fri, 10 May 2019 13:27:39 -0700
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=732Afl1TCzQHn4r3ZCKpVhHMU61tq4e+ZnJIIf/bYiQ=; b=IWd/irh6OmHKIAxyHevKQhHaacxytvH+k3I1hIqmbIkJttVMhBTCMaskfDeHdgQE8Q clkxg7IqigvN5Iz02e8KUrQIZPdvjFKeLrq1nuFOkqIN64l25Ut2ZjTQes+pxOBwuwwe YD9SMHLaL3CxnLoVm/0/Ub/kOBnQLdmpAa1a+dDYUppGQw3BhGwiBV3TTkipb3ErXbtp mS1RKLx+9CyLTLjN2Wf2B7HxZFNreG+hPf21rxUu8bCT1pJTIygnBnNkUeKDN3vNYul5 ymgKk82ZUh6KUg5g9TdOPPQGxM+T9oYut1WRnLDXAGqPTe+4Qj6GOLnCxCNjt8wzCD1K ZKxg==
- In-reply-to: <CAAOKOsfSAR5aRBvEcyQKRzDCvOgRJdyRvVb9AXMq6d22RaUozQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAAOKOsfSAR5aRBvEcyQKRzDCvOgRJdyRvVb9AXMq6d22RaUozQ@mail.gmail.com>
On Fri, May 10, 2019 at 8:04 AM David Wells <bughunters@xxxxxxxxxxx> wrote:
>
> #1 Invalid read from *taddrstr *call in *text.c*
> POC folder: *01_taddstr_(text.c_148)*
This has literal NUL bytes embedded in the body of an if/then. Run
from an interactive shell, it gives:
text.c:995: unknown word code in gettext2()
text.c:995: unknown word code in gettext2()
text.c:72: attempting to decrement tindent below zero
text.c:72: attempting to decrement tindent below zero
and then (several seconds later) a crash.
The following minimal subset of their test will put the shell into an
infinite loop, without (at least for as long as I was willing to wait)
crashing it:
if true; then me > you || !
:
fi
> #2 Invalid read from *execcmd_analyse *in *exec.c*
> POC folder: *02_execcmd_analyse_(exec.c_3653)*
The test case is 3kb of a mangled shell script (missing closing
quotes, random bytes inserted) so I'm not going to attempt to reduce
it to a minimal case. Feeding it to "zsh -nf" yields:
11: exec.c:2655: BUG: miscounted typeset assignments
11: exec.c:2655: BUG: miscounted typeset assignments
11: exec.c:2655: BUG: miscounted typeset assignments
11: exec.c:2655: BUG: miscounted typeset assignments
and then after several seconds a crash. I did not attempt feeding
this (or #3 - #5) through a shell that does not have the -n option,
because I don't have a secure sandbox in which to run scripts I can't
visually verify.
> #3 Invalid read from *dupstring *in *string.c*
> POC folder: *03_dupstring_(string.c_39)*
This gives exactly the same errors as #2, and then exits with
[long ugly filename]:87: parse error near `}'
> #4 Invalid read from *bin_print *in *builtin.c*
> POC folder: *04_bin_print_(builtin.c_5009)*
This produces no error output at all except for:
[long ugly filename]:41: parse error near `)'
> #5 Invalid read from *untokenize *in *exec.c*
> POC folder: *05_untokenize_(exec.c_1994)*
Again no error except:
[long ugly filename]:94: parse error near `}'
> #6 Invalid read from *getjob *in *jobs.c*
> POC folder: *06_getjob_(jobs.c_1935)*
This one I fed to "zsh -xf" and got (file name removed for readability):
+1> bg $'%\M-\C-?' $'\C-VI7'
bg:1: no job control in this shell.
+1> disown $'%777777777777777\M-^'
+1> $'\C-['
+1> $'\C-X\C-@\C-@\C-@@\C-@7'
1: command not found: ^[
1: command not found: ^X
followed eventually by a crash. The input has multiple NUL bytes
following the ^X, and then some other misc. garbage, so the input
processing may have a generic problem with NULs.
> #7 Invalid read from *hasher *in *hashtable.c*
> POC folder: *07_hasher_(hashtable.c_85)*
For this one "zsh -xf" says:
+1> foset :print $'\C-@\C-@\C-@hree'
1: command not found: foset
+1> set -E e
+2> typeset -priTt CeE e
and then just goes away until killed. Only that final typeset is
necessary to reproduce the bug, the rest is irrelevant.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author