dst can be relative for "../" replace call

This commit is contained in:
Erik Krogh Kristensen
2020-04-03 11:08:31 +02:00
parent e46cde17a1
commit 94751c1b31
2 changed files with 21 additions and 1 deletions

View File

@@ -210,7 +210,7 @@ module TaintedPath {
exists(DotDotSlashPrefixRemovingReplace call |
src = call.getInput() and
dst = call.getOutput() and
dstlabel.isAbsolute() and // result can be absolute
(srclabel.isNonNormalized() or dstlabel.isAbsolute()) and // if src is normalized, then dst must be absolute (if dst is relative, then dst is sanitized)
dstlabel.toAbsolute() = srclabel.toAbsolute() // preserves normalization status
)
or