securesauce / precli

Precaution CLI - command line static application security testing tool
https://precli.readthedocs.io/
Other
14 stars 3 forks source link

Mult-line underlining not working properly in plain renderer #529

Open ericwb opened 1 month ago

ericwb commented 1 month ago

Describe the bug The plain renderer doesn't work properly when the location is a multi-line string.

To Reproduce Steps to reproduce the behavior:

$ .tox/py312/bin/precli tests/unit/rules/python/stdlib/argparse/examples/argparse_add_argument_password.py --plain
PY027: Invocation of Process Using Visible Sensitive Information
  File "tests/unit/rules/python/stdlib/argparse/examples/argparse_add_argument_password.py", line 
20, in <module>
    parser.add_argument(                                                                            
    ^                                                                                               
Error: Secrets in CLI arguments are leaked to command history, logs, ps output, etc.

Found 1 errors, 0 warnings, and 0 notes in 1 files and 26 lines of code.

Expected behavior Should underline entire multi-line

Version

precli 0.5.12.dev8
Copyright 2024 Secure Sauce LLC
License BUSL-1.1: Business Source License 1.1 <https://spdx.org/licenses/BUSL-1.1.html>
  Python 3.12.4 (main, Jun 25 2024, 11:01:48) [Clang 15.0.0 (clang-1500.3.9.4)]

Additional context