CVE-2021-31402: Dio Dio Vulnerable To CRLF Injection Vulnerability
HIGHCVE-2021-31402 is a HIGH (CVSS 7.5) dio vulnerable to crlf injection vulnerability (CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')) affecting Dio libraries in the Pub ecosystem. The issue involves dio vulnerable to crlf injection with http method string. Remediation is available by upgrading affected packages to version 5.0.0.
CVE-2021-31402 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2021-31402
To remediate this vulnerability, upgrade all affected Dio dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade dio to 5.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for dio
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-31402, inspect your project dependencies for Dio:
inspect dependencies for dio
Analyze the terminal output to locate any version of Dio in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection'), where the product uses crlf (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes crlf sequences from inputs. In Dio, 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
CVE-2021-31402 Affected Dio Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
dio
|
Pub |
< 5.0.0
|
5.0.0
|
References
Frequently Asked Questions
What is CVE-2021-31402?
Which Dio versions are affected?
What version fixes CVE-2021-31402?
Is dio affected?
What is the CVSS score of CVE-2021-31402?
What CWE is associated with CVE-2021-31402?
How can I check Pub dependencies for CVE-2021-31402?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9324-jv53-9cc8",
"modified" : "2023-03-21T22:41:11Z",
"published" : "2023-03-21T22:41:11Z",
"aliases" : [ "CVE-2021-31402" ],
"summary" : "dio vulnerable to CRLF injection with HTTP method string",
"details" : "### Impact\nThe dio package 4.0.0 for Dart allows CRLF injection if the attacker controls the HTTP method string, a different vulnerability than CVE-2020-35669.\n\n### Patches\nThe vulnerability has been resolved by https://github.com/cfug/dio/commit/927f79e93ba39f3c3a12c190624a55653d577984, and included since v5.0.0.\n\n### Workarounds\nCherry-pick the commit to your own fork can resolves the vulberability too.\n\n### References\n- https://nvd.nist.gov/vuln/detail/CVE-2021-31402\n- https://osv.dev/GHSA-jwpw-q68h-r678\n- https://github.com/cfug/dio/issues/1130\n- https://github.com/cfug/dio/issues/1752\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Pub",
"name" : "dio"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/cfug/dio/security/advisories/GHSA-9324-jv53-9cc8"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-31402"
}, {
"type" : "WEB",
"url" : "https://github.com/cfug/dio/issues/1752"
}, {
"type" : "WEB",
"url" : "https://github.com/flutterchina/dio/issues/1130"
}, {
"type" : "WEB",
"url" : "https://github.com/cfug/dio/commit/927f79e93ba39f3c3a12c190624a55653d577984"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/cfug/dio"
}, {
"type" : "WEB",
"url" : "https://osv.dev/GHSA-jwpw-q68h-r678"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-PUB-DIO-5891148"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-93" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-03-21T22:41:11Z",
"nvd_published_at" : null
}
}