YARA · Signature Base (Florian Roth / Nextron)
SIGNATURE_BASE_EXPL_Gitlab_CE_RCE_Malformed_JPG_CVE_2021_22204
Detects malformed JPG files exploting EXIF vulnerability CVE-2021-22204 and used in the exploitation of GitLab vulnerability CVE-2021-22205
- Author
- Florian Roth (Nextron Systems)
- Date
- 2021-10-26
- Modified
- 2023-12-05
- Score / Quality
- 70 / 83
What this rule detects
Detects malformed JPG files exploting EXIF vulnerability CVE-2021-22204 and used in the exploitation of GitLab vulnerability CVE-2021-22205
It defines 2 patterns (0 text, 1 hex, 1 regex).
YARA-X says: warning[text_as_hex]: hex pattern could be written as text literal
Summary generated from the rule's metadata and condition.
Rule source
rule SIGNATURE_BASE_EXPL_Gitlab_CE_RCE_Malformed_JPG_CVE_2021_22204 : CVE_2021_22204 CVE_2021_22205 FILE
{
meta:
= "Detects malformed JPG files exploting EXIF vulnerability CVE-2021-22204 and used in the exploitation of GitLab vulnerability CVE-2021-22205"
= "Florian Roth (Nextron Systems)"
= "3d769340-0306-596d-8783-2b37b93a5673"
= "2021-10-26"
= "2023-12-05"
= "https://attackerkb.com/topics/D41jRUXCiJ/cve-2021-22205/rapid7-analysis?referrer=blog"
= "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/exploit_gitlab_cve_2021_22205.yar#L29-L44"
= "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
= "0718ad24337acbb746c6e0d7e0b42d2d034ff583ec6fd12b34fda4737d7e78b0"
= 70
= 83
= "CVE-2021-22204, CVE-2021-22205, FILE"
strings:
$h1 = { 41 54 26 54 46 4F 52 4D }
$sr1 = /\(metadata[\s]{0,3}\([A-Za-z]{1,20} "\\/
condition:
filesize < 10KB and $h1 and $sr1
}
Strings (2 patterns)
| Identifier | Type | Value | Modifiers |
|---|---|---|---|
| $h1 | hex | { 41 54 26 54 46 4F 52 4D } | |
| $sr1 | regex | /\(metadata[\s]{0,3}\([A-Za-z]{1,20} "\\/ |
Condition
filesize < 10KB and $h1 and $sr1In plain words (Heuristic)
- The file must be smaller than 10KB (a cheap guard that skips large files).
- Pattern $h1 must be present.
- Pattern $sr1 must be present.
Test this rule in your browser
Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.
Licence & attribution
Author: Florian Roth (Nextron Systems)
Source repository: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a
Licence: Detection Rule License 1.1 (repository licence)
Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.
Rule id: 3d769340-0306-596d-8783-2b37b93a5673
Tags:CVE_2021_22204CVE_2021_22205FILE
Related rules
- ExploitSignature Base (Florian Roth / Nextron)· Florian Roth (Nextron Systems)· 2021-10-26
- ExploitSignature Base (Florian Roth / Nextron)· Florian Roth (Nextron Systems)· 2021-09-18
- ExploitSignature Base (Florian Roth / Nextron)· Florian Roth (Nextron Systems)· 2022-12-19
- ExploitSignature Base (Florian Roth / Nextron)· Florian Roth (Nextron Systems)· 2021-03-20
- ExploitSignature Base (Florian Roth / Nextron)· Florian Roth (Nextron Systems)· 2023-01-13
- ExploitSignature Base (Florian Roth / Nextron)· Florian Roth (Nextron Systems)· 2022-10-11
- ExploitSignature Base (Florian Roth / Nextron)· Florian Roth (Nextron Systems)· 2021-03-02
- ExploitSignature Base (Florian Roth / Nextron)· Florian Roth (Nextron Systems)· 2023-01-25