CVE-2021-31411: Vaadin bom Insecure Temporary Directory Usage Vulnerability

HIGH
Advisory Identifier: GHSA-p826-8vhq-h439
CVSS 6.3
CWE-379
Published
Advisory Summary

CVE-2021-31411 is a HIGH (CVSS 6.3) insecure temporary directory usage vulnerability (CWE-379: Creation of Temporary File in Directory with Insecure Permissions) affecting Vaadin bom libraries in the Maven ecosystem. The issue involves insecure temporary directory usage in frontend build functionality of vaadin 14 and 15-19. Remediation is available by upgrading affected packages to version 14.5.3, 19.0.5.

CVE-2021-31411 at a Glance

CVE Identifier CVE-2021-31411
GHSA Identifier GHSA-p826-8vhq-h439
Severity HIGH
CVSS v3.1 Base Score 6.3
CWE Classification CWE-379: Creation of Temporary File in Directory with Insecure Permissions
Affected Product Vaadin bom
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2021-31411

To remediate this vulnerability, upgrade all affected Vaadin bom dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

com.vaadin:vaadin-bom fixed: 14.5.3
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-bom</artifactId>
    <version>14.5.3</version>
</dependency>
com.vaadin:vaadin-bom fixed: 19.0.5
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-bom</artifactId>
    <version>19.0.5</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=com.vaadin

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2021-31411, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=com.vaadin

Analyze the terminal output to locate any version of Vaadin bom in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 14.5.3), your application is affected.

Note: The mvn dependency:tree -Dincludes=com.vaadin command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-379: Creation of Temporary File in Directory with Insecure Permissions, where the product creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file. In Vaadin bom, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Insecure temporary directory usage in frontend build functionality of `com.vaadin:flow-server` versions 2.0.9 through 2.5.2 (Vaadin 14.0.3 through Vaadin 14.5.2), 3.0 prior to 6.0 (Vaadin 15 prior to 19), and 6.0.0 through 6.0.5 (Vaadin 19.0.0 through 19.0.4) allows local users to inject malicious code into frontend resources during application rebuilds. - https://vaadin.com/security/cve-2021-31411

CVE-2021-31411 Affected Vaadin bom Versions

2 component(s)
Fixed Versions:
14.5.319.0.5
Product / Package Ecosystem Affected Versions Fixed Version
com.vaadin:vaadin-bom
Maven
≥ 14.0.3
< 14.5.3
14.5.3
com.vaadin:vaadin-bom
Maven
≥ 15.0.0
< 19.0.5
19.0.5

References

Frequently Asked Questions

What is CVE-2021-31411?
CVE-2021-31411 is a security vulnerability in Vaadin bom involving Insecure temporary directory usage in frontend build functionality of Vaadin 14 and 15-19 under CWE-379: Creation of Temporary File in Directory with Insecure Permissions.
Which Vaadin bom versions are affected?
Affected versions include releases prior to 14.5.3, 19.0.5 across affected packages: com.vaadin:vaadin-bom.
What version fixes CVE-2021-31411?
Upgrading to 14.5.3, 19.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is vaadin-bom affected?
Yes, com.vaadin:vaadin-bom is affected in releases prior to 14.5.3, 19.0.5. Upgrade your dependency to 14.5.3, 19.0.5 or later.
What is the CVSS score of CVE-2021-31411?
CVE-2021-31411 has a CVSS v3.1 base score of 6.3 (HIGH) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2021-31411?
CVE-2021-31411 is classified under CWE-379: Creation of Temporary File in Directory with Insecure Permissions (The product creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.).
How can I check Maven dependencies for CVE-2021-31411?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=com.vaadin'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-p826-8vhq-h439",
  "modified" : "2021-05-19T17:41:45Z",
  "published" : "2021-05-06T15:27:12Z",
  "aliases" : [ "CVE-2021-31411" ],
  "summary" : "Insecure temporary directory usage in frontend build functionality of Vaadin 14 and 15-19",
  "details" : "Insecure temporary directory usage in frontend build functionality of `com.vaadin:flow-server` versions 2.0.9 through 2.5.2 (Vaadin 14.0.3 through Vaadin 14.5.2), 3.0 prior to 6.0 (Vaadin 15 prior to 19), and 6.0.0 through 6.0.5 (Vaadin 19.0.0 through 19.0.4) allows local users to inject malicious code into frontend resources during application rebuilds.\n\n- https://vaadin.com/security/cve-2021-31411",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "com.vaadin:vaadin-bom"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "14.0.3"
      }, {
        "fixed" : "14.5.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 14.5.2"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "com.vaadin:vaadin-bom"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "15.0.0"
      }, {
        "fixed" : "19.0.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 19.0.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vaadin/platform/security/advisories/GHSA-p826-8vhq-h439"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-31411"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vaadin/flow/pull/10640"
  }, {
    "type" : "WEB",
    "url" : "https://vaadin.com/security/cve-2021-31411"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-379" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-04T17:54:40Z",
    "nvd_published_at" : "2021-05-05T19:15:00Z"
  }
}