CVE-2021-23331: Insecure temporary file used in com.squareup:connect

com.squareup:connect Updated 02 Oct 2025

Summary

16/06/2021
No i
Low
3.3

CVE-2021-23331: Insecure temporary file used in com.squareup:connect. Affects com.squareup:connect versions < 2.20191120.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The com.squareup:connect package is an open-source library used for connecting to various services. It provides functionality for downloading files from a remote server. However, all versions of this package are vulnerable to an insecure temporary file issue. The method prepareDownloadFile creates a temporary file with incorrect permissions on Unix-like systems, making the downloaded file visible to all users on the local system. This can lead to unauthorized access and exposure of sensitive information.

Vulnerability Detail

The vulnerability in com.squareup:connect arises from the creation of temporary files with incorrect permissions. When the method prepareDownloadFile is called, it creates a temporary file with the permissions bits of -rw-r--r-- on Unix-like systems. As a result, the downloaded file can be accessed by other users on the system. This can lead to the exposure of sensitive data to unauthorized parties. The issue has been assigned a CVSS score of 3.3, indicating a low severity level.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a workaround, you can set the system property java.io.tmpdir to a safe directory. By doing so, you can ensure that temporary files created by the com.squareup:connect package are stored in a secure location with appropriate permissions. This will mitigate the risk of unauthorized access to downloaded files. Here's an example of how to set the java.io.tmpdir system property:

System.setProperty("java.io.tmpdir", "/path/to/safe/directory");

Conclusion

The com.squareup:connect package is vulnerable to an insecure temporary file issue, which can lead to unauthorized access to downloaded files. To mitigate this vulnerability, it is recommended to upgrade to the latest version of the package. Additionally, setting the java.io.tmpdir system property to a safe directory can provide a temporary workaround. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for com.squareup:connect →

Share this vulnerability

FAQ

The vulnerability allows other users on the local system to access the contents of downloaded files, potentially exposing sensitive information.

All versions of com.squareup:connect are affected up to version 2.20191120.0.

Yes, upgrading to the latest version of com.squareup:connect will fix the vulnerability.

Yes, setting the java.io.tmpdir system property to a safe directory can mitigate the risk of unauthorized access to downloaded files.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback