Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mishandling invalid actions key type #286

Merged
merged 4 commits into from
Apr 25, 2024

Conversation

Anilm3
Copy link
Collaborator

@Anilm3 Anilm3 commented Apr 25, 2024

If the actions is provided with an incompatible type (i.e. anything but an array), the resulting action mapper is a nullptr rather than a valid structure. This later on can cause a segmentation fault on ddwaf_run.

@Anilm3 Anilm3 requested a review from a team as a code owner April 25, 2024 13:24
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.05%. Comparing base (2fcd3cf) to head (8ff299e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #286      +/-   ##
==========================================
+ Coverage   83.00%   83.05%   +0.04%     
==========================================
  Files         119      119              
  Lines        4743     4744       +1     
  Branches     2249     2249              
==========================================
+ Hits         3937     3940       +3     
+ Misses        311      307       -4     
- Partials      495      497       +2     
Flag Coverage Δ
waf_test 83.05% <100.00%> (+0.04%) ⬆️

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.

@pr-commenter
Copy link

pr-commenter bot commented Apr 25, 2024

Benchmarks

Benchmark execution time: 2024-04-25 13:55:28

Comparing candidate commit 8ff299e in PR branch anilm3/fix-invalid-action-type with baseline commit 2fcd3cf in branch master.

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

scenario:exact_match_matcher.random

  • 🟩 execution_time [-76.510µs; -75.590µs] or [-5.060%; -4.999%]

scenario:is_xss_matcher.random

  • 🟥 execution_time [+5.508ms; +5.514ms] or [+8.187%; +8.196%]

scenario:lowercase_transformer.random

  • 🟩 execution_time [-112.350µs; -111.353µs] or [-6.423%; -6.366%]

scenario:phrase_match_matcher.enforce_word_boundary.random

  • 🟩 execution_time [-2.567ms; -2.566ms] or [-30.441%; -30.420%]

scenario:phrase_match_matcher.random

  • 🟥 execution_time [+279.767µs; +283.037µs] or [+4.599%; +4.653%]

scenario:regex_match_matcher.case_insensitive_flag.random

  • 🟩 execution_time [-722.508µs; -721.082µs] or [-14.925%; -14.895%]

scenario:regex_match_matcher.case_insensitive_option.random

  • 🟩 execution_time [-722.614µs; -721.196µs] or [-14.931%; -14.901%]

scenario:regex_match_matcher.lowercase_transformer.random

  • 🟩 execution_time [-747.298µs; -745.619µs] or [-11.783%; -11.757%]

scenario:remove_nulls_transformer.random

  • 🟥 execution_time [+1.140ms; +1.142ms] or [+12.022%; +12.045%]

scenario:unsigned_equals_matcher.random

  • 🟩 execution_time [-44.457µs; -43.449µs] or [-3.865%; -3.777%]

@Anilm3 Anilm3 merged commit 28e9752 into master Apr 25, 2024
34 of 35 checks passed
@Anilm3 Anilm3 deleted the anilm3/fix-invalid-action-type branch April 25, 2024 14:09
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.

None yet

3 participants