Skip to content

fix(security): secret sanitizer regex word boundary hardening and artifact name guard #116

Closed

Description

@dan-petty

Problem Statement

The secret sanitizer's OpenAI and Anthropic key patterns (sk-[A-Za-z0-9_-]{20,} and sk-ant-[A-Za-z0-9_-]{20,}) in devops_cli.security.sanitizer lack word boundaries (\b), causing legitimate hyphenated tokens and task file paths (e.g. docs/agent/tasks/task-090-infracost-finops-cloud-cost.md) to be corrupted into ta<masked-openai-key>.

Proposed Changes

  • Enforce boundary anchors \bsk-[A-Za-z0-9_-]{20,}\b and \bsk-ant-[A-Za-z0-9_-]{20,}\b in _SECRET_PATTERNS.
  • Distinguish between secret literals and safe filesystem paths.
  • Expand unit tests in tests/test_consolidation_security_sanitizer.py covering task-* filenames and compound identifiers.

Acceptance Criteria

  • Zero false masking of task-* filenames across reviews and artifacts.
  • 100% test pass on secret masking and zero regressions in devops ci.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p0-criticalscope/securitytype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions