Repository navigation
fix(tech-detect): Imperva matches X-CDN: Imperva as well as Incapsula #646 - #872
Merged
Merged
Conversation
nc9
force-pushed
the
fix/646-imperva-xcdn
branch
2 times, most recently
from
October 16, 2026 15:24
e50de9e to
caf5a34
Compare
nc9
marked this pull request as ready for review
October 16, 2026 15:24
|
Review of PR 872 (Imperva No (high) or (critical) findings. The fingerprint moves from
The CHANGELOG entry reads well. Tests cover the new behaviour. I did not run them. |
Contributor
Author
|
Review triage (caf5a34): no change pushed.
|
…646 The fingerprint moves from the generated set to the curated security set: the generated set's research data is not in the repository, so a fix there could not survive a regeneration, which skips ids the curated set defines. X-CDN now reads Imperva or Incapsula, matching waf-detect. Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/646-imperva-xcdn
branch
from
October 16, 2026 15:54
caf5a34 to
92694a2
Compare
|
Review of #872 (Imperva No high or critical findings. The change is small and correct. I read the diff and confirmed in
Tests and changelog entry look good. |
nc9
added a commit
that referenced
this pull request
Oct 29, 2026
…s on hostile page) #1244 (#1245) Closes #1244. Detection scans every stored page with every fingerprint, so a pattern with an unbounded run after a repeatable literal is quadratic on a page that repeats the literal and never closes it. `requirejs` took about 70 s on 1 MB of `<script ` repeats (1 MB flood now 114 ms for the whole fingerprint set). Beyond `requirejs` (the issue), a scan of every html and script-url pattern, each run on 100 KB to 200 KB (the test now uses 200 KB with a 250 ms budget) built from its own leading literal, found 14 more that took seconds: bulma, foundation-sites, semantic-ui, materialize-css, animate-css (`<link[^>]+href="[^"]*/x.css`), plausible and fathom (`data-domain=.*plausible`), facebook-pixel, rudderstack, didomi, ensighten, yotpo (`.*` / `.+` in URLs), dynatrace-rum (`[_a-z0-9]*`), userway. All now have bounded windows (200 to 600 chars; the link patterns also require whitespace before `href`). Where: `data/research-fingerprints.json`, the input of `scripts/generate-tech-fingerprints.ts`, is not in the repo (the last generated.ts change, #872, also edited it by hand), so the fixes are edits to `generated.ts` and to `analytics.ts` / `ads.ts`. Anyone regenerating from an extern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #646.
What changes
pub#643 taught waf-detect that
X-CDN: Impervameans Imperva. tech-detect's Imperva fingerprint still matchedIncapsulaonly, so the two disagreed on the same response.fingerprints/generated.ts) into the curatedSECURITY_FINGERPRINTS(fingerprints/security.ts).packages/tech-detect/data/research-fingerprints.json, which is gitignored and in neither repo, so a fix made there could not survive a regeneration.scripts/generate-tech-fingerprints.ts,CURATEDincludesSECURITY_FINGERPRINTS), so a regeneration now keeps the curated entry and does not re-add the old one.X-CDNnow matches/\b(?:Incapsula|Imperva)\b/i. TheX-Iinfoand/_Incapsula_Resourcedetectors, the id, the name and the icon are unchanged.X-CDNis not one of them, as the issue thread notes. That is filed as tech-detect in a local audit only sees a fixed header subset, so header-only fingerprints never match #871.Tests
packages/tech-detect/tests/imperva-xcdn-646.test.ts:X-CDN: ImpervaandX-CDN: Incapsulaare detected,X-CDN: Fastlyis not, and the entry is in the curated set and not the generated one. Fails before the change.fingerprints.test.ts(no duplicate ids) anduntrusted-meta.test.ts.test-suites.ts --checkand the detect-secrets hook pass.Docs and skill