CVE-2021-22331
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedThere is a JavaScript injection vulnerability in certain Huawei smartphones. A module does not verify some inputs sufficiently. Attackers can exploit this vulnerability by sending a malicious application request to launch JavaScript injection. This may compromise normal service. Affected product versions include HUAWEI P30 versions earlier than 10.1.0.165(C01E165R2P11), 11.0.0.118(C635E2R1P3), 11.0.0.120(C00E120R2P5), 11.0.0.138(C10E4R5P3), 11.0.0.138(C185E4R7P3), 11.0.0.138(C432E8R2P3), 11.0.0.138(C461E4R3P3), 11.0.0.138(C605E4R1P3), and 11.0.0.138(C636E4R3P3).
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceJavaScript injection vulnerability in Huawei P30 smartphones where a module fails to properly validate certain inputs. Attackers can exploit this by sending malicious application requests to inject and execute arbitrary JavaScript code, potentially compromising device services.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data< 10.1.0.165\(c01e165r2p11\)< 11.0.0.118\(c635e2r1p3\)< 11.0.0.120\(c00e120r2p5\)< 11.0.0.138\(c10e4r5p3\)< 11.0.0.138\(c185e4r7p3\)< 11.0.0.138\(c432e8r2p3\)< 11.0.0.138\(c461e4r3p3\)< 11.0.0.138\(c605e4r1p3\)< 11.0.0.138\(c636e4r3p3\)CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify device modelGo to Settings > About Phone > Model Number and verify the device is Huawei P30Affected if Device model is not Huawei P30 - this CVE only affects P30 smartphones
-
Check firmware build numberGo to Settings > About Phone > Build Number to view the current firmware build (e.g., C01E165R2P11)Affected if Build number cannot be read or device is not a Huawei P30
-
Compare build to affected versionsCompare your build number against the list: 10.1.0.165(C01E165R2P11), 11.0.0.118(C635E2R1P3), 11.0.0.120(C00E120R2P5), or 11.0.0.138 with any of these suffixes: C10E4R5P3, C185E4R7P3, C432E8R2P3, C461E4R3P3, C605E4R1P3, C636E4R3P3Affected if Your firmware version is lower than any of these patched builds - the device is running a vulnerable version
If the Huawei P30 firmware build number is below the patched versions listed, the device is affected by this JavaScript injection vulnerability.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
From vendor data10.1.0.16511.0.0.11811.0.0.120
Update Huawei P30 to the patched firmware versions: 10.1.0.165(C01E165R2P11) or respective 11.0.x builds (C635E2R1P3, C00E120R2P5, or C10E4R5P3/C185E4R7P3/C432E8R2P3/C461E4R3P3/C605E4R1P3/C636E4R3P3).
- Consultation2.0 h
- Testing2.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,408.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2021-22331 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2021-22331 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data