Back to skill

Security audit

Pdf Rename

Security checks for vulnerabilities and agentic risk

Overview

This PDF renaming skill is mostly purpose-related, but it ships stale manifests and helper scripts that can rename or move user-accessible files in unsafe, under-scoped ways.

Review before installing. Use only on a disposable copy of a PDF folder, remove bundled manifest files and folder-specific helper scripts, run preview first, and do not use --execute unless the manifest was freshly generated for that exact folder. Avoid the LLM parsing path for confidential PDFs unless you are comfortable sending extracted text to the configured local gateway.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/execute.py:38
Finding

Manifest-Controlled Source Paths Permit Out-of-Scope File Moves

Content
View full analysis

Vulnerability Details

File Location: scripts/execute.py, lines 38-42 and 60-84
Vulnerability Type: Untrusted path usage and missing directory confinement
Risk Level: High

Vulnerable Code

python
# Load manifest (prefer verified, fallback to auto)
manifest_path = MANIFEST_IN if os.path.exists(MANIFEST_IN) else MANIFEST_FALLBACK
if not os.path.exists(manifest_path):
    print('[ERROR] No manifest found. Run extract.py first.')
    return
with open(manifest_path, 'r', encoding='utf-8') as f:
    manifest = json.load(f)

ready = [m for m in manifest if m.get('status') == 'ready']
skipped = [m for m in manifest if m.get('status') != 'ready']

print(f'\n[DRY RUN] {len(ready)} files to rename, {len(skipped)} skipped\n')

# Assign duplicate counters
dup_counters = {}
for m in ready:
    if m.get('is_duplicate') and m.get('duplicate_group'):
        grp = m['duplicate_group']
        dup_counters[grp] = dup_counters.get(grp, 0) + 1

errors = []

if not dry_run:
    backup_dir = os.path.join(folder, f'_backup_{datetime.now().strftime("%Y%m%d_%H%M%S")}')
    os.makedirs(backup_dir, exist_ok=True)
    print(f'[BACKUP] {backup_dir}\n')

for m in ready:
    new_name = build_filename(m, counter=dup_counters.get(m['duplicate_group']) if m.get('is_duplicate') else None)
    dst = os.path.join(folder, new_name)

    # Handle name collisions
    base, ext = os.path.splitext(new_name)
    counter = 1
    while os.path.exists(dst) and os.path.abspath(dst) != os.path.abspath(m['filepath']):
        new_name = f'{base} ({counter}){ext}'
        dst = os.path.join(folder, new_name)
        counter += 1

    if dry_run:
        print(f'  {m["filename"]}')
        print(f'    -> {new_name}')
        print()
    else:
        try:
            if os.path.exists(m['filepath']):
                shutil.copy2(m['filepath'], os.path.join(backup_dir, m['filename']))
            shut
...[truncated 2770 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not trust or use an absolute filepath stored in the manifest during execution. Derive the source from the selected folder and validated basename:

    python
    root = os.path.realpath(folder)
    filename = m["filename"]
    
    if filename != os.path.basename(filename):
        raise ValueError("Manifest filename must not contain path components")
    
    src = os.path.realpath(os.path.join(root, filename))
    if os.path.commonpath([root, src]) != root:
        raise ValueError("Source path escapes the selected folder")
    
  2. Require the source to be a regular file and to have a .pdf suffix:

    python
    if not os.path.isfile(src) or not filename.lower().endswith(".pdf"):
        raise ValueError("Source must be a regular PDF file")
    
  3. Apply equivalent confinement validation to the destination and backup paths.

  4. Reject symlinks or explicitly define and enforce a safe symlink policy.

  5. Store only relative filenames in manifests, not absolute source paths.

  6. Record the canonical extraction root in the manifest and require it to match the execution root.

  7. Do not distribute generated manifest.json or manifest_verified.json files. Generate them for each folder at runtime.

  8. Abort execution if the manifest is stale, references missing files, contains duplicate source entries, or was not generated for the requested folder.

  9. Add automated tests covering absolute paths, .. traversal, path separators in filenames, symlinks, stale manifests, and sources outside the selected root.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/_finish_gametheory.py:1
Finding

Undocumented Helper Performs Immediate Bulk Renaming and Continues After Backup Failure

Content
View full analysis

Vulnerability Details

File Location: scripts/_finish_gametheory.py, lines 1-43
Vulnerability Type: Unsafe import-time filesystem modification and non-atomic backup/rename workflow
Risk Level: Medium

Vulnerable Code

python
import json, os, shutil, sys

sys.stdout.reconfigure(encoding='utf-8')

folder = r'C:\Users\taizun\Desktop\Document\文献\LLM\LLMxGame Theory'
manifest_out = os.path.join(os.path.dirname(__file__), 'manifest_verified.json')

with open(manifest_out, 'r', encoding='utf-8') as f:
    m = json.load(f)

def sanitize(name):
    for ch in '<>:"/\\|?*':
        name = name.replace(ch, '')
    return name.strip()

backup_dir = os.path.join(folder, f'_backup_20260530_120302')
os.makedirs(backup_dir, exist_ok=True)

for entry in m[9:]:  # only entries 10-15 (0-indexed)
    fname = entry['filename']
    src = os.path.join(folder, fname)
    year = entry['year'] or '????'
    venue = entry['venue'] or ''
    title = entry['title']
    new_name = f'[{year}]' + (f' [{venue}]' if venue else '') + ' ' + title + '.pdf'
    new_name = sanitize(new_name)
    dst = os.path.join(folder, new_name)

    # Backup
    try:
        shutil.copy2(src, os.path.join(backup_dir, fname))
    except Exception as e:
        print(f'[BACKUP FAIL] {fname}: {e}')

    # Rename using os.rename (Unicode-safe on Windows)
    try:
        os.rename(src, dst)
        print(f'[OK] {fname}')
        print(f'     -> {new_name}')
    except Exception as e:
        print(f'[FAIL] {fname}: {e}')

print('\nDone')

Technical Analysis

This helper performs filesystem modifications at module scope. It has no if __name__ == '__main__' guard, so both direct execution and Python import trigger directory creation, backup attempts, and file renames.

The script also:

  • Uses a hard-coded personal directory rather than an explicit user-selected folder.
  • Has no preview mode or conf ...[truncated 2224 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove this one-off migration helper from the distributed Skill if it is no longer required.

  2. If retained, move all operational code into a function and add a main guard:

    python
    def main():
        ...
    
    if __name__ == "__main__":
        main()
    
  3. Require the target folder as an explicit command-line argument; remove the hard-coded personal path.

  4. Default to preview mode and require an explicit --execute flag for changes.

  5. Display the complete rename plan and request confirmation before execution.

  6. Abort the rename for an entry if its backup fails. Do not treat backup failure as a recoverable warning.

  7. Use a newly generated timestamped backup directory and verify each copied file before renaming.

  8. Canonicalize source, destination, and backup paths and require them to remain within the selected folder.

  9. Validate manifest filenames as basenames and require regular PDF files.

  10. Detect destination collisions and generate deterministic non-conflicting names.

  11. Implement rollback for partial failures or use a two-phase transaction-like workflow.

  12. Remove generated manifests and personal absolute paths from the distributed package.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (58)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code is related to the declared renaming purpose, since it renames academic PDFs into the described filename format and creates backups. However, it does not implement the advertised three-stage pipeline (Extract → Verify → Rename); it only performs the final rename step based on an existing manifest. It is also narrowly scoped to a specific hardcoded Windows folder and only processes entries m[9:], described as entries 10-15, rather than acting as a general-purpose folder organizer triggered by user requests. So the description overstates the breadth and workflow of the skill compared with the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description says the skill standardizes PDF filenames using an Extract → Verify → Rename pipeline for batch organization. The provided code instead edits JSON manifest entries with predefined title/year/venue values for the first several items, sets verification/status fields, and outputs a new manifest file. There is no file-renaming logic, no PDF processing/extraction, and no general-purpose batch workflow. While metadata verification is loosely related, the primary behavior of this chunk is manual manifest correction, which materially differs from the declared end-user purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents an active PDF renaming utility that processes folders and renames files based on extracted and verified metadata. However, this code chunk is only a data file containing hardcoded verified metadata for a specific set of PDFs. It does not access files, rename anything, enrich metadata dynamically, or implement triggers/pipeline stages. While such data could support a larger renaming system, this chunk by itself does not match the declared operational behavior, so the description materially overstates what the provided code actually does.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This file is named and placed like a skill manifest, but it actually contains a large corpus of extracted PDF contents, file metadata, and local paths instead of a constrained behavioral manifest. In an agent system, treating untrusted document text as manifest/config data creates a prompt-injection and data-boundary failure: downstream components may ingest adversarial content as trusted instructions or overload context with irrelevant material.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill documentation describes capabilities that read manifests, write verified data files, rename PDFs, and optionally use an LLM gateway API, but it declares no explicit tool scope or permission boundaries. In an agent environment, this increases the chance of over-broad file and network access being granted implicitly, which can enable unintended file modification or external data transmission beyond the user’s expectations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The activation phrases are broad enough to match common, ambiguous user requests such as organizing papers or renaming PDFs, which can cause the skill to trigger in contexts where the user did not intend file-modifying behavior. Because this skill ultimately writes manifests and can rename files, overbroad activation raises the risk of accidental invocation and unintended changes to local documents.

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.

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
93% confidence
Finding

The script performs bulk file modification by renaming multiple PDFs automatically, with only a best-effort backup and no interactive confirmation, dry-run, or safety gate before changing user files. In the context of a file-organizing skill, this is risky because incorrect metadata, filename collisions, wrong folder targeting, or partial failures could cause unintended file changes and operational data loss for the user.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code adds general HTTP model invocation capability to a skill whose stated purpose is file renaming, expanding its trust boundary beyond local filesystem processing. Even if intended for metadata extraction, the capability allows document contents to be sent off-process, which is security-relevant because users may reasonably expect a local organizer to keep files local.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The prompt includes up to 4000 characters of extracted PDF text and sends it to an HTTP API without any visible warning, consent flow, or privacy notice. This is dangerous because users may unknowingly expose sensitive research content, PII, or confidential manuscripts during what appears to be a simple local renaming task.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script transmits extracted PDF text, plus filename and year hints, to an HTTP chat-completions API even though the skill is presented as a local PDF renaming/metadata-enrichment workflow. Academic PDFs often contain unpublished papers, proprietary drafts, or sensitive author information, so sending document contents to another service without explicit disclosure or consent creates a real data-exposure risk.

Content

No source excerpt is available for this finding.

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · scripts/llm_parse.py (reported line 52)May include surrounding context.

python
"temperature": 0.1,
        }).encode("utf-8")

        req = urllib.request.Request(
            "http://127.0.0.1:4892/v1/chat/completions",
            data=payload,
            headers={"Content-Type": "application/json", "Authorization": "Bearer local"},

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.

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
88% confidence
Finding

The file includes very large amounts of irrelevant extracted book and paper text inside what appears to be an operational manifest, including repeated table-of-contents material and long OCR bodies. Even if the content is benign, embedding bulk untrusted text in a manifest can stuff downstream LLM context, degrade security review, hide malicious instructions in data, and cause the rename pipeline to make decisions on irrelevant material.

Content

Scanner excerpt · scripts/manifest.json (reported line 199)May include surrounding context.

json
"filepath": "C:/Users/taizun/Desktop/tmp\\Ch-var-adv.pdf",
    "year_hint": null,
    "status": "needs_llm_review",
    "raw_text": "Contents\n10 Advanced variance reduction 3\n10.1 Grid-based stratification . . . . . . . . . . . . . . . . . . . . . . . 3\n10.2 Stratification and antithetics . . . . . . . . . . . . . . . . . . . . 6\n10.3 Latin hypercube sampling . . . . . . . . . . . . . . . . . . . . . . 8\n10.4 Orthogonal array sampling . . . . . . . . . . . . . . . . . . . . . 12\n10.5 Adaptive importance sampling . . . . . . . . . . . . . . . . . . . 17\n10.6 Nonparametric AIS . . . . . . . . . . . . . . . . . . . . . . . . . 28\n10.7 Generalized antithetic sampling . . . . . . . . . . . . . . . . . . . 36\n10.8 Control variates with antithetics and stratification . . . . . . . . 37\n10.9 Bridge, umbrella and path sampling . . . . . . . . . . . . . . . . 39\nEnd notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51\nExercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55\n1\n2 Contents\n© Art Owen 2009–2013 do not distribute or post electronically without\nauthor’s permission\n10\nAdvanced variance reduction\nThis chapter collects together some advanced and specialized topics in vari-\nance reduction. They are generalizations, extensions and hybrids of methods\npreviously considered.\nWe begin with § 10.1 on grid-based stratification, suitable for low dimensions\nIn dimension d it improves the Monte Carlo RMSE to O(n−1/2−1/d). In § 10.2\nwe apply antithetic sampling within those strata, yielding a method of Haber\nwith RMSE O(n−1/2−2/d). Then § 10.3 presents Latin hypercube sampling, a\nstratification method suitable for large or even unbounded dimension. We round\nout our mini-chapter on advanced stratification with § 10.4 on orthogonal array\nsampling, which is very well suited to intermediate dimensionalities.\nImportance sampling can provide great efficiency gains, but it is difficult to\ndo well and a poor choice can s
...[truncated 25 chars]

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
88% confidence
Finding

The file includes very large amounts of irrelevant extracted book and paper text inside what appears to be an operational manifest, including repeated table-of-contents material and long OCR bodies. Even if the content is benign, embedding bulk untrusted text in a manifest can stuff downstream LLM context, degrade security review, hide malicious instructions in data, and cause the rename pipeline to make decisions on irrelevant material.

Content

Scanner excerpt · scripts/manifest.json (reported line 199)May include surrounding context.

json
"filepath": "C:/Users/taizun/Desktop/tmp\\Ch-var-adv.pdf",
    "year_hint": null,
    "status": "needs_llm_review",
    "raw_text": "Contents\n10 Advanced variance reduction 3\n10.1 Grid-based stratification . . . . . . . . . . . . . . . . . . . . . . . 3\n10.2 Stratification and antithetics . . . . . . . . . . . . . . . . . . . . 6\n10.3 Latin hypercube sampling . . . . . . . . . . . . . . . . . . . . . . 8\n10.4 Orthogonal array sampling . . . . . . . . . . . . . . . . . . . . . 12\n10.5 Adaptive importance sampling . . . . . . . . . . . . . . . . . . . 17\n10.6 Nonparametric AIS . . . . . . . . . . . . . . . . . . . . . . . . . 28\n10.7 Generalized antithetic sampling . . . . . . . . . . . . . . . . . . . 36\n10.8 Control variates with antithetics and stratification . . . . . . . . 37\n10.9 Bridge, umbrella and path sampling . . . . . . . . . . . . . . . . 39\nEnd notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51\nExercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55\n1\n2 Contents\n© Art Owen 2009–2013 do not distribute or post electronically without\nauthor’s permission\n10\nAdvanced variance reduction\nThis chapter collects together some advanced and specialized topics in vari-\nance reduction. They are generalizations, extensions and hybrids of methods\npreviously considered.\nWe begin with § 10.1 on grid-based stratification, suitable for low dimensions\nIn dimension d it improves the Monte Carlo RMSE to O(n−1/2−1/d). In § 10.2\nwe apply antithetic sampling within those strata, yielding a method of Haber\nwith RMSE O(n−1/2−2/d). Then § 10.3 presents Latin hypercube sampling, a\nstratification method suitable for large or even unbounded dimension. We round\nout our mini-chapter on advanced stratification with § 10.4 on orthogonal array\nsampling, which is very well suited to intermediate dimensionalities.\nImportance sampling can provide great efficiency gains, but it is difficult to\ndo well and a poor choice can s
...[truncated 25 chars]

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
88% confidence
Finding

The file includes very large amounts of irrelevant extracted book and paper text inside what appears to be an operational manifest, including repeated table-of-contents material and long OCR bodies. Even if the content is benign, embedding bulk untrusted text in a manifest can stuff downstream LLM context, degrade security review, hide malicious instructions in data, and cause the rename pipeline to make decisions on irrelevant material.

Content

Scanner excerpt · scripts/manifest.json (reported line 199)May include surrounding context.

json
"filepath": "C:/Users/taizun/Desktop/tmp\\Ch-var-adv.pdf",
    "year_hint": null,
    "status": "needs_llm_review",
    "raw_text": "Contents\n10 Advanced variance reduction 3\n10.1 Grid-based stratification . . . . . . . . . . . . . . . . . . . . . . . 3\n10.2 Stratification and antithetics . . . . . . . . . . . . . . . . . . . . 6\n10.3 Latin hypercube sampling . . . . . . . . . . . . . . . . . . . . . . 8\n10.4 Orthogonal array sampling . . . . . . . . . . . . . . . . . . . . . 12\n10.5 Adaptive importance sampling . . . . . . . . . . . . . . . . . . . 17\n10.6 Nonparametric AIS . . . . . . . . . . . . . . . . . . . . . . . . . 28\n10.7 Generalized antithetic sampling . . . . . . . . . . . . . . . . . . . 36\n10.8 Control variates with antithetics and stratification . . . . . . . . 37\n10.9 Bridge, umbrella and path sampling . . . . . . . . . . . . . . . . 39\nEnd notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51\nExercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55\n1\n2 Contents\n© Art Owen 2009–2013 do not distribute or post electronically without\nauthor’s permission\n10\nAdvanced variance reduction\nThis chapter collects together some advanced and specialized topics in vari-\nance reduction. They are generalizations, extensions and hybrids of methods\npreviously considered.\nWe begin with § 10.1 on grid-based stratification, suitable for low dimensions\nIn dimension d it improves the Monte Carlo RMSE to O(n−1/2−1/d). In § 10.2\nwe apply antithetic sampling within those strata, yielding a method of Haber\nwith RMSE O(n−1/2−2/d). Then § 10.3 presents Latin hypercube sampling, a\nstratification method suitable for large or even unbounded dimension. We round\nout our mini-chapter on advanced stratification with § 10.4 on orthogonal array\nsampling, which is very well suited to intermediate dimensionalities.\nImportance sampling can provide great efficiency gains, but it is difficult to\ndo well and a poor choice can s
...[truncated 25 chars]

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
88% confidence
Finding

The file includes very large amounts of irrelevant extracted book and paper text inside what appears to be an operational manifest, including repeated table-of-contents material and long OCR bodies. Even if the content is benign, embedding bulk untrusted text in a manifest can stuff downstream LLM context, degrade security review, hide malicious instructions in data, and cause the rename pipeline to make decisions on irrelevant material.

Content

Scanner excerpt · scripts/manifest.json (reported line 199)May include surrounding context.

json
"filepath": "C:/Users/taizun/Desktop/tmp\\Ch-var-adv.pdf",
    "year_hint": null,
    "status": "needs_llm_review",
    "raw_text": "Contents\n10 Advanced variance reduction 3\n10.1 Grid-based stratification . . . . . . . . . . . . . . . . . . . . . . . 3\n10.2 Stratification and antithetics . . . . . . . . . . . . . . . . . . . . 6\n10.3 Latin hypercube sampling . . . . . . . . . . . . . . . . . . . . . . 8\n10.4 Orthogonal array sampling . . . . . . . . . . . . . . . . . . . . . 12\n10.5 Adaptive importance sampling . . . . . . . . . . . . . . . . . . . 17\n10.6 Nonparametric AIS . . . . . . . . . . . . . . . . . . . . . . . . . 28\n10.7 Generalized antithetic sampling . . . . . . . . . . . . . . . . . . . 36\n10.8 Control variates with antithetics and stratification . . . . . . . . 37\n10.9 Bridge, umbrella and path sampling . . . . . . . . . . . . . . . . 39\nEnd notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51\nExercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55\n1\n2 Contents\n© Art Owen 2009–2013 do not distribute or post electronically without\nauthor’s permission\n10\nAdvanced variance reduction\nThis chapter collects together some advanced and specialized topics in vari-\nance reduction. They are generalizations, extensions and hybrids of methods\npreviously considered.\nWe begin with § 10.1 on grid-based stratification, suitable for low dimensions\nIn dimension d it improves the Monte Carlo RMSE to O(n−1/2−1/d). In § 10.2\nwe apply antithetic sampling within those strata, yielding a method of Haber\nwith RMSE O(n−1/2−2/d). Then § 10.3 presents Latin hypercube sampling, a\nstratification method suitable for large or even unbounded dimension. We round\nout our mini-chapter on advanced stratification with § 10.4 on orthogonal array\nsampling, which is very well suited to intermediate dimensionalities.\nImportance sampling can provide great efficiency gains, but it is difficult to\ndo well and a poor choice can s
...[truncated 25 chars]

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
88% confidence
Finding

The file includes very large amounts of irrelevant extracted book and paper text inside what appears to be an operational manifest, including repeated table-of-contents material and long OCR bodies. Even if the content is benign, embedding bulk untrusted text in a manifest can stuff downstream LLM context, degrade security review, hide malicious instructions in data, and cause the rename pipeline to make decisions on irrelevant material.

Content

Scanner excerpt · scripts/manifest.json (reported line 199)May include surrounding context.

json
"filepath": "C:/Users/taizun/Desktop/tmp\\Ch-var-adv.pdf",
    "year_hint": null,
    "status": "needs_llm_review",
    "raw_text": "Contents\n10 Advanced variance reduction 3\n10.1 Grid-based stratification . . . . . . . . . . . . . . . . . . . . . . . 3\n10.2 Stratification and antithetics . . . . . . . . . . . . . . . . . . . . 6\n10.3 Latin hypercube sampling . . . . . . . . . . . . . . . . . . . . . . 8\n10.4 Orthogonal array sampling . . . . . . . . . . . . . . . . . . . . . 12\n10.5 Adaptive importance sampling . . . . . . . . . . . . . . . . . . . 17\n10.6 Nonparametric AIS . . . . . . . . . . . . . . . . . . . . . . . . . 28\n10.7 Generalized antithetic sampling . . . . . . . . . . . . . . . . . . . 36\n10.8 Control variates with antithetics and stratification . . . . . . . . 37\n10.9 Bridge, umbrella and path sampling . . . . . . . . . . . . . . . . 39\nEnd notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51\nExercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55\n1\n2 Contents\n© Art Owen 2009–2013 do not distribute or post electronically without\nauthor’s permission\n10\nAdvanced variance reduction\nThis chapter collects together some advanced and specialized topics in vari-\nance reduction. They are generalizations, extensions and hybrids of methods\npreviously considered.\nWe begin with § 10.1 on grid-based stratification, suitable for low dimensions\nIn dimension d it improves the Monte Carlo RMSE to O(n−1/2−1/d). In § 10.2\nwe apply antithetic sampling within those strata, yielding a method of Haber\nwith RMSE O(n−1/2−2/d). Then § 10.3 presents Latin hypercube sampling, a\nstratification method suitable for large or even unbounded dimension. We round\nout our mini-chapter on advanced stratification with § 10.4 on orthogonal array\nsampling, which is very well suited to intermediate dimensionalities.\nImportance sampling can provide great efficiency gains, but it is difficult to\ndo well and a poor choice can s
...[truncated 25 chars]

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
88% confidence
Finding

This repeated context-stuffing pattern shows the manifest is being used as a container for long-form document contents rather than narrowly scoped configuration. In an LLM-assisted skill, that increases the chance that irrelevant or hostile document text dominates context and interferes with extraction, verification, or safe rename decisions.

Content

Scanner excerpt · scripts/manifest.json (reported line 215)May include surrounding context.

json
"filepath": "C:/Users/taizun/Desktop/tmp\\Ch-var-basic.pdf",
    "year_hint": null,
    "status": "needs_llm_review",
    "raw_text": "Contents\n8 V ariance reduction 3\n8.1 Overview of variance reduction . . . . . . . . . . . . . . . . . . . 3\n8.2 Antithetics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5\n8.3 Example: expected log return . . . . . . . . . . . . . . . . . . . . 8\n8.4 Stratification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10\n8.5 Example: stratified compound Poisson . . . . . . . . . . . . . . . 14\n8.6 Common random numbers . . . . . . . . . . . . . . . . . . . . . 17\n8.7 Conditioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24\n8.8 Example: maximum Dirichlet . . . . . . . . . . . . . . . . . . . . 26\n8.9 Control variates . . . . . . . . . . . . . . . . . . . . . . . . . . . 28\n8.10 Moment matching and reweighting . . . . . . . . . . . . . . . . . 33\nEnd notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35\nExercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38\n1\n2 Contents\n© Art Owen 2009–2013,2018 do not distribute or post electronically without\nauthor’s permission\n8\nVariance reduction\nMonte Carlo integration typically has an error variance of the form σ2/n. We\nget a better answer by sampling with a larger value of n, but the computing\ntime grows with n. Sometimes we can find a way to reduce σ instead. To do\nthis, we construct a new Monte Carlo problem with the same answer as our\noriginal one but with a lower σ. Methods to do this are known as variance\nreduction techniques.\nThe techniques can be placed into groups, though no taxonomy is quite\nperfect. First we will look at antithetic sampling, stratification, and common\nrandom numbers. These methods all improve efficiency by sampling the input\nvalues more strategically. Next we will consider conditioning and control vari-\nates. These methods take advantage of closed form solutions 
...[truncated 25 chars]

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
88% confidence
Finding

This repeated context-stuffing pattern shows the manifest is being used as a container for long-form document contents rather than narrowly scoped configuration. In an LLM-assisted skill, that increases the chance that irrelevant or hostile document text dominates context and interferes with extraction, verification, or safe rename decisions.

Content

Scanner excerpt · scripts/manifest.json (reported line 215)May include surrounding context.

json
"filepath": "C:/Users/taizun/Desktop/tmp\\Ch-var-basic.pdf",
    "year_hint": null,
    "status": "needs_llm_review",
    "raw_text": "Contents\n8 V ariance reduction 3\n8.1 Overview of variance reduction . . . . . . . . . . . . . . . . . . . 3\n8.2 Antithetics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5\n8.3 Example: expected log return . . . . . . . . . . . . . . . . . . . . 8\n8.4 Stratification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10\n8.5 Example: stratified compound Poisson . . . . . . . . . . . . . . . 14\n8.6 Common random numbers . . . . . . . . . . . . . . . . . . . . . 17\n8.7 Conditioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24\n8.8 Example: maximum Dirichlet . . . . . . . . . . . . . . . . . . . . 26\n8.9 Control variates . . . . . . . . . . . . . . . . . . . . . . . . . . . 28\n8.10 Moment matching and reweighting . . . . . . . . . . . . . . . . . 33\nEnd notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35\nExercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38\n1\n2 Contents\n© Art Owen 2009–2013,2018 do not distribute or post electronically without\nauthor’s permission\n8\nVariance reduction\nMonte Carlo integration typically has an error variance of the form σ2/n. We\nget a better answer by sampling with a larger value of n, but the computing\ntime grows with n. Sometimes we can find a way to reduce σ instead. To do\nthis, we construct a new Monte Carlo problem with the same answer as our\noriginal one but with a lower σ. Methods to do this are known as variance\nreduction techniques.\nThe techniques can be placed into groups, though no taxonomy is quite\nperfect. First we will look at antithetic sampling, stratification, and common\nrandom numbers. These methods all improve efficiency by sampling the input\nvalues more strategically. Next we will consider conditioning and control vari-\nates. These methods take advantage of closed form solutions 
...[truncated 25 chars]

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
88% confidence
Finding

This repeated context-stuffing pattern shows the manifest is being used as a container for long-form document contents rather than narrowly scoped configuration. In an LLM-assisted skill, that increases the chance that irrelevant or hostile document text dominates context and interferes with extraction, verification, or safe rename decisions.

Content

Scanner excerpt · scripts/manifest.json (reported line 215)May include surrounding context.

json
"filepath": "C:/Users/taizun/Desktop/tmp\\Ch-var-basic.pdf",
    "year_hint": null,
    "status": "needs_llm_review",
    "raw_text": "Contents\n8 V ariance reduction 3\n8.1 Overview of variance reduction . . . . . . . . . . . . . . . . . . . 3\n8.2 Antithetics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5\n8.3 Example: expected log return . . . . . . . . . . . . . . . . . . . . 8\n8.4 Stratification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10\n8.5 Example: stratified compound Poisson . . . . . . . . . . . . . . . 14\n8.6 Common random numbers . . . . . . . . . . . . . . . . . . . . . 17\n8.7 Conditioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24\n8.8 Example: maximum Dirichlet . . . . . . . . . . . . . . . . . . . . 26\n8.9 Control variates . . . . . . . . . . . . . . . . . . . . . . . . . . . 28\n8.10 Moment matching and reweighting . . . . . . . . . . . . . . . . . 33\nEnd notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35\nExercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38\n1\n2 Contents\n© Art Owen 2009–2013,2018 do not distribute or post electronically without\nauthor’s permission\n8\nVariance reduction\nMonte Carlo integration typically has an error variance of the form σ2/n. We\nget a better answer by sampling with a larger value of n, but the computing\ntime grows with n. Sometimes we can find a way to reduce σ instead. To do\nthis, we construct a new Monte Carlo problem with the same answer as our\noriginal one but with a lower σ. Methods to do this are known as variance\nreduction techniques.\nThe techniques can be placed into groups, though no taxonomy is quite\nperfect. First we will look at antithetic sampling, stratification, and common\nrandom numbers. These methods all improve efficiency by sampling the input\nvalues more strategically. Next we will consider conditioning and control vari-\nates. These methods take advantage of closed form solutions 
...[truncated 25 chars]

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
88% confidence
Finding

This repeated context-stuffing pattern shows the manifest is being used as a container for long-form document contents rather than narrowly scoped configuration. In an LLM-assisted skill, that increases the chance that irrelevant or hostile document text dominates context and interferes with extraction, verification, or safe rename decisions.

Content

Scanner excerpt · scripts/manifest.json (reported line 215)May include surrounding context.

json
"filepath": "C:/Users/taizun/Desktop/tmp\\Ch-var-basic.pdf",
    "year_hint": null,
    "status": "needs_llm_review",
    "raw_text": "Contents\n8 V ariance reduction 3\n8.1 Overview of variance reduction . . . . . . . . . . . . . . . . . . . 3\n8.2 Antithetics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5\n8.3 Example: expected log return . . . . . . . . . . . . . . . . . . . . 8\n8.4 Stratification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10\n8.5 Example: stratified compound Poisson . . . . . . . . . . . . . . . 14\n8.6 Common random numbers . . . . . . . . . . . . . . . . . . . . . 17\n8.7 Conditioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24\n8.8 Example: maximum Dirichlet . . . . . . . . . . . . . . . . . . . . 26\n8.9 Control variates . . . . . . . . . . . . . . . . . . . . . . . . . . . 28\n8.10 Moment matching and reweighting . . . . . . . . . . . . . . . . . 33\nEnd notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35\nExercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38\n1\n2 Contents\n© Art Owen 2009–2013,2018 do not distribute or post electronically without\nauthor’s permission\n8\nVariance reduction\nMonte Carlo integration typically has an error variance of the form σ2/n. We\nget a better answer by sampling with a larger value of n, but the computing\ntime grows with n. Sometimes we can find a way to reduce σ instead. To do\nthis, we construct a new Monte Carlo problem with the same answer as our\noriginal one but with a lower σ. Methods to do this are known as variance\nreduction techniques.\nThe techniques can be placed into groups, though no taxonomy is quite\nperfect. First we will look at antithetic sampling, stratification, and common\nrandom numbers. These methods all improve efficiency by sampling the input\nvalues more strategically. Next we will consider conditioning and control vari-\nates. These methods take advantage of closed form solutions 
...[truncated 25 chars]

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
88% confidence
Finding

This repeated context-stuffing pattern shows the manifest is being used as a container for long-form document contents rather than narrowly scoped configuration. In an LLM-assisted skill, that increases the chance that irrelevant or hostile document text dominates context and interferes with extraction, verification, or safe rename decisions.

Content

Scanner excerpt · scripts/manifest.json (reported line 215)May include surrounding context.

json
"filepath": "C:/Users/taizun/Desktop/tmp\\Ch-var-basic.pdf",
    "year_hint": null,
    "status": "needs_llm_review",
    "raw_text": "Contents\n8 V ariance reduction 3\n8.1 Overview of variance reduction . . . . . . . . . . . . . . . . . . . 3\n8.2 Antithetics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5\n8.3 Example: expected log return . . . . . . . . . . . . . . . . . . . . 8\n8.4 Stratification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10\n8.5 Example: stratified compound Poisson . . . . . . . . . . . . . . . 14\n8.6 Common random numbers . . . . . . . . . . . . . . . . . . . . . 17\n8.7 Conditioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24\n8.8 Example: maximum Dirichlet . . . . . . . . . . . . . . . . . . . . 26\n8.9 Control variates . . . . . . . . . . . . . . . . . . . . . . . . . . . 28\n8.10 Moment matching and reweighting . . . . . . . . . . . . . . . . . 33\nEnd notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35\nExercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38\n1\n2 Contents\n© Art Owen 2009–2013,2018 do not distribute or post electronically without\nauthor’s permission\n8\nVariance reduction\nMonte Carlo integration typically has an error variance of the form σ2/n. We\nget a better answer by sampling with a larger value of n, but the computing\ntime grows with n. Sometimes we can find a way to reduce σ instead. To do\nthis, we construct a new Monte Carlo problem with the same answer as our\noriginal one but with a lower σ. Methods to do this are known as variance\nreduction techniques.\nThe techniques can be placed into groups, though no taxonomy is quite\nperfect. First we will look at antithetic sampling, stratification, and common\nrandom numbers. These methods all improve efficiency by sampling the input\nvalues more strategically. Next we will consider conditioning and control vari-\nates. These methods take advantage of closed form solutions 
...[truncated 25 chars]

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
88% confidence
Finding

Another large raw text block is embedded directly in the manifest, confirming a systemic design issue rather than a one-off anomaly. This increases attack surface for prompt injection, obscures true configuration, and can exhaust context windows or bias LLM classification toward unrelated content.

Content

Scanner excerpt · scripts/manifest.json (reported line 231)May include surrounding context.

json
"filepath": "C:/Users/taizun/Desktop/tmp\\Ch-var-is.pdf",
    "year_hint": null,
    "status": "needs_llm_review",
    "raw_text": "Contents\n9 Importance sampling 3\n9.1 Basic importance sampling . . . . . . . . . . . . . . . . . . . . . 4\n9.2 Self-normalized importance sampling . . . . . . . . . . . . . . . . 8\n9.3 Importance sampling diagnostics . . . . . . . . . . . . . . . . . . 11\n9.4 Example: PERT . . . . . . . . . . . . . . . . . . . . . . . . . . . 13\n9.5 Importance sampling versus acceptance-rejection . . . . . . . . . 17\n9.6 Exponential tilting . . . . . . . . . . . . . . . . . . . . . . . . . . 18\n9.7 Modes and Hessians . . . . . . . . . . . . . . . . . . . . . . . . . 19\n9.8 General variables and stochastic processes . . . . . . . . . . . . . 21\n9.9 Example: exit probabilities . . . . . . . . . . . . . . . . . . . . . 23\n9.10 Control variates in importance sampling . . . . . . . . . . . . . . 25\n9.11 Mixture importance sampling . . . . . . . . . . . . . . . . . . . . 27\n9.12 Multiple importance sampling . . . . . . . . . . . . . . . . . . . 31\n9.13 Positivisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33\n9.14 What-if simulations . . . . . . . . . . . . . . . . . . . . . . . . . 35\nEnd notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37\nExercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40\n1\n2 Contents\n© Art Owen 2009–2013,2018 do not distribute or post electronically without\nauthor’s permission\n9\nImportance sampling\nIn many applications we want to compute µ = E(f(X)) where f(x) is nearly\nzero outside a region A for which P(X ∈ A) is small. The set A may have\nsmall volume, or it may be in the tail of the X distribution. A plain Monte\nCarlo sample from the distribution of X could fail to have even one point inside\nthe region A. Problems of this type arise in high energy physics, Bayesian\ninference, rare event simulation for finance and insurance, and rendering
...[truncated 26 chars]

Static analysis

No suspicious patterns detected.