Commit a3b6d13
committed
[java-source-utils] Fix lgtm java/path-injection-local
Context: e11d024
Commit e11d024 attempted to fix LGTM-reported
[`java/path-injection-local`][0] warnings by using the comment
`// lgtm [java/path-injection-local]`.
Unfortunately, this is insufficient: the comment *also* needs to
provide a 25+ character justification for why the offending statement
can be ignored. This justification was not provided.
Update the `// lgtm [java/path-injection-local]` comments to provide
a justification, as required by tooling.
Copying the longer justification from e11d024:
> LGTM is complaining that `tools/java-source-utils` (69e1b80) accepts
> user-controlled data. These warnings will be *ignored* because the
> app is *unusable* without "user-controlled data"
> …
> These are all user-controlled, and they are necessary to allow
> `java-source-utils` to *work*.
> …
> LGTM complains that `--output-javadoc FILE` accepts a user-controlled
> path which may [contain] directory separator chars, and
> *this is intentional*; using it would be annoying if that weren't true!
See also [`JavaSourceUtils.cs`][1], which passes [a value][2] located
within `$(IntermediateOutputPath)` to
`java-source-utils.jar --output-javadoc`. Allowing `--output-javadoc`
to contain directory separator chars is what makes this possible!
[0]: https://github.com/github/codeql/blob/f192191e8c4c14d70a86342de47c8882516c7c25/java/ql/src/Security/CWE/CWE-022/TaintedPath.qhelp
[1]: https://github.com/xamarin/xamarin-android/blob/b00185c485287c2c5f0350a067ebc178aec2382c/src/Xamarin.Android.Build.Tasks/Tasks/JavaSourceUtils.cs#L134-L135
[2]: https://github.com/xamarin/xamarin-android/blob/b00185c485287c2c5f0350a067ebc178aec2382c/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.ClassParse.targets#L691 parent 120d8a7 commit a3b6d13
File tree
2 files changed
+5
-5
lines changed- tools/java-source-utils/src/main/java/com/microsoft/android
2 files changed
+5
-5
lines changedLines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
0 commit comments