Lucene search
K

ChatGPT Finds XSS IN DeepSeek AI Python Code

🗓️ 11 Feb 2025 00:00:00Reported by Georgi GuninskiType 
packetstorm
 packetstorm
🔗 packetstorm.news👁 372 Views

ChatGPT identifies XSS vulnerability in DeepSeek AI Python code due to unsanitized user input.

Code
Summary:  On 2025-02-09 ChatGPT AI found "security concern" (XSS) in
    DeepSeek's AI python code.
    
    Background:
    
    Consider the simple coding question (Q):
    
    Write Python CGI which takes as an argument NAME and outputs: "Hello NAME".
    
    First page and results on google for "python CGI" return for me
    tutorials, which are flawed and textbook examples of the cross site
    scripting (XSS) vulnerability. This is a "knowledge chain attack"
    which applies to training AI bots.
    
    Timeline:
    2023: ChatGPT writes textbook vulnerable code for (Q) [1]
    2025-01-28:  DeepSeek fails (Q) too the same way
    
    2025-02-09:  We gave to ChatGPT the buggy DeepSeek's solution for
    review of python code and ChatGPT wrote:
    
    ===
    Security Concern: HTML Injection
    
    The script directly inserts user input into the response without
    sanitization, making it vulnerable to HTML injection (e.g., someone
    could pass ?NAME=<script>alert('Hacked!')</script>).
    ===
    
    Observe that the review includes exploit too, and the current standard
    term XSS is not used ("HTML injection" was in the 90's).
    
    ChatGPT gave the improved code:
    # Get the query parameters
    form = cgi.FieldStorage()
    
    # Extract and sanitize the 'NAME' parameter
    name = html.escape(form.getvalue('NAME', 'World'))
    
    While correct from security point of view, this code breaks special
    characters in input for general web apps AFAICT.
    
    AI bots training each other appear scary for me.
    
    Related rant:
    
    This might be a joke:
    
    Humans built a super AI and the first question was: "Is there god?".
    The answer was: "Since now there is". (In Bulgarian: Хората направили
    супер изкуствен интелект и първият въпрос бил: "Има ли бог".
    Отговорът: "Вече има")
    
    From Wikipeia on Singularity [2]
    
    The technological singularity—or simply the singularity—is a
    hypothetical future point in time at which technological growth
    becomes uncontrollable and irreversible, resulting in unforeseeable
    consequences for human civilization.
    
    
    [1]: https://www.linkedin.com/pulse/ai-chatgpt-writes-insecure-code-georgi-guninski
    [2]: https://en.wikipedia.org/wiki/Technological_singularity

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

11 Feb 2025 00:00Current
6.8Medium risk
Vulners AI Score6.8
372