Back to skills
SKILL.md
1742 Issue Identifiers 96c5c70c
ASecurity*Complete identifier reference for all YARA rule conventions, errors, and recommendations. Combines yaraQA automated checks with style guide and performance manual review items.*
- 9 stars
- 0 votes
- 0 copies
- 1 view
- Added May 31, 2026
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add tools-only/X-Skills --skill 1742-issue-identifiers_96c5c70c --agent claude-codeAre you the author of 1742 Issue Identifiers 96c5c70c?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tools-only-1742-issue-identifiers-96c5c70c)# YARA Rule Issue Identifiers
*Complete identifier reference for all YARA rule conventions, errors, and recommendations. Combines yaraQA automated checks with style guide and performance manual review items.*
## Identifier Scheme
| Code | Category | Source | Level |
|------|----------|--------|-------|
|`CE`|Condition Error|yaraQA|Error π΄|
|`CF`|Condition Fail (performance)|yaraQA|Warning π‘|
|`CS`|Combination/String|yaraQA|Warning π‘|
|`DS`|Duplicate String|yaraQA|Warning π‘|
|`DU`|Duplicate Rule|yaraQA|Warning π‘|
|`HS`|High String count|yaraQA|Info/Warning π΅π‘|
|`MF`|Meta Field|Style Guide|Info/Warning π΅π‘|
|`MO`|Module usage|yaraQA|Info π΅|
|`NC`|Naming Convention|Style Guide|Warning π‘|
|`NO`|Nocase+Other modifiers|yaraQA|Info π΅|
|`PA`|Performance Atom|yaraQA|Warning π‘|
|`PI`|Performance Impact|yaraQA|Warning π‘|
|`RE`|Regex Error|yaraQA|Warning π‘|
|`RX`|Performance eXtended|Performance|Warning π‘|
|`SM`|String Modifier|yaraQA|Info/Error π΅π΄|
|`SS`|String Style|Style Guide|Info π΅|
|`ST`|String Triad|Style Guide|Info π΅|
|`SV`|String Value (style)|yaraQA|Info/Warning π΅π‘|
|`ID`|Indentation/Formatting|Style Guide|Info π΅|
|`FM`|condition Formatting|Style Guide|Info π΅|
---
## NC β Naming Convention Issues
*From YARA Style Guide β Rule naming standards*
### NC1 β Missing Main Category
**Level:** Warning π‘
**Check:** Rule name lacks a main category prefix
```yara
// WRONG: No category
rule CobaltStrike_Loader { ... }
// CORRECT:
rule MAL_CobaltStrike_Loader_May23 { ... }
rule HKTL_CobaltStrike_Beacon_Jan24 { ... }
```
**Main Categories Required:**
- `MAL` β Malware
- `HKTL` β Hack tool
- `WEBSHELL` β Web shell
- `EXPL` β Exploit code
- `VULN` β Vulnerable component
- `SUSP` β Suspicious/generic
- `PUA` β Potentially unwanted application
---
### NC2 β Incorrect Category Order
**Level:** Info π΅
**Check:** Naming components not ordered from generic to specific
```yara
// SUBOPTIMAL: Specific before generic
rule Loader_MAL_APT_CozyBear_ELF_Apr18 { ... }
// CORRECT: Generic to specific
rule MAL_APT_CozyBear_ELF_Loader_Apr18 { ... }
```
**Correct Order:** `CATEGORY β INTENTION β ACTOR β PLATFORM β TYPE β DATE`
---
### NC3 β Missing Date Suffix
**Level:** Info π΅
**Check:** Rule lacks MonthYear or numeric suffix
```yara
// SUBOPTIMAL: No date
rule MAL_APT_CozyBear_ELF_Loader { ... }
// CORRECT:
rule MAL_APT_CozyBear_ELF_Loader_Apr18 { ... }
rule MAL_APT_CozyBear_ELF_Loader_1 { ... }
```
---
### NC4 β Ambiguous Technology Tag
**Level:** Info π΅
**Check:** File type detectable from strings but not in name
```yara
// INCONSISTENT: Go binary detection but not in name
rule MAL_APT_CozyBear_Loader_Apr18 {
strings:
$a1 = "Go build" // Clearly Go binary
...
}
// CORRECT:
rule MAL_APT_CozyBear_GO_Loader_Apr18 { ... }
```
---
### NC5 β Platform Omission When Non-Windows
**Level:** Info π΅
**Check:** Non-Windows rule missing platform indicator
```yara
// SUBOPTIMAL: ELF binary without LNX
rule MAL_APT_CozyBear_ELF_Loader_Apr18 { ... }
// CORRECT:
rule MAL_APT_CozyBear_LNX_ELF_Loader_Apr18 { ... }
```
**Note:** `WIN` is default and often omitted, but `LNX`, `MacOS` should be explicit.
---
### NC6 β Modifier Not Reflected in Name
**Level:** Info π΅
**Check:** Rule detects obfuscated/encoded/InMemory but name doesn't indicate
```yara
// INCONSISTENT: Detects obfuscation but not in name
rule MAL_CRIME_RANSOM_PS1_Loader_May23 {
strings:
$a1 = /[Bb]64[Dd]ecode/ // Obfuscated Base64
...
}
// CORRECT:
rule MAL_CRIME_RANSOM_PS1_OBFUSC_Loader_May23 { ... }
```
**Common Modifiers:** `OBFUSC`, `Encoded`, `Unpacked`, `InMemory`
---
## MF β Meta Field Issues
*From YARA Style Guide β Metadata standards*
### MF1 β Missing Mandatory Meta Field
**Level:** Warning π‘
**Check:** Rule lacks description, author, reference, or date
```yara
// WRONG: Missing fields
rule MAL_Test_May23 {
meta:
description = "Detects malware"
// Missing: author, reference, date
...
}
// CORRECT:
rule MAL_Test_May23 {
meta:
description = "Detects X malware family"
author = "Analyst Name / Company"
reference = "https://blog.example.com/analysis"
date = "2023-05-15"
...
}
```
**Mandatory Fields:** `description`, `author`, `reference`, `date`
---
### MF2 β Description Without "Detects"
**Level:** Info π΅
**Check:** Description doesn't start with "Detects ..."
```yara
// SUBOPTIMAL:
description = "This is a rule for malware X"
// CORRECT:
description = "Detects X malware family used by APT Y"
```
---
### MF3 β Description Contains URL
**Level:** Info π΅
**Check:** Description field includes URL (should be in reference)
```yara
// WRONG:
description = "Detects malware from https://evil.com/campaign"
// CORRECT:
description = "Detects malware from Evil campaign"
reference = "https://evil.com/campaign"
```
---
### MF4 β Description Too Short or Too Long
**Level:** Info π΅
**Check:** Description < 60 or > 400 characters
```yara
// TOO SHORT (< 60):
description = "Detects evil"
// TOO LONG (> 400):
description = "Detects a very complex malware that does many things including ... [300 more chars]"
// CORRECT (60-400 chars):
description = "Detects X malware family used by APT Y in Z campaign targeting financial institutions"
```
---
### MF5 β Author Field Contains URL
**Level:** Info π΅
**Check:** Author field has URL instead of name/handle
```yara
// WRONG:
author = "https://twitter.com/analyst"
// CORRECT:
author = "Analyst Name (@twitterhandle)"
author = "Security Team / Company Name"
```
---
### MF6 β Multiple Author Fields
**Level:** Info π΅
**Check:** Multiple authors as separate fields instead of comma-separated
```yara
// WRONG:
meta:
author = "Alice"
author = "Bob"
author = "Charlie"
// CORRECT:
meta:
author = "Alice, Bob, Charlie"
```
---
### MF7 β Date Format Incorrect
**Level:** Warning π‘
**Check:** Date not in YYYY-MM-DD format
```yara
// WRONG:
date = "15-05-2023"
date = "May 15, 2023"
date = "2023"
// CORRECT:
date = "2023-05-15"
```
---
### MF8 β Reference is Unstable/Private
**Level:** Warning π‘
**Check:** Reference points to private repo, paste bin, or temporary URL
```yara
// PROBLEMATIC:
reference = "https://pastebin.com/raw/abc123" // Expires
reference = "https://private.intel/internal/123" // Inaccessible
// PREFERRED:
reference = "https://blog.public-site.com/analysis"
reference = "https://github.com/vendor/advisory/blob/main/CVE-2023-1234.md"
reference = "Internal Research" // If truly internal
```
---
### MF9 β Missing Score for Detection Rules
**Level:** Info π΅
**Check:** High-confidence malware rule lacks score field
```yara
// SUBOPTIMAL: No score for malware detection
rule MAL_APT_CozyBear_Implant_Apr18 {
meta:
description = "Detects CozyBear implant"
...
}
// CORRECT:
rule MAL_APT_CozyBear_Implant_Apr18 {
meta:
description = "Detects CozyBear implant"
score = 85 // High: direct malware match
...
}
```
---
### MF10 β Score Mismatch with Rule Type
**Level:** Warning π‘
**Check:** Score inconsistent with rule's detection target
```yara
// MISMATCH: Generic heuristic with high score
rule SUSP_Obfuscated_PS1_May23 {
meta:
score = 95 // Too high for suspicious/heuristic
...
}
// MISMATCH: Known malware with low score
rule MAL_APT_CozyBear_Implant_Apr18 {
meta:
score = 45 // Too low for known malware
...
}
// CORRECT:
// SUSP rules: 60-79
// MAL rules: 80-100
```
**Score Guidelines:**
- 0-39: Very Low (capabilities, common packers)
- 40-59: Noteworthy (uncommon packers, anomalies)
- 60-79: Suspicious (heuristics, obfuscation)
- 80-100: High (direct malware/hack tool matches)
---
### MF11 β Using Archive Hash Instead of File Hash
**Level:** Warning π‘
**Check:** Hash is for ZIP/RAR containing sample, not extracted file
```yara
// WRONG: Hash of the ZIP container
hash = "a1b2c3d4..." // Hash of malware.zip
// CORRECT: Hash of extracted malware.exe
hash = "e5f6g7h8..." // Hash of malware.exe from inside zip
```
---
### MF12 β Missing Modified Date for Updated Rules
**Level:** Info π΅
**Check:** Rule has been updated but lacks `modified` field
```yara
// Original
rule MAL_Test_May23 {
meta:
date = "2023-05-15"
...
}
// Updated (should indicate modification)
rule MAL_Test_May23 {
meta:
date = "2023-05-15"
modified = "2023-08-20"
...
}
```
---
## ID β Indentation and Formatting Issues
*From YARA Style Guide β Code formatting*
### ID1 β Inconsistent Indentation
**Level:** Info π΅
**Check:** Mixed tabs/spaces or inconsistent indentation levels
```yara
// WRONG: Mixed indentation
rule Bad {
meta:
description = "inconsistent"
author = "mixed"
strings:
$s1 = "value"
condition:
filesize < 10KB
}
// CORRECT:
rule Good {
meta:
description = "consistent 3-space indent"
author = "Name"
strings:
$s1 = "value"
condition:
filesize < 10KB
}
```
---
### ID2 β No Indentation Inside Rule
**Level:** Warning π‘
**Check:** Rule content at same level as rule keyword
```yara
// WRONG:
rule NoIndent {
meta:
description = "hard to read"
strings:
$s1 = "test"
condition:
filesize < 10KB
}
// CORRECT: Use 3-4 spaces per level
```
---
## TR β String Triad Issues
*From YARA Style Guide β $x/$s/$a/$fp convention*
### TR1 β Missing Pre-Selection String ($a*)
**Level:** Info π΅
**Check:** Rule targets specific file type but lacks $a* pre-selection
```yara
// SUBOPTIMAL: No file type pre-selection
rule MAL_Go_Malware_Jan24 {
strings:
$x1 = "evil payload"
condition:
$x1
}
// CORRECT:
rule MAL_Go_Malware_Jan24 {
strings:
$a1 = "Go build" // Pre-select Go binaries
$x1 = "evil payload"
condition:
$a1 and $x1
}
```
---
### TR2 β Incorrect String Prefix Usage
**Level:** Warning π‘
**Check:** String used inconsistently with its prefix
```yara
// WRONG: $a string used as unique signature
rule MAL_Test_Jan24 {
strings:
$a1 = "evil_unique_string" // Should be $x
condition:
$a1 // Using pre-selection string alone
}
// CORRECT:
rule MAL_Test_Jan24 {
strings:
$a1 = "Go build"
$x1 = "evil_unique_string"
condition:
$a1 and $x1
}
```
---
### TR3 β Missing False Positive Filter
**Level:** Info π΅
**Check:** Generic rule lacks $fp* strings for known benign matches
```yara
// SUBOPTIMAL: Could match legitimate Go tools
rule HKTL_Go_Tool_Jan24 {
strings:
$a1 = "Go build"
$s1 = "main.hack"
condition:
$a1 and $s1
}
// BETTER:
rule HKTL_Go_Tool_Jan24 {
strings:
$a1 = "Go build"
$s1 = "main.hack"
$fp1 = "Copyright by LegitimateCorp"
condition:
$a1 and $s1 and not $fp1
}
```
---
### TR4 β $fp String Not Used in Condition
**Level:** Warning π‘
**Check:** $fp* string defined but not negated in condition
```yara
// WRONG: $fp defined but never checked
rule MAL_Test_Jan24 {
strings:
$s1 = "evil"
$fp1 = "legitimate"
condition:
$s1 // Missing: and not $fp1
}
// CORRECT:
condition:
$s1 and not $fp1
```
---
## SS β String Style Issues
*From YARA Style Guide β String formatting*
### SS1 β Hex String Could Be Text
**Level:** Info π΅
**Check:** Hex string contains only readable ASCII characters
```yara
// SUBOPTIMAL:
$s1 = { 46 72 6F 6D 42 61 73 65 36 34 }
// CORRECT:
$s1 = "FromBase64"
```
**Exception:** Control characters (`\t`, `\n`) acceptable in hex.
---
### SS2 β Long Hex Not Wrapped at 16 Bytes
**Level:** Info π΅
**Check:** Hex string > 16 bytes on single line
```yara
// HARD TO READ:
$s1 = { 2c 20 2a 79 6f 77 2e 69 20 26 20 30 78 46 46 29 3b 0a 20 20 70 72 69 6e 74 66 20 28 28 28 2a 79 6f 77 2e 69 20 26 20 30 78 66 66 29 }
// CORRECT (wrapped at 16):
$s1 = { 2c 20 2a 79 6f 77 2e 69 20 26 20 30 78 46 46 29
3b 0a 20 20 70 72 69 6e 74 66 20 28 28 28 2a 79
6f 77 2e 69 20 26 20 30 78 66 66 29 }
```
---
### SS3 β Hex String Missing ASCII Comment
**Level:** Info π΅
**Check:** Hex string representing ASCII lacks comment
```yara
// SUBOPTIMAL:
$s1 = { 29 29 29 3b 0a 49 45 58 28 0a }
// CORRECT:
/* )));
IEX( */
$s1 = { 29 29 29 3b 0a 49 45 58 28 0a }
```
---
### SS4 β Long Non-Descriptive Identifier
**Level:** Info π΅
**Check:** String identifier unnecessarily verbose
```yara
// VERBOSE:
$string_value_footer_1 = "eval("
$selection_14 = "eval("
// CONCISE:
$s1 = "eval("
$eval = "eval("
```
---
## FM β Condition Formatting Issues
*From YARA Style Guide β Condition structure*
### FM1 β Missing Newline Before AND
**Level:** Info π΅
**Check:** Condition operators on same line
```yara
// SUBOPTIMAL:
condition:
uint16(0) == 0x5a4d and filesize < 300KB and all of ($s*)
// CORRECT:
condition:
uint16(0) == 0x5a4d
and filesize < 300KB
and all of ($s*)
```
---
### FM2 β OR Block Not Indented
**Level:** Info π΅
**Check:** Parentheses for OR conditions not properly indented
```yara
// SUBOPTIMAL:
condition:
uint16(0) == 0x5a4d
and filesize < 300KB
and ( 1 of ($x*) or all of ($s*) )
// CORRECT:
condition:
uint16(0) == 0x5a4d
and filesize < 300KB
and (
1 of ($x*)
or all of ($s*)
)
```
---
### FM3 β Nested OR Without Proper Grouping
**Level:** Info π΅
**Check:** Complex nested conditions lack clear grouping
```yara
// UNCLEAR:
condition:
uint16(0) == 0x5a4d
and 1 of ($x*) or 2 of ($s*) and 3 of them
// CORRECT:
condition:
uint16(0) == 0x5a4d
and (
1 of ($x*)
or (
2 of ($s*)
and 3 of them
)
)
```
---
## RX β Extended Performance Guidelines
*From YARA Performance Guidelines β Manual review items*
### RX1 β Using Hash Loop Instead of String Match
**Level:** Warning π‘
**Check:** Hash calculation in loop instead of direct string match
```yara
// SLOW:
condition:
for any var_sect in pe.sections:
(hash.md5(var_sect.raw_data_offset, 0x100) == "d99eb1e503...")
// FAST:
strings:
$section = { d9 9e b1 e5 03 ca c3 a1 ... }
condition:
$section
```
---
### RX2 β Short String Without Position Check
**Level:** Warning π‘
**Check:** Short string (< 4 bytes) used without `at` position
```yara
// PROBLEMATIC: Searches entire file
strings:
$mz = "MZ"
condition:
$mz
// CORRECT: Use uint or add position
condition:
uint16(0) == 0x5A4D
// OR:
strings:
$mz = "MZ"
condition:
$mz at 0 // Still triggers PA1, but better than no position
```
---
### RX3 β Regex With Unbounded Quantifier
**Level:** Warning π‘
**Check:** Regex uses `.*`, `.+`, or `{x,}` without upper bound
```yara
// SLOW:
$re = /cmd\.exe.*\.dll/
$re = /data.{10,}/ // No upper bound
// BETTER:
$re = /cmd\.{1,50}\.dll/
$re = /data.{10,100}/
```
---
### RX4 β Condition Order Not Short-Circuit Optimized
**Level:** Warning π‘
**Check:** Expensive checks before cheap checks
```yara
// SLOW:
condition:
math.entropy(0, filesize) > 7
and uint16(0) == 0x5A4D
and filesize < 100KB
// FAST:
condition:
uint16(0) == 0x5A4D
and filesize < 100KB
and math.entropy(0, filesize) > 7
```
---
### RX5 β Using Module for Simple Header Check
**Level:** Warning π‘
**Check:** Module imported only for basic file type check
```yara
// SLOW: Parses entire PE
import "pe"
condition: pe.is_pe
// FAST: Header check
condition: uint16(0) == 0x5A4D
```
---
### RX6 β Using Magic Module
**Level:** Warning π‘
**Check:** Magic module used (not available on Windows, slows scanning)
```yara
// SLOW and INCOMPATIBLE:
import "magic"
condition:
magic.mime_type() == "image/gif"
// FAST:
condition:
(uint32be(0) == 0x47494638 and uint16be(4) == 0x3961)
or (uint32be(0) == 0x47494638 and uint16be(4) == 0x3761)
```
---
### RX7 β Loop Over Full File Without Filesize Limit
**Level:** Warning π‘
**Check:** `for` loop without filesize limitation
```yara
// SLOW on large files:
condition:
$mz at 0
and for all i in (1..filesize) : (whatever)
// BETTER:
condition:
$mz at 0
and filesize < 100KB
and for all i in (1..filesize) : (whatever)
```
---
## Summary Table
| ID | Issue | Level | Category |
|----|-------|-------|----------|
|NC1|Missing main category|π‘ Warning|Naming|
|NC2|Incorrect category order|π΅ Info|Naming|
|NC3|Missing date suffix|π΅ Info|Naming|
|NC4|Ambiguous technology tag|π΅ Info|Naming|
|NC5|Platform omission (non-Windows)|π΅ Info|Naming|
|NC6|Modifier not in name|π΅ Info|Naming|
|MF1|Missing mandatory meta field|π‘ Warning|Metadata|
|MF2|Description without "Detects"|π΅ Info|Metadata|
|MF3|Description contains URL|π΅ Info|Metadata|
|MF4|Description length|π΅ Info|Metadata|
|MF5|Author contains URL|π΅ Info|Metadata|
|MF6|Multiple author fields|π΅ Info|Metadata|
|MF7|Date format incorrect|π‘ Warning|Metadata|
|MF8|Unstable/private reference|π‘ Warning|Metadata|
|MF9|Missing score|π΅ Info|Metadata|
|MF10|Score mismatch|π‘ Warning|Metadata|
|MF11|Archive hash vs file hash|π‘ Warning|Metadata|
|MF12|Missing modified date|π΅ Info|Metadata|
|ID1|Inconsistent indentation|π΅ Info|Formatting|
|ID2|No indentation|π‘ Warning|Formatting|
|TR1|Missing pre-selection string|π΅ Info|Strings|
|TR2|Incorrect prefix usage|π‘ Warning|Strings|
|TR3|Missing false positive filter|π΅ Info|Strings|
|TR4|$fp not used in condition|π‘ Warning|Strings|
|SS1|Hex could be text|π΅ Info|Style|
|SS2|Hex not wrapped|π΅ Info|Style|
|SS3|Hex missing comment|π΅ Info|Style|
|SS4|Long identifier|π΅ Info|Style|
|FM1|Missing newline before AND|π΅ Info|Formatting|
|FM2|OR block not indented|π΅ Info|Formatting|
|FM3|Nested OR without grouping|π΅ Info|Formatting|
|RX1|Hash loop vs string|π‘ Warning|Performance|
|RX2|Short string without position|π‘ Warning|Performance|
|RX3|Unbounded quantifier|π‘ Warning|Performance|
|RX4|Condition order|π‘ Warning|Performance|
|RX5|Module for header check|π‘ Warning|Performance|
|RX6|Magic module usage|π‘ Warning|Performance|
|RX7|Loop without filesize limit|π‘ Warning|Performance|
Files in this skill
- README.md
- skill.md
Attribution
Comments
Loading commentsβ¦
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.