MCPcopy Index your code
hub / github.com/devploit/debugHunter / checkParams

Function checkParams

background.js:608–657  ·  view source on GitHub ↗
(url, baseline = null)

Source from the content-addressed store, hash-verified

606}
607
608async function checkParams(url, baseline = null) {
609 const settings = await getSettings();
610 const allParams = [...debugParams.high, ...debugParams.medium];
611
612 try {
613 // Use provided baseline or fetch new one
614 if (!baseline) {
615 baseline = await getUrlBaseline(url);
616 }
617 if (!baseline) return;
618
619 // Check high-confidence params first
620 const sortedParams = [
621 ...debugParams.high.map(p => ({ ...p, confidence: 'high' })),
622 ...debugParams.medium.map(p => ({ ...p, confidence: 'medium' })),
623 ];
624
625 for (const param of sortedParams) {
626 const modifiedUrl = appendParam(url, param);
627
628 try {
629 const modifiedResponse = await rateLimitedFetch(modifiedUrl);
630 const modifiedText = await modifiedResponse.text();
631
632 const analysis = await analyzeResponseDifference(
633 baseline.mockResponse, modifiedResponse,
634 baseline.text, modifiedText,
635 settings
636 );
637
638 if (analysis.isDifferent) {
639 await addFinding('params', {
640 url: modifiedUrl,
641 baseUrl: url,
642 param: `${param.key}=${param.value}`,
643 confidence: param.confidence,
644 severity: analysis.severity,
645 reasons: analysis.reasons,
646 originalResponse: truncateForStorage(baseline.text),
647 modifiedResponse: truncateForStorage(modifiedText),
648 });
649 }
650 } catch (e) {
651 // Skip this param on error
652 }
653 }
654 } catch (error) {
655 console.error(`[debugHunter] Params check failed: ${error.message}`);
656 }
657}
658
659// ============================================================================
660// HEADER CHECKING (uses cached baseline)

Callers 1

scanUrlFunction · 0.85

Calls 7

getSettingsFunction · 0.85
getUrlBaselineFunction · 0.85
appendParamFunction · 0.85
rateLimitedFetchFunction · 0.85
addFindingFunction · 0.85
truncateForStorageFunction · 0.85

Tested by

no test coverage detected