fix: resolve RedisCache array offset error and improve discovery diagnostics

- Fix RedisCache driver to handle MGET failures gracefully with fallback
- Add comprehensive discovery context comparison debug tools
- Identify root cause: WEB context discovery missing 166 items vs CLI
- WEB context missing RequestFactory class entirely (52 vs 69 commands)
- Improved exception handling with detailed binding diagnostics
This commit is contained in:
2025-09-12 20:05:18 +02:00
parent 8040d3e7a5
commit e30753ba0e
46990 changed files with 10789682 additions and 89639 deletions

View File

@@ -133,6 +133,7 @@ final readonly class WafFeedbackIntegrator
}
// Create a new detection collection with the processed detections
/** @var array<\App\Framework\Waf\Detection> $processedDetections */
$newDetections = new DetectionCollection($processedDetections);
// Determine the new status based on the remaining detections
@@ -172,7 +173,7 @@ final readonly class WafFeedbackIntegrator
return LayerResult::neutral(
'waf_feedback_integrator',
'Detections adjusted based on feedback'
)->withExecutionDuration($result->executionDuration);
)->withExecutionDuration($result->executionDuration ?? Duration::zero());
} else {
return LayerResult::clean(
'waf_feedback_integrator',
@@ -265,7 +266,7 @@ final readonly class WafFeedbackIntegrator
if ($adjustedThreatScore < 0.7) { // Assuming 0.7 is the block threshold
return WafDecision::allow(
$assessment,
$decision->processingTime
$decision->processingTime ?? Duration::zero()
);
}
}
@@ -339,7 +340,7 @@ final readonly class WafFeedbackIntegrator
}
// If there's a clear consensus (more than 50% of suggestions), return it
if ($mostSuggestedCount > ($totalSeverityAdjustments / 2)) {
if ($mostSuggestedSeverity !== null && $mostSuggestedCount > ($totalSeverityAdjustments / 2)) {
return DetectionSeverity::from($mostSuggestedSeverity);
}