aboutsummaryrefslogtreecommitdiffstats
path: root/lib/srtgui/templates/cve.html_orig
blob: e5ec7eff16a299ec35fe627ccb23a36865f8a52d (plain)
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
{% extends "base.html" %}

{% load projecttags %}

{% block title %} {{cve_list_table.0.0.name}} - SRTool {% endblock %}

{% block pagecontent %}

<div class="row">
  <!-- Breadcrumbs -->
    <div class="col-md-12">
        <ul class="breadcrumb" id="breadcrumb">
            <li><a href="{% url 'landing' %}">Home</a></li><span class="divider">&rarr;</span>
            <li><a href="{% url 'cves' %}">CVE's</a></li><span class="divider">&rarr;</span>
            <li>{{cve_list_table.0.0.name}}</li>
            <li><a class="btn btn-default navbar-btn " id="cve-prev" href="{% url 'cve' cve_prev %}">Prev</a></li>
            <li><a class="btn btn-default navbar-btn " id="cve-next" href="{% url 'cve' cve_next %}">Next</a></li>
        </ul>
    </div>
</div>

<!-- Begin container -->


<div class="row">
  <div class="col-md-12">
    <div class="page-header build-data">
        <h1 style="display:inline-block;vertical-align: middle;">{{cve_list_table.0.0.name}} Detail {% if not cve_list_table.0.0.public %} <font color="red">[PRIVATE]</font> {% endif %}</h1>
        {% if access.is_creator %}
            <span style="padding-left:30px;"><button id="select-quickedit" class="btn btn-default" type="button">Edit SRTool Status...</button></span>
            <span style="padding-left:30px;"><button id="select-cveedit" class="btn btn-default" type="button">Edit CVE Data ...</button></span>
        {% endif %}
    </div>
  </div>
</div>


<div class="row" style="padding-left: 25px;">
<UL>
    <LI>
    <i>SRTool Priority:</i> {{cve_list_table.0.0.get_priority_text}}
    </LI>
    <LI>
    <i>SRTool Status:</i> {{cve_list_table.0.0.get_status_text}}
    </LI>
    <LI>
    <i>SRTool Notes:</i> '{{cve_list_table.0.0.comments}}'
    {% if access.is_creator %}
    </LI>
    <LI>
    <i>SRTool Private Notes:</i> '{{cve_list_table.0.0.comments_private}}'
    {% endif %}
    </LI>
    <LI>
    {% if access.is_creator %}
        <i>Publish = {{cve_list_table.0.0.get_publish_text}}</i>
        <!--<a class="btn btn-default navbar-btn " id="login-button" href="">Publish Now</a> -->
    {% else %}
        <i>Publish</i> = {{cve_list_table.0.0.get_publish_text}}, <i>Publish Date</i> = {{cve_list_table.0.0.publish_date}}
    {% endif %}
    </LI>
</UL>


</div>
<!-- Quick Edit -->
<div id="details-quickedit" style="display:none;">
    <p><p>
    <button class="execute" id="submit-quickedit"> Submit Changes </button>
    <p><i>Priority</i> =
    <select name="Priority" id="select-priority-state">
    <option value="0" {% if 0 == cve_list_table.0.0.priority %}selected{% endif %}></option>
    <option value="1" {% if 1 == cve_list_table.0.0.priority %}selected{% endif %}>Minor</option>
    <option value="2" {% if 2 == cve_list_table.0.0.priority %}selected{% endif %}>Low</option>
    <option value="3" {% if 3 == cve_list_table.0.0.priority %}selected{% endif %}>Medium</option>
    <option value="4" {% if 4 == cve_list_table.0.0.priority %}selected{% endif %}>High</option>
    </select>
    <p><input type="text" placeholder="Edit Note" id="text-note" size="40" value="{{cve_list_table.0.0.comments}}"></p>
    <p><input type="text" placeholder="Edit Private Note" id="text-private-note" size="40" value="{{cve_list_table.0.0.comments_private}}"></p>
    <i>Publish</i> =
    <select name="Publish" id="select-publish-state">
    <option value="0" {% if 0 == cve_list_table.0.0.publish_state %}selected{% endif %}>Unpublished</option>
    <option value="1" {% if 1 == cve_list_table.0.0.publish_state %}selected{% endif %}>Not to be Published</option>
    <option value="2" {% if 2 == cve_list_table.0.0.publish_state %}selected{% endif %}>Published</option>
    <option value="3" {% if 3 == cve_list_table.0.0.publish_state %}selected{% endif %}>Publish Request (New)</option>
    <option value="4" {% if 4 == cve_list_table.0.0.publish_state %}selected{% endif %}>Publish Request (Update)</option>
    <option value="5" {% if 5 == cve_list_table.0.0.publish_state %}selected{% endif %}>Publish Submitted</option>
    </select>
    <i>Publish Date</i> = <input type="text" placeholder="Auto Publish Date" id="select-publish-date" size="40" value="{{cve_list_table.0.0.publish_date}}"><p>
    <p><p>
</div>

<div class="row">
  <div class="col-md-8 tabbable">
    <ul class="nav nav-tabs">
        {% for object,details,state,id in cve_list_table %}
        <li class="{{state}}">
            <a href="#{{id}}" data-toggle="tab">
                <span class="glyphicon glyphicon-question-sign get-help" title="{{id}}"></span>
                {{id}}
            </a>
        </li>
        {% endfor %}
    </ul>

    <div class="tab-content">
      {% for object,details,state,id in cve_list_table %}
      <div class="tab-pane {{state}}" id="{{id}}">

<!-- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->

        <!-- Row: Description and Quick Info -->
        <div class="row">
          <div class="col-md-5">
            <div>
                <h3>Decription</h3>
                {{object.description}}
            </div>
            <p/>
            <div>
             <B>Source:</B> {{object.cve_data_format}}      <B>Last Modified:</B>  {{object.lastModifiedDate}}
            </div>
          </div>
          <div class="col-md-5">
            <div class="well">
              <h2>Quick Info</h2>


                    <dl class="dl-horizontal">
                        <dt>CVE Dictionary Entry:</dt>
                        <dd>{{object.name}}</dd>

                        <dt>Original release date:</dt>
                        <dd>{{object.publishedDate}}</dd>

                        <dt>Last revised:</dt>
                        <dd>{{object.lastModifiedDate}}</dd>

                        <dt>Source:</dt>
                        <dd>{{object.cve_data_format}}</dd>

                        {% if id == "Summary" %}
                            <dt>SRTool Vulnerability:</dt>
                            <dd>
                            {% if object.cve_to_vulnerability.all %}
                              {% for cv in object.cve_to_vulnerability.all %}
                                {% if not forloop.first %}| {% endif %}<a href="{% url 'vulnerability' cv.vulnerability.pk %}">{{cv.vulnerability.name}}</a>
                              {% endfor %}
                            {% else %}
                               No vulnerability record found
                            {% endif %}
                        {% endif %}
                        </dd>

                        <dt>NIST Link:</dt>
                        <dd><a href="https://nvd.nist.gov/vuln/detail/{{object.name}}" target="_blank">{{object.name}}</a></dd>

                   </dl>
            </div>
          </div>
        </div> <!-- /Description -->

        <!-- Row: CVSS -->
        <div class="row"  style="padding-left: 25px;">
          <h3>Impact</h3>
          <div class="col-md-4">
            <h3>CVSS Severity (version 3.0):</h3>
                <dl class="dl-horizontal">
                    <dt>CVSS v3 Base Score:</dt>
                    <dd>{{details.cvssV3_baseScore}} {{details.cvssV3_baseSeverity}}</dd>

                    <dt>Vector:</dt>
                    <dd>{{details.cvssV3_vectorString}}</dd>

                    <dt>Impact Score:</dt>
                    <dd>{{details.cvssV3_impactScore}}</dd>

                    <dt>Exploitability Score:</dt>
                    <dd>{{details.cvssV3_exploitabilityScore}}</dd>
               </dl>
            <h3>CVSS Version 3 Metrics:</h3>
                <dl class="dl-horizontal">
                    <dt>Attack Vector (AV):</dt>
                    <dd>{{details.cvssV3_attackVector}}</dd>

                    <dt>Attack Complexity (AC):</dt>
                    <dd>{{details.cvssV3_attackComplexity}}</dd>

                    <dt>Privileges Required (PR):</dt>
                    <dd>{{details.cvssV3_privilegesRequired}}</dd>

                    <dt>User Interaction (UI):</dt>
                    <dd>{{details.cvssV3_userInteraction}}</dd>

                    <dt>Scope (S):</dt>
                    <dd>{{details.cvssV3_scope}}</dd>

                    <dt>Confidentiality (C):</dt>
                    <dd>{{details.cvssV3_confidentialityImpact}}</dd>

                    <dt>Integrity (I):</dt>
                    <dd>{{details.cvssV3_integrityImpact}}</dd>

                    <dt>Availability (A):</dt>
                    <dd>{{details.cvssV3_availabilityImpact}}</dd>
               </dl>
          </div>
          <div class="col-md-4">
            <h3>CVSS Severity (version 2.0):</h3>
                <dl class="dl-horizontal">
                    <dt>CVSS v2 Base Score:</dt>
                    <dd>{{details.cvssV2_baseScore}} {{details.cvssV2_severity}}</dd>

                    <dt>Vector:</dt>
                    <dd>{{details.cvssV2_vectorString}}</dd>

                    <dt>Impact Subscore:</dt>
                    <dd>{{details.cvssV2_impactScore}}</dd>

                    <dt>Exploitability Subscore:</dt>
                    <dd>{{details.cvssV2_exploitabilityScore}}</dd>

               </dl>
            <h3>CVSS Version 2 Metrics:</h3>
                <dl class="dl-horizontal">
                    <dt>Access Vector (AV):</dt>
                    <dd>{{details.cvssV2_accessVector}}</dd>

                    <dt>Access Complexity (AC):</dt>
                    <dd>{{details.cvssV2_accessComplexity}}</dd>

                    <dt>Authentication:</dt>
                    <dd>{{details.cvssV2_authentication}}</dd>

                    <dt>Impact Type:</dt>
                    <dd>???</dd>

               </dl>
          </div>
        </div> <!-- /CVSS -->

        <!-- Row: References -->
        <div class="row" style="padding-left: 25px;">
            <h3>References to Advisories, Solutions, and Tools</h3>
            <p>
            By selecting these links, you will be leaving NIST webspace. We have provided these links to other web sites
            because they may have information that would be of interest to you. No inferences should be drawn on account
            of other sites being referenced, or not, from this page. There may be other web sites that are more appropriate
            for your purpose. NIST does not necessarily endorse the views expressed, or concur with the facts presented on
            these sites. Further, NIST does not endorse any commercial products that may be mentioned on these sites. Please
            address comments about this page to nvd@nist.gov.
            </p>
            <table class="table table-striped table-condensed" data-testid="vuln-hyperlinks-table">
                <thead>
                    <tr>
                        <th>Hyperlink</th>
                        <th>Resource</th>
                    </tr>
                </thead>
                {% if object.references.all %}
                  {% for ref in object.references.all %}
                    <tr>
                        <td><a href="{{ref.hyperlink}}" target="_blank">{{ ref.hyperlink }}</a></td>
                        <td>{{ ref.resource }}</td>
                    </tr>
                  {% endfor %}
                {% else %}
                    <tr>
                        <td>No references</td>
                    </tr>
                {% endif %}
            </table>
        </div> <!-- /References -->

        <!-- Row: CWE -->
        <div class="row" style="padding-left: 25px;">
            <h3>Technical Details</h3>
            <p>
            <h4>Vulnerability Type<a href="{% url 'cwes' %}">  (View All)</a></h4>
            <p>
            <table class="table table-striped table-condensed" data-testid="cve2cwe-hyperlinks-table">
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Summary</th>
                    </tr>
                </thead>
                {% if object.cve2cwe.all %}
                  {% for ref in object.cve2cwe.all %}
                    <tr>
                        <td>{{ ref.cwe.name }}</td>
                        <td>{{ ref.cwe.summary }}</td>
                    </tr>
                  {% endfor %}
                {% else %}
                    <tr>
                        <td>No CWE references</td>
                    </tr>
                {% endif %}
            </table>
        </div> <!-- /CWE -->

        <!-- Row: CPE -->
        <div class="row" style="padding-left: 25px;">
            <h3>Vulnerable software and versions</h3>
            <div > <!--style="padding-left: 25px;" -->
              {% if details.get_cpe_list %}
                {% for cpe in details.get_cpe_list %}
                  {% if not cpe %}
                  {% elif not cpe.0 %}
                  {% elif '[config' in cpe.0 %}
                    <div style="padding-left: 25px;">
                    <h4>&bull; Configuration </h3>
                  {% elif '[and]' == cpe.0 %}
                        <div style="padding-left: 25px;">
                        <h4>&bull; AND</h3>
                  {% elif '[or]' == cpe.0 %}
                            <div  style="padding-left: 25px;">
                            <h4>&bull; OR</h3>
                            <table class="table table-striped table-condensed" data-testid="configs-hyperlinks-table">
                                <thead>
                                    <tr>
                                        <th>Vulnerable</th>
                                        <th>CPE 2.3</th>
                                        <th>CPE 2.2</th>
                                        <th><!--<span class="glyphicon glyphicon-question-sign get-help" title="Version End Including"></span>-->Version End</th>
                                    </tr>
                                </thead>
                  {% elif '[/or]' == cpe.0 %}
                            </table>
                            </div>
                  {% elif '[/and]' == cpe.0 %}
                        </div>
                  {% elif '[/config]' == cpe.0 %}
                    </div>
                  {% else %}
                                    <tr>
                                        <td>{{ cpe.0 }}</td>
                                        <td>{{ cpe.1 }}</td>
                                        <td>{{ cpe.2 }}</td>
                                        <td>{{ cpe.3 }}</td>
                                    </tr>
                  {% endif %}
                {% endfor %}
              {% else %}
              No CPE configurations
              {% endif %}
            </div>
            <p>
        </div> <!-- /CPE -->


<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->

      </div> <!-- end tab-pane -->
      {% endfor %}
    </div> <!-- end tab-content -->

  </div> <!-- end tabbable -->
</div> <!-- end row -->

<div class="row" style="padding-left: 25px;">
    <h3>History</h3>

    <table class="table table-striped table-condensed" data-testid="vuln-hyperlinks-table">
        <thead>
            <tr>
                <th>Comment</th>
                <th>Date</th>
                <th>Author</th>
            </tr>
        </thead>

        {% if cve_list_table.1.0.cve_history.all %}
          {% for c in cve_list_table.1.0.cve_history.all %}
            <tr>
                <td>{{ c.comment }}</td>
                <td>{{ c.date }}</td>
                <td>{{ c.author }}</td>
            </tr>
          {% endfor %}
        {% else %}
            <tr>
                <td>No history found</td>
            </tr>
        {% endif %}
    </table>
</div>

<HR ALIGN="center" WIDTH="100%">

<script>
    var selected_quickedit=false;

    $(document).ready(function() {
        function onCommitAjaxSuccess(data, textstatus) {
            if (window.console && window.console.log) {
                console.log("XHR returned:", data, "(" + textstatus + ")");
            } else {
                alert("NO CONSOLE:\n");
                return;
            }
            if (data.error != "ok") {
                alert("error on request:\n" + data.error);
                return;
            }
            // reload the page with the updated tables
            location.reload(true);
        }

        function onCommitAjaxError(jqXHR, textstatus, error) {
            console.log("ERROR:"+error+"|"+textstatus);
            alert("XHR errored1:\n" + error + "\n(" + textstatus + ")");
        }

        /* ensure cookie exists {% csrf_token %} */
        function postCommitAjaxRequest(reqdata) {
        reqdata['cve_id'] = {{ object.id }};
        var ajax = $.ajax({
                type:"POST",
                data: reqdata,
                url:"{% url 'xhr_cve_commit' %}",
                headers: { 'X-CSRFToken': $.cookie("csrftoken")},
                success: onCommitAjaxSuccess,
                error: onCommitAjaxError,
            })
        }

        $('#select-quickedit').click(function(){
            if (selected_quickedit) {
                selected_quickedit=false;
                $("#details-quickedit").slideUp();
            } else {
                selected_quickedit=true;
                $("#details-quickedit").slideDown();
            }
        });

        $('#select-cveedit').click(function(){
        	window.location.replace("{% url 'cve_edit' cve_list_table.0.0.name %}");
        });

        $('#submit-quickedit').click(function(){
            var note=$('#text-note').val().trim();
            var private_note=$('#text-private-note').val().trim();
            var priority=$('#select-priority-state').val();
            var publish_state=$('#select-publish-state').val();
            var publish_date=$('#select-publish-date').val();
            postCommitAjaxRequest({
                "action"        : 'submit-quickedit',
                "priority"      : priority,
                "note"          : note,
                "private_note"  : private_note,
                "publish_state" : publish_state,
                "publish_date"  : publish_date,
                });
        });

        /* Set the report link */
        $('#report_link').attr('href',"{% url 'report' request.resolver_match.url_name %}?record_list={{cve_list_table.0.0.id}}");
    });
</script>
{% endblock %}