Skip to content

Sanitize sync_my_list errors to resolve CodeQL stack-trace exposure alert - #9

Merged
JPMarhefka merged 2 commits into
mainfrom
copilot/fix-code-scanning-alerts
Aug 12, 2026
Merged

Sanitize sync_my_list errors to resolve CodeQL stack-trace exposure alert#9
JPMarhefka merged 2 commits into
mainfrom
copilot/fix-code-scanning-alerts

Conversation

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Code scanning alert #1 (py/stack-trace-exposure) flagged user-visible exception leakage in list sync responses. This change removes raw exception text from API output while preserving response shape and stage-level failure reporting.

  • Alert remediation

    • Updated /home/runner/work/Partuno/Partuno/services.py in sync_my_list(...) to replace detail: str(exc) with fixed safe messages in:
      • additions error path
      • updates error path
      • removals error path
  • Behavioral impact

    • Clients still receive structured per-stage/per-item errors.
    • Internal exception content is no longer exposed in response payloads.
  • Representative change

    # before
    errors.append({"stage": "additions", "detail": str(exc)})
    
    # after
    errors.append({
        "stage": "additions",
        "detail": "Failed to add one or more parts to the list.",
    })

Validation

  • python -m pytest -q
  • python -m compileall -q .
  • Documentation updated where behavior changed
  • No credentials, tokens, account identifiers, or live provider data added

Safety and compatibility

  • No live provider writes were executed, or the exact authorized test is
    described here.
  • MCP tool annotations and REST/OpenAPI compatibility were considered.
  • Any provider-specific behavior or limitation is documented.

Co-authored-by: JPMarhefka <37427123+JPMarhefka@users.noreply.github.com>
@JPMarhefka
JPMarhefka marked this pull request as ready for review August 12, 2026 07:53
@JPMarhefka
JPMarhefka self-requested a review as a code owner August 12, 2026 07:53
@JPMarhefka
JPMarhefka requested a lite review from Copilot August 12, 2026 07:54
Copilot AI changed the title [WIP] Fix code scanning alert flagged in repository Sanitize sync_my_list errors to resolve CodeQL stack-trace exposure alert Aug 12, 2026
@JPMarhefka
JPMarhefka merged commit 8e29917 into main Aug 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants