@forwardimpact/pathway 0.25.6 → 0.25.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forwardimpact/pathway",
3
- "version": "0.25.6",
3
+ "version": "0.25.7",
4
4
  "description": "Career progression web app and CLI for exploring roles and generating agent teams",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -38,6 +38,20 @@ import {
38
38
  } from "./formatters/index.js";
39
39
  import { sortTracksByName } from "./formatters/track/shared.js";
40
40
 
41
+ /**
42
+ * Escape HTML special characters to prevent XSS
43
+ * @param {string} text
44
+ * @returns {string}
45
+ */
46
+ function escapeHtml(text) {
47
+ return text
48
+ .replace(/&/g, "&")
49
+ .replace(/</g, "&lt;")
50
+ .replace(/>/g, "&gt;")
51
+ .replace(/"/g, "&quot;")
52
+ .replace(/'/g, "&#039;");
53
+ }
54
+
41
55
  /**
42
56
  * Create a chapter cover page
43
57
  * @param {Object} params
@@ -425,7 +439,7 @@ async function init() {
425
439
  container.innerHTML = `
426
440
  <div class="slide-error">
427
441
  <h1>Initialization Error</h1>
428
- <p>${error.message}</p>
442
+ <p>${escapeHtml(String(error.message))}</p>
429
443
  </div>
430
444
  `;
431
445
  hideLoading();