Repository navigation
Commit 682b8b2
zstd-safe: refuse CCtx::try_clone once NbWorkers was set
ZSTD_copyCCtx() trusts stage == ZSTDcs_init to mean that appliedParams,
hashLog3 and the workspace tables come from the same reset. The
multithreaded branch of ZSTD_CCtx_init_compressStream2() overwrites
appliedParams with the workers' parameters while leaving the outer
context's stage and tables as an abandoned single-threaded frame left
them, so try_clone() then copied tables of mismatched sizes: up to 512 KiB
past the clone's workspace, or 16 MiB past the source's.
The applied parameters cannot be queried, so remember whether NbWorkers
was ever set to a non-zero value, and from then on refuse try_clone() and
the (unsafe) compress_block() with ZSTD_error_stage_wrong.
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-XGF4B4VN.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MxSMUdwqoQ3qm6UF82MgZD1 parent cee6529 commit 682b8b2
2 files changed
Lines changed: 91 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
309 | 316 | | |
310 | 317 | | |
311 | 318 | | |
| |||
334 | 341 | | |
335 | 342 | | |
336 | 343 | | |
337 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
338 | 350 | | |
339 | 351 | | |
340 | 352 | | |
| |||
839 | 851 | | |
840 | 852 | | |
841 | 853 | | |
842 | | - | |
| 854 | + | |
843 | 855 | | |
844 | | - | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
845 | 861 | | |
846 | 862 | | |
847 | 863 | | |
| |||
865 | 881 | | |
866 | 882 | | |
867 | 883 | | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
868 | 903 | | |
869 | 904 | | |
870 | 905 | | |
871 | 906 | | |
872 | 907 | | |
| 908 | + | |
| 909 | + | |
873 | 910 | | |
874 | 911 | | |
875 | 912 | | |
| |||
881 | 918 | | |
882 | 919 | | |
883 | 920 | | |
| 921 | + | |
884 | 922 | | |
885 | 923 | | |
886 | 924 | | |
| |||
911 | 949 | | |
912 | 950 | | |
913 | 951 | | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
914 | 955 | | |
915 | 956 | | |
916 | 957 | | |
| |||
926 | 967 | | |
927 | 968 | | |
928 | 969 | | |
| 970 | + | |
929 | 971 | | |
930 | 972 | | |
931 | 973 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
880 | 880 | | |
881 | 881 | | |
882 | 882 | | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
883 | 928 | | |
884 | 929 | | |
885 | 930 | | |
| |||
0 commit comments