You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "xingtanzjr (via GitHub)" <gi...@apache.org> on 2023/06/13 06:22:37 UTC

[GitHub] [iotdb] xingtanzjr opened a new pull request, #10138: [To rel/1.2] Fix a a coding pattern that could possibly have security impact

xingtanzjr opened a new pull request, #10138:
URL: https://github.com/apache/iotdb/pull/10138

   ## Description
   This PR fix a coding pattern that could possibly have security impact. This issue allows a malicious actor to potentially break out of the expected directory. The impact is limited to sibling directories. For example, `userControlled.getCanonicalPath().startsWith("/user/out")` will allow an attacker to access a directory with a name like `/user/outnot.
   
   ## Why?
   To demonstrate this vulnerability, consider `"/user/outnot".startsWith("/user/out")`. The check is bypassed although `/outnot` is not under the `/out` directory. It's important to understand that the terminating slash may be removed when using various `String` representations of the `File` object. 
   For example, on Linux, `println(new File("/var"))` will print `/var`, but `println(new File("/var", "/")` will print `/var/`; however, `println(new File("/var", "/").getCanonicalPath())` will print `/var`.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] xingtanzjr merged pull request #10138: [To rel/1.2] Fix a a coding pattern that could possibly have security impact

Posted by "xingtanzjr (via GitHub)" <gi...@apache.org>.
xingtanzjr merged PR #10138:
URL: https://github.com/apache/iotdb/pull/10138


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org