From d79b31d749ed2603d3b1777e0aadecc32837e8a0 Mon Sep 17 00:00:00 2001 From: anupamme Date: Fri, 2 Oct 2026 21:30:11 +0000 Subject: [PATCH] fix: multi_agent.cwe-79 security vulnerability Automated security fix generated by OrbisAI Security --- MMM-CalendarExtMiniMonth.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MMM-CalendarExtMiniMonth.js b/MMM-CalendarExtMiniMonth.js index 1c19873..ed9f359 100644 --- a/MMM-CalendarExtMiniMonth.js +++ b/MMM-CalendarExtMiniMonth.js @@ -52,6 +52,12 @@ function formatPattern(date, pattern, locale) { } } +function escapeHtml(value) { + return String(value).replace(/[&<>"']/g, function (ch) { + return { '&': '&', '<': '<', '>': '>', '"': '"', '\'': ''' }[ch] + }) +} + function toTimestampMs(value) { if (value instanceof Date) { return value.getTime() @@ -179,7 +185,7 @@ Module.register('MMM-CalendarExtMiniMonth', { } return { name: calendarName, - title: event.title, + title: event.title ? escapeHtml(event.title) : event.title, startDate: startDate, endDate: endDate, fullDayEvent: !!event.fullDayEvent,