Commit fd509a7
crypto: harden CryptoKey algorithm slots
Clone CryptoKey algorithm dictionaries into null-prototype objects
before storing or caching them internally. Copy nested hash dictionaries
and publicExponent bytes so internal consumers and transferred keys do
not observe user-mutable input objects or polluted Object.prototype
fields.
Keep public algorithm and inspect output as ordinary objects. Make the
clone path check only own hash and publicExponent properties.
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: #63111
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>1 parent 8657df3 commit fd509a7
2 files changed
Lines changed: 97 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
932 | 933 | | |
933 | 934 | | |
934 | 935 | | |
| 936 | + | |
| 937 | + | |
935 | 938 | | |
936 | 939 | | |
937 | 940 | | |
| |||
949 | 952 | | |
950 | 953 | | |
951 | 954 | | |
952 | | - | |
953 | | - | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
954 | 974 | | |
| 975 | + | |
955 | 976 | | |
956 | 977 | | |
957 | 978 | | |
| |||
976 | 997 | | |
977 | 998 | | |
978 | 999 | | |
979 | | - | |
980 | | - | |
| 1000 | + | |
| 1001 | + | |
981 | 1002 | | |
982 | 1003 | | |
983 | 1004 | | |
| |||
1013 | 1034 | | |
1014 | 1035 | | |
1015 | 1036 | | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1016 | 1043 | | |
1017 | 1044 | | |
1018 | 1045 | | |
| |||
1022 | 1049 | | |
1023 | 1050 | | |
1024 | 1051 | | |
| 1052 | + | |
1025 | 1053 | | |
1026 | 1054 | | |
1027 | 1055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
50 | 115 | | |
51 | 116 | | |
52 | 117 | | |
| |||
0 commit comments