#1146653 bash: Segfault in bash echo -e with huge data

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Wiebe Cazemier
Date:
2026-09-04 08:13:02 UTC
Severity:
normal
Tags:
#1146653#5
Date:
2026-09-04 07:47:15 UTC
From:
To:
Dear Maintainer,

The following segfaults:

#!/bin/bash
set -e
ulimit -c unlimited
tmpgz=$(mktemp)
curl -o "$tmpgz" https://ytec.nl/media/many_lines_redacted.txt.gz
many_lines=$(zcat "$tmpgz")
echo -e "$many_lines" > /dev/null


To not use the untrusted file, this can be used too, but for me it OOMS
before crashes:

bash -c 'v=$(yes | head -n 1000000000); echo -e "$v" >/dev/null; echo ok'


Reported and confirmed to exist upstream in git master:

https://lists.gnu.org/archive/html/bug-bash/2026-09/msg00010.html

So, affected versions are probably all, not just this Debian 12 system.

It's possibly a security problem, but I did not take the time to try to
exploit it.