Commit a571f52
committed
Add extra validations to prevent Signature wrapping attacks
There was a bug on the toolkit that made it vulnerable to a
Signature wrapping attacks in the specific scenario where
there was a Signature that referenced at the same time
2 elements (but past the scheme validator process since
1 of the element was inside the encrypted assertion.
On this commit we added 3 new validators in order to avoid
Signature wrapping attacks:
- Extra validations at the validate_signed_elements method to check that
the ref URIs and IDs are unique and consistent.
- Validate the document (encrypted and decrypted version) against the scheme.
- Use at validate_signature method the same logic than in xpath_from_signed_assertion
(adding the 'id' => doc.signed_element_id condition).1 parent 8453f12 commit a571f52
1 file changed
+47
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| 340 | + | |
340 | 341 | | |
341 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
342 | 349 | | |
343 | 350 | | |
344 | 351 | | |
| |||
434 | 441 | | |
435 | 442 | | |
436 | 443 | | |
| 444 | + | |
| 445 | + | |
437 | 446 | | |
438 | 447 | | |
439 | 448 | | |
440 | 449 | | |
441 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
442 | 482 | | |
443 | 483 | | |
444 | 484 | | |
| |||
614 | 654 | | |
615 | 655 | | |
616 | 656 | | |
617 | | - | |
618 | | - | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
619 | 660 | | |
620 | 661 | | |
621 | 662 | | |
| |||
625 | 666 | | |
626 | 667 | | |
627 | 668 | | |
628 | | - | |
629 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
630 | 672 | | |
631 | 673 | | |
632 | 674 | | |
| |||
0 commit comments