You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/10/18 12:45:00 UTC

[jira] [Commented] (PHOENIX-6576) Do not use guava's Files.createTempDir()

    [ https://issues.apache.org/jira/browse/PHOENIX-6576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17429992#comment-17429992 ] 

ASF GitHub Bot commented on PHOENIX-6576:
-----------------------------------------

stoty commented on a change in pull request #1333:
URL: https://github.com/apache/phoenix/pull/1333#discussion_r730882929



##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/SpooledTmpFileDeleteIT.java
##########
@@ -58,7 +58,11 @@ private Connection getConnection() throws Exception {
     @Before
     public void setup() throws Exception {
         tableName = generateUniqueName();
-        spoolDir = Files.createTempDir();
+        File tempDirBase =
+                new File(System.getProperty("java.io.tmpdir"));

Review comment:
       This seems to be redundant.
   Why not use the directory-less method below ?




-- 
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: issues-unsubscribe@phoenix.apache.org

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


> Do not use guava's Files.createTempDir()
> ----------------------------------------
>
>                 Key: PHOENIX-6576
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6576
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: lujie
>            Priority: Major
>
> see [https://www.cvedetails.com/cve/CVE-2020-8908/]
> A temp directory creation vulnerability exists in all versions of Guava, allowing an attacker with access to the machine to potentially access data in a temporary directory created by the Guava API com.google.common.io.Files.createTempDir(). By default, on unix-like systems, the created directory is world-readable (readable by an attacker with access to the system). The method in question has been marked [@deprecated|https://github.com/deprecated] in versions 30.0 and later and should not be used. For Android developers, we recommend choosing a temporary directory API provided by Android, such as context.getCacheDir(). For other Java developers, we recommend migrating to the Java 7 API java.nio.file.Files.createTempDirectory() which explicitly configures permissions of 700, or configuring the Java runtime's java.io.tmpdir system property to point to a location whose permissions are appropriately configured.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)