Skip to content

Hidden ASCII Matcher#411

Merged
Anilm3 merged 8 commits into
masterfrom
anilm3/hidden-ascii
Jun 4, 2025
Merged

Hidden ASCII Matcher#411
Anilm3 merged 8 commits into
masterfrom
anilm3/hidden-ascii

Conversation

@Anilm3

@Anilm3 Anilm3 commented Jun 3, 2025

Copy link
Copy Markdown
Collaborator

This PR introduces a matcher, called hidden_ascii_match, for identifying strings containing hidden ASCII, i.e. characters in the unicode range [U+E0000, U+E007F]. These characters mirror the ASCII range and are often used for prompt injection, more information can be found here.

Related Jiras: APPSEC-57854

@codecov-commenter

codecov-commenter commented Jun 3, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 84.61538% with 18 lines in your changes missing coverage. Please review.

Project coverage is 85.33%. Comparing base (e8fb3cf) to head (771b7ab).

Files with missing lines Patch % Lines
src/utf8.cpp 74.60% 8 Missing and 8 partials ⚠️
src/dynamic_string.hpp 88.88% 1 Missing ⚠️
src/matcher/hidden_ascii_match.cpp 93.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #411      +/-   ##
==========================================
- Coverage   85.38%   85.33%   -0.06%     
==========================================
  Files         173      175       +2     
  Lines        8897     8946      +49     
  Branches     3906     3924      +18     
==========================================
+ Hits         7597     7634      +37     
- Misses        498      504       +6     
- Partials      802      808       +6     
Flag Coverage Δ
waf_test 85.33% <84.61%> (-0.06%) ⬇️

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.

@pr-commenter

pr-commenter Bot commented Jun 3, 2025

Copy link
Copy Markdown

Benchmarks clang

Benchmark execution time: 2025-06-04 17:59:09

Comparing candidate commit 771b7ab in PR branch anilm3/hidden-ascii with baseline commit e8fb3cf in branch master.

Found 0 performance improvements and 1 performance regressions! Performance is the same for 0 metrics, 0 unstable metrics.

scenario:global-benchmark.random.clang

  • 🟥 execution_time [+23.152ms; +23.167ms] or [+9.583%; +9.589%]

@pr-commenter

pr-commenter Bot commented Jun 3, 2025

Copy link
Copy Markdown

Benchmarks gcc

Benchmark execution time: 2025-06-04 18:01:51

Comparing candidate commit 771b7ab in PR branch anilm3/hidden-ascii with baseline commit e8fb3cf in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@pr-commenter

pr-commenter Bot commented Jun 3, 2025

Copy link
Copy Markdown

Benchmarks clang-pgo

Benchmark execution time: 2025-06-04 17:32:00

Comparing candidate commit 8946a12 in PR branch anilm3/hidden-ascii with baseline commit e8fb3cf in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@Anilm3
Anilm3 marked this pull request as ready for review June 3, 2025 14:47
@Anilm3
Anilm3 requested a review from a team as a code owner June 3, 2025 14:47

@Taiki-San Taiki-San left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the hidden ascii match and the UTF8 code, only a minor comment

Comment thread src/matcher/hidden_ascii_match.cpp

@Taiki-San Taiki-San left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The matcher look good :)

Comment thread src/utf8.cpp
Comment thread src/dynamic_string.hpp
Comment thread src/matcher/hidden_ascii_match.cpp
Comment thread src/utf8.cpp
@Anilm3
Anilm3 merged commit 31c61e9 into master Jun 4, 2025
51 checks passed
@Anilm3
Anilm3 deleted the anilm3/hidden-ascii branch June 4, 2025 18:08
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.

4 participants