Skip to content

Commit 8314e00

Browse files
committed
more corner cases for TACACS+
1 parent d613a60 commit 8314e00

File tree

1 file changed

+239
-0
lines changed

1 file changed

+239
-0
lines changed
Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
#
2+
# Test vectors for TACACS+ error conditions
3+
#
4+
proto tacacs
5+
proto-dictionary tacacs
6+
fuzzer-out tacacs
7+
8+
#
9+
# ---- Packet-level header validation tests ----
10+
#
11+
12+
#
13+
# Packet too small - 5 bytes (minimum is 12)
14+
#
15+
decode-proto c0 01 01 01 00
16+
match Packet is too small (5 < 12) to be TACACS+.
17+
18+
#
19+
# Packet too small - 11 bytes
20+
#
21+
decode-proto c0 01 01 01 00 00 00 01 00 00 00
22+
match Packet is too small (11 < 12) to be TACACS+.
23+
24+
#
25+
# Unsupported version 0.0
26+
#
27+
decode-proto 00 01 01 01 00 00 00 01 00 00 00 00
28+
match Unsupported TACACS+ version 0.0 (00)
29+
30+
#
31+
# Unsupported version 12.2
32+
#
33+
decode-proto c2 01 01 01 00 00 00 01 00 00 00 00
34+
match Unsupported TACACS+ version 12.2 (c2)
35+
36+
#
37+
# Unsupported version 13.0
38+
#
39+
decode-proto d0 01 01 01 00 00 00 01 00 00 00 00
40+
match Unsupported TACACS+ version 13.0 (d0)
41+
42+
#
43+
# Packet too large - byte 8 of length field is nonzero (> 64K)
44+
#
45+
decode-proto c0 01 01 01 00 00 00 01 01 00 00 00
46+
match Packet is too large. Our limit is 64K
47+
48+
#
49+
# Packet does not fill buffer - length says 10 but only 0 body bytes
50+
#
51+
decode-proto c0 01 01 01 00 00 00 01 00 00 00 0a
52+
match Packet does not exactly fill buffer
53+
54+
#
55+
# Packet does not fill buffer - length says 0 but 5 extra body bytes
56+
#
57+
decode-proto c0 01 01 01 00 00 00 01 00 00 00 00 01 02 03 04 05
58+
match Packet does not exactly fill buffer
59+
60+
#
61+
# Unknown packet type 0
62+
#
63+
decode-proto c0 00 01 01 00 00 00 01 00 00 00 00
64+
match Unknown packet type 0
65+
66+
#
67+
# Unknown packet type 4
68+
#
69+
decode-proto c0 04 01 01 00 00 00 01 00 00 00 00
70+
match Unknown packet type 4
71+
72+
#
73+
# Unknown packet type 255
74+
#
75+
decode-proto c0 ff 01 01 00 00 00 01 00 00 00 00
76+
match Unknown packet type 255
77+
78+
#
79+
# ---- Authentication Start (type=0x01, seq_no=1) ----
80+
#
81+
82+
#
83+
# Authentication-Start header too small - body 3 bytes (need 8)
84+
#
85+
decode-proto c0 01 01 01 00 00 00 01 00 00 00 03 01 02 03
86+
match Header for Authentication-Start is too small (15 < 12)
87+
88+
#
89+
# Authentication-Start data overflows - user_len=10 but body only 8 bytes
90+
#
91+
decode-proto c0 01 01 01 00 00 00 01 00 00 00 08 01 00 02 03 0a 00 00 00
92+
match Data overflows the packet
93+
94+
#
95+
# Authentication-Start data underflows - all lengths=0 but 12 extra bytes
96+
#
97+
decode-proto c0 01 01 01 00 00 00 01 00 00 00 14 01 00 02 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
98+
match Data underflows the packet
99+
100+
#
101+
# ---- Authentication Continue (type=0x01, seq_no=3) ----
102+
#
103+
104+
#
105+
# Authentication-Continue header too small - body 2 bytes (need 5)
106+
#
107+
decode-proto c0 01 03 01 00 00 00 01 00 00 00 02 01 02
108+
match Header for Authentication-Continue is too small (14 < 12)
109+
110+
#
111+
# Authentication-Continue invalid version 12.1 (must be 12.0)
112+
#
113+
decode-proto c1 01 03 01 00 00 00 01 00 00 00 05 00 00 00 00 00
114+
match Invalid TACACS+ version
115+
116+
#
117+
# Authentication-Continue data overflows - user_msg_len=10 but body only 5 bytes
118+
#
119+
decode-proto c0 01 03 01 00 00 00 01 00 00 00 05 00 0a 00 00 00
120+
match Data overflows the packet
121+
122+
#
123+
# ---- Authentication Reply (type=0x01, seq_no=2) ----
124+
#
125+
126+
#
127+
# Authentication-Reply header too small - body 3 bytes (need 6)
128+
#
129+
decode-proto c0 01 02 01 00 00 00 01 00 00 00 03 01 02 03
130+
match Header for Authentication-Reply is too small (15 < 12)
131+
132+
#
133+
# Authentication-Reply data overflows - server_msg_len=10 but body only 6 bytes
134+
#
135+
decode-proto c0 01 02 01 00 00 00 01 00 00 00 06 01 00 00 0a 00 00
136+
match Data overflows the packet
137+
138+
#
139+
# Authentication-Reply data underflows - all lengths=0 but 10 extra bytes
140+
#
141+
decode-proto c0 01 02 01 00 00 00 01 00 00 00 10 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
142+
match Data underflows the packet
143+
144+
#
145+
# ---- Authorization Request (type=0x02, seq_no=1) ----
146+
#
147+
148+
#
149+
# Authorization-Request header too small - body 3 bytes (need 8)
150+
#
151+
decode-proto c0 02 01 01 00 00 00 01 00 00 00 03 01 02 03
152+
match Header for Authorization-Request is too small (15 < 12)
153+
154+
#
155+
# Authorization-Request invalid version 12.1 (must be 12.0)
156+
#
157+
decode-proto c1 02 01 01 00 00 00 01 00 00 00 08 06 00 02 03 00 00 00 00
158+
match Invalid TACACS+ version
159+
160+
#
161+
# Authorization-Request argument count overflow - arg_cnt=5 but body only 8 bytes
162+
#
163+
decode-proto c0 02 01 01 00 00 00 01 00 00 00 08 06 00 02 03 00 00 00 05
164+
match Argument count 5 overflows the remaining data (8) in the Authorization-Request packet
165+
166+
#
167+
# Authorization-Request argument length overflow - arg_len[0]=255 but only 1 byte available
168+
#
169+
decode-proto c0 02 01 01 00 00 00 01 00 00 00 0a 06 00 02 03 00 00 00 01 ff 00
170+
match Argument 0 length 255 overflows packet
171+
172+
#
173+
# ---- Authorization Reply (type=0x02, seq_no=2) ----
174+
#
175+
176+
#
177+
# Authorization-Reply header too small - body 3 bytes (need 6)
178+
#
179+
decode-proto c0 02 02 01 00 00 00 01 00 00 00 03 01 02 03
180+
match Header for Authorization-Reply is too small (15 < 12)
181+
182+
#
183+
# Authorization-Reply argument count overflow - arg_cnt=5 but body only 6 bytes
184+
#
185+
decode-proto c0 02 02 01 00 00 00 01 00 00 00 06 01 05 00 00 00 00
186+
match Argument count 5 overflows the remaining data (6) in the Authorization-Reply packet
187+
188+
#
189+
# ---- Accounting Request (type=0x03, seq_no=1) ----
190+
#
191+
192+
#
193+
# Accounting-Request header too small - body 3 bytes (need 9)
194+
#
195+
decode-proto c0 03 01 01 00 00 00 01 00 00 00 03 01 02 03
196+
match Header for Accounting-Request is too small (15 < 12)
197+
198+
#
199+
# Accounting-Request invalid version 12.1 (must be 12.0)
200+
#
201+
decode-proto c1 03 01 01 00 00 00 01 00 00 00 09 02 06 00 02 03 00 00 00 00
202+
match Invalid TACACS+ version
203+
204+
#
205+
# Accounting-Request data overflows - user_len=255 but body only 9 bytes
206+
#
207+
decode-proto c0 03 01 01 00 00 00 01 00 00 00 09 02 06 00 02 03 ff 00 00 00
208+
match Data overflows the packet
209+
210+
#
211+
# Accounting-Request argument length overflow - arg_len[0]=255 but only 1 byte available
212+
#
213+
decode-proto c0 03 01 01 00 00 00 01 00 00 00 0b 02 06 00 02 03 00 00 00 01 ff 00
214+
match Argument 0 length 255 overflows packet
215+
216+
#
217+
# ---- Accounting Reply (type=0x03, seq_no=2) ----
218+
#
219+
220+
#
221+
# Accounting-Reply header too small - body 2 bytes (need 5)
222+
#
223+
decode-proto c0 03 02 01 00 00 00 01 00 00 00 02 01 02
224+
match Header for Accounting-Reply is too small (14 < 12)
225+
226+
#
227+
# Accounting-Reply data overflows - server_msg_len=10 but body only 5 bytes
228+
#
229+
decode-proto c0 03 02 01 00 00 00 01 00 00 00 05 00 0a 00 00 01
230+
match Data overflows the packet
231+
232+
#
233+
# Accounting-Reply data underflows - all lengths=0 but 10 extra bytes
234+
#
235+
decode-proto c0 03 02 01 00 00 00 01 00 00 00 0f 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00
236+
match Data underflows the packet
237+
238+
count
239+
match 69

0 commit comments

Comments
 (0)