CVE-2018-7548

In subst.c in zsh through 5.4.2, there is a NULL pointer dereference when using ${(PA)...} on an empty array result

published February 27, 2018

CVSS
—
EPSS
3%
Percentile
84.8
In the wild
Unconfirmed
What it is

⚠️ A NULL pointer dereference in zsh can trip you up, especially when dealing with empty arrays — like trying to pull out a chair that isn't there! Think of it like trying to serve a dish without any ingredients. If the kitchen (or in this case, the code) expects something to be there but finds nothing, it just can’t function right! This vulnerability can lead to unexpected behaviors or crashes in scripts that rely on empty arrays, possibly throwing a wrench in your carefully crafted command line operations. While not critical, it’s definitely an annoyance that could disrupt your workflow!

Put simply

Think of it like trying to serve a dish without any ingredients. If the kitchen (or in this case, the code) expects something to be there but finds nothing, it just can’t function right! The issue arises in subst.c of zsh versions up to 5.4.2, where using the ${(PA)...} parameter expansion on an empty array results in dereferencing a NULL pointer, causing a crash.

What to do

This vulnerability can lead to unexpected behaviors or crashes in scripts that rely on empty arrays, possibly throwing a wrench in your carefully crafted command line operations. While not critical, it’s definitely an annoyance that could disrupt your workflow! To mitigate this, update your zsh to version 5.4.3 or later, where this NULL pointer dereference has been addressed. Ensuring your scripts handle empty arrays gracefully can also prevent potential issues down the line. You've got this! By updating your zsh, you’ll keep your command line experience smooth and crash-free! 🛡️

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.02543 · 84.8th percentile
Published
2018-02-27T22:00Z
EPSS history
Timeline
  • 27 FEB 22:00Z
    In subst.c in zsh through 5.4.2, there is a NULL pointer dereference when using ${(PA)...} on an empty array result
    cvelistv5