Skip to content

fix(appsec): block RASP matches when a library wraps the abort error - #11335

Open
CarlesDD wants to merge 4 commits into
masterfrom
ccapell/APPSEC-71813/rasp-find-wrapped-abort-errors
Open

CarlesDD wants to merge 4 commits into
masterfrom
ccapell/APPSEC-71813/rasp-find-wrapped-abort-errors

Conversation

@CarlesDD

Copy link
Copy Markdown
Contributor

What does this PR do?

RASP blocking actions now block the request when a library wraps the abort error and keeps it in a property other than cause (such as sequelize or typeorm).

Motivation

RASP blocks the request when the abort error reaches the framework error handlers, but the lookup only followed cause. With these libraries the operation was stopped, but the user got the application's 500 and the span wasn't marked as blocked.

APPSEC-71813

Additional Notes

  • stack is skipped because, before Node.js 22, reading its descriptor formats the stack trace and calls Error.prepareStackTrace, increasing the overhead.

Known limitations

  • node-fetch 2/3 and got 11–13 only copy the message of the abort error, so these requests still get the application's error response.

@CarlesDD
CarlesDD requested a review from a team as a code owner November 19, 2026 18:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T06:35:50.131467Z e79f5f5 New commits
🔒 Security Review ✅ Completed 2026-11-24T06:38:06.085721Z e79f5f5 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dd-octo-sts

dd-octo-sts Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 9.56 MB
Deduped: 10.31 MB
No deduping: 10.31 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.5.3 | 131.25 kB | 531.9 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.15%. Comparing base (7d57720) to head (e79f5f5).
⚠️ Report is 29 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #11335     +/-   ##
=========================================
  Coverage   99.15%   99.15%             
=========================================
  Files        1127     1136      +9     
  Lines      187108   188442   +1334     
  Branches       82       86      +4     
=========================================
+ Hits       185519   186858   +1339     
+ Misses       1588     1584      -4     
+ Partials        1        0      -1     
Flag Coverage Δ
ai-guard 63.33% <ø> (+0.08%) ⬆️
apm-capabilities 55.16% <52.11%> (+0.01%) ⬆️
apm-integrations 81.93% <52.11%> (+0.20%) ⬆️
appsec 59.32% <100.00%> (+0.23%) ⬆️
debugger 70.89% <ø> (+0.04%) ⬆️
instrumentation 60.18% <71.83%> (+0.16%) ⬆️
llmobs 82.51% <ø> (+0.02%) ⬆️
master-coverage 99.15% <100.00%> (?)
openfeature 68.07% <ø> (+0.07%) ⬆️
platform 68.15% <ø> (+0.08%) ⬆️
profiling 66.51% <ø> (+0.07%) ⬆️
serverless 66.67% <ø> (+1.17%) ⬆️
test-optimization 82.02% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-official

datadog-official Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 1 test - 1 passed on retry View in Datadog

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 98.55% (+0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e79f5f5 | Docs | View more details | Give us feedback!

@pr-commenter

pr-commenter Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-11-24 06:48:17

Comparing candidate commit e79f5f5 in PR branch ccapell/APPSEC-71813/rasp-find-wrapped-abort-errors with baseline commit 7d57720 in branch master.

📊 Benchmarking dashboard

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

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-20

  • unstable max_rss_usage [-42.466MB; +76.094MB] or [-17.780%; +31.860%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20

  • unstable max_rss_usage [-42.514MB; +5.794MB] or [-17.694%; +2.411%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-26

  • unstable max_rss_usage [-36.521MB; +13.693MB] or [-13.008%; +4.877%]

scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-26

  • unstable max_rss_usage [-28.763MB; +20.639MB] or [-9.455%; +6.784%]

scenario:encoders-0.4-immediate-flush-20

  • unstable max_rss_usage [-10775.974KB; +10779.974KB] or [-12.992%; +12.997%]

scenario:openfeature-initialization-configuration-26

  • unstable cpu_user_time [-104.292ms; +165.175ms] or [-5.899%; +9.342%]
  • unstable execution_time [-106.920ms; +168.595ms] or [-5.830%; +9.194%]
  • unstable throughput [-50371.154op/s; +29581.415op/s] or [-9.038%; +5.308%]

scenario:openfeature-initialization-error-20

  • unstable max_rss_usage [-3700.368KB; +4991.641KB] or [-4.981%; +6.719%]

scenario:openfeature-scale-full-24

  • unstable max_rss_usage [-20.321MB; +34.729MB] or [-7.690%; +13.143%]

scenario:openfeature-scale-full-26

  • unstable max_rss_usage [-18.960MB; +41.224MB] or [-8.287%; +18.019%]

scenario:plugin-graphql-long-with-depth-off-26

  • unstable cpu_user_time [-283.535ms; +445.259ms] or [-4.377%; +6.873%]
  • unstable execution_time [-300.859ms; +475.321ms] or [-4.564%; +7.211%]
  • unstable max_rss_usage [-28.875MB; +40.338MB] or [-14.429%; +20.157%]
  • unstable throughput [-22.226op/s; +14.006op/s] or [-6.470%; +4.077%]

scenario:plugin-graphql-long-with-depth-on-max-26

  • unstable max_rss_usage [-33450.730KB; +33905.397KB] or [-17.198%; +17.432%]

* @returns {DatadogRaspAbortError | undefined}
*/
function findWrappedDatadogRaspAbortError (error, req) {
if (!isError(error)) return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (!isError(error)) return
if (!isError(error)) return undefined

errors.push(value)
}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

return undefined

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants