#5906·kanboard

[Bug]: Stored XSS via project name in the analytic AJAX layout (AnalyticController)

Author: tao0845Created Sep 25, 2026Updated Sep 25, 2026
Labelstriage needed

Bug Summary

Kanboard 1.2.54 is affected by a stored cross-site scripting vulnerability in the AJAX rendering path used by project Analytics views. A project manager can store an HTML/JavaScript payload in a project name. When a project manager or application administrator opens an Analytics view for that project, the payload is rendered unescaped in the modal title and executes in the viewer's browser.

Description

ProjectEditController::update() accepts a project name and ProjectModel::update() stores it without HTML sanitization. ProjectValidator::validateModification() applies required and maximum-length validation but does not encode or filter HTML.

For all AnalyticController actions, LayoutHelper::analytic() builds a title by concatenating the project name with the analytic-view title:

php
if (isset($params['project']['name'])) {
    $params['title'] = $params['project']['name'].' > '.$params['title'];
}

For AJAX requests, app/Template/analytic/layout.php renders the title with raw PHP output:

php
<?php if ($is_ajax): ?>
    <div class="page-header">
        <h2><?= $title ?></h2>
    </div>
<?php endif ?>

The front-end modal inserts the AJAX response through element.innerHTML = html; therefore, attacker-controlled markup in the project name is parsed and executed by the browser.

The affected actions are taskDistribution, userDistribution, cfd, burndown, averageTimeByColumn, leadAndCycleTime, timeComparison, and estimatedVsActualByColumn.

Steps to Reproduce

  1. Log in as a user with the project-manager role for a project.

  2. Open the project edit page and obtain the CSRF token.

  3. Change the project name to the following payload and save it:

    xml
    <img src=x onerror=alert(document.domain)>
  4. Open Analytics for the same project, for example Task distribution.

  5. Load the analytic view through its AJAX request:

    http
    GET /index.php?controller=AnalyticController&action=taskDistribution&project_id=1 HTTP/1.1
    Host: TARGET
    Cookie: KB_SID=<SESSION>
    X-Requested-With: XMLHttpRequest
  6. Observe the unescaped project name in the <h2> element of the response. When the response is opened through the modal, the payload executes.

Expected Behavior

Project names must be HTML-escaped before being included in the analytic AJAX title. The response should render the payload as text:

xml
<h2>&lt;img src=x onerror=alert(document.domain)&gt; &gt; Task distribution</h2>

Actual Behavior

The project name is output without escaping:

xml
<h2><img src=x onerror=alert(document.domain)> &gt; Task distribution</h2>

The AJAX modal injects the returned HTML using innerHTML, causing the stored JavaScript payload to execute in the browser session of a project manager or application administrator viewing the affected project.

Version

1.2.54

Database

Any Kanboard-supported database backend

PHP Version

No response

Browser

No response

Operating System

No response

Relevant Logs or Error Output

bash

Additional Context

No response

Checklist

  • I have searched existing issues to ensure this bug hasn't been reported before.
  • I verified that the problem is not caused by a plugin. Please report the issue to the plugin author if applicable.