croc icon indicating copy to clipboard operation
croc copied to clipboard

Explicit Evaluation of Wildcard Characters on the Sender Side CLI

Open mgerstner opened this issue 2 years ago • 2 comments

The Croc command line tool explicitly (re)evaluates wildcard glob characters in filename arguments (croc.go:262). This seems highly unusual to me, since normally the user's shell will expand wildcards, not the programs that the filenames are passed to.

This means even if special characters are escaped on shell level, that Croc will still attempt to expand them. This only happens if a filename contains at least one * character. For a sender side user this could be surprising, if a filename actually contains an * character, that this will suddenly be expanded nevertheless. Although a bit far fetched it might still pose a social engineering attack vector, by tricking somebody into forwarding a strangely named file and make them unwittingly send more files than intended.

The principle of least surprise is violated here and I would drop this logic, or execute it only in whatever use case this is helpful with.

mgerstner avatar Sep 08 '23 12:09 mgerstner

Thanks - this would be a great PR to have

schollz avatar Sep 20 '23 12:09 schollz

Stale issue message

github-actions[bot] avatar Feb 09 '24 12:02 github-actions[bot]

Stale issue message

github-actions[bot] avatar Jul 23 '24 12:07 github-actions[bot]