Cloudanix VulnDB

CVE-2018-1000097

High · 7.8

CVSS

7.8

EPSS

2.0%

Published

Mar 13, 2018

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A file unpacking tool can let attackers run their own code on a computer if someone opens a specially made file with it.

Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Full Compromise
Component
Application
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Buffer overflow in the looks_like_c_code function in unshar.c at line 75 due to absent bounds checking on input lines, enabling arbitrary code execution.

Why it matters to the business

Attackers can gain code execution on Linux systems if users process untrusted shar archives, increasing risk of compromise across Ubuntu, Debian, and other distributions using sharutils.

How an attack unfolds

An attacker crafts a shar file that triggers the unchecked buffer in looks_like_c_code when a victim runs unshar on it, leading to code execution.

How to fix it

Upgrade sharutils to a patched release from the distribution vendor or disable/uninstall the unshar command; avoid processing untrusted shar archives.

How to confirm the fix worked

Confirm sharutils package version is updated beyond the vulnerable 4.15.2 release and test unshar against known trigger inputs to verify absence of overflow behavior.

Typical attack path

  1. Craft malicious shar file to overflow buffer in unshar.c
  2. Deliver file to target via email, web, or shared storage
  3. Victim executes unshar on the crafted file
  4. Overflow leads to arbitrary code execution

How to detect it

Review process execution logs and command history for unshar invocations on files from external or untrusted sources; correlate with subsequent anomalous process creation or privilege escalation.

  • unshar
  • looks_like_c_code
  • /usr/bin/unshar

What your security team should do

  • Restrict or remove sharutils from systems where possible
  • Apply vendor patches for sharutils immediately
  • Block execution of unshar on files from untrusted origins via policy or sandboxing

The record

Sharutils sharutils (unshar command) version 4.15.2 contains a Buffer Overflow vulnerability in Affected component on the file unshar.c at line 75, function looks_like_c_code. Failure to perform checking of the buffer containing input line. that can result in Could lead to code execution. This attack appear to be exploitable via Victim have to run unshar command on a specially crafted file..

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 sharutils 0 1:4.15.2-3
Debian:12 sharutils 0 1:4.15.2-3
Debian:13 sharutils 0 1:4.15.2-3
Debian:8 sharutils 0 1:4.14-2+deb8u1
Debian:9 sharutils 0 1:4.15.2-2+deb9u1
Ubuntu:14.04:LTS sharutils 0 1:4.14-1ubuntu1.1
Ubuntu:16.04:LTS sharutils 0 1:4.15.2-1ubuntu0.1
openSUSE:Tumbleweed sharutils 0 4.15.2-6.9

Related vulnerabilities