feat: add Workflows plugin (tool + backend)#4
Conversation
| // (LayerInfoModal renders layer.description through showdown). | ||
| function buildLayerDescription(jobId, job) { | ||
| const lines = ['Generated by the Workflows tool.', ''] | ||
| if (job.name) lines.push(`**Run:** ${job.name}`) |
There was a problem hiding this comment.
XSS. Make sure job.names like <img src=x onerror=alert(document.domain)> don't inject code.
There was a problem hiding this comment.
Still complaining about:
- mdSafe() does NOT fully close the stored XSS (this is the important one). It escapes < > & \ |and_ *, which kills the raw-tag and code-span-breakout vectors — but it leaves ", !, [, ], (, )` untouched, so markdown image/link syntax still injects HTML. Confirmed against showdown:
Run name / payload value =
)
→ renders as
<img src="https://a/b.png"onerror="alert(document.domain)" alt="" />
That's an auto-firing onerror (no click needed), stored into the shared mission config → fires for every user who opens that layer's Info modal.
Also [click](javascript:alert(1)) → <a href="javascript:alert(1)">click</a> (click-required, but still stored).
Fix: extend mdSafe() to also escape the double-quote and neutralize markdown link/image punctuation, e.g. append:
.replace(/"/g, '"')
.replace(/[\[\]()!]/g, (m) => '\\' + m)
| lines.push('| Parameter | Value |') | ||
| lines.push('| --- | --- |') | ||
| entries.forEach(([k, v]) => { | ||
| lines.push(`| \`${k}\` | \`${v}\` |`) |
There was a problem hiding this comment.
XSS. Make sure key and values like the following do not inject code.
a`<img src=x onerror=alert(1)>`b
There was a problem hiding this comment.
Addressed in latest push.
|
Oh, also do update the main README.md and add the Workflows plugin to it. Thanks! |
Workflows integration for MMGIS: submit jobs against a configured workflows API (cookie OAuth via inline connect link), track/filter/ rename runs with per-user history, and add completed runs' tile STAC items as mission layers — grouped under a "Workflow Outputs" header, with TiTiler rescale options seeded from item raster statistics and provenance shown in the layer info modal. Backend module stores per-user submission history (endpoint, payload, run name) in the workflow_submissions table. Data-source URI fields carry no baked-in defaults — they're omitted from payloads and the API applies its own deployment-specific defaults server-side. All user-controlled values interpolated into layer descriptions and display names are escaped/stripped against stored XSS (descriptions render through showdown and persist into the shared mission config).
cbc9788 to
238e1e1
Compare
|
@jdrodjpl Almost there, just my last message above and then a bit more for the XSS issue |
Workflows integration for MMGIS: submit jobs against a configured workflows API (cookie OAuth via inline connect link), track/filter/ rename runs with per-user history, and add completed runs' tile STAC items as mission layers — grouped under a "Workflow Outputs" header, with TiTiler rescale options seeded from item raster statistics and provenance shown in the layer info modal.
Backend module stores per-user submission history (endpoint, payload, run name) in the workflow_submissions table.
Data-source URI fields carry no baked-in defaults — they're omitted from payloads and the API applies its own deployment-specific defaults server-side.