-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-saved-hitlist-006.txt
executable file
·2368 lines (2368 loc) · 18.7 KB
/
test-saved-hitlist-006.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
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
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(lp0
ccopy_reg
_reconstructor
p1
(c__main__
Hit
p2
c__builtin__
object
p3
Ntp4
Rp5
(dp6
S'category'
p7
S'buffer'
p8
sS'end'
p9
I692
sS'name'
p10
S'gets'
p11
sS'parameters'
p12
(lp13
S''
p14
aS'f'
p15
asS'level'
p16
I5
sS'url'
p17
g14
sS'column'
p18
I2
sS'context_text'
p19
S' gets(f);'
p20
sS'hook'
p21
c__main__
normal
p22
sS'warning'
p23
S'Does not check for buffer overflows (CWE-120, CWE-20)'
p24
sS'suggestion'
p25
S'Use fgets() instead'
p26
sS'input'
p27
I1
sS'line'
p28
I32
sS'filename'
p29
S'test.c'
p30
sS'start'
p31
I688
sbag1
(g2
g3
Ntp32
Rp33
(dp34
g7
g8
sg9
I1462
sg10
S'strncat'
p35
sg12
(lp36
g14
aS'd'
p37
aS's'
p38
aS'sizeof(d)'
p39
asg16
I5
sg17
g14
sg18
I3
sg19
S' strncat(d,s,sizeof(d)); /* Misuse - this should be flagged as riskier. */'
p40
sS'note'
p41
S'Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left.'
p42
sg21
c__main__
c_strncat
p43
sg23
S'Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120)'
p44
sg25
S'Consider strcat_s, strlcat, snprintf, or automatically resizing strings'
p45
sg28
I60
sg29
g30
sg31
I1455
sbag1
(g2
g3
Ntp46
Rp47
(dp48
g7
g8
sg9
I1539
sg10
S'_tcsncat'
p49
sg12
(lp50
g14
aS'd'
p51
aS's'
p52
aS'sizeof(d)'
p53
asg16
I5
sg17
g14
sg18
I3
sg19
S' _tcsncat(d,s,sizeof(d)); /* Misuse - flag as riskier */'
p54
sg41
g42
sg21
g43
sg23
g44
sg25
S'Consider strcat_s, strlcat, or automatically resizing strings'
p55
sg28
I61
sg29
g30
sg31
I1531
sbag1
(g2
g3
Ntp56
Rp57
(dp58
g7
g8
sg9
I1680
sg10
S'MultiByteToWideChar'
p59
sg12
(lp60
g14
aS'CP_ACP'
p61
aS'0'
p62
aS'szName'
p63
aS'-1'
p64
aS'wszUserName'
p65
aS'sizeof(wszUserName)'
p66
asg16
I5
sg17
g14
sg18
I3
sg19
S' MultiByteToWideChar(CP_ACP,0,szName,-1,wszUserName,sizeof(wszUserName));'
p67
sg41
S'Risk is high, it appears that the size is given as bytes, but the function requires size as characters.'
p68
sg21
c__main__
c_multi_byte_to_wide_char
p69
sg23
S'Requires maximum length in CHARACTERS, not bytes (CWE-120)'
p70
sg25
g14
sg28
I64
sg29
g30
sg31
I1661
sbag1
(g2
g3
Ntp71
Rp72
(dp73
g7
g8
sg9
I1815
sg10
S'MultiByteToWideChar'
p74
sg12
(lp75
g14
aS'CP_ACP'
p76
aS'0'
p77
aS'szName'
p78
aS'-1'
p79
aS'wszUserName'
p80
aS'sizeof wszUserName'
p81
asg16
I5
sg17
g14
sg18
I3
sg19
S' MultiByteToWideChar(CP_ACP,0,szName,-1,wszUserName,sizeof wszUserName);'
p82
sg41
g68
sg21
g69
sg23
g70
sg25
g14
sg28
I66
sg29
g30
sg31
I1796
sbag1
(g2
g3
Ntp83
Rp84
(dp85
g7
S'misc'
p86
sg9
I2533
sg10
S'SetSecurityDescriptorDacl'
p87
sg12
(lp88
g14
aS'&sd'
p89
aS'TRUE'
p90
aS'NULL'
p91
aS'FALSE'
p92
asg16
I5
sg17
g14
sg18
I3
sg31
I2508
sg19
S' SetSecurityDescriptorDacl(&sd,TRUE,NULL,FALSE);'
p93
sg21
c__main__
c_hit_if_null
p94
sg23
S'Never create NULL ACLs; an attacker can set it to Everyone (Deny All Access), which would even forbid administrator access (CWE-732)'
p95
sg25
g14
sg28
I77
sg29
g30
sS'check_for_null'
p96
I3
sbag84
ag1
(g2
g3
Ntp97
Rp98
(dp99
g7
g8
sg9
I372
sg10
S'strcpy'
p100
sg12
(lp101
g14
aS'b'
p102
aS'a'
p103
asg16
I4
sg17
g14
sg18
I2
sg19
S' strcpy(b, a);'
p104
sg21
c__main__
c_buffer
p105
sg23
S'Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120)'
p106
sg25
S'Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)'
p107
sg28
I17
sg29
g30
sg31
I366
sbag1
(g2
g3
Ntp108
Rp109
(dp110
g7
g8
sg9
I429
sg10
S'sprintf'
p111
sg12
(lp112
g14
aS's'
p113
aS'"hello %s"'
p114
aS'bug'
p115
asg16
I4
sg17
g14
sg18
I2
sg19
S' sprintf(s, "hello %s", bug);'
p116
sg21
c__main__
c_sprintf
p117
sg23
S'Does not check for buffer overflows (CWE-120)'
p118
sg25
S'Use sprintf_s, snprintf, or vsnprintf'
p119
sg28
I20
sg29
g30
sg31
I422
sbag1
(g2
g3
Ntp120
Rp121
(dp122
g7
g8
sg9
I459
sg10
S'sprintf'
p123
sg12
(lp124
g14
aS's'
p125
aS'gettext("hello %s")'
p126
aS'bug'
p127
asg16
I4
sg17
g14
sg18
I2
sg19
S' sprintf(s, gettext("hello %s"), bug);'
p128
sg21
g117
sg23
g118
sg25
g119
sg28
I21
sg29
g30
sg31
I452
sbag1
(g2
g3
Ntp129
Rp130
(dp131
g7
S'format'
p132
sg9
I498
sg10
S'sprintf'
p133
sg12
(lp134
g14
aS's'
p135
aS'unknown'
p136
aS'bug'
p137
asg16
I4
sg17
g14
sg18
I2
sg19
S' sprintf(s, unknown, bug);'
p138
sg21
g117
sg23
S'Potential format string problem (CWE-134)'
p139
sg25
S'Make format string constant'
p140
sg28
I22
sg29
g30
sg31
I491
sbag1
(g2
g3
Ntp141
Rp142
(dp143
g7
g132
sg9
I524
sg10
S'printf'
p144
sg12
(lp145
g14
aS'bf'
p146
aS'x'
p147
asg16
I4
sg17
g14
sg18
I2
sg19
S' printf(bf, x);'
p148
sg21
c__main__
c_printf
p149
sg23
S'If format strings can be influenced by an attacker, they can be exploited (CWE-134)'
p150
sg25
S'Use a constant for the format specification'
p151
sg28
I23
sg29
g30
sg31
I518
sbag1
(g2
g3
Ntp152
Rp153
(dp154
g7
g8
sg9
I557
sg10
S'scanf'
p155
sg12
(lp156
g14
aS'"%s"'
p157
aS's'
p158
asg16
I4
sg17
g14
sg18
I2
sg19
S' scanf("%s", s);'
p159
sg21
c__main__
c_scanf
p160
sg23
S"The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20)"
p161
sg25
S'Specify a limit to %s, or use a different input function'
p162
sg27
I1
sg28
I25
sg29
g30
sg31
I552
sbag1
(g2
g3
Ntp163
Rp164
(dp165
g7
g8
sg9
I593
sg10
S'scanf'
p166
sg12
(lp167
g14
aS'"%s"'
p168
ag158
asg16
I4
sg17
g14
sg18
I2
sg19
S' scanf("%s", s);'
p169
sg21
g160
sg23
g161
sg25
g162
sg27
I1
sg28
I27
sg29
g30
sg31
I588
sbag1
(g2
g3
Ntp170
Rp171
(dp172
g7
g132
sg9
I997
sg10
S'syslog'
p173
sg12
(lp174
g14
aS'LOG_ERR'
p175
aS'attacker_string'
p176
asg16
I4
sg17
g14
sg18
I2
sg19
S' syslog(LOG_ERR, attacker_string);'
p177
sg21
g149
sS'format_position'
p178
I2
sg23
S"If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134)"
p179
sg25
S'Use a constant format string for syslog'
p180
sg28
I38
sg29
g30
sg31
I991
sbag1
(g2
g3
Ntp181
Rp182
(dp183
g7
g8
sg9
I1088
sg10
S'_mbscpy'
p184
sg12
(lp185
g14
aS'd'
p186
aS's'
p187
asg16
I4
sg17
g14
sg18
I3
sg19
S" _mbscpy(d,s); /* like strcpy, this doesn't check for buffer overflow */"
p188
sg21
g105
sg23
g106
sg25
S'Consider using a function version that stops copying at the end of the buffer'
p189
sg28
I49
sg29
g30
sg31
I1081
sbag1
(g2
g3
Ntp190
Rp191
(dp192
g7
g8
sg9
I1394
sg10
S'lstrcat'
p193
sg12
(lp194
g14
aS'd'
p195
aS's'
p196
asg16
I4
sg17
g14
sg18
I3
sg19
S' lstrcat(d,s);'
p197
sg21
g105
sg23
S'Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120)'
p198
sg25
g14
sg28
I56
sg29
g30
sg31
I1387
sbag1
(g2
g3
Ntp199
Rp200
(dp201
g7
S'shell'
p202
sg9
I2634
sg10
S'CreateProcess'
p203
sg12
(lp204
g14
aS'NULL'
p205
aS'"C:\\\\Program Files\\\\GoodGuy\\\\GoodGuy.exe -x"'
p206
aS'""'
p207
asg16
I3
sg17
g14
sg18
I3
sg31
I2621
sg19
S' CreateProcess(NULL, "C:\\\\Program Files\\\\GoodGuy\\\\GoodGuy.exe -x", "");'
p208
sg21
g94
sg23
S'This causes a new process to execute and is difficult to use safely (CWE-78)'
p209
sg25
S'Specify the application path in the first argument, NOT as part of the second, or embedded spaces could allow an attacker to force a different program to run'
p210
sg28
I79
sg29
g30
sg96
I1
sbag200
ag1
(g2
g3
Ntp211
Rp212
(dp213
g7
g8
sg9
I3057
sg10
S'getopt_long'
p214
sg12
(lp215
g14
aS'argc'
p216
aS'argv'
p217
aS'"a"'
p218
aS'longopts'
p219
aS'NULL'
p220
asg16
I3
sg17
S'dangers-c'
p221
sg18
I20
sg19
S' while ((optc = getopt_long (argc, argv, "a",longopts, NULL )) != EOF) {'
p222
sg21
g22
sg23
S'Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20)'
p223
sg25
S'Check implementation on installation, or limit the size of all string inputs'
p224
sg27
I1
sg28
I95
sg29
g30
sg31
I3046
sbag1
(g2
g3
Ntp225
Rp226
(dp227
g7
g8
sg9
I318
sg10
S'strcpy'
p228
sg12
(lp229
g14
aS'a'
p230
aS'gettext("Hello there")'
p231
asg16
I2
sg17
g14
sg18
I2
sg19
S' strcpy(a, gettext("Hello there")); // Did this work?'
p232
sg41
S'Risk is low because the source is a constant string.'
p233
sg21
g105
sg23
g106
sg25
g107
sg28
I16
sg29
g30
sg31
I312
sbag1
(g2
g3
Ntp234
Rp235
(dp236
g7
g8
sg9
I407
sg10
S'sprintf'
p237
sg12
(lp238
g14
aS's'
p239
aS'"hello"'
p240
asg16
I2
sg17
g14
sg18
I2
sg19
S' sprintf(s, "hello");'
p241
sg41
S'Risk is low because the source has a constant maximum length.'
p242
sg21
g117
sg23
g118
sg25
g119
sg28
I19
sg29
g30
sg31
I400
sbag1
(g2
g3
Ntp243
Rp244
(dp245
g7
g8
sg29
g30
sg9
I1047
sg10
S'char'
p246
sg12
(lp247
sg16
I2
sg17
g14
sS'lookahead'
p248
S"char d[20];\n char s[20];\n int n;\n\n _mbscpy(d,s); /* like strcpy, this doesn't check for buffer overflow */\n memcpy(d,s); // fail - no size\n memcpy(d, s, sizeof(d)); // pass\n memcpy(& n, s, sizeof( n )); // pass\n memcpy(&n,s,sizeof(s)); // fail - sizeof not of destination\n memcpy(d,s,n); // fail - size unguessable\n CopyMemory(d,s);\n lstrcat(d,s);\n strncpy(d,s);\n _tcsncpy(d,s);\n strncat(d,s,10);\n strncat(d,s,sizeof(d)); /* Misuse - this should be flagged as riskier. */\n _tcsncat(d,s"
p249
sg18
I3
sg19
S' char d[20];'
p250
sg21
c__main__
c_static_array
p251
sg23
S'Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120)'
p252
sg25
S'Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length'
p253