Skip to content

fix(fingerprints): prevent jQuery false positive from plugin URLs#161

Open
yutasuzuki-0206 wants to merge 1 commit into
projectdiscovery:mainfrom
yutasuzuki-0206:fix/jquery-scriptsrc-false-positive
Open

fix(fingerprints): prevent jQuery false positive from plugin URLs#161
yutasuzuki-0206 wants to merge 1 commit into
projectdiscovery:mainfrom
yutasuzuki-0206:fix/jquery-scriptsrc-false-positive

Conversation

@yutasuzuki-0206

Copy link
Copy Markdown

Summary

The first scriptSrc pattern for jQuery incorrectly matches jQuery plugin URLs, causing false version detection.

Problem

The current pattern:

/(\d+\.\d+\.\d+)/jquery[/.-][^u]

Matches plugin URLs like:

https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js

The path /1.4.1/jquery.c satisfies [/.-][^u], extracting 1.4.1 as the jQuery version — even though this is the jquery-cookie plugin version, not jQuery itself.

This leads to incorrect CVE matches (e.g., 7 false positive vulnerabilities including KEV-listed CVE-2020-11023) on sites that actually run jQuery 3.7.0+.

Fix

Changed the pattern to require jquery.js or jquery.min.js specifically:

/(\\d+\\.\\d+\\.\\d+)/jquery(?:\\.min)?\\.js

This prevents matches on plugin filenames like jquery.cookie.js, jquery-ui.js, or jquery.fancybox.js.

Test cases

URL Before After
/3.7.0/jquery.min.js ✅ 3.7.0 ✅ 3.7.0
/3.6.0/jquery.js ✅ 3.6.0 ✅ 3.6.0
/jquery-cookie/1.4.1/jquery.cookie.min.js ❌ 1.4.1 (wrong) ✅ no match
/jquery-ui/1.13.2/jquery-ui.min.js ❌ 1.13.2 (wrong) ✅ no match
/1.0.0/jquery.fancybox.min.js ❌ 1.0.0 (wrong) ✅ no match

All existing tests pass.

The first scriptSrc pattern for jQuery (`/(\d+\.\d+\.\d+)/jquery[/.-][^u]`)
incorrectly matches jQuery plugin URLs such as:
`jquery-cookie/1.4.1/jquery.cookie.min.js`

This causes the plugin's version (1.4.1) to be reported as the jQuery
version, leading to false positive CVE detections.

Changed the pattern to require `jquery.js` or `jquery.min.js` specifically,
preventing matches on plugin filenames like `jquery.cookie.js`,
`jquery-ui.js`, or `jquery.fancybox.js`.

Before: `/(\\d+\\.\\d+\\.\\d+)/jquery[/.-][^u]`
After:  `/(\\d+\\.\\d+\\.\\d+)/jquery(?:\\.min)?\\.js`

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@neo-by-projectdiscovery-dev

neo-by-projectdiscovery-dev Bot commented Apr 16, 2026

Copy link
Copy Markdown

Neo - PR Security Review

Caution

Neo couldn't finish analyzing this pull request during this run. Please run the review again.

Comment @pdneo help for available commands. · Open in Neo

@snicket2100

Copy link
Copy Markdown

@yutasuzuki-0206 I think you are trying to change an autogenerated file. The actual definition is here:

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.

2 participants