Duplicate entries in executables
file lead to undefined behavior
#5525
Labels
exec
About calls to executables from Agda tactics
reflection
Elaborator reflection, macros, tactic arguments
security hazard
Issue in Agda that could be exploited by a malicious actor
type: bug
Issues and pull requests about actual bugs
Milestone
Discovered when looking at #5070. Ping @wenkokke.
Agda accepts silently executables with the same
basename
:E.g. I can write this into
.agda/executables
:(The second command does not echo, but crashes if called on the command line.)
This makes the example from the docs fail:
Error:
It succeeds if I swap the entries in the
executables
file.This behaviour can be explained by a use
Map.fromList
, which takes the last of the duplicate entries and throws the others away silently. (You have been warned by @gallais!)agda/src/full/Agda/Interaction/Library.hs
Lines 387 to 388 in 6c56133
This is a potential security problem!
Also, Agda swallows the OS error thrown by the second executable and simply returns the empty string. That's DOS/Windows-style error swallowing, not good...
Agda should report:
executables
The text was updated successfully, but these errors were encountered: