forked from snyk-labs/nodejs-goof
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathresults_code.html
1912 lines (1761 loc) · 142 KB
/
results_code.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Snyk test report</title>
<meta name="description" content=" known vulnerabilities found in .">
<base target="_blank">
<link rel="icon" type="image/png" href="https://res.cloudinary.com/snyk/image/upload/v1468845142/favicon/favicon.png"
sizes="194x194">
<link rel="shortcut icon" href="https://res.cloudinary.com/snyk/image/upload/v1468845142/favicon/favicon.ico">
<style type="text/css">
body {
-moz-font-feature-settings: "pnum";
-webkit-font-feature-settings: "pnum";
font-variant-numeric: proportional-nums;
display: flex;
flex-direction: column;
font-feature-settings: "pnum";
font-size: 100%;
line-height: 1.5;
min-height: 100vh;
-webkit-text-size-adjust: 100%;
margin: 0;
padding: 0;
color: #393842;
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, roboto, noto, arial, sans-serif;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 500;
}
a,
a:link,
a:visited {
border-bottom: 1px solid #4b45a9;
text-decoration: none;
color: #4b45a9;
}
a:hover,
a:focus,
a:active {
border-bottom: 1px solid #4b45a9;
}
hr {
border: none;
margin: 1em 0;
border-top: 1px solid #c5c5c5;
}
ul {
padding: 0 1em;
margin: 1em 0;
}
code {
background-color: #EEE;
color: #333;
padding: 0.25em 0.5em;
border-radius: 0.25em;
}
pre {
font-size: 14px;
}
pre code {
padding: 10px;
font-family: monospace;
background-color: #393842;
border-radius: 4px;
color: #fff;
display: block;
white-space: pre-wrap;
overflow-x: auto;
max-width: 100%;
min-width: 100px;
}
a code {
border-radius: .125rem .125rem 0 0;
padding-bottom: 0;
color: #4b45a9;
}
a[href^="http://"]:after,
a[href^="https://"]:after:not(.brand) {
background-image: linear-gradient(transparent,transparent),url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20112%20109%22%3E%3Cg%20id%3D%22Page-1%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cg%20id%3D%22link-external%22%3E%3Cg%20id%3D%22arrow%22%3E%3Cpath%20id%3D%22Line%22%20stroke%3D%22%234B45A9%22%20stroke-width%3D%2215%22%20d%3D%22M88.5%2021l-43%2042.5%22%20stroke-linecap%3D%22square%22%2F%3E%3Cpath%20id%3D%22Triangle%22%20fill%3D%22%234B45A9%22%20d%3D%22M111.2%200v50L61%200z%22%2F%3E%3C%2Fg%3E%3Cpath%20id%3D%22square%22%20fill%3D%22%234B45A9%22%20d%3D%22M66%2015H0v94h94V44L79%2059v35H15V30h36z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E");
background-repeat: no-repeat;
background-size: .75rem;
content: "";
display: inline-block;
height: .75rem;
margin-left: .25rem;
width: .75rem;
}
/* Layout */
[class*=layout-container] {
margin: 0 auto;
max-width: 71.25em;
padding: 20px;
position: relative;
}
.layout-container--short {
padding-top: 0;
padding-bottom: 0;
max-width: 48.75em;
}
.layout-container--short:after {
display: block;
content: "";
clear: both;
}
/* Header */
.header {
padding-bottom: 1px;
}
.paths {
margin-left: 8px;
font-size:14px;
}
.project__header {
background-color: #4b45a9;
background-image: linear-gradient(to right, #7530a6 0%, #461d9f 50%);
color: #fff;
}
.project__header__title {
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-all;
margin-top: 0;
margin-bottom: 12px;
}
.meta-count {
display: inline-block;
margin: 0 12px 6px 0;
padding-right: 12px;
font-size:14px;
}
/* Card */
.card {
background-color: #fff;
border: 1px solid #c5c5c5;
border-radius: .25rem;
margin: 0 0 2em 0;
position: relative;
min-height: 40px;
padding: 0;
}
.card .label {
background-color: #767676;
border: 2px solid #767676;
color: white;
padding: 0.25rem 0.75rem;
font-size: 0.875rem;
text-transform: uppercase;
display: inline-block;
margin: 0;
border-radius: 0.25rem;
}
.card .label__text {
vertical-align: text-top;
font-weight: bold;
}
.card .label--critical {
background-color: #AB1A1A;
border-color: #AB1A1A;
}
.card .label--high {
background-color: #CE5019;
border-color: #CE5019;
}
.card .label--medium {
background-color: #D68000;
border-color: #D68000;
}
.card .label--low {
background-color: #88879E;
border-color: #88879E;
}
.severity--low {
border-color: #88879E;
}
.severity--medium {
border-color: #D68000;
}
.severity--high {
border-color: #CE5019;
}
.severity--critical {
border-color: #AB1A1A;
}
.card--vuln {
padding-top: 4em;
}
.card--vuln .label {
left: 0;
position: absolute;
top: 1.1em;
padding-left: 1.9em;
padding-right: 1.9em;
border-radius: 0 0.25rem 0.25rem 0;
}
.card__section {
background-color: #faf9fa
}
.card__section h2 {
font-size: 22px;
margin-bottom: 0.5em;
}
.card__section p {
margin: 0 0 12px 0;
}
.card__meta {
padding: 0;
margin-top: 10px;
font-size: 1.1em;
}
.card__meta__item {
display: inline-block;
}
.card .card__meta__paths {
font-size: 0.9em;
}
.card__title {
font-size: 28px;
margin-top: 0;
}
.card__cta p {
margin: 0;
text-align: right;
}
/* Styles by Andy */
.brand, .brand:link, .brand:visited { display:inline-block; border:none; }
.brand::after { background:none; }
.test-meta { float:right; max-width:500px; opacity:.75; font-size:12px; text-align: right; }
.test-meta .filepath { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-meta .timestamp { margin:0 0 6px }
.report-summary { display:flex; justify-content: space-between; margin-bottom: 24px; }
.header-wrap, .source-panel { align-self: center; }
.severity-icon { display:inline-block; width:32px; height: 32px; }
.severity-icon.severity-icon--critical { background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIi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d2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iNCIgZmlsbD0iIzg4ODc5RSIvPgo8cGF0aCBkPSJNMjIgMjEuMjU3OFYyNEgxMy40MTAyVjIxLjI1NzhIMjJaTTE0LjU0NjkgNi45Mzc1VjI0SDExLjAzMTJWNi45Mzc1SDE0LjU0NjlaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K) }
.meta-count .severity-icon { float:left; width:24px; height:24px; margin-right:6px; background-size: 24px 24px; }
.source-panel { text-align: right; }
.source-panel__heading { display:block; margin-top:6px; text-transform:uppercase; color:#727184; font-size:12px; }
.scan-coverage { max-width: 400px; padding:0; margin:12px 0 0; font-size:14px; }
.scan-coverage .type { display:inline-block; list-style-type: none; padding:3px; margin:0 0 0 10px; }
.card { padding:0; border-width:4px 1px 1px; border-color:#d3d3d9; border-radius: 4px 4px 0 0 }
.card.severity--low { border-top-color: #88879E; }
.card.severity--medium { border-top-color: #D68000; }
.card.severity--high { border-top-color: #CE5019; }
.card.severity--critical { border-top-color: #AB1A1A; }
.card .fix-analysis { display:none }
.card.show-fix .fix-analysis { display:block }
.card.show-fix .dataflow { display:none }
.card__header { padding:24px }
.card__header__main { display:flex; }
.card__header__main .severity-icon { margin-right:12px; }
.card__meta { display:flex; align-items:flex-start; margin:0; list-style:none; }
.card__meta__item { display:inline-block; padding-right:8px; border-right:1px solid #eee; margin-right: 8px; font-size:12px; color:#727184 }
.card__meta__item:last-child { border:none; }
.card .card__title { display:inline-block; margin:0; font-size:22px; font-weight:600; vertical-align: top;}
.card__actions { display:flex; padding:2px; border:1px solid #d3d3d9; border-radius:20px; background-color:#fff; margin-left: auto; }
.card__action { align-self: center; padding:5px 15px; font-size:14px; cursor: pointer; transition: all .2s; }
.card__action:hover { color: #4b45a1; }
.card__action.is-selected { background-color:#4b45a1; color:#fff; border-radius:20px; }
.severity--high .card-dataflow.is-selected { background-color:#CE5019 ; }
.severity--medium .card-dataflow.is-selected { background-color:#D68000 ; }
.severity--low .card-dataflow.is-selected { background-color:#88879E ; }
.card__section {padding:24px; border-top: 1px solid #d3d3d9}
.card__snippet { background-color: transparent; font-family: monospace; white-space: pre; margin: 1em 0px; }
.card__summary { position: relative; padding: 16px 24px; border: 1px solid #d3d3d9; border-left-width:4px; border-radius:2px; background-color:#fff; color:#393842; word-break: break-word; }
.card__summary.severity--critical { border-left-color:#AB1A1A ; }
.card__summary.severity--high { border-left-color:#CE5019 ; }
.card__summary.severity--medium { border-left-color:#D68000 ; }
.card__summary.severity--low { border-left-color:#88879E; }
.card__summary .file-location { margin-top:12px; font-size:13px; color:#727184 }
.dataflow { margin:12px 0 }
.dataflow__item, .code-source { display: flex; padding:4px 8px; border:1px solid transparent; border-width: 1px 0; font-family: monospace; color:#393842; font-size:14px }
.dataflow__item:hover { cursor:pointer; border-color: #eee; background-color:#fff; }
.dataflow__item:hover .marker { background-color: #ffc905; }
.dataflow__step, .dataflow__lineno, .code-lineno { align-self: flex-start; flex:0 0 50px; width: 50px; text-align: right; color:#727184; font-size:12px; }
.dataflow__step { flex:0 0 30px; width: 30px; }
.dataflow__lineno { flex:0 0 60px; padding:0 20px 0 0; }
.dataflow__code { display:flex; align-self: flex-start; align-content: flex-start; flex-grow: 1; margin-right:40px; line-height:1; overflow:auto; }
.dataflow__code h1, .dataflow__code h2, .dataflow__code h3, .dataflow__code h4, .dataflow__code h5, .dataflow__code h6, .dataflow__code strong, .dataflow__code b, .dataflow__code em, .dataflow__code i, .dataflow__code p { padding:0; margin:0; font-family: monospace; color:#393842; font-size:14px; font-weight:400; font-style: normal; } /* overriding html default styling within the code */
.dataflow__code br { display:none } /* overriding html default styling within the code */
.dataflow__code .dataflow__codeprefix, .dataflow__code .dataflow__codesuffix { display:inline-block; margin:0; white-space:nowrap }
.dataflow__badge { align-self:flex-start; padding:2px 3px; border:1px solid #d3d3d9; border-radius:2px; margin-top:2px; background-color:#f4f4f6; font-size:11px; line-height:1; font-family: sans-serif; text-transform: uppercase; color:#646374 }
.dataflow__filename { padding:6px 12px; border:1px solid #eee; border-radius: 4px; margin:20px 0 10px; font-size:13px; color:#393842; background-color: #fff; }
.marker { padding:2px 6px; border-radius:4px; background-color: rgba(0,0,0,.1); word-break: break-all; white-space: nowrap; }
.marker.block { white-space: pre; line-height: 1.5; }
.card .card__section h2, .card .card__section h3 { font-size:18px; }
.card__panel__heading { padding:5px 0; font-size:22px; font-weight: 600; }
.heading-char { display: inline-block; width:22px; height:22px; border:1px solid #d3d3d9; border-radius:15px; margin-right:5px; color:#727184; font-size:14px; background-color:#fff; text-align: center; }
.card__panel__markdown { font-size:14px; color:#393842; }
.card__panel__markdown table { border-collapse: collapse; border:1px solid #d3d3d9; border-radius:3px; }
.card__panel__markdown tbody { display: table-row-group; vertical-align: top; }
.card__panel__markdown table td, .card__panel__markdown table th { min-width: 100px; padding:2px 5px; text-align: left; border-top:1px solid #d3d3d9; }
.card__panel__markdown table td { background-color:#fff; font-size:14px; line-height: 1.4; }
.is-hidden { display:none; }
@media print {
/* All your print styles go here */
.card .fix-analysis { display:block; }
.card__section { background-color: none; }
.project__header, .card__actions, .severity-icon { display: none; }
.marker { border:1px solid #555; margin:-1px 0; background: transparent }
}
</style>
<style type="text/css">
.metatable {
text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-webkit-box-direction: normal;
color: inherit;
font-feature-settings: "pnum";
box-sizing: border-box;
background: transparent;
border: 0;
font: inherit;
font-size: 100%;
margin: 0;
outline: none;
padding: 0;
text-align: left;
text-decoration: none;
vertical-align: baseline;
z-index: auto;
margin-top: 12px;
border-collapse: collapse;
border-spacing: 0;
font-variant-numeric: tabular-nums;
max-width: 51.75em;
}
tbody {
text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-webkit-box-direction: normal;
color: inherit;
font-feature-settings: "pnum";
border-collapse: collapse;
border-spacing: 0;
box-sizing: border-box;
background: transparent;
border: 0;
font: inherit;
font-size: 100%;
margin: 0;
outline: none;
padding: 0;
text-align: left;
text-decoration: none;
vertical-align: baseline;
z-index: auto;
display: flex;
flex-wrap: wrap;
}
.meta-row {
text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-webkit-box-direction: normal;
color: inherit;
font-feature-settings: "pnum";
border-collapse: collapse;
border-spacing: 0;
box-sizing: border-box;
background: transparent;
border: 0;
font: inherit;
font-size: 100%;
outline: none;
text-align: left;
text-decoration: none;
vertical-align: baseline;
z-index: auto;
display: flex;
align-items: start;
border-top: 1px solid #d3d3d9;
padding: 8px 0 0 0;
border-bottom: none;
margin: 8px;
width: 47.75%;
}
.meta-row-label {
text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-webkit-box-direction: normal;
font-feature-settings: "pnum";
border-collapse: collapse;
border-spacing: 0;
color: #4c4a73;
box-sizing: border-box;
background: transparent;
border: 0;
font: inherit;
margin: 0;
outline: none;
text-decoration: none;
z-index: auto;
align-self: start;
flex: 1;
font-size: 1rem;
line-height: 1.5rem;
padding: 0;
text-align: left;
vertical-align: top;
text-transform: none;
letter-spacing: 0;
}
.meta-row-value {
text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-webkit-box-direction: normal;
color: inherit;
font-feature-settings: "pnum";
border-collapse: collapse;
border-spacing: 0;
word-break: break-word;
box-sizing: border-box;
background: transparent;
border: 0;
font: inherit;
font-size: 100%;
margin: 0;
outline: none;
padding: 0;
text-align: right;
text-decoration: none;
vertical-align: baseline;
z-index: auto;
}
</style>
</head>
<body class="section-projects">
<main class="layout-stacked">
<header class="project__header">
<div class="layout-container">
<a class="brand" href="https://snyk.io" title="Snyk">
<svg width="100" height="46" fill="none" xmlns="http://www.w3.org/2000/svg">
<title>Snyk - Snyk Code</title>
<path d="M89.7 24.95h-.4v6.95h-5V14.6l5-7.8v16.15c.99-1.22 4.33-5.84 4.33-5.84h6.17l-5.85 6.18 6.05 8.63h-6.3l-4-6.96ZM75.77 23.8l2.05-6.67h4.94l-5.8 14.71c-1.72 4.43-4.2 7.42-7.89 7.42a7.02 7.02 0 0 1-3.24-.72l1.99-3.08c.3.04.6.05.91.05 1.7 0 2.98-1.66 3.81-3.62l-6.08-14.76h5.6l2.18 6.59c.43 1.25.74 3.64.74 3.64s.39-2.3.79-3.56Zm-15.09-.34c0-1.93-.85-2.84-2.47-2.84-.8 0-1.62.23-2.19.57v10.7h-4.99V17.28l4.89-.4-.12 2.4h.16a6.2 6.2 0 0 1 4.97-2.5c2.56 0 4.77 1.58 4.77 5.33v9.8H60.7v-8.44Zm-23.94 7.67.45-3.4c1.56.77 3.32 1.13 4.8 1.13 1.08 0 1.79-.36 1.79-1.01 0-1.87-6.73-1.42-6.73-6.3 0-3.13 2.86-4.77 6.44-4.77 1.79 0 3.64.48 4.83.9l-.48 3.35a13.22 13.22 0 0 0-4.38-.93c-.88 0-1.59.3-1.59.88 0 1.84 6.88 1.47 6.88 6.24 0 3.17-2.82 4.99-6.68 4.99-2.13 0-3.85-.37-5.33-1.08Z" fill="#fff"/>
<g clip-path="url(#a)" fill="#fff">
<path d="M25.86 10c.27.73.42 1.5.47 2.28v.24l-1.7 4.53c.4 3.58.77 8 .35 9.06-.2.53-.81 1.48-1.81 2.81l1.08 10.04 4.3-3.08a1.7 1.7 0 0 0 .7-1.37V12.17a1.7 1.7 0 0 0-1.22-1.63 33.9 33.9 0 0 0-2.17-.54ZM11.53 12.29a9.74 9.74 0 0 1 6.22 0l.52-.86.35-2.42s-2.43-.13-3.96-.13c-1.43 0-2.76.05-4 .14l.35 2.42.52.85ZM4.27 26.11c-.41-1.06-.04-5.48.35-9.06l-1.68-4.53v-.24c.04-.78.2-1.55.46-2.28-.9.2-1.62.39-2.18.54A1.7 1.7 0 0 0 0 12.17v22.34a1.7 1.7 0 0 0 .71 1.37l4.32 3.1L6.1 28.95c-1-1.35-1.62-2.3-1.83-2.84Z"/>
<path d="M20.7.97a.11.11 0 0 1 .11.06l.57 1.07c1.53 2.84 4.12 8.18 4.12 10.17v.1l-1.7 4.57V17c.54 4.82.7 8.1.42 8.8-.24.62-1.2 1.94-2 3l1.18 9.57-.71.5-7.07 5.07a1.7 1.7 0 0 1-1.98 0l-5.71-4.11-.87-.63-1.16-.83 1.16-9.56a19 19 0 0 1-2.02-3.02c-.27-.7-.11-3.98.42-8.8v-.07l-1.7-4.57v-.1c0-1.99 2.59-7.33 4.12-10.17l.57-1.06a.11.11 0 0 1 .1-.07.12.12 0 0 1 .13.1l1.53 10.67.95 1.56.24-.08c1.04-.37 2.13-.57 3.24-.6 1.1.03 2.2.24 3.25.6l.24.08.93-1.56L20.6 1.07a.12.12 0 0 1 .12-.1Zm0-.97a1.08 1.08 0 0 0-1.07.94l-1.5 10.45-.45.73c-1-.3-2.02-.47-3.05-.49a11 11 0 0 0-3.04.49l-.45-.73L9.64.94A1.08 1.08 0 0 0 8.56 0a1.1 1.1 0 0 0-.97.57l-.57 1.07c-.7 1.31-4.23 8-4.23 10.64v.26l.06.17 1.62 4.36c-.56 5.16-.68 8.22-.34 9.1.08.2.32.82 1.91 2.94l-1.12 9.16-.07.57.47.34 1.16.83.87.62 5.72 4.1a2.66 2.66 0 0 0 3.1 0l7.07-5.06.7-.5.47-.34-.07-.57-1.12-9.18c1.57-2.09 1.82-2.7 1.9-2.9.34-.88.22-3.95-.34-9.1l1.62-4.37.06-.16v-.27c0-2.64-3.53-9.32-4.23-10.64L21.66.58a1.09 1.09 0 0 0-.97-.57L20.7 0Z"/>
<path d="m7.76 27.3 2.08-.61a.22.22 0 0 0 .11-.08l1.99-2.26a.24.24 0 0 1 .37.02c.03.04.05.08.05.13l.35 6.48c0 .05-.02.1-.04.15-.14.2-.54.81-.54 1.2 0 .48.73 1.11 1.42 1.62l.03-.06c.24-.44.57-.52.72-.18.06.25.08.5.06.76h.01v.6c0 .03 0 .07-.02.1-.13.26-.75 1.37-2.08 1.37-.57 0-1.96-.18-2.58-1.88a18 18 0 0 1-.78-5.2v-.2l-.13-.15c-.33-.41-.72-.92-1.13-1.46a.24.24 0 0 1 .11-.36ZM20.52 29.11l-.12.16v.2c0 .13 0 3.08-.78 5.2a2.67 2.67 0 0 1-2.58 1.88c-1.33 0-1.94-1.1-2.08-1.37a.24.24 0 0 1-.02-.1v-.6c-.02-.26 0-.52.06-.77.14-.34.46-.26.72.18l.03.07c.7-.51 1.42-1.15 1.42-1.63 0-.38-.4-1-.54-1.2a.26.26 0 0 1-.04-.14l.35-6.48a.24.24 0 0 1 .3-.23c.05.02.09.04.12.08l1.98 2.26c.03.04.07.06.12.07l2.07.6a.24.24 0 0 1 .13.39c-.4.53-.8 1.03-1.14 1.43ZM10.26 22.31a.37.37 0 0 1-.36.32.61.61 0 0 0 .95.36.6.6 0 0 0-.04-1h1.04v.03a1.37 1.37 0 1 1-2.74.02V22h1.06-.02a.37.37 0 0 1 .1.32ZM9.59 20.92a.24.24 0 0 1-.19-.09c-.3-.35-1.2-1.55.37-1.55 1.17 0 2.1.71 2.62 1.22a.24.24 0 0 1-.17.42H9.59ZM19.11 22h-.01 1.06v.05a1.37 1.37 0 1 1-2.75-.02V22h1.05a.6.6 0 0 0-.25.73.6.6 0 0 0 .49.37.6.6 0 0 0 .68-.47.37.37 0 0 1-.27-.63ZM17.04 20.92a.24.24 0 0 1-.17-.42 3.88 3.88 0 0 1 2.63-1.22c1.56 0 .66 1.2.36 1.55a.24.24 0 0 1-.19.09h-2.63Z"/>
<path d="M17.02 37.48a2 2 0 0 1-.49-.06.24.24 0 0 0-.24.1 2 2 0 0 1-3.29 0 .24.24 0 0 0-.24-.1c-.15.03-.3.05-.46.05h-.14a.24.24 0 0 0-.26.23c0 .05 0 .09.03.13a3.1 3.1 0 0 0 5.45 0 .24.24 0 0 0-.1-.34.24.24 0 0 0-.13-.02h-.13Zm-1.72-2.72c.17.06.33.14.48.25-.15-.25-.35-.34-.48-.25Zm-1.77.22c.14-.1.3-.17.46-.22-.13-.08-.3-.01-.46.23v-.01ZM13.91 34.26c-.17.06-.35.14-.5.25.17-.25.36-.34.5-.25ZM15.92 34.54a2.26 2.26 0 0 0-.55-.28c.15-.1.37 0 .55.28Z"/>
<path d="M13.68 37.12a.1.1 0 0 0-.06.17 1.67 1.67 0 0 0 2.03 0 .1.1 0 0 0 .03-.1.1.1 0 0 0-.1-.07h-1.9ZM5.44 11.62c.1-.97 1-3.12 1.94-5.08a.2.2 0 0 1 .37.06l.18 1.28v.06c-.1.73-.54 3.25-1.67 5.02a.2.2 0 0 1-.35-.04l-.45-1.21a.22.22 0 0 1-.02-.1ZM23.04 12.96a14.32 14.32 0 0 1-1.67-5.08l.19-1.28a.2.2 0 0 1 .36-.06c.94 1.96 1.84 4.1 1.94 5.08v.08l-.45 1.21a.2.2 0 0 1-.28.13.2.2 0 0 1-.09-.08Z"/>
</g>
<defs>
<clipPath id="a">
<path fill="#fff" d="M0 0h29.27v45.23H0z"/>
</clipPath>
</defs>
</svg>
</a>
<div class="test-meta">
<p class="timestamp">April 11th 2022, 9:17:22 pm</p>
<div class="filepath" title="/Users/swschmidt/Snyk Workspace/goof-github">Source: /Users/swschmidt/Snyk Workspace/goof-github</div>
</div>
</div>
</header>
<div class="layout-container">
<div class="report-summary">
<div class="header-wrap">
<h1 class="project__header__title">Snyk Code Report</h1>
<div class="meta-counts">
<div class="meta-count">
<span class="severity-icon severity-icon--high"></span> <span><strong>5</strong> high issues</span>
</div>
<div class="meta-count">
<span class="severity-icon severity-icon--medium"></span> <span><strong>15</strong> medium issues</span>
</div>
<div class="meta-count">
<span class="severity-icon severity-icon--low"></span> <span><strong>2</strong> low issues</span>
</div>
</div>
</div>
<div class="source-panel">
<span class="source-panel__heading">Scan Coverage</span>
<ul class="scan-coverage">
<li class="type">JavaScript files: <strong>10</strong></li><li class="type">EJS files: <strong>4</strong></li>
</ul>
</div>
</div>
<div class="cards--vuln filter--patch filter--ignore">
<div class="card card--vuln disclosure--not-new severity--high" data-snyk-test="high">
<header class="card__header">
<div class="card__header__main">
<div class="severity-icon severity-icon--high"></div>
<h2 class="card__title">Command Injection</h2>
<div class="card__actions">
<span class="card__action card-dataflow is-selected" onclick="toggleCardView(event)">Data Flow</span>
<span class="card__action card-fix" onclick="toggleCardView(event)">Fix Analysis</span>
</div>
</div>
<ul class="card__meta">
<li class="card__meta__item">SNYK-CODE</li>
<li class="card__meta__item">CWE-78</li>
</ul>
</header>
<div class="card__section">
<div class="card__summary severity--high">
<p>Unsanitized input from the HTTP request body flows into child_process.exec, where it is used to build a shell command. This may result in a Command Injection vulnerability.</p>
<div class="file-location">Found in: <strong>routes/index.js (line : 161)</strong></div>
</div>
<div class="card__panel dataflow">
<h2 class="card__panel__heading"><span class="heading-char">⇣</span> Data Flow</h2>
<div class="dataflow__filename"> routes/index.js</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">155:14</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> var item = <br /></span><span class="marker">req.body</span><span class="dataflow__codesuffix">.content;</span></div>
<span class="dataflow__badge" title="Data is 'tainted' if it comes from an insecure source such as a file, the network, or the user. This tainted data is passed to a sensitive sink, as described below.">Source</span>
<span class="dataflow__step">0</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">155:14</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> var item = <br /></span><span class="marker">req.body</span><span class="dataflow__codesuffix">.content;</span></div>
<span class="dataflow__step">1</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">155:7</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> var <br /></span><span class="marker">item</span><span class="dataflow__codesuffix"> = req.body.content;</span></div>
<span class="dataflow__step">2</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">157:15</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> if (typeof (<br /></span><span class="marker">item</span><span class="dataflow__codesuffix">) == 'string' && item.match(imgRegex)) {</span></div>
<span class="dataflow__step">3</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">157:36</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> if (typeof (item) == 'string' && <br /></span><span class="marker">item</span><span class="dataflow__codesuffix">.match(imgRegex)) {</span></div>
<span class="dataflow__step">4</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">158:15</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> var url = <br /></span><span class="marker">item</span><span class="dataflow__codesuffix">.match(imgRegex)[1];</span></div>
<span class="dataflow__step">5</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">158:15</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> var url = <br /></span><span class="marker">item.match</span><span class="dataflow__codesuffix">(imgRegex)[1];</span></div>
<span class="dataflow__step">6</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">158:15</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> var url = <br /></span><span class="marker">item.match(imgRegex)</span><span class="dataflow__codesuffix">[1];</span></div>
<span class="dataflow__step">7</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">158:9</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> var <br /></span><span class="marker">url</span><span class="dataflow__codesuffix"> = item.match(imgRegex)[1];</span></div>
<span class="dataflow__step">8</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">159:33</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> console.log('found img: ' + <br /></span><span class="marker">url</span><span class="dataflow__codesuffix">);</span></div>
<span class="dataflow__step">9</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">161:24</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> exec('identify ' + <br /></span><span class="marker">url</span><span class="dataflow__codesuffix">, function (err, stdout, stderr) {</span></div>
<span class="dataflow__step">10</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">161:10</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> exec(<br /></span><span class="marker">'identify ' + url</span><span class="dataflow__codesuffix">, function (err, stdout, stderr) {</span></div>
<span class="dataflow__step">11</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">161:5</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> <br /></span><span class="marker">exec('identify ' + url, function (err, stdout, stderr</span><span class="dataflow__codesuffix">) {</span></div>
<span class="dataflow__badge" title="Sinks are the operations that must receive clean data and that you wouldn't want an attacker to be able to manipulate.">Sink</span>
<span class="dataflow__step">12</span>
</div>
</div>
<div class="card__panel fix-analysis">
<h2 class="card__panel__heading"><span class="heading-char">✓</span> Fix Analysis</h2>
<div class="card__panel__markdown"><h2 id="details">Details</h2>
<p>With an OS command injection attack a web application user can pass commands directly to the system shell, attached to a legitimate request. These commands can then be executed on the application server, potentially leading to harmful consequences, including data exposure or deletion. Like code injection attacks, command injection attacks are essentially a failure of data validation. Unlike code injection attacks, which introduce new code, command injection attacks use existing system functions, often taking advantage of the application's unnecessarily high privilege level, increasing the risk of serious harm and reputational damage.</p>
<h3 id="best-practices-for-prevention">Best practices for prevention</h3>
<ul>
<li>Never trust user input. Assume any input may transmit harmful values.</li>
<li>Adopt the principle of least privilege: No application should have a greater access level than needed to run its required tasks.</li>
<li>Control user access policies on a task-by-task basis.</li>
<li>Don't pass user input directly to the system; use libraries or APIs that lack system access.</li>
<li>Where shell commands must be passed, escape values using functions like shlex for Python, or escapeshellarg() for PHP.</li>
<li>Sanitize user input with regular expressions to define permitted characters along with maximum string length.</li>
<li>Convert special characters such as <code>& | ; $ > < \ !</code> before passing to the server.</li>
<li>Whitelist permitted commands and validate user responses against these expectations.</li>
<li>Remember that code injection can take place on multiple fronts: GET and POST requests, but also cookies and HTTP headers.</li>
<li>Ensure up-to-date patching across all systems to remediate known vulnerabilities.</li>
<li>Educate all team members on safer data handling procedures to prevent attacks.</li>
</ul>
</div>
</div>
</div>
</div>
<div class="card card--vuln disclosure--not-new severity--high" data-snyk-test="high">
<header class="card__header">
<div class="card__header__main">
<div class="severity-icon severity-icon--high"></div>
<h2 class="card__title">Hardcoded Secret</h2>
<div class="card__actions">
<span class="card__action card-dataflow is-selected" onclick="toggleCardView(event)">Data Flow</span>
<span class="card__action card-fix" onclick="toggleCardView(event)">Fix Analysis</span>
</div>
</div>
<ul class="card__meta">
<li class="card__meta__item">SNYK-CODE</li>
<li class="card__meta__item">CWE-547</li>
</ul>
</header>
<div class="card__section">
<div class="card__summary severity--high">
<p>Avoid hardcoding values that are meant to be secret. Found a hardcoded string used in here.</p>
<div class="file-location">Found in: <strong>app.js (line : 83)</strong></div>
</div>
<div class="card__panel dataflow">
<h2 class="card__panel__heading"><span class="heading-char">⇣</span> Data Flow</h2>
<div class="dataflow__filename"> app.js</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">83:13</span>
<div class="dataflow__code"><span class="dataflow__codeprefix">var token = <br /></span><span class="marker">'SECRET_TOKEN_f8ed84e8f41e4146403dd4a6bbcea5e418d23a9'</span><span class="dataflow__codesuffix">;</span></div>
<span class="dataflow__badge" title="Data is 'tainted' if it comes from an insecure source such as a file, the network, or the user. This tainted data is passed to a sensitive sink, as described below.">Source</span>
<span class="dataflow__step">0</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">83:5</span>
<div class="dataflow__code"><span class="dataflow__codeprefix">var <br /></span><span class="marker">token</span><span class="dataflow__codesuffix"> = 'SECRET_TOKEN_f8ed84e8f41e4146403dd4a6bbcea5e418d23a9';</span></div>
<span class="dataflow__badge" title="Sinks are the operations that must receive clean data and that you wouldn't want an attacker to be able to manipulate.">Sink</span>
<span class="dataflow__step">1</span>
</div>
</div>
<div class="card__panel fix-analysis">
<h2 class="card__panel__heading"><span class="heading-char">✓</span> Fix Analysis</h2>
<div class="card__panel__markdown"><h2 id="details">Details</h2>
<p>When constants are hardcoded into applications, this information could easily be reverse-engineered and become known to attackers. For example, if a breached authentication token is hardcoded in multiple places in the application, it may lead to components of the application remaining vulnerable if not all instances are changed.
Another negative effect of hard-coding constants is potential unpredictability in the application's performance if the development team fails to update every single instance of the hardcoded constant throughout the code. For these reasons, hard-coding security-relevant constants is considered bad coding practice and should be remedied if present and avoided in future.</p>
<h3 id="best-practices-for-prevention">Best practices for prevention</h3>
<ul>
<li>Never hard code security-related constants; use symbolic names or configuration lookup files.</li>
<li>As hard coding is often done by coders working alone on a small scale, examine all legacy code components and test carefully when scaling.</li>
<li>Adopt a "future-proof code" mindset: While use of constants may save a little time now and make development simpler in the short term, it could cost time and money adapting to scale or other unforeseen circumstances (such as new hardware) in the future.</li>
</ul>
</div>
</div>
</div>
</div>
<div class="card card--vuln disclosure--not-new severity--medium" data-snyk-test="medium">
<header class="card__header">
<div class="card__header__main">
<div class="severity-icon severity-icon--medium"></div>
<h2 class="card__title">Allocation of Resources Without Limits or Throttling</h2>
<div class="card__actions">
<span class="card__action card-dataflow is-selected" onclick="toggleCardView(event)">Data Flow</span>
<span class="card__action card-fix" onclick="toggleCardView(event)">Fix Analysis</span>
</div>
</div>
<ul class="card__meta">
<li class="card__meta__item">SNYK-CODE</li>
<li class="card__meta__item">CWE-770</li>
</ul>
</header>
<div class="card__section">
<div class="card__summary severity--medium">
<p>This endpoint handler performs a file system operation and does not use a rate-limiting mechanism. It may enable the attackers to perform Denial-of-service attacks. Consider using a rate-limiting middleware such as express-limit.</p>
<div class="file-location">Found in: <strong>routes/index.js (line : 67)</strong></div>
</div>
<div class="card__panel dataflow">
<h2 class="card__panel__heading"><span class="heading-char">⇣</span> Data Flow</h2>
<div class="dataflow__filename"> routes/index.js</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">67:17</span>
<div class="dataflow__code"><span class="dataflow__codeprefix">exports.login = <br /></span><span class="marker">function (req, res, next</span><span class="dataflow__codesuffix">) {</span></div>
<span class="dataflow__badge" title="Data is 'tainted' if it comes from an insecure source such as a file, the network, or the user. This tainted data is passed to a sensitive sink, as described below.">Source</span>
<span class="dataflow__step">0</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">68:10</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> return <br /></span><span class="marker">res.render</span><span class="dataflow__codesuffix">('admin', {</span></div>
<span class="dataflow__badge" title="Sinks are the operations that must receive clean data and that you wouldn't want an attacker to be able to manipulate.">Sink</span>
<span class="dataflow__step">1</span>
</div>
</div>
<div class="card__panel fix-analysis">
<h2 class="card__panel__heading"><span class="heading-char">✓</span> Fix Analysis</h2>
<div class="card__panel__markdown"><h2 id="details">Details</h2>
<p>Without unlimited resources, software operating in the real world is inherently limited in the resources it may consume; similarly, servers are limited by the number of simultaneous sessions they can handle. Therefore, it is important for developers to design software that considers these real-world physical (or virtual) limitations and limits user sessions accordingly, both in terms of the number of user sessions and in the quantity of resources each user may demand. Software with this weakness does not include such limitations and as a result, individual user sessions may consume too many resources, leading to unintended software behavior including, potentially, denial of service. This can be compared to a single restaurant customer emptying out the entire buffet, leaving no food for other customers--or an entire busload mobbing the buffet all at once, with a similar effect. This may happen inadvertently or as a result of an attack by a malicious user.</p>
<h3 id="best-practices-for-prevention">Best practices for prevention</h3>
<ul>
<li>Test extensively to obtain baseline values indicating how the software performs in the real world under various conditions (normal and peak); use these values to determine reasonable software limits.</li>
<li>Set clear limits for all flexible parameters such as maximum allocable memory, number of processes within a given timeframe, file descriptors, requests per client, number of records per request, etc. This is particularly true for any parameters within user control.</li>
<li>Release all resources when no longer in use, including incorporating timeouts for inactive users, processes, and resources.</li>
<li>Familiarize Dev, Ops, and IT teams with best practices for recognizing and preventing DoS attacks and out-of-control resource allocation to prevent catastrophic failures.</li>
</ul>
</div>
</div>
</div>
</div>
<div class="card card--vuln disclosure--not-new severity--medium" data-snyk-test="medium">
<header class="card__header">
<div class="card__header__main">
<div class="severity-icon severity-icon--medium"></div>
<h2 class="card__title">Allocation of Resources Without Limits or Throttling</h2>
<div class="card__actions">
<span class="card__action card-dataflow is-selected" onclick="toggleCardView(event)">Data Flow</span>
<span class="card__action card-fix" onclick="toggleCardView(event)">Fix Analysis</span>
</div>
</div>
<ul class="card__meta">
<li class="card__meta__item">SNYK-CODE</li>
<li class="card__meta__item">CWE-770</li>
</ul>
</header>
<div class="card__section">
<div class="card__summary severity--medium">
<p>This endpoint handler performs a file system operation and does not use a rate-limiting mechanism. It may enable the attackers to perform Denial-of-service attacks. Consider using a rate-limiting middleware such as express-limit.</p>
<div class="file-location">Found in: <strong>routes/index.js (line : 75)</strong></div>
</div>
<div class="card__panel dataflow">
<h2 class="card__panel__heading"><span class="heading-char">⇣</span> Data Flow</h2>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">75:17</span>
<div class="dataflow__code"><span class="dataflow__codeprefix">exports.admin = <br /></span><span class="marker">function (req, res, next</span><span class="dataflow__codesuffix">) {</span></div>
<span class="dataflow__badge" title="Data is 'tainted' if it comes from an insecure source such as a file, the network, or the user. This tainted data is passed to a sensitive sink, as described below.">Source</span>
<span class="dataflow__step">0</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">76:10</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> return <br /></span><span class="marker">res.render</span><span class="dataflow__codesuffix">('admin', {</span></div>
<span class="dataflow__badge" title="Sinks are the operations that must receive clean data and that you wouldn't want an attacker to be able to manipulate.">Sink</span>
<span class="dataflow__step">1</span>
</div>
</div>
<div class="card__panel fix-analysis">
<h2 class="card__panel__heading"><span class="heading-char">✓</span> Fix Analysis</h2>
<div class="card__panel__markdown"><h2 id="details">Details</h2>
<p>Without unlimited resources, software operating in the real world is inherently limited in the resources it may consume; similarly, servers are limited by the number of simultaneous sessions they can handle. Therefore, it is important for developers to design software that considers these real-world physical (or virtual) limitations and limits user sessions accordingly, both in terms of the number of user sessions and in the quantity of resources each user may demand. Software with this weakness does not include such limitations and as a result, individual user sessions may consume too many resources, leading to unintended software behavior including, potentially, denial of service. This can be compared to a single restaurant customer emptying out the entire buffet, leaving no food for other customers--or an entire busload mobbing the buffet all at once, with a similar effect. This may happen inadvertently or as a result of an attack by a malicious user.</p>
<h3 id="best-practices-for-prevention">Best practices for prevention</h3>
<ul>
<li>Test extensively to obtain baseline values indicating how the software performs in the real world under various conditions (normal and peak); use these values to determine reasonable software limits.</li>
<li>Set clear limits for all flexible parameters such as maximum allocable memory, number of processes within a given timeframe, file descriptors, requests per client, number of records per request, etc. This is particularly true for any parameters within user control.</li>
<li>Release all resources when no longer in use, including incorporating timeouts for inactive users, processes, and resources.</li>
<li>Familiarize Dev, Ops, and IT teams with best practices for recognizing and preventing DoS attacks and out-of-control resource allocation to prevent catastrophic failures.</li>
</ul>
</div>
</div>
</div>
</div>
<div class="card card--vuln disclosure--not-new severity--medium" data-snyk-test="medium">
<header class="card__header">
<div class="card__header__main">
<div class="severity-icon severity-icon--medium"></div>
<h2 class="card__title">Allocation of Resources Without Limits or Throttling</h2>
<div class="card__actions">
<span class="card__action card-dataflow is-selected" onclick="toggleCardView(event)">Data Flow</span>
<span class="card__action card-fix" onclick="toggleCardView(event)">Fix Analysis</span>
</div>
</div>
<ul class="card__meta">
<li class="card__meta__item">SNYK-CODE</li>
<li class="card__meta__item">CWE-770</li>
</ul>
</header>
<div class="card__section">
<div class="card__summary severity--medium">
<p>This endpoint handler performs a file system operation and does not use a rate-limiting mechanism. It may enable the attackers to perform Denial-of-service attacks. Consider using a rate-limiting middleware such as express-limit.</p>
<div class="file-location">Found in: <strong>routes/index.js (line : 82)</strong></div>
</div>
<div class="card__panel dataflow">
<h2 class="card__panel__heading"><span class="heading-char">⇣</span> Data Flow</h2>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">82:31</span>
<div class="dataflow__code"><span class="dataflow__codeprefix">exports.get_account_details = <br /></span><span class="marker">function(req, res, next</span><span class="dataflow__codesuffix">) {</span></div>
<span class="dataflow__badge" title="Data is 'tainted' if it comes from an insecure source such as a file, the network, or the user. This tainted data is passed to a sensitive sink, as described below.">Source</span>
<span class="dataflow__step">0</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">86:10</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> return <br /></span><span class="marker">res.render</span><span class="dataflow__codesuffix">('account.hbs', profile)</span></div>
<span class="dataflow__badge" title="Sinks are the operations that must receive clean data and that you wouldn't want an attacker to be able to manipulate.">Sink</span>
<span class="dataflow__step">1</span>
</div>
</div>
<div class="card__panel fix-analysis">
<h2 class="card__panel__heading"><span class="heading-char">✓</span> Fix Analysis</h2>
<div class="card__panel__markdown"><h2 id="details">Details</h2>
<p>Without unlimited resources, software operating in the real world is inherently limited in the resources it may consume; similarly, servers are limited by the number of simultaneous sessions they can handle. Therefore, it is important for developers to design software that considers these real-world physical (or virtual) limitations and limits user sessions accordingly, both in terms of the number of user sessions and in the quantity of resources each user may demand. Software with this weakness does not include such limitations and as a result, individual user sessions may consume too many resources, leading to unintended software behavior including, potentially, denial of service. This can be compared to a single restaurant customer emptying out the entire buffet, leaving no food for other customers--or an entire busload mobbing the buffet all at once, with a similar effect. This may happen inadvertently or as a result of an attack by a malicious user.</p>
<h3 id="best-practices-for-prevention">Best practices for prevention</h3>
<ul>
<li>Test extensively to obtain baseline values indicating how the software performs in the real world under various conditions (normal and peak); use these values to determine reasonable software limits.</li>
<li>Set clear limits for all flexible parameters such as maximum allocable memory, number of processes within a given timeframe, file descriptors, requests per client, number of records per request, etc. This is particularly true for any parameters within user control.</li>
<li>Release all resources when no longer in use, including incorporating timeouts for inactive users, processes, and resources.</li>
<li>Familiarize Dev, Ops, and IT teams with best practices for recognizing and preventing DoS attacks and out-of-control resource allocation to prevent catastrophic failures.</li>
</ul>
</div>
</div>
</div>
</div>
<div class="card card--vuln disclosure--not-new severity--medium" data-snyk-test="medium">
<header class="card__header">
<div class="card__header__main">
<div class="severity-icon severity-icon--medium"></div>
<h2 class="card__title">Allocation of Resources Without Limits or Throttling</h2>
<div class="card__actions">
<span class="card__action card-dataflow is-selected" onclick="toggleCardView(event)">Data Flow</span>
<span class="card__action card-fix" onclick="toggleCardView(event)">Fix Analysis</span>
</div>
</div>
<ul class="card__meta">
<li class="card__meta__item">SNYK-CODE</li>
<li class="card__meta__item">CWE-770</li>
</ul>
</header>
<div class="card__section">
<div class="card__summary severity--medium">
<p>This endpoint handler performs a file system operation and does not use a rate-limiting mechanism. It may enable the attackers to perform Denial-of-service attacks. Consider using a rate-limiting middleware such as express-limit.</p>
<div class="file-location">Found in: <strong>routes/index.js (line : 89)</strong></div>
</div>
<div class="card__panel dataflow">
<h2 class="card__panel__heading"><span class="heading-char">⇣</span> Data Flow</h2>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">89:32</span>
<div class="dataflow__code"><span class="dataflow__codeprefix">exports.save_account_details = <br /></span><span class="marker">function(req, res, next</span><span class="dataflow__codesuffix">) {</span></div>
<span class="dataflow__badge" title="Data is 'tainted' if it comes from an insecure source such as a file, the network, or the user. This tainted data is passed to a sensitive sink, as described below.">Source</span>
<span class="dataflow__step">0</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">107:12</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> return <br /></span><span class="marker">res.render</span><span class="dataflow__codesuffix">('account.hbs', profile)</span></div>
<span class="dataflow__badge" title="Sinks are the operations that must receive clean data and that you wouldn't want an attacker to be able to manipulate.">Sink</span>
<span class="dataflow__step">1</span>
</div>
</div>
<div class="card__panel fix-analysis">
<h2 class="card__panel__heading"><span class="heading-char">✓</span> Fix Analysis</h2>
<div class="card__panel__markdown"><h2 id="details">Details</h2>
<p>Without unlimited resources, software operating in the real world is inherently limited in the resources it may consume; similarly, servers are limited by the number of simultaneous sessions they can handle. Therefore, it is important for developers to design software that considers these real-world physical (or virtual) limitations and limits user sessions accordingly, both in terms of the number of user sessions and in the quantity of resources each user may demand. Software with this weakness does not include such limitations and as a result, individual user sessions may consume too many resources, leading to unintended software behavior including, potentially, denial of service. This can be compared to a single restaurant customer emptying out the entire buffet, leaving no food for other customers--or an entire busload mobbing the buffet all at once, with a similar effect. This may happen inadvertently or as a result of an attack by a malicious user.</p>
<h3 id="best-practices-for-prevention">Best practices for prevention</h3>
<ul>
<li>Test extensively to obtain baseline values indicating how the software performs in the real world under various conditions (normal and peak); use these values to determine reasonable software limits.</li>
<li>Set clear limits for all flexible parameters such as maximum allocable memory, number of processes within a given timeframe, file descriptors, requests per client, number of records per request, etc. This is particularly true for any parameters within user control.</li>
<li>Release all resources when no longer in use, including incorporating timeouts for inactive users, processes, and resources.</li>
<li>Familiarize Dev, Ops, and IT teams with best practices for recognizing and preventing DoS attacks and out-of-control resource allocation to prevent catastrophic failures.</li>
</ul>
</div>
</div>
</div>
</div>
<div class="card card--vuln disclosure--not-new severity--medium" data-snyk-test="medium">
<header class="card__header">
<div class="card__header__main">
<div class="severity-icon severity-icon--medium"></div>
<h2 class="card__title">Allocation of Resources Without Limits or Throttling</h2>
<div class="card__actions">
<span class="card__action card-dataflow is-selected" onclick="toggleCardView(event)">Data Flow</span>
<span class="card__action card-fix" onclick="toggleCardView(event)">Fix Analysis</span>
</div>
</div>
<ul class="card__meta">
<li class="card__meta__item">SNYK-CODE</li>
<li class="card__meta__item">CWE-770</li>
</ul>
</header>
<div class="card__section">
<div class="card__summary severity--medium">
<p>This endpoint handler performs a file system operation and does not use a rate-limiting mechanism. It may enable the attackers to perform Denial-of-service attacks. Consider using a rate-limiting middleware such as express-limit.</p>
<div class="file-location">Found in: <strong>routes/index.js (line : 241)</strong></div>
</div>
<div class="card__panel dataflow">
<h2 class="card__panel__heading"><span class="heading-char">⇣</span> Data Flow</h2>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">241:18</span>
<div class="dataflow__code"><span class="dataflow__codeprefix">exports.import = <br /></span><span class="marker">function (req, res, next</span><span class="dataflow__codesuffix">) {</span></div>
<span class="dataflow__badge" title="Data is 'tainted' if it comes from an insecure source such as a file, the network, or the user. This tainted data is passed to a sensitive sink, as described below.">Source</span>
<span class="dataflow__step">0</span>
</div>
<div class="dataflow__item">
<span class="dataflow__lineno" title="line:column">259:5</span>
<div class="dataflow__code"><span class="dataflow__codeprefix"> <br /></span><span class="marker">fs.readFile('backup.txt', 'ascii', function (err, data</span><span class="dataflow__codesuffix">) {</span></div>
<span class="dataflow__badge" title="Sinks are the operations that must receive clean data and that you wouldn't want an attacker to be able to manipulate.">Sink</span>
<span class="dataflow__step">1</span>
</div>
</div>
<div class="card__panel fix-analysis">
<h2 class="card__panel__heading"><span class="heading-char">✓</span> Fix Analysis</h2>
<div class="card__panel__markdown"><h2 id="details">Details</h2>
<p>Without unlimited resources, software operating in the real world is inherently limited in the resources it may consume; similarly, servers are limited by the number of simultaneous sessions they can handle. Therefore, it is important for developers to design software that considers these real-world physical (or virtual) limitations and limits user sessions accordingly, both in terms of the number of user sessions and in the quantity of resources each user may demand. Software with this weakness does not include such limitations and as a result, individual user sessions may consume too many resources, leading to unintended software behavior including, potentially, denial of service. This can be compared to a single restaurant customer emptying out the entire buffet, leaving no food for other customers--or an entire busload mobbing the buffet all at once, with a similar effect. This may happen inadvertently or as a result of an attack by a malicious user.</p>
<h3 id="best-practices-for-prevention">Best practices for prevention</h3>
<ul>
<li>Test extensively to obtain baseline values indicating how the software performs in the real world under various conditions (normal and peak); use these values to determine reasonable software limits.</li>
<li>Set clear limits for all flexible parameters such as maximum allocable memory, number of processes within a given timeframe, file descriptors, requests per client, number of records per request, etc. This is particularly true for any parameters within user control.</li>