بتل کد Battle Codeدارد باز می‌شود…

جواب «Step 2: The Report Page» چالش 2 از جلسه‌ی 64

سؤال

گزارش را به‌صورت یک صفحه‌ی HTML بساز که بتوانی ارائه بدهی. لازم‌ها: یک h1 که شامل Security report باشد؛ شش بخش با idهای summary، scope، map، findings، fixes، remaining، هر کدام با یک h2؛ در #findings یک table با یک ردیف سرستون (thهای Severity، Where، What، Fix) و دست‌کم دو ردیف داده (td)؛ و در #map یک ul با دست‌کم سه li.

راهنما

ساختار جلسه‌ی ۱۱ وب (جدول) و ۱۳ (بخش‌ها با id) را به یاد بیاور.

یک جواب درست

<h1>Security report: Guestbook</h1>

<section id="summary">
  <h2>Summary</h2>
  <p>We reviewed the guestbook (3 pages) with the 10-item checklist. We found 4 issues: 2 high, 1 medium, 1 low.</p>
</section>

<section id="scope">
  <h2>Scope and method</h2>
  <p>Pages: index, guestbook, login. Method: the 10-item checklist, manual review, retest in the preview.</p>
</section>

<section id="map">
  <h2>Attack surface</h2>
  <ul>
    <li>input: #name, #message</li>
    <li>output: #entries (was innerHTML)</li>
    <li>resource: pics/cat.svg (own)</li>
  </ul>
</section>

<section id="findings">
  <h2>Findings</h2>
  <table>
    <tr><th>Severity</th><th>Where</th><th>What</th><th>Fix</th></tr>
    <tr><td>high</td><td>guestbook.js:12</td><td>innerHTML with user text</td><td>createElement + textContent</td></tr>
    <tr><td>high</td><td>login.js:8</td><td>no lockout</td><td>lock after 3 wrong tries</td></tr>
    <tr><td>low</td><td>login.js:15</td><td>chatty error</td><td>one generic message</td></tr>
  </table>
</section>

<section id="fixes">
  <h2>Fixes and retest</h2>
  <p>All three fixed; the XSS test with &lt;b&gt;hi&lt;/b&gt; now shows plain text; three wrong passwords lock the account.</p>
</section>

<section id="remaining">
  <h2>Remaining work</h2>
  <p>Add a CSP header when the page goes live; add logging (phase 3).</p>
</section>

اول خودت امتحان کن؛ جواب‌های دیگر هم قبول است. برگرد و خودت حلش کن