|
67 | 67 | "valid": false |
68 | 68 | }, |
69 | 69 | { |
70 | | - "description": "invalid leading zeroes, as they are treated as octals", |
71 | | - "comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/", |
| 70 | + "description": "leading zeroes are valid per RFC 2673 (despite CVE-2021-28918 octal risks)", |
| 71 | + "comment": "see https://sick.codes/universal-netmask-npm-package-used-by-270000-projects-vulnerable-to-octal-input-data-server-side-request-forgery-remote-file-inclusion-local-file-inclusion-and-more-cve-2021-28918/ - NOTE: strict anti-octal rules belong in URI formats for Draft 2020-12, but will be integrated into ipv4 in the v1 spec.", |
72 | 72 | "data": "087.10.0.1", |
73 | | - "valid": false |
| 73 | + "valid": true |
74 | 74 | }, |
75 | 75 | { |
76 | 76 | "description": "value without leading zero is valid", |
|
88 | 88 | "valid": false |
89 | 89 | }, |
90 | 90 | { |
91 | | - "description": "leading zero in last octet (Strict ABNF Compliance)", |
92 | | - "comment": "RFC 3986, Section 3.2.2 strict bounds applied over RFC 2673 to prevent octal vulnerabilities. dec-octet = DIGIT / %d49-57 DIGIT / '1' 2DIGIT / '2' %d48-52 DIGIT / '25' %d48-53", |
| 91 | + "description": "leading zero is valid under RFC 2673 loose syntax", |
| 92 | + "comment": "RFC 2673, Section 3.2: dotted-quad = decbyte \".\" decbyte \".\" decbyte \".\" decbyte (where decbyte = 1*3DIGIT). NOTE: Planned for update in v1 spec to enforce strict anti-octal rules.", |
93 | 93 | "data": "192.168.0.01", |
94 | | - "valid": false |
| 94 | + "valid": true |
95 | 95 | }, |
96 | 96 | { |
97 | 97 | "description": "leading whitespace is invalid", |
98 | | - "comment": "RFC 3986, Section 3.2.2: IPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet", |
| 98 | + "comment": "RFC 2673, Section 3.2: dotted-quad = decbyte \".\" decbyte \".\" decbyte \".\" decbyte", |
99 | 99 | "data": " 192.168.0.1", |
100 | 100 | "valid": false |
101 | 101 | }, |
102 | 102 | { |
103 | 103 | "description": "trailing whitespace is invalid", |
104 | | - "comment": "RFC 3986, Section 3.2.2: IPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet", |
| 104 | + "comment": "RFC 2673, Section 3.2: dotted-quad = decbyte \".\" decbyte \".\" decbyte \".\" decbyte", |
105 | 105 | "data": "192.168.0.1 ", |
106 | 106 | "valid": false |
107 | 107 | }, |
108 | 108 | { |
109 | 109 | "description": "trailing newline is invalid", |
110 | | - "comment": "RFC 3986, Section 3.2.2: IPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet", |
| 110 | + "comment": "RFC 2673, Section 3.2: dotted-quad = decbyte \".\" decbyte \".\" decbyte \".\" decbyte", |
111 | 111 | "data": "192.168.0.1\n", |
112 | 112 | "valid": false |
113 | 113 | }, |
114 | 114 | { |
115 | 115 | "description": "hexadecimal notation is invalid", |
116 | | - "comment": "RFC 3986, Section 3.2.2: dec-octet = DIGIT / %d49-57 DIGIT / '1' 2DIGIT / '2' %d48-52 DIGIT / '25' %d48-53", |
| 116 | + "comment": "RFC 2673, Section 3.2: decbyte = 1*3DIGIT (requires DIGIT, forbids alpha/hex)", |
117 | 117 | "data": "0x7f.0.0.1", |
118 | 118 | "valid": false |
119 | 119 | }, |
120 | 120 | { |
121 | 121 | "description": "octal notation explicit is invalid", |
122 | | - "comment": "RFC 3986, Section 3.2.2: dec-octet = DIGIT / %d49-57 DIGIT / '1' 2DIGIT / '2' %d48-52 DIGIT / '25' %d48-53", |
| 122 | + "comment": "RFC 2673, Section 3.2: decbyte = 1*3DIGIT (requires DIGIT, forbids alpha)", |
123 | 123 | "data": "0o10.0.0.1", |
124 | 124 | "valid": false |
125 | 125 | }, |
126 | 126 | { |
127 | 127 | "description": "empty part (double dot) is invalid", |
128 | | - "comment": "RFC 3986, Section 3.2.2: IPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet", |
| 128 | + "comment": "RFC 2673, Section 3.2: dotted-quad = decbyte \".\" decbyte \".\" decbyte \".\" decbyte", |
129 | 129 | "data": "192.168..1", |
130 | 130 | "valid": false |
131 | 131 | }, |
132 | 132 | { |
133 | 133 | "description": "leading dot is invalid", |
134 | | - "comment": "RFC 3986, Section 3.2.2: IPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet", |
| 134 | + "comment": "RFC 2673, Section 3.2: dotted-quad = decbyte \".\" decbyte \".\" decbyte \".\" decbyte", |
135 | 135 | "data": ".192.168.0.1", |
136 | 136 | "valid": false |
137 | 137 | }, |
138 | 138 | { |
139 | 139 | "description": "trailing dot is invalid", |
140 | | - "comment": "RFC 3986, Section 3.2.2: IPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet", |
| 140 | + "comment": "RFC 2673, Section 3.2: dotted-quad = decbyte \".\" decbyte \".\" decbyte \".\" decbyte", |
141 | 141 | "data": "192.168.0.1.", |
142 | 142 | "valid": false |
143 | 143 | }, |
144 | 144 | { |
145 | 145 | "description": "minimum valid IPv4 address", |
146 | | - "comment": "RFC 3986, Section 3.2.2: dec-octet = DIGIT", |
| 146 | + "comment": "RFC 2673, Section 3.2: decbyte = 1*3DIGIT", |
147 | 147 | "data": "0.0.0.0", |
148 | 148 | "valid": true |
149 | 149 | }, |
150 | 150 | { |
151 | 151 | "description": "maximum valid IPv4 address", |
152 | | - "comment": "RFC 3986, Section 3.2.2: dec-octet = DIGIT / %d49-57 DIGIT / '1' 2DIGIT / '2' %d48-52 DIGIT / '25' %d48-53", |
| 152 | + "comment": "RFC 2673, Section 3.2: decbyte = 1*3DIGIT", |
153 | 153 | "data": "255.255.255.255", |
154 | 154 | "valid": true |
155 | 155 | }, |
156 | 156 | { |
157 | 157 | "description": "empty string is invalid", |
158 | | - "comment": "RFC 3986, Section 3.2.2: IPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet", |
| 158 | + "comment": "RFC 2673, Section 3.2: dotted-quad requires 4 decbytes", |
159 | 159 | "data": "", |
160 | 160 | "valid": false |
161 | 161 | }, |
162 | 162 | { |
163 | 163 | "description": "plus sign is invalid", |
164 | | - "comment": "RFC 3986, Section 3.2.2: dec-octet = DIGIT / %d49-57 DIGIT / '1' 2DIGIT / '2' %d48-52 DIGIT / '25' %d48-53", |
| 164 | + "comment": "RFC 2673, Section 3.2: decbyte = 1*3DIGIT (forbids symbols)", |
165 | 165 | "data": "+1.2.3.4", |
166 | 166 | "valid": false |
167 | 167 | }, |
168 | 168 | { |
169 | 169 | "description": "negative sign is invalid", |
170 | | - "comment": "RFC 3986, Section 3.2.2: dec-octet = DIGIT / %d49-57 DIGIT / '1' 2DIGIT / '2' %d48-52 DIGIT / '25' %d48-53", |
| 170 | + "comment": "RFC 2673, Section 3.2: decbyte = 1*3DIGIT (forbids symbols)", |
171 | 171 | "data": "-1.2.3.4", |
172 | 172 | "valid": false |
173 | 173 | }, |
174 | 174 | { |
175 | 175 | "description": "exponential notation is invalid", |
176 | | - "comment": "RFC 3986, Section 3.2.2: dec-octet = DIGIT / %d49-57 DIGIT / '1' 2DIGIT / '2' %d48-52 DIGIT / '25' %d48-53", |
| 176 | + "comment": "RFC 2673, Section 3.2: decbyte = 1*3DIGIT (forbids alpha)", |
177 | 177 | "data": "1e2.0.0.1", |
178 | 178 | "valid": false |
179 | 179 | }, |
180 | 180 | { |
181 | 181 | "description": "alpha characters are invalid", |
182 | | - "comment": "RFC 3986, Section 3.2.2: dec-octet = DIGIT / %d49-57 DIGIT / '1' 2DIGIT / '2' %d48-52 DIGIT / '25' %d48-53", |
| 182 | + "comment": "RFC 2673, Section 3.2: decbyte = 1*3DIGIT (forbids alpha)", |
183 | 183 | "data": "192.168.a.1", |
184 | 184 | "valid": false |
185 | 185 | }, |
186 | 186 | { |
187 | 187 | "description": "internal whitespace is invalid", |
188 | | - "comment": "RFC 3986, Section 3.2.2: IPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet", |
| 188 | + "comment": "RFC 2673, Section 3.2: dotted-quad = decbyte \".\" decbyte \".\" decbyte \".\" decbyte", |
189 | 189 | "data": "192. 168.0.1", |
190 | 190 | "valid": false |
191 | 191 | }, |
192 | 192 | { |
193 | 193 | "description": "tab character is invalid", |
194 | | - "comment": "RFC 3986, Section 3.2.2: IPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet", |
| 194 | + "comment": "RFC 2673, Section 3.2: dotted-quad = decbyte \".\" decbyte \".\" decbyte \".\" decbyte", |
195 | 195 | "data": "192.168.0.1\t", |
196 | 196 | "valid": false |
197 | 197 | }, |
198 | 198 | { |
199 | 199 | "description": "with port number is invalid", |
200 | | - "comment": "RFC 3986, Section 3.2.2: IPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet", |
| 200 | + "comment": "RFC 2673, Section 3.2: dotted-quad = decbyte \".\" decbyte \".\" decbyte \".\" decbyte", |
201 | 201 | "data": "192.168.0.1:80", |
202 | 202 | "valid": false |
203 | 203 | }, |
204 | 204 | { |
205 | 205 | "description": "single octet out of range in last position", |
206 | | - "comment": "RFC 3986, Section 3.2.2: dec-octet = DIGIT / %d49-57 DIGIT / '1' 2DIGIT / '2' %d48-52 DIGIT / '25' %d48-53", |
| 206 | + "comment": "RFC 2673 limits the semantic value of decbyte to 255.", |
207 | 207 | "data": "192.168.0.256", |
208 | 208 | "valid": false |
209 | 209 | } |
|
0 commit comments