Program: CWE-79
Project: CVE-2021-30071
Buggy source:
    <div class="l-center">
      <div class="l-sort clearfix noselect">
        <div class="l-unit-toolbar__buttonstrip">
          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/edit/user/?user=<?php echo $user;?>"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
          <?php
            echo '<a href="/add/key/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i>'._('Add SSH Key').'</a>';
          ?>
      </div>
     </div>
    </div>
    
<div class="l-separator"></div>

<div class="l-center units">
  <div class="header table-header">     
    <div class="l-unit__col l-unit__col--right">
      <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('SSH_ID');?></b></div>
      <div class="clearfix l-unit__stat-col--left compact-2">
        &nbsp;
      </div> 
      <div class="clearfix l-unit__stat-col--left wide-7"><b><?php print _('SSH KEY');?></b></div>
    </div>
  </div>

 <?php
 	$i = 0;
    foreach ($data as $key => $value) {
    ++$i;
  ?>
  <div class="l-unit header animated fadeIn">
    <div class="l-unit__col l-unit__col--right">
      <div class="clearfix l-unit__stat-col--left wide-3"><b><?=$data[$key]['ID'];?></b></div>
          <div class="clearfix l-unit__stat-col--left text-left compact-2">
            <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
              <div class="actions-panel clearfix">
                <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
                  <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
                    <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
                    <input type="hidden" name="delete_url" value="/delete/key/?key=<?=$key?>&token=<?=$_SESSION['token']?>" />
                    <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
                      <p class="confirmation"><?=sprintf(_('DELETE_KEY_CONFIRM'),$key)?></p>
                    </div>
                  </a>
                </div>
              </div>
            </div>
          </div>
        <div class="clearfix l-unit__stat-col--left wide-7"><b><?=htmlspecialchars($data[$key]['KEY'], ENT_QUOTES);?></b></div>
      </div>
    </div>
  <?}?>
</div>

<div id="vstobjects">
    <div class="l-separator"></div>
        <div class="l-center">
            <div class="l-unit-ft">
                <table class='data'></table>
                <div class="data-count l-unit__col l-unit__col--right clearfix">
                <?php
                printf(ngettext('%d SSH Key', '%d SSH Keys', $i),$i);
                ?>
      </div>
    </div>
  </div>
</div>
    

Fixed version (ground truth):
    <div class="l-center">
      <div class="l-sort clearfix noselect">
        <div class="l-unit-toolbar__buttonstrip">
          <a class="ui-button cancel" dir="ltr" id="btn-back" href="/edit/user/?user=<?php echo $user;?>"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
          <?php
            echo '<a href="/add/key/" id="btn-create" class="ui-button cancel" dir="ltr"><i class="fas fa-plus-circle status-icon green"></i>'._('Add SSH Key').'</a>';
          ?>
      </div>
     </div>
    </div>
    
<div class="l-separator"></div>

<div class="l-center units">
  <div class="header table-header">     
    <div class="l-unit__col l-unit__col--right">
      <div class="clearfix l-unit__stat-col--left wide-3"><b><?php print _('SSH_ID');?></b></div>
      <div class="clearfix l-unit__stat-col--left compact-2">
        &nbsp;
      </div> 
      <div class="clearfix l-unit__stat-col--left wide-7"><b><?php print _('SSH KEY');?></b></div>
    </div>
  </div>

 <?php
 	$i = 0;
    foreach ($data as $key => $value) {
    ++$i;
  ?>
  <div class="l-unit header animated fadeIn">
    <div class="l-unit__col l-unit__col--right">
      <div class="clearfix l-unit__stat-col--left wide-3"><b><?=htmlspecialchars($data[$key]['ID']);?></b></div>
          <div class="clearfix l-unit__stat-col--left text-left compact-2">
            <div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
              <div class="actions-panel clearfix">
                <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
                  <a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
                    <i class="fas fa-trash status-icon red status-icon dim do_delete"></i>
                    <input type="hidden" name="delete_url" value="/delete/key/?key=<?=$key?>&token=<?=$_SESSION['token']?>" />
                    <div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
                      <p class="confirmation"><?=sprintf(_('DELETE_KEY_CONFIRM'),$key)?></p>
                    </div>
                  </a>
                </div>
              </div>
            </div>
          </div>
        <div class="clearfix l-unit__stat-col--left wide-7"><b><?=htmlspecialchars($data[$key]['KEY'], ENT_QUOTES);?></b></div>
      </div>
    </div>
  <?}?>
</div>

<div id="vstobjects">
    <div class="l-separator"></div>
        <div class="l-center">
            <div class="l-unit-ft">
                <table class='data'></table>
                <div class="data-count l-unit__col l-unit__col--right clearfix">
                <?php
                printf(ngettext('%d SSH Key', '%d SSH Keys', $i),$i);
                ?>
      </div>
    </div>
  </div>
</div>