Skip to content

🛡️ Sentinel: Improve control character detection in input validation#102

Merged
amrabed merged 2 commits into
mainfrom
sentinel-fix-control-chars-11125674854379474649
Jun 19, 2026
Merged

🛡️ Sentinel: Improve control character detection in input validation#102
amrabed merged 2 commits into
mainfrom
sentinel-fix-control-chars-11125674854379474649

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

The input validation for control characters was using a naive check c < " ", which only caught characters in the range 0x00-0x1F. This missed the DEL character (0x7F) and other non-printable Unicode characters.

I replaced this check with not c.isprintable() in both project/app.py and scripts/rename.py.

Verified the fix with a new test case in tests/test_app.py and by running the full test suite.


PR created automatically by Jules for task 11125674854379474649 started by @amrabed

…lidation

Updated input validation in `project/app.py` and `scripts/rename.py` to use `str.isprintable()` instead of a naive ASCII range check (`c < " "`). This ensures that the `DEL` character (0x7f) and other non-printable characters are correctly identified and rejected, mitigating risks of terminal injection or UI manipulation.

Added a test case in `tests/test_app.py` to verify the fix for the `DEL` character.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@amrabed amrabed marked this pull request as ready for review June 19, 2026 10:47
@amrabed amrabed self-requested a review as a code owner June 19, 2026 10:47
Comment thread tests/test_app.py Outdated
…lidation (Addressed feedback)

- Replaced naive ASCII range check (`c < " "`) with `str.isprintable()` for robust control character detection.
- Updated `project/app.py` and `scripts/rename.py`.
- Added a test case in `tests/test_app.py` for the `DEL` character.
- Removed unnecessary comment in `tests/test_app.py` as per review feedback.
@amrabed amrabed merged commit 1c15520 into main Jun 19, 2026
3 checks passed
@amrabed amrabed deleted the sentinel-fix-control-chars-11125674854379474649 branch June 19, 2026 10:55
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.

1 participant