Commit 1200bb0
committed
fix(workflows): validate every redirect hop when fetching workflow/step catalogs
WorkflowCatalog._fetch_single_catalog and StepCatalog._fetch_single_catalog
opened the catalog URL with open_url(entry.url, timeout=30) and validated
only the final resp.geturl(). open_url follows redirects, so an https://
catalog entry that 30x-redirects through a non-HTTPS host mid-chain could
let a network attacker rewrite the next hop and slip a payload past the
terminal-URL-only check. The payload then drives step/workflow catalog data.
Pass a redirect_validator that runs the existing HTTPS/hostname check before
every redirect hop, keeping the final geturl() check as a defense-in-depth
backstop. This brings both workflow catalog loaders to parity with the
presets (#3523) and extensions (#3524) catalog fetchers.
Tests: add per-hop redirect-validation tests for both WorkflowCatalog and
StepCatalog (a non-HTTPS intermediate hop is rejected); both fail before the
fix ("NoneType object is not callable" — no validator passed). Update the two
existing malformed-redirect tests whose open_url stub lacked the
redirect_validator kwarg.1 parent d7699c3 commit 1200bb0
2 files changed
Lines changed: 102 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
526 | 536 | | |
527 | | - | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
528 | 540 | | |
529 | 541 | | |
530 | 542 | | |
| |||
1180 | 1192 | | |
1181 | 1193 | | |
1182 | 1194 | | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
1183 | 1205 | | |
1184 | | - | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
1185 | 1209 | | |
1186 | 1210 | | |
1187 | 1211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6161 | 6161 | | |
6162 | 6162 | | |
6163 | 6163 | | |
6164 | | - | |
| 6164 | + | |
| 6165 | + | |
| 6166 | + | |
6165 | 6167 | | |
6166 | 6168 | | |
6167 | 6169 | | |
| |||
6176 | 6178 | | |
6177 | 6179 | | |
6178 | 6180 | | |
| 6181 | + | |
| 6182 | + | |
| 6183 | + | |
| 6184 | + | |
| 6185 | + | |
| 6186 | + | |
| 6187 | + | |
| 6188 | + | |
| 6189 | + | |
| 6190 | + | |
| 6191 | + | |
| 6192 | + | |
| 6193 | + | |
| 6194 | + | |
| 6195 | + | |
| 6196 | + | |
| 6197 | + | |
| 6198 | + | |
| 6199 | + | |
| 6200 | + | |
| 6201 | + | |
| 6202 | + | |
| 6203 | + | |
| 6204 | + | |
| 6205 | + | |
| 6206 | + | |
| 6207 | + | |
| 6208 | + | |
| 6209 | + | |
| 6210 | + | |
| 6211 | + | |
| 6212 | + | |
| 6213 | + | |
| 6214 | + | |
| 6215 | + | |
6179 | 6216 | | |
6180 | 6217 | | |
6181 | 6218 | | |
| |||
6720 | 6757 | | |
6721 | 6758 | | |
6722 | 6759 | | |
6723 | | - | |
| 6760 | + | |
| 6761 | + | |
| 6762 | + | |
6724 | 6763 | | |
6725 | 6764 | | |
6726 | 6765 | | |
| |||
6735 | 6774 | | |
6736 | 6775 | | |
6737 | 6776 | | |
| 6777 | + | |
| 6778 | + | |
| 6779 | + | |
| 6780 | + | |
| 6781 | + | |
| 6782 | + | |
| 6783 | + | |
| 6784 | + | |
| 6785 | + | |
| 6786 | + | |
| 6787 | + | |
| 6788 | + | |
| 6789 | + | |
| 6790 | + | |
| 6791 | + | |
| 6792 | + | |
| 6793 | + | |
| 6794 | + | |
| 6795 | + | |
| 6796 | + | |
| 6797 | + | |
| 6798 | + | |
| 6799 | + | |
| 6800 | + | |
| 6801 | + | |
| 6802 | + | |
| 6803 | + | |
| 6804 | + | |
| 6805 | + | |
| 6806 | + | |
| 6807 | + | |
| 6808 | + | |
| 6809 | + | |
| 6810 | + | |
| 6811 | + | |
6738 | 6812 | | |
6739 | 6813 | | |
6740 | 6814 | | |
| |||
0 commit comments