loopx icon indicating copy to clipboard operation
loopx copied to clipboard

[Bug]: public-safe-outbound reports common private home-path values as clean

Open JasonBuildAI opened this issue 1 month ago • 0 comments

Preflight

  • [x] I searched existing issues and discussions for this behavior.
  • [x] This report is not an unpatched security vulnerability.
  • [x] The report and attachments contain no credentials or private/internal material.

Issue origin

Observed or reproduced in a real environment (native Windows source checkout).

LoopX version or commit

4191b7d966da09a7b0e136353f331e8d5e677dec (main), source checkout with uv sync --extra test.

Host or runtime surface

Codex CLI (native Windows). The rule is host-independent, but these spellings come directly from ordinary host-generated home paths.

LoopX area

Capability or extension (providers, adapters, skills)

Problem

The builtin, default-enabled public-safe-outbound capability is the documented fail-closed scrub before content goes to an external repository. Its README promises that private absolute paths are detected and that the scanner prefers false positives over misses. The current private_abs_path rule still returns ok: true for three common private-home spellings:

  • a home path that ends at the user segment, such as /home/example or C:\Users\example (the form printed by $HOME, %USERPROFILE%, and many command/config examples);
  • a Windows path whose account name contains a non-ASCII character, such as C:\Users\示例用户\project;
  • a Windows path whose root or keyword differs in case, such as c:\users\example\project (Windows paths are case-insensitive by default).

This is a privacy-boundary failure, not a cosmetic miss: an operator can scan a note, runbook, config, or diff containing their real account name/home directory, receive the public-safe success result, and then publish the material. C:\Users\示例用户\project directly exposes a real Windows account name; /home/example exposes the account name and home layout. The miss affects every user who relies on the scanner for the exact value normally produced by their environment. The severity is a silent false-negative in a safety gate, and current main still carries it.

This is a follow-up to #6223. That change added native/escaped separator spellings and explicitly deferred case-insensitive spellings and non-ASCII account names as separately-decided gaps. It also retained the rule's requirement for a trailing separator. The three gaps share one rule and one false-clean outcome, so this issue covers the remaining variants without changing the named private roots.

Minimal reproduction

Create a synthetic directory containing these files (all names and account names below are placeholders):

control.txt       control=/home/example/project
home.txt          home=/home/example
windows.txt       win=C:\Users\example
unicode.txt       unicode=C:\Users\示例用户\project
lowercase.txt     lower=c:\users\example\project
public.txt        public=C:\work\example

Then run the shipped scan entrypoint:

uv run --extra test python -m loopx.capabilities.public_safe_outbound.scan_cli \
  --scan-root <synthetic-directory> --format json

The same result is visible through scanner.scan_texts:

from loopx.capabilities.public_safe_outbound.scanner import scan_texts

cases = {
    "posix-control": "/home/example/project",
    "home-value": "/home/example",
    "windows-value": r"C:\Users\example",
    "unicode-user": r"C:\Users\示例用户\project",
    "lowercase-root": r"c:\users\example\project",
    "public-control": r"C:\work\example",
}
for label, value in cases.items():
    result = scan_texts({label: "value=" + value})
    print(label, result.ok, [hit.rule_id for hit in result.hits])

Expected behavior

All five private-path cases report rule_id: "private_abs_path" and make the scan fail (ok: false, CLI exit 1). The public.txt/C:\work\example control stays clean. The roots considered private do not expand beyond the existing Users, home, data00, and root keywords.

Actual behavior

Only the pre-existing POSIX control with a trailing separator is detected. The other four private values return ok: true with no hits. A directory containing only those four files returns {"hit_count": 0, ..., "ok": true} and exit 0.

Sanitized diagnostics

{"case": "posix-control", "hits": ["private_abs_path"], "ok": false}
{"case": "home-value", "hits": [], "ok": true}
{"case": "windows-value", "hits": [], "ok": true}
{"case": "unicode-user", "hits": [], "ok": true}
{"case": "lowercase-root", "hits": [], "ok": true}
{"case": "public-control", "hits": [], "ok": true}

The shipped CLI over the four private variant files alone returned:

{"hit_count": 0, "hits": [], "ok": true, "schema_version": "public_safe_outbound_scan_v0", "unscanned_count": 0, "unscanned_reasons": []}

Exit code: 0.

Additional context

  • Follow-up to merged #6223; prior issue: #6220.
  • The existing POSIX Users, home, data00, and root roots remain the intended policy. This report does not ask to classify every absolute path as private.
  • I intend to submit a small regression-tested fix for this rule.

JasonBuildAI avatar Oct 24 '26 09:10 JasonBuildAI