Count-Based¶
Overview¶
A count crossed a fixed threshold. What separates these from composition is that the count is over indicators of one kind rather than over distinct kinds, and what separates them from corpus behavioral is that the threshold is a configured constant rather than a deviation from a learned baseline.
H036 counts obfuscation indicators on one line. H030 counts added
dependencies weighted by rarity. H045, H052 and H055 count packages in a
cluster. Every threshold is configurable under [thresholds], and every
one was set against the benign corpus rather than chosen.
See Rule Mechanics for the field table, the severity weights and the reserved identifier ranges.
Threat context¶
One swallow does not make a summer, but a swarm of them means the season has turned. Some signals are not a pattern but a rate: how many network calls, how many new dependencies, how many distinct hosts, how many decode steps. One is normal, a dozen is a different animal. The count-based family watches those magnitudes and flags the recipe that crosses a learned threshold, without claiming any single occurrence was wrong.
The single mosquito is not the problem; the swarm is. These rules trade precision for reach: a kitchen-sink build can trip them benignly, so their thresholds are set from the benign corpus's actual distribution rather than from intuition.
Detection mechanisms¶
The rules that make up this category are listed below, each with the series that implements it and the severity it carries. Scoring, matching and identifier allocation are shared across every category: see Rule Mechanics.
Individual rules¶
| Rule | Name | Severity |
|---|---|---|
| H030 | Dependency-Set Expansion | MEDIUM |
| H036 | Shell Obfuscation Density | MEDIUM |
| H045 | Mass Adoption | HIGH |
| H052 | Shared Source Repository | HIGH |
| H055 | Attribute Burst | MEDIUM |
H030: Dependency-Set Expansion¶
- Target: programmatic (delta over dependency arrays × per-dep novelty)
- Severity: MEDIUM (weight 15) - corpus rate 0.13 % (published dependency seed)
-
Category:
dependency -
Condition: A single diff adds 3+
depends/makedepends/optdepends/checkdependsentries whose count × mean rarity exceeds the expansion gate (≥1.5, tuned on corpus).
Why not count alone: Adding 5 deps that are all common (glibc, qt6-base, cmake) is a normal heavy build and should not fire. The signal is count weighted by how rare/novel each added dep is, reusing D001's dependency_observation_count as a rarity proxy. Novel/obscure deps push the magnitude up; common deps contribute near zero.
No double-count with D001: H030 fires on the aggregate pattern (multiple rare deps appearing together), which is a materially different signal from any single dep being novel. Individual D001 per-dep firings remain untouched. This is not the H027 mistake: the aggregate condition captures a different phenomenon (co-occurrence, not individual presence).
Origin: Socket/Snyk dependency-surface profiling - a version bump that expands the dependency graph with obscure entries is the "expand attack surface quietly" shape. D001 already flags each novel dep individually; H030 catches the disproportionate co-occurrence.
H036: Shell Obfuscation Density¶
- Target: programmatic (resolved build-function lines, position-scoped)
- Severity: MEDIUM (weight 15), or HIGH (weight 25) when the reconstructed line reveals an executable action
-
Category:
obfuscation -
Condition: A single added line inside a critical build function (
build(),prepare(),check(),package()) contains 3 or more distinct obfuscation indicators:
| Indicator | Pattern |
|---|---|
| Base64 decode | base64 -d / base64 --decode |
| Hex escape | printf '\x...' |
| Command substitution | $( or ` |
| Eval | eval |
| Pipe to shell | \| bash / \| sh / \| zsh |
| URL shortener | bit.ly, t.co, tinyurl, shorturl, ow.ly, is.gd |
| Quiet wget pipe | wget -q -O - \| |
| Variable expansion with network/shell | ${var}...curl / ${var}...bash |
| ANSI-C quoting (June-W3) | $'...' |
| Variable indirection (June-W3) | ${!var} |
| Empty-quote concatenation (June-W3) | word''word |
A single obfuscation indicator is unusual but can be legitimate (e.g. eval
for dynamic configuration). Three or more on the same line is characteristic
of deliberately hidden behaviour: each layer adds indirection, and the density
itself is the signal.
H045: Mass Adoption¶
- Severity: HIGH (weight 25)
-
Category:
adoption -
Condition: One maintainer submitted at least
[thresholds] h045.min_packages(default 10) package bases withinh045.window_days(default 7).
A split package is one adoption: a single PKGBUILD with twelve pkgname
outputs files twelve package names but one upstream release. The threshold is
therefore counted over distinct pkgbase values, while every output is still
carried in the finding's member list and analysed on its own for content.
H052: Shared Source Repository¶
- Severity: HIGH (weight 25)
-
Category:
adoption -
Condition: At least
[thresholds] h052.min_packages(default 3) otherwise unrelated packages share a source repository. A shared new domain is G001/G010; a shared adoption window from several accounts is G014.
H055: Attribute Burst¶
- Severity: MEDIUM (weight 15)
-
Category:
adoption -
Condition: At least
[thresholds] h055.min_packages(default 5) package bases sharing a maintainer were modified withinh055.window_hours(default 24).
Only modified packages count. H045 already claims the added-package clusters, so counting additions here would report the same maintainer twice.
The count is over distinct pkgbase values, and a family whose bases share one
variant stem (foo, foo-bin, foo-git) stands down: a split package
touching every output in one cycle is one logical update, not a burst across
packages. The member list still carries every output so each is analysed and
shown.
Interpretation¶
- The finding reports the count and the threshold, so the reviewer can judge whether the volume is explained by the package's purpose.
- These are context rules: read alongside the concrete findings they magnify, not as standalone accusations.
- Because traffic and dependency counts drift with ecosystem fashion, their thresholds are the ones most likely to be retuned; treat a persistent benign count finding as a calibration note.