Skip to content

fix(schema+config): privacy field denylist + PLAIN logging leak + config path duplication #481

Closed

Description

@Sinity

Problems

name not in content field denylist

schemas/privacy.py:86-129 — _CONTENT_FIELD_NAMES omits name, author, creator, sender, and participant. Fields like user.name can pass through privacy guards into x-polylogue-values enum annotations.

max_length=0 treated as falsy

schemas/privacy.py:219 — max_length or _SAFE_ENUM_MAX_LEN treats max_length=0 (meaning "no limit") as falsy, silently capping at 50. Use max_length if max_length is not None else _SAFE_ENUM_MAX_LEN.

POLYLOGUE_FORCE_PLAIN doesn't suppress log colors

logging.py:148 — ConsoleRenderer(colors=sys.stderr.isatty()) respects TTY but ignores POLYLOGUE_FORCE_PLAIN. Colored log output leaks in plain mode when stderr is a TTY.

Duplicated XDG path resolution

privacy_config.py:139-140 and helper_source_state.py:12 reimplement XDG path resolution instead of importing from polylogue.paths. Maintenance hazard: if _roots.py fallback changes, these diverge.

Config model has no validation

config.py:81-89 — Config dataclass accepts invalid/relative paths with no post-init validation. PrivacyConfig silently falls back to "standard" for invalid level values.

Affected code

  • schemas/privacy.py:86-129 — content field denylist
  • schemas/privacy.py:219 — max_length falsy bug
  • logging.py:148 — PLAIN log color leak
  • privacy_config.py:139-140 — duplicated XDG path
  • helper_source_state.py:12 — duplicated XDG path
  • config.py:81-89 — no validation

Discovered during adversarial audit 2026-04-26.

Activity

  1. Sinity commented on Apr 26, 2026

    @Sinity
    OwnerAuthor

    Partially addressed by #489. Remaining items tracked in this issue.

  2. added a commit that references this issue on Apr 27, 2026
    d2cd2da
  3. added a commit that references this issue on May 7, 2026
    378bc73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:schematype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions