Skip to content

Prevent drag-and-drop filename option injection - #43

Open
acts-1631 wants to merge 1 commit into
tarot231:mainfrom
acts-1631:security-dnd-option-injection
Open

Prevent drag-and-drop filename option injection#43
acts-1631 wants to merge 1 commit into
tarot231:mainfrom
acts-1631:security-dnd-option-injection

Conversation

@acts-1631

Copy link
Copy Markdown

Leafpad builds a command-line string from dropped filenames and launches additional instances with g_spawn_command_line_async. A filename containing a newline can inject a separate GTK option such as --gtk-module and load attacker-controlled native code.

This changes multi-file drag-and-drop to call g_spawn_async with an argv array, keeping the filename as one argument.

Validated with argv-injection and GTK module-loading probes.

Leafpad rebuilt a command-line string from dropped filenames and

reparsed it before spawning additional editor instances. A filename

containing a newline could inject --gtk-module and load an attacker

controlled GTK module.

Pass the filename as an argv element to g_spawn_async so filename

characters cannot become additional command-line options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant