Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2020-27350

CVE-2020-27350: Debian APT Buffer Overflow Vulnerability

CVE-2020-27350 is a buffer overflow vulnerability in Debian Advanced Package Tool caused by integer overflows while parsing .deb packages. This article covers technical details, affected APT versions, and mitigation.

Published:

CVE-2020-27350 Overview

CVE-2020-27350 is an integer overflow and underflow vulnerability affecting the Advanced Package Tool (APT), the primary package management system used by Debian-based Linux distributions including Ubuntu. The vulnerability exists in multiple source files responsible for parsing .deb packages: apt-pkg/contrib/extracttar.cc, apt-pkg/deb/debfile.cc, and apt-pkg/contrib/arfile.cc. These flaws, tracked as GHSL-2020-168 and GHSL-2020-169, could allow an attacker with local access and elevated privileges to potentially corrupt memory and affect the confidentiality, integrity, and availability of the system.

Critical Impact

A local attacker with high privileges could exploit integer overflow/underflow conditions during .deb package parsing, potentially leading to memory corruption, information disclosure, or denial of service affecting the underlying system.

Affected Products

  • Debian Advanced Package Tool (apt) versions 1.2.32ubuntu0 prior to 1.2.32ubuntu0.2
  • Debian Advanced Package Tool (apt) versions 1.6.12ubuntu0 prior to 1.6.12ubuntu0.2
  • Debian Advanced Package Tool (apt) versions 2.0.2ubuntu0 prior to 2.0.2ubuntu0.2
  • Debian Advanced Package Tool (apt) versions 2.1.10ubuntu0 prior to 2.1.10ubuntu0.1
  • Canonical Ubuntu Linux 16.04 LTS, 18.04 LTS, 20.04 LTS, and 20.10
  • Debian Linux 10.0
  • NetApp SolidFire Baseboard Management Controller Firmware

Discovery Timeline

  • December 10, 2020 - CVE-2020-27350 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2020-27350

Vulnerability Analysis

This vulnerability stems from improper handling of integer arithmetic operations within APT's package parsing routines. When processing .deb packages, the affected code paths in extracttar.cc, debfile.cc, and arfile.cc fail to properly validate integer boundaries before performing arithmetic operations. This allows specially crafted .deb packages to trigger integer overflow or underflow conditions.

The vulnerability requires local access and elevated privileges to exploit, which limits the attack surface but still poses a significant risk in multi-user environments or scenarios where an attacker has already gained some level of system access. Successful exploitation could lead to memory corruption, potentially allowing the attacker to manipulate system behavior during package operations.

Root Cause

The root cause is classified as CWE-190 (Integer Overflow or Wraparound). The vulnerable code performs arithmetic operations on integer values derived from .deb package metadata without adequate bounds checking. When these values are manipulated by an attacker, the resulting calculations can overflow or underflow, leading to unexpected behavior such as incorrect buffer sizes, memory allocation errors, or buffer overflows during subsequent operations.

Attack Vector

The attack requires local access to the target system with high privileges. An attacker would need to craft a malicious .deb package containing specially constructed metadata designed to trigger the integer overflow/underflow conditions. When APT processes this package during installation, upgrade, or inspection operations, the vulnerable parsing code would be executed.

The attack flow involves:

  1. Crafting a malicious .deb package with manipulated archive headers
  2. Introducing the package to the target system (via local access or compromised repository)
  3. Triggering APT to parse the malicious package
  4. Exploiting the resulting memory corruption for further system compromise

Due to the local attack vector and high privilege requirements, this vulnerability is most likely to be exploited as part of a privilege escalation chain or by an insider threat.

Detection Methods for CVE-2020-27350

Indicators of Compromise

  • Presence of unusually sized or malformed .deb packages in APT cache directories (/var/cache/apt/archives/)
  • APT crashes or unexpected termination during package operations
  • Unusual memory consumption patterns during package installation or updates
  • Core dumps or segmentation faults in APT-related processes

Detection Strategies

  • Monitor APT process behavior for abnormal memory allocation patterns during package parsing
  • Implement file integrity monitoring on APT cache directories to detect suspicious package files
  • Configure auditd rules to log access to APT binaries and package cache locations
  • Deploy endpoint detection solutions capable of identifying memory corruption exploitation attempts

Monitoring Recommendations

  • Enable verbose logging for APT operations and review logs for parsing errors or crashes
  • Monitor system calls related to memory allocation during package management operations
  • Implement anomaly detection for package sizes and metadata that fall outside normal parameters
  • Set up alerts for repeated APT failures or crashes that could indicate exploitation attempts

How to Mitigate CVE-2020-27350

Immediate Actions Required

  • Update APT to the patched versions immediately on all affected systems
  • Audit package repositories and sources for potentially compromised packages
  • Review system logs for evidence of exploitation attempts prior to patching
  • Restrict package installation privileges to trusted administrators only

Patch Information

Patches have been released by both Debian and Ubuntu to address this vulnerability. Administrators should apply the following updates:

For NetApp SolidFire systems, refer to the NetApp Security Advisory NTAP-20210108-0005 for specific remediation guidance.

Additional technical details are available in the Launchpad Bug Report 1899193.

Workarounds

  • Restrict local access to systems running vulnerable APT versions
  • Implement strict controls on package sources, using only trusted and verified repositories
  • Configure APT to use HTTPS for all repository connections to reduce man-in-the-middle risks
  • Employ application whitelisting to prevent unauthorized package installations
bash
# Update APT on Debian-based systems
sudo apt update
sudo apt install --only-upgrade apt

# Verify the installed APT version
apt --version

# Configure APT to use HTTPS repositories (edit sources.list)
sudo sed -i 's/http:/https:/g' /etc/apt/sources.list

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.