Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2020-7059

CVE-2020-7059: PHP fgetss() Buffer Overflow Vulnerability

CVE-2020-7059 is a buffer overflow flaw in PHP's fgetss() function that allows attackers to read past allocated memory, potentially causing crashes or data leaks. This article covers technical details, affected versions, and fixes.

Published: March 4, 2026

CVE-2020-7059 Overview

CVE-2020-7059 is a critical out-of-bounds read vulnerability affecting the fgetss() function in PHP. When using fgetss() to read data with stripping tags, it is possible to supply specially crafted data that causes the function to read past the allocated buffer. This memory safety flaw can lead to information disclosure or application crash, potentially exposing sensitive data from server memory or causing denial of service conditions.

Critical Impact

This out-of-bounds read vulnerability in PHP's fgetss() function can expose sensitive memory contents to attackers or crash PHP applications, affecting web servers and applications running vulnerable PHP versions across multiple platforms.

Affected Products

  • PHP versions 7.2.x below 7.2.27
  • PHP versions 7.3.x below 7.3.14
  • PHP versions 7.4.x below 7.4.2
  • Tenable Tenable.sc
  • Oracle Communications Diameter Signaling Router
  • openSUSE Leap 15.1
  • Debian Linux 8.0

Discovery Timeline

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

Technical Details for CVE-2020-7059

Vulnerability Analysis

The vulnerability resides in PHP's fgetss() function, which is designed to read lines from a file while stripping HTML and PHP tags from the content. The function fails to properly validate buffer boundaries when processing input data containing malformed or specially crafted tag structures. This improper bounds checking (CWE-125: Out-of-bounds Read) allows the function to read memory beyond the allocated buffer limits.

When exploited, attackers can potentially extract sensitive information from adjacent memory regions, which may include configuration data, session tokens, encryption keys, or other application secrets stored in memory. Additionally, attempting to access unmapped memory regions will trigger segmentation faults, causing the PHP process to crash and resulting in denial of service.

Root Cause

The root cause of this vulnerability is insufficient input validation in the tag-stripping logic of the fgetss() function. When processing input streams containing malformed HTML or PHP tags, the function does not adequately check that read operations remain within allocated buffer boundaries. This allows memory reads to extend past the intended data region when encountering specially crafted tag sequences that confuse the parser's state machine.

Attack Vector

The vulnerability is exploitable remotely via network-based attacks against PHP applications that use the fgetss() function to process user-controlled or externally-sourced file content. An attacker can craft malicious input containing specially structured tag patterns that trigger the out-of-bounds read condition. Attack scenarios include:

  • Uploading malicious files to web applications that parse uploaded content using fgetss()
  • Submitting crafted data to PHP scripts that read from user-controlled streams
  • Exploiting applications that process external data sources (feeds, APIs) through fgetss()

The vulnerability does not require authentication and can be exploited without user interaction, making it particularly dangerous for internet-facing PHP applications.

Detection Methods for CVE-2020-7059

Indicators of Compromise

  • PHP application crashes or unexpected segmentation faults during file processing operations
  • Unusual memory access patterns or core dumps related to PHP processes
  • Error logs showing buffer-related issues in scripts utilizing fgetss() function
  • Unexpected information disclosure in application responses containing memory fragments

Detection Strategies

  • Monitor PHP error logs for segmentation faults and memory access violations during file operations
  • Implement application-level logging around fgetss() function calls to detect anomalous input patterns
  • Use static code analysis tools to identify applications using the deprecated fgetss() function
  • Deploy runtime application self-protection (RASP) solutions to detect buffer overread attempts

Monitoring Recommendations

  • Enable PHP error logging and monitor for unexpected crashes in web application processes
  • Implement file integrity monitoring on PHP binary installations to verify patched versions
  • Configure web application firewalls to detect and block suspicious file upload attempts
  • Review application logs for unusual patterns in file processing operations

How to Mitigate CVE-2020-7059

Immediate Actions Required

  • Upgrade PHP to patched versions: 7.2.27 or later, 7.3.14 or later, or 7.4.2 or later
  • Audit applications for usage of the deprecated fgetss() function and replace with secure alternatives
  • Apply vendor-specific patches for affected products including Tenable.sc and Oracle Communications Diameter Signaling Router
  • Update Linux distributions with security patches from Debian, openSUSE, and Ubuntu

Patch Information

Security patches have been released by PHP and multiple vendors. The official PHP bug report is available at PHP Bug Report #79099. Distribution-specific patches are available through:

  • Ubuntu Security Notice USN-4279-1
  • Debian Security Advisory DSA-4626
  • Debian Security Advisory DSA-4628
  • Gentoo GLSA 202003-57
  • Tenable Security Advisory TNS-2021-14
  • Oracle Security Alert CPUJul2020

Workarounds

  • Refactor application code to use fgets() combined with strip_tags() instead of the deprecated fgetss() function
  • Implement input validation and sanitization before processing external file content
  • Restrict file upload functionality and validate file contents before processing
  • Deploy web application firewalls to filter potentially malicious input patterns
bash
# Check current PHP version for vulnerability status
php -v

# Update PHP on Debian/Ubuntu systems
sudo apt-get update && sudo apt-get upgrade php

# Update PHP on RHEL/CentOS systems
sudo yum update php

# Verify patched version is installed (should be 7.2.27+, 7.3.14+, or 7.4.2+)
php -r "echo 'PHP Version: ' . phpversion() . PHP_EOL;"

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechPhp

  • SeverityCRITICAL

  • CVSS Score9.1

  • EPSS Probability2.12%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-125
  • Technical References
  • openSUSE Security Announcement

  • Debian LTS Security Announcement

  • Bugtraq Security Discussion #27

  • Bugtraq Security Discussion #31

  • Bugtraq Security Discussion #3

  • Gentoo GLSA 202003-57

  • NetApp Security Advisory NTAP-20200221-0002

  • Debian Security Advisory DSA-4626

  • Debian Security Advisory DSA-4628

  • Oracle Security Alert CPUApr2021

  • Oracle Security Alert CPUJul2020
  • Vendor Resources
  • PHP Bug Report #79099

  • Ubuntu Security Notice USN-4279-1

  • Tenable Security Advisory TNS-2021-14
  • Related CVEs
  • CVE-2025-14178: PHP Buffer Overflow Vulnerability

  • CVE-2024-8932: PHP ldap_escape() Buffer Overflow Flaw

  • CVE-2024-11236: PHP ldap_escape() Buffer Overflow Flaw

  • CVE-2024-11233: PHP Buffer Overflow Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English