Skip to content

Conversation

@reuvensh
Copy link
Contributor

@reuvensh reuvensh commented Nov 27, 2025

Description

Related Issue

Fixes #

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements

Changes Made

Testing

  • All existing tests pass
  • Added new tests for the changes
  • Tested manually (describe below)

Manual Testing Steps

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code where necessary
  • I have added/updated docstrings for all functions and classes
  • I have added type annotations to all functions and classes
  • My changes generate no new linting errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Screenshots (if applicable)

Additional Context


Note

Masks sensitive data in exception tracebacks for both text and JSON formatters, adds tests, and bumps version to 1.1.1.

  • Logging/Masking:
    • Enhance AbstractMaskedLogger._mask_sensitive_data to mask record.msg, record.exc_text, and fallback to masking exc_info (traceback) by populating record.exc_text.
    • Override MaskerFormatterJson.formatException to mask secrets in serialized exceptions.
  • Tests:
    • Add tests to ensure traceback masking in text (MaskerFormatter) and JSON (MaskerFormatterJson) outputs.
  • Version:
    • Bump version to 1.1.1 in maskerlogger/__init__.py and pyproject.toml.

Written by Cursor Bugbot for commit 98e4f22. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

# Mask sensitive data in the formatted exception string
if found_matching_regex := self.regex_matcher.match_regex_to_line(formatted):
return self._mask_secret(formatted, found_matching_regex)
return formatted
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing timeout exception handling in formatException

The formatException method in MaskerFormatterJson lacks error handling for TimeoutException. When regex_matcher.match_regex_to_line or _mask_secret encounters a timeout, the exception propagates uncaught, potentially crashing the logging process. This is inconsistent with _mask_sensitive_data which wraps similar operations in a try-except block to handle timeouts gracefully.

Fix in Cursor Fix in Web

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2025

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.66%. Comparing base (8d80d9e) to head (98e4f22).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
maskerlogger/masker_formatter.py 81.25% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
- Coverage   92.65%   91.66%   -0.99%     
==========================================
  Files           4        4              
  Lines         177      192      +15     
==========================================
+ Hits          164      176      +12     
- Misses         13       16       +3     
Flag Coverage Δ
unittests 91.66% <82.35%> (-0.99%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aviadlevy aviadlevy merged commit 69f833f into oxsecurity:main Nov 27, 2025
8 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.

3 participants