Back to skill

Security audit

Досье на человека

Security checks for vulnerabilities and agentic risk

Overview

The skill discloses a Perplexity-based dossier workflow, but it also profiles living people broadly and can read sibling task files or fetch arbitrary cited URLs, creating privacy and isolation risks.

Install only if you intend to run authorized professional background research on living people and are comfortable sending the subject's name, queries, and factual claims to Perplexity. Avoid using it in shared or multi-tenant task-drive environments until input resolution is limited to the current task and source URL fetching blocks local/private/internal network targets. Treat its local state files as sensitive dossier data.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/verify_facts.py:174
Finding

Cross-Task Dossier Discovery and Unauthorized File Access

Content
View full analysis

Vulnerability Details

File Location: scripts/verify_facts.py:174-270; additional exposure in scripts/guide.py:131-157 and reuse by scripts/render_dossier.py:1193-1203
Vulnerability Type: Cross-task workspace access and tenant isolation failure
Risk Level: High

Vulnerable Code

python
def task_drive_roots() -> list:
    roots = []
    state = os.environ.get("OUROBOROS_SKILL_STATE_DIR")
    if state:
        for parent in pathlib.Path(state).resolve().parents:
            cand = parent / "task_drives"
            if cand.is_dir():
                roots.append(cand)
                break
    for cand in (pathlib.Path("/data/task_drives"),
                 pathlib.Path.home() / "ouroboros-data" / "data" / "task_drives"):
        if cand.is_dir() and cand not in roots:
            roots.append(cand)
    return roots


def find_in_task_drives(rel: pathlib.Path):
    best = None
    recent = []
    AMBIGUOUS.clear()
    now = time.time()
    for root in task_drive_roots():
        try:
            dirs = [d for d in root.iterdir() if d.is_dir()]
        except OSError:
            continue
        for d in dirs:
            f = d / rel
            try:
                if f.is_file():
                    m = f.stat().st_mtime
                    if now - m <= CONCURRENT_WINDOW_SEC:
                        recent.append(f)
                    if now - m <= FRESH_INPUT_HOURS * 3600 and (best is None or m > best[0]):
                        best = (m, f)
            except OSError:
                continue
    if len(recent) > 1:
        AMBIGUOUS.extend(str(f) for f in recent)
        return None
    return best[1] if best else None


def resolve_input(raw: str) -> tuple:
    p = pathlib.Path(raw).expanduser()
    tried = []
    candidates = [p]
    if not p.is_absolute():
        v = os.environ.get("OUROBOROS_TASK_DRIVE")
  
...[truncated 4577 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict input lookup to the current OUROBOROS_TASK_DRIVE.
  2. If the current task directory is unavailable, require an explicit absolute path rather than scanning global task roots.
  3. Remove fallback enumeration of /data/task_drives and ~/ouroboros-data/data/task_drives.
  4. Remove sibling-task enumeration from guide.py status; inspect only the current task's files.
  5. If cross-task access is an intended administrative feature, require a platform-issued task identifier and verify ownership or an explicit authorization capability before opening the file.
  6. Canonicalize the selected path with resolve() and verify that it is contained within the authorized current-task root.
  7. Do not use freshness or filename uniqueness as authorization controls.
  8. Add tests proving that a relative filename cannot resolve to a sibling task, even when that sibling file is newer or is the only matching candidate.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/verify_facts.py:705
Finding

Server-Side Request Forgery Through Unrestricted Source URL Verification

Content
View full analysis

Vulnerability Details

File Location: scripts/verify_facts.py:705-770
Vulnerability Type: Server-Side Request Forgery
Risk Level: Medium

Vulnerable Code

python
def fetch_source_text(url: str, timeout: float = 20.0) -> tuple[str, str]:
    """Text of a source page. Returns text and an error reason."""
    timeout = min(timeout, time_left())
    if timeout < 3:
        return "", "не хватило времени до дедлайна"
    try:
        req = urllib.request.Request(url, headers={
            "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) "
                          "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124 Safari/537.36",
            "Accept-Language": "ru,en;q=0.8",
        })
        with urllib.request.urlopen(req, timeout=timeout) as resp:
            raw = resp.read(1_500_000)
            ctype = str(resp.headers.get("Content-Type") or "").lower()
            charset = resp.headers.get_content_charset() or ""
    except Exception as exc:
        return "", f"{type(exc).__name__}: {str(exc)[:90]}"
    if raw[:5] == b"%PDF-" or "application/pdf" in ctype:
        return "", "PDF — текст страницы не читается"
    html_text = ""
    for enc in [charset, "utf-8", "cp1251"]:
        if not enc:
            continue
        try:
            html_text = raw.decode(enc)
            break
        except (LookupError, UnicodeDecodeError):
            continue
    if not html_text:
        html_text = raw.decode("utf-8", "replace")
    import html as _html
    text = _html.unescape(_ANY_TAG.sub(" ", _TAG_RE.sub(" ", html_text)))
    return re.sub(r"\s+", " ", text), ""


def check_cited_source(claim: dict, srcmap: dict[str, dict]) -> tuple[str, str]:
    core = numeric_core(claim.get("value") or "")
    if not core:
        return "НЕ ПРОВЕРИТЬ", "величину не разобрать"
    urls = [str((srcmap.get(str(n)) or {}).get("url") or "")
    
...[truncated 3706 chars]
Remediation
View remediation

Remediation Suggestions

  1. Parse URLs with urllib.parse.urlsplit() and allow only exact http and https schemes.
  2. Reject URLs containing user-info components, malformed hostnames, unsupported ports, or ambiguous numeric IP representations.
  3. Resolve the hostname before connecting and reject every loopback, private, link-local, multicast, reserved, unspecified, and documentation-range address for both IPv4 and IPv6.
  4. Disable automatic redirects or implement a redirect handler that repeats full scheme, hostname, port, and resolved-address validation for every hop.
  5. Protect against DNS rebinding by connecting only to the validated resolved address while preserving the intended HTTP Host value and TLS hostname verification.
  6. Apply an outbound network allowlist where practical. Source verification should normally access public web endpoints only.
  7. Block cloud metadata destinations at both the application and network-policy layers.
  8. Retain strict response-size and timeout limits, and restrict accepted content types to those required for verification.
  9. Add tests for loopback addresses, RFC1918 ranges, IPv6 private and link-local addresses, encoded IP forms, redirect chains, and hostnames that resolve to internal addresses.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (30)

Tainted flow: 'req' from os.environ.get (line 247, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/search.py (reported line 251)May include surrounding context.

python
SONAR_URL, data=json.dumps(body).encode(),
            headers={"Authorization": "Bearer " + key, "Content-Type": "application/json"})
        try:
            with urllib.request.urlopen(req, timeout=per_try) as resp:
                payload = json.load(resp)
            answer = str((payload.get("choices") or [{}])[0].get("message", {}).get("content") or "")
            answer = re.sub(r"<think>.*?</think>", "", answer, flags=re.S).strip()

Tainted flow: 'req' from os.environ.get (line 907, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Скрипт загружает URL из dossier.json и делает прямой urllib.request.urlopen без allowlist/denylist и без ограничения на локальные адреса. Если входной JSON или source URL контролируется атакующим, это даёт SSRF-поведение: можно инициировать запросы к произвольным внутренним или чувствительным хостам, а также использовать навык как сетевой прокси.

Content

Scanner excerpt · scripts/verify_facts.py (reported line 716)May include surrounding context.

python
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124 Safari/537.36",
            "Accept-Language": "ru,en;q=0.8",
        })
        with urllib.request.urlopen(req, timeout=timeout) as resp:
            raw = resp.read(1_500_000)
            ctype = str(resp.headers.get("Content-Type") or "").lower()
            charset = resp.headers.get_content_charset() or ""

Tainted flow: 'req' from os.environ.get (line 907, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/verify_facts.py (reported line 911)May include surrounding context.

python
SONAR_URL, data=json.dumps(body).encode(),
            headers={"Authorization": "Bearer " + key, "Content-Type": "application/json"})
        try:
            with urllib.request.urlopen(req, timeout=per_try) as resp:
                payload = json.load(resp)
            break
        except urllib.error.HTTPError as exc:

Tainted flow: 'req' from os.environ.get (line 907, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/verify_facts.py (reported line 987)May include surrounding context.

python
"""
    req = urllib.request.Request("https://api.perplexity.ai/", method="HEAD")
    try:
        with urllib.request.urlopen(req, timeout=timeout):
            return ""
    except urllib.error.HTTPError:
        return ""

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is configured to trigger on essentially any request about a living person, including vague prompts like 'who is X' or 'who am I meeting.' That broad activation surface can cause the agent to collect and compile extensive personal dossiers in situations where the user did not explicitly request OSINT-style profiling, increasing privacy, compliance, and misuse risk.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'env' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description advertises broad natural-language invocation cues without clear scope boundaries, which makes accidental or overbroad routing more likely. In a skill designed to gather information about living persons over the network, that can lead to disproportionate data collection and profiling beyond user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The markdown explicitly requires 'Язык: только русский' and says the dossier must be entirely in Russian. This forces a specific language regardless of user preference and does not offer a language choice or opt-in, which is a natural-language policy violation under the locale/language rule.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This playbook directs the agent to send queries about a real person to an external service (Perplexity Sonar) to build a dossier, but it does not require any user warning, consent flow, or data-minimization check before transmission. In the context of a skill explicitly designed to compile a dossier on a living person, this increases privacy and compliance risk because personal data, inferred identifiers, and sensitive search intent may be disclosed to a third party without transparency or authorization.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
77% confidence
Finding

The module-level documentation says guide.py works without network access or disk writes, but the status path imports other modules with side effects that may update caches or status files during initialization or normal execution. This mismatch can cause operators or higher-level agents to invoke the script under false assumptions, leading to unintended state changes on disk in an analysis workflow that is supposed to be read-only.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code embeds the skill’s user-facing guidance in a single fixed language, Russian, and does not indicate any option to select another language. That creates a natural-language policy concern because the skill effectively forces a locale/language choice on users without explicit opt-in or documented justification.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
72% confidence
Finding

The module docstring claims the script does not touch the network, yet it imports and calls helper modules whose documented behavior depends on Sonar/external-source workflows. Even if this file mostly reads cached logs/status, the misleading contract is dangerous in an agent setting because operators may grant or review permissions based on false assumptions, and future changes in imported modules could silently introduce network side effects.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Comments and behavior indicate that dates and month names are forcibly converted to Russian because the dossier is assumed to be read by a Russian-speaking executive. This is a natural-language locale policy constraint embedded in the skill, and the file does not present it as an explicit user-selectable option or justified region-specific requirement.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/render_dossier.py (reported line 1677)May include surrounding context.

python
# Имя по шаблону, если агент дал своё («son_dossier.docx») или не дал никакого.
        parts = re.sub(r"\(.*?\)", " ", as_text(data.get("name"))).split()
        who = f"{parts[-1]} {parts[0]}" if len(parts) >= 2 else (parts[0] if parts else "без имени")
        when = as_text(data.get("prepared"))[:10] or __import__("time").strftime("%Y-%m-%d")
        std = re.sub(r'[\\/:*?"<>|]', "", f"Досье — {who} — {when}.docx")
        if raw_out:
            print(f"[i] Имя файла «{raw_out}» не по шаблону — сохраняю как «{std}»")

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Манифест описывает render_dossier.py как компонент для выпуска двухстраничного Word-документа и того же текста в чат, а проверку относит к verify_facts.py, поиск — к search.py. Здесь же код блокирует сборку, если не пройдена триангуляция, если недостаточно Sonar-запросов или если меньше половины источников пришло из ответов search.py, то есть берет на себя дополнительные policy/validation-функции за пределами простого рендера.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script persistently stores research answers, source URLs, and the target person's identity in local JSONL files for later briefing, which creates a privacy and data-retention risk for sensitive dossiers on living people. In this skill context, that is more dangerous because the skill is explicitly designed to gather personal background information before meetings, so local artifacts may expose profiling data beyond the immediate task.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The script sends user queries about a living person to an external Perplexity API endpoint and is explicitly built to collect personal dossier information. In this skill context, that external transmission is materially sensitive because it exports profiling data, names, organizations, and generated research outside the local environment, creating privacy, compliance, and third-party handling risks.

Content

Scanner excerpt · scripts/search.py (reported line 46)May include surrounding context.

python
sys.dont_write_bytecode = True

SONAR_URL = "https://api.perplexity.ai/chat/completions"
MAX_QUERIES = 8          # свои вопросы — до восьми за вызов, как в методике
LOG_NAME = "search_log.jsonl"
RESEARCH_NAME = "research.jsonl"

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

Скрипт по дизайну отправляет утверждения из досье во внешний сервис Perplexity Sonar для проверки фактов. Поскольку досье содержит персональные данные о живом человеке и, вероятно, чувствительные биографические сведения, такая передача наружу является реальным риском приватности и комплаенса, даже если она функционально ожидаема.

Content

Scanner excerpt · scripts/verify_facts.py (reported line 130)May include surrounding context.

python
merged.append(part)
        out.extend(merged)
    return out
SONAR_URL = "https://api.perplexity.ai/chat/completions"

# Предела нет и быть не должно: проверяется КАЖДОЕ утверждение. Сначала
# стоял срез на 15 — он молча отсекал хвост, и агент отчитывался «все 15

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Функции task_drive_roots/find_in_task_drives ищут dossier.json в каталогах других задач и могут читать самый свежий совпавший файл, если путь не абсолютный. Это создаёт межзадачное смешение данных и риск несанкционированного доступа к чужому досье, что особенно опасно для навыка, собирающего персональные данные о живых людях.

Content

No source excerpt is available for this finding.