Skip to content

URI parsing preprocessor#439

Merged
Anilm3 merged 4 commits into
masterfrom
anilm3/uri-parse-processor
Sep 1, 2025
Merged

URI parsing preprocessor#439
Anilm3 merged 4 commits into
masterfrom
anilm3/uri-parse-processor

Conversation

@Anilm3

@Anilm3 Anilm3 commented Aug 15, 2025

Copy link
Copy Markdown
Collaborator

This PR adds a new preprocessor which parses a URI and extracts its constituent components into a new address. This new address can then be used to evaluate specific parts of a URL without over-complicated and inaccurate regular expressions. An example definition of this preprocessor in configuration can be seen below:

{
  "id": "processor-001",
  "generator": "uri_parse",
  "conditions": [],
  "parameters": {
    "mappings": [
      {
        "inputs": [
          {
            "address": "server.io.net.url"
          }
        ],
        "output": "server.io.net.request.url"
      }
    ]
  },
  "evaluate": true,
  "output": false
}

The output of this preprocessor is a map with the following contents:

{
  "scheme": <string>,
  "userinfo": <string>,
  "host": <string>,
  "port": <unsigned>,
  "path": <string>,
  "query": {},
  "fragment": <string>
}

Related Jiras: APPSEC-58778

@codecov-commenter

codecov-commenter commented Aug 15, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.77108% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.10%. Comparing base (2ccf343) to head (1311d67).
⚠️ Report is 35 commits behind head on master.

Files with missing lines Patch % Lines
src/processor/uri_parse.cpp 92.30% 2 Missing and 3 partials ⚠️
src/uri_utils.cpp 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #439      +/-   ##
==========================================
+ Coverage   85.07%   85.10%   +0.03%     
==========================================
  Files         178      180       +2     
  Lines        9166     9226      +60     
  Branches     4043     4084      +41     
==========================================
+ Hits         7798     7852      +54     
- Misses        545      548       +3     
- Partials      823      826       +3     
Flag Coverage Δ
waf_test 85.10% <92.77%> (+0.03%) ⬆️

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.

@github-actions

github-actions Bot commented Aug 15, 2025

Copy link
Copy Markdown

Artifact Size Comparison 📦

Artifact Previous Release This PR Difference
darwin-arm64::libddwaf.a 86105528 87368232 0.01%
darwin-arm64::libddwaf.a.stripped 4442896 4487152 0.00%
darwin-arm64::libddwaf.dylib 1920368 1939152 0.00%
darwin-universal::libddwaf.a 173548224 176109656 0.01%
darwin-universal::libddwaf.a.stripped 9465600 9562952 0.01%
darwin-universal::libddwaf.dylib 4050288 4069072 0.00%
darwin-x86_64::libddwaf.a 87442648 88741376 0.01%
darwin-x86_64::libddwaf.a.stripped 5022656 5075752 0.01%
darwin-x86_64::libddwaf.dylib 2107008 2109888 0.00%
linux-aarch64::libddwaf.a 70896324 71776140 0.01%
linux-aarch64::libddwaf.a.stripped 11575224 11660584 0.00%
linux-aarch64::libddwaf.so 2427912 2441096 0.00%
linux-armv7::libddwaf.a 62633514 63410016 0.01%
linux-armv7::libddwaf.a.stripped 10576914 10654012 0.00%
linux-armv7::libddwaf.so 2108812 2124948 0.00%
linux-i386::libddwaf.a 60811086 61581926 0.01%
linux-i386::libddwaf.a.stripped 9140778 9206550 0.00%
linux-i386::libddwaf.so 2346940 2358380 0.00%
linux-x86_64::libddwaf.a 71366196 72248660 0.01%
linux-x86_64::libddwaf.a.stripped 11397112 11478264 0.00%
linux-x86_64::libddwaf.so 2616768 2631392 0.00%
windows-arm64::ddwaf.dll 4749824
windows-arm64::ddwaf.lib 11698
windows-arm64::ddwaf_static.lib 56538786
windows-win32::ddwaf.dll 3298304 3343872 0.01%
windows-win32::ddwaf.lib 11922 11922 0.00%
windows-win32::ddwaf_static.lib 47761216 48440688 0.01%
windows-x64::ddwaf.dll 4030976 4072960 0.01%
windows-x64::ddwaf.lib 11698 11698 0.00%
windows-x64::ddwaf_static.lib 55348460 56100664 0.01%
windows-x86_64::libddwaf.a 6263042 6311410 0.00%
windows-x86_64::libddwaf.dll 18798493 18828118 0.00%
windows-x86_64::libddwaf.dll.a 31948 31948 0.00%

@pr-commenter

pr-commenter Bot commented Aug 21, 2025

Copy link
Copy Markdown

Benchmarks clang

Benchmark execution time: 2025-09-01 08:36:06

Comparing candidate commit 1311d67 in PR branch anilm3/uri-parse-processor with baseline commit 2ccf343 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 Aug 21, 2025

Copy link
Copy Markdown

Benchmarks gcc

Benchmark execution time: 2025-09-01 08:36:06

Comparing candidate commit 1311d67 in PR branch anilm3/uri-parse-processor with baseline commit 2ccf343 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 Aug 21, 2025

Copy link
Copy Markdown

Benchmarks clang-pgo

Benchmark execution time: 2025-08-30 22:13:17

Comparing candidate commit 563348c in PR branch anilm3/uri-parse-processor with baseline commit 2ccf343 in branch master.

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

Comment thread src/builder/processor_builder.cpp Outdated
Comment thread src/processor/uri_parse.cpp Outdated
@Anilm3
Anilm3 force-pushed the anilm3/uri-parse-processor branch from dcd6bf4 to 563348c Compare August 30, 2025 21:36
@Anilm3
Anilm3 marked this pull request as ready for review September 1, 2025 08:11
@Anilm3
Anilm3 requested a review from a team as a code owner September 1, 2025 08:11
@Anilm3
Anilm3 force-pushed the anilm3/uri-parse-processor branch from 563348c to 1311d67 Compare September 1, 2025 08:11
@Anilm3
Anilm3 enabled auto-merge (squash) September 1, 2025 08:34
@Anilm3
Anilm3 merged commit 62dca00 into master Sep 1, 2025
56 of 57 checks passed
@Anilm3
Anilm3 deleted the anilm3/uri-parse-processor branch September 1, 2025 08:37
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