Skip to content

oliver-kriska/claude-elixir-phoenix / targets/dsh/skills/phx-deps-audit

phx-deps-audit

Flagged

Audit Hex deps for supply-chain security risk — bidi chars, compile-time exec, maintainer changes, typosquats, CVEs. Use after mix deps.update, when checking if a package upgrade is safe, or reviewing mix.lock PR diffs.

priv/yara/hex-malware.yar

View on GitHub
// hex-malware.yar — byte-pattern starter rules for /phx:deps-audit.
//
// Soft dep: only runs if `yara` is on PATH. Findings normalize to the
// Phase 1 NDJSON finding shape with rule_id namespaced as yara/<name>.
//
// Targets: detection patterns that are CHEAPER as byte-scans than as
// AST walks. Examples: large base64 blobs (faster than perl regex),
// BEAM bytecode magic embedded as string literal, cross-ecosystem
// npm-attack signatures translated from event-stream/flatmap-stream.

rule large_base64_blob {
    meta:
        description = "Large base64-like literal in source (>=256 chars)"
        rule_id = "yara/large_base64_blob"
        severity = "warn"
        author = "phx-deps-audit"
    strings:
        $b64 = /[A-Za-z0-9+\/]{256,}={0,2}/
    condition:
        $b64 and filesize < 50KB
}

rule beam_magic_in_source {
    meta:
        description = "BEAM bytecode FOR1 magic inside source string literal"
        rule_id = "yara/beam_magic_in_source"
        severity = "block"
        author = "phx-deps-audit"
    strings:
        $for1 = "FOR1"
        $beam_ext = ".beam"
    condition:
        // BEAM files start with FOR1; finding it inside an .ex file's
        // string literal is highly suspicious (loader gadget).
        $for1 in (0..filesize) and any of ($beam_ext)
}

rule gzip_magic_in_source {
    meta:
        description = "Gzip magic bytes in source — possibly embedded payload"
        rule_id = "yara/gzip_magic_in_source"
        severity = "warn"
        author = "phx-deps-audit"
    strings:
        $gzip = { 1F 8B 08 }
    condition:
        $gzip and filesize < 50KB
}

rule zip_magic_in_source {
    meta:
        description = "Zip magic bytes in source — possibly embedded payload"
        rule_id = "yara/zip_magic_in_source"
        severity = "warn"
        author = "phx-deps-audit"
    strings:
        $zip = { 50 4B 03 04 }
    condition:
        $zip and filesize < 50KB
}

rule event_stream_flatmap_signature {
    meta:
        description = "Cross-ecosystem npm-attack signature (event-stream/flatmap-stream)"
        rule_id = "yara/event_stream_flatmap_signature"
        severity = "warn"
        author = "phx-deps-audit"
    strings:
        $a = "flatmap-stream"
        $b = "flatmap_stream"
    condition:
        any of them
}

rule curl_attacker_pattern {
    meta:
        description = "curl invocation with non-https or http-only literal URL (exfil pattern)"
        rule_id = "yara/curl_attacker_pattern"
        severity = "warn"
        author = "phx-deps-audit"
    strings:
        $c1 = "curl"
        $exfil = /http:\/\/[^"'\s]+/
    condition:
        all of them
}
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall