Back to skill

Security audit

Ab Predictor

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its marketing scoring purpose, but it automatically executes an unverified sibling Python module if present.

Review before installing. The main scoring tool is local and does not show network, credential, or persistence behavior, but only use it in an environment where the sibling content-resonance-scorer directory is trusted or absent. Be cautious applying its targeted advertising advice in regulated financial, mortgage, veteran, or credit-repair contexts.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
ab_predictor.py:36
Finding

Automatic Execution of an Unverified Sibling Python Module

Content
View full analysis

Vulnerability Details

File Location: ab_predictor.py, lines 36–49
Vulnerability Type: Unsafe dynamic module loading from an implicitly trusted relative path
Risk Level: Medium

Vulnerable Code:

python
def _load_crs():
    """Load content_resonance_scorer from sibling project dir."""
    here = _pl.Path(__file__).parent
    scorer_path = here.parent / "content-resonance-scorer" / "content_resonance_scorer.py"
    if not scorer_path.exists():
        return None
    spec = _ilu.spec_from_file_location("content_resonance_scorer", scorer_path)
    mod = _ilu.module_from_spec(spec)
    spec.loader.exec_module(mod)
    return mod

_CRS = _load_crs()

Technical Analysis

The Skill constructs a path outside its own project directory and executes the Python module found there through exec_module(). It verifies only that the path exists; it does not validate the module's origin, integrity, ownership, permissions, signature, or expected hash.

_load_crs() is called at module initialization, before command-line arguments are parsed. Consequently, the sibling module's top-level code is executed for every invocation, including operations that should be non-executing or low risk, such as --help and --version.

This creates a local code-execution trust boundary: any user, package, or compromised process capable of creating or modifying ../content-resonance-scorer/content_resonance_scorer.py can cause arbitrary Python code to run under the identity of the user or Agent invoking this Skill.

Attack Path

  1. An attacker gains the ability to create or modify the sibling path ../content-resonance-scorer/content_resonance_scorer.py.
  2. The attacker places arbitrary top-level Python code in that file.
  3. A user or Agent invokes ab_predictor.py with any arguments, including --help or --version.
  4. Python imports ab_predictor.py, evaluates _CRS = _load_crs(), and locates the at ...[truncated 1234 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove automatic module execution from the relative sibling directory.
  2. Package the premium backend as an explicit, version-pinned dependency obtained from a trusted source.
  3. Require explicit user opt-in before enabling the optional backend, such as a dedicated --backend argument or trusted configuration setting.
  4. Parse command-line arguments before loading optional executable code. Do not load the backend for --help, --version, or internal-only scoring.
  5. If file-based plugin loading is necessary:
    • Restrict plugins to an administrator-controlled directory.
    • Resolve the path canonically and ensure it remains within the approved directory.
    • Reject files with unsafe ownership or writable permissions.
    • Verify a pinned cryptographic hash or trusted digital signature before import.
    • Fail closed when verification cannot be completed.
  6. Document the backend's trust boundary and installation procedure rather than silently treating any file at the sibling path as trusted.
  7. Add tests confirming that unverified sibling files are never imported and that informational commands do not execute optional backend code.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill dynamically imports and executes Python code from a sibling path outside the current file's trust boundary. If an attacker can place or modify content_resonance_scorer.py in that location, running this skill will execute arbitrary code with the user's privileges, which is far more capability than needed for local A/B scoring.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language labels and rewrite templates include targeting language such as 'Veteran, earned-it framing' and '500-680 score, shame-sensitive,' then prescribe persuasion tactics tailored to those groups. This is a policy-relevant natural-language issue because the file embeds organizationally sensitive audience-treatment guidance in comments and strings without any compliance framing or user safeguards.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · ab_predictor.py (reported line 241)May include surrounding context.

python
f = scored.features
    feats = {}
    for crs_attr, (dim, divisor) in _CRS_FIELD_MAP.items():
        raw = getattr(f, crs_attr, 0.0)
        feats[dim] = min(1.0, raw / divisor)
    feats["_face_first"] = 1.0 if FACE_PATTERN.search(text[:100]) else 0.0
    feats["_word_count"] = float(scored.word_count)

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The code opens a user-supplied path and reads local file contents, but there is no confirmation prompt, visible disclosure at read time, or warning comment/docstring near the operation. Because local file access affects user data handling, this qualifies as a missing user warning for a code file.

Content

No source excerpt is available for this finding.