Skip to content

MuhammadWaseem29/universal-content-spoof-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Universal Content Spoofing Payloads ✨ ❤️

Overview

This repository contains high-impact payloads designed to demonstrate critical severity in Content Spoofing and URL Redirection vulnerabilities. It provides a standardized method for validating security controls in web applications that handle external resources.

Technical Analysis

Vulnerability Class

CWE-601: URL Redirection to Untrusted Site CWE-1021: Improper Restriction of Rendered UI Layers or Frames

Root Cause

The vulnerability typically occurs when a web application accepts a URL parameter to load a resource (such as a PDF, image, or frame) but fails to validate the origin of that resource against a strict allowlist.

Vulnerable Implementation

In many PDF viewing libraries (like PDF.js) or custom file handlers, developers often implement a simple fetch mechanism without origin checks:

// VULNERABLE CODE
function loadDocument() {
    const urlParams = new URLSearchParams(window.location.search);
    const fileUrl = urlParams.get('file');

    // DANGEROUS: No validation of the 'file' origin
    if (fileUrl) {
        document.getElementById('viewer').src = fileUrl;
    }
}

Impact Analysis

When exploited, this vulnerability allows attackers to:

  1. Spoof Trusted Domains: Render malicious content within the context of the trusted domain.
  2. Bypass Phishing Filters: Leverage the reputation of the legitimate domain to evade email security gateways.
  3. Execute Social Engineering: Present counterfeit legal or security documents that appear to originate from the target organization.

Remediation

To mitigate this vulnerability, implement strict input validation using an allowlist of trusted origins.

Secure Implementation

// SECURE CODE
function loadDocument() {
    const urlParams = new URLSearchParams(window.location.search);
    const fileUrl = urlParams.get('file');
    
    // 1. Define trusted domains
    const trustedOrigins = [
        'https://trusted.example.com',
        'https://example.com'
    ];

    if (fileUrl) {
        try {
            const url = new URL(fileUrl);
            
            // 2. Validate Origin
            if (!trustedOrigins.includes(url.origin)) {
                throw new Error('Untrusted Origin Detected');
            }
            
            // 3. Load only if validated
            document.getElementById('viewer').src = fileUrl;
            
        } catch (e) {
            console.error('Security Violation:', e.message);
            // Handle error (e.g., show generic error page)
        }
    }
}

Universal Payloads

1. Domain Seizure Simulation

Simulates a Federal Law Enforcement domain seizure. URL:

https://raw.githubusercontent.com/MuhammadWaseem29/universal-content-spoof-poc/master/payloads/domain-seized.pdf
Screenshot 2025-12-22 at 1 40 48 PM

2. Ransomware Infection

Simulates a cryptographic ransomware attack. URL:

https://raw.githubusercontent.com/MuhammadWaseem29/universal-content-spoof-poc/master/payloads/ransomware-note.pdf
Screenshot 2025-12-22 at 1 42 12 PM

3. Data Breach Alert

Simulates a critical system compromise and data leak. URL:

https://raw.githubusercontent.com/MuhammadWaseem29/universal-content-spoof-poc/master/payloads/data-breach-alert.pdf
Screenshot 2025-12-22 at 1 43 07 PM

Usage

Construct the exploitation URL by appending the payload to the vulnerable parameter:

https://redacted.com/web/viewer.html?file=[PAYLOAD_URL]

Created By

Security Researcher GitHub: @MuhammadWaseem29

License

This project is licensed under the MIT License. For Educational and Authorized Security Testing Only.

References

✨ ❤️

About

Universal Content Spoofing Payloads ✨

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages