Files
gerrit/java/com/google/gerrit/proto
Dave Borowitz eeae376f3c Disable @-syntax in server-side CmdLineParser instances
Since args4j 2.0.29, the default behavior when passing an argument value
of the form "@file" is to read the contents of "file" from the
filesystem and use that as the argument value. This is inappropriate
when the argument value is provided by a user on the internet to a
Gerrit server.

Turn off the behavior in all codepaths in Gerrit. The 5 calls fixed in
this change are all the calls of the CmdLineParser constructors found by
IntelliJ.

It would arguably be ok to leave the @-syntax on for the standalone
programs like ProtoGen, since someone running those programs on a server
could already read arbitrary files with `cat`. However, it's safest to
disable in all paths, so we don't risk making an incorrect judgment
call, and so someone copy/pasting the usage doesn't unintentionally
copy an insecure usage. Moreover, this functionality has not yet been
present in any stable releases, so we know nobody is depending on it
working.

Change-Id: Ib2e40dee443b96c5a8db67affa52a424bba5c4ae
2018-10-08 13:14:28 -07:00
..