Commit 772868c
committed
fix(security): absorb stronger severity + threat_level on merge dedup
MergeFindings phase-1 dedup by (rule_id, location) took max Confidence
and the most-severe Tier but kept the first occurrence's Severity and
ThreatLevel, discarding a later duplicate's if it was more severe. A
low/info finding followed by a high/warning duplicate at the same
(rule_id, location) merged at the LOWER severity, making the aggregate
CalculateRiskScore and the report summary order-dependent, contradicting
US2's "max severity among agreeing findings" intent.
Add severityRank and threatLevelRank ordering helpers (strict refinements
of threatCategory's bucketing, so they never disagree with
CalculateRiskScore) and take the more-severe Severity and ThreatLevel on
absorb. Merging the same two findings in either order now yields
identical Severity/ThreatLevel/Confidence/Tier and an identical risk
score.
Related: Spec 0771 parent 5c14f79 commit 772868c
2 files changed
Lines changed: 108 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
465 | 504 | | |
466 | 505 | | |
467 | 506 | | |
| |||
525 | 564 | | |
526 | 565 | | |
527 | 566 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
532 | 573 | | |
533 | 574 | | |
534 | 575 | | |
535 | 576 | | |
536 | 577 | | |
537 | 578 | | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
538 | 585 | | |
539 | 586 | | |
540 | 587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
361 | 418 | | |
362 | 419 | | |
363 | 420 | | |
| |||
0 commit comments