Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2024-10819

CVE-2024-10819: Binary-husky Gpt Academic CSRF Vulnerability

CVE-2024-10819 is a Cross-Site Request Forgery flaw in Binary-husky Gpt Academic that enables unauthorized file uploads and stored XSS attacks. This article covers technical details, affected versions, impact, and mitigation.

Published:

CVE-2024-10819 Overview

CVE-2024-10819 is a Cross-Site Request Forgery (CSRF) vulnerability in binary-husky/gpt_academic version 3.83. The flaw allows an attacker to coerce an authenticated user's browser into uploading attacker-controlled files without consent. Because the application accepts the forged upload within the victim's session, the uploaded content is treated as legitimate. When the uploaded file contains malicious script payloads, it enables stored Cross-Site Scripting (XSS) against subsequent viewers. Successful exploitation can lead to session theft, impersonation, and full account takeover. The weakness is tracked under CWE-352.

Critical Impact

A single visit to an attacker-controlled page can result in unauthorized file uploads, stored XSS execution, and complete compromise of the victim's session in gpt_academic.

Affected Products

  • binary-husky/gpt_academic version 3.83
  • Deployments exposing the upload endpoint without CSRF token enforcement
  • Multi-user instances where authenticated sessions can be targeted via cross-origin requests

Discovery Timeline

  • 2025-03-20 - CVE-2024-10819 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-10819

Vulnerability Analysis

The vulnerability resides in the file upload functionality of gpt_academic 3.83. The upload endpoint accepts cross-origin POST requests using only the browser-supplied session cookie for authentication. No anti-CSRF token, Origin validation, or SameSite cookie enforcement is applied to the request flow.

An attacker hosts a malicious page that submits a hidden form or fetch request to the gpt_academic upload route. When an authenticated victim visits the page, the browser attaches the session cookie, and the server processes the upload as if the victim initiated it. The uploaded artifact can include HTML or JavaScript payloads that are later rendered in the application interface.

Because the uploaded content is served back to users without sufficient output encoding, the CSRF primitive chains into stored XSS. The combined attack converts a one-click action into persistent script execution against any user who interacts with the malicious file in the application.

Root Cause

The root cause is missing CSRF protection on state-changing requests, specifically the file upload handler. Session validation relies solely on ambient cookie credentials, which browsers automatically include in cross-origin requests. The absence of token-based request validation violates the synchronizer token pattern recommended for CSRF defense.

Attack Vector

Exploitation requires only that an authenticated user load attacker-controlled web content. No prior privileges on the target are needed beyond an existing session. User interaction is limited to visiting a page, which can be delivered through phishing, malvertising, or a compromised third-party site. The vulnerability is network-reachable wherever the gpt_academic instance is exposed.

A technical write-up is available in the Huntr Bug Bounty Report.

Detection Methods for CVE-2024-10819

Indicators of Compromise

  • Upload requests to gpt_academic with Referer or Origin headers pointing to untrusted external domains
  • Uploaded files containing HTML, JavaScript, or SVG content with embedded <script> tags
  • Unexpected file creation timestamps in the gpt_academic upload directory tied to active user sessions
  • Outbound requests from user browsers to unfamiliar callback domains following a session in gpt_academic

Detection Strategies

  • Inspect web server access logs for POST requests to upload endpoints lacking expected Referer values or CSRF tokens
  • Scan stored upload directories for files containing script tags, event handlers, or javascript: URIs
  • Monitor application logs for uploads originating from sessions that did not perform an interactive navigation to the upload UI

Monitoring Recommendations

  • Forward gpt_academic access logs to a centralized SIEM and alert on cross-origin upload attempts
  • Enable Content Security Policy (CSP) violation reporting to surface unexpected inline script execution
  • Track per-user upload frequency and flag anomalous spikes that may indicate forged requests

How to Mitigate CVE-2024-10819

Immediate Actions Required

  • Upgrade binary-husky/gpt_academic beyond version 3.83 once a fixed release is published by the maintainers
  • Restrict access to the gpt_academic instance to trusted users via network controls or authenticated reverse proxy until a patch is applied
  • Instruct users to log out of gpt_academic sessions before browsing untrusted sites
  • Review uploaded files for malicious script content and remove any unauthorized artifacts

Patch Information

No vendor advisory URL is listed in the NVD record at the time of publication. Track the Huntr Bug Bounty Report and the project repository for remediation updates. Apply any maintainer-released patch that introduces CSRF token validation on upload and other state-changing endpoints.

Workarounds

  • Deploy a reverse proxy that enforces Origin and Referer header validation on upload routes
  • Set session cookies to SameSite=Strict to prevent cross-site request inclusion of credentials
  • Apply a strict Content Security Policy that disables inline scripts and restricts allowed sources for executed code
  • Serve user-uploaded files from a sandboxed domain with Content-Disposition: attachment to prevent inline rendering
bash
# Example nginx hardening for the gpt_academic upload route
location /upload {
    if ($http_origin !~* ^https://gpt-academic\.example\.com$) {
        return 403;
    }
    add_header Set-Cookie "session=$cookie_session; SameSite=Strict; Secure; HttpOnly";
    add_header Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'";
    proxy_pass http://gpt_academic_backend;
}

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

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.