Skip to content

Commit 2b5e3bf

Browse files
authored
Merge pull request #32 from advanced-rest-client/fix/W-10881270/sanitize-server-description
Fix/w 10881270/sanitize server description
2 parents 672f814 + 6f2c62b commit 2b5e3bf

File tree

6 files changed

+39
-4
lines changed

6 files changed

+39
-4
lines changed

demo/W-10881270/W-10881270.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"asyncapi": "2.0.0",
3+
"info": {
4+
"title": "asyncapijson",
5+
"version": "1.0.1",
6+
"description": "some description"
7+
},
8+
"servers": {
9+
"server1": {
10+
"url": "https://server1.com/",
11+
"protocol": "https",
12+
"protocolVersion": "1"
13+
},
14+
"server2": {
15+
"url": "https://server2.com",
16+
"protocol": "https",
17+
"protocolVersion": "1",
18+
"description":"XSS_IS_HERE<img src=x onerror=alert(document.domain)>"
19+
}
20+
},
21+
"channels": {}
22+
}

demo/apis.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"no-endpoints/no-endpoints.raml": "RAML 1.0",
1111
"google-drive-api/google-drive-api.raml": "RAML 1.0",
1212
"async-api/async-api.yaml": "ASYNC 2.0",
13+
"W-10881270/W-10881270.json": "ASYNC 2.0",
1314
"exchange-experience-api/exchange-experience-api.raml": "RAML 0.8",
1415
"multiple-servers/multiple-servers.yaml": { "type": "OAS 3.0", "mime": "application/yaml" },
1516
"APIC-641/APIC-641.yaml": { "type": "OAS 3.0", "mime": "application/yaml" },

demo/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class ApiDemo extends ApiDemoPage {
2626
['multiple-servers', 'Multiple servers'],
2727
['async-api', 'AsyncAPI'],
2828
['APIC-641', 'APIC-641'],
29+
['W-10881270', 'W-10881270'],
2930
].map(
3031
([file, label]) => html`
3132
<anypoint-item data-src="${file}-compact.json">${label}</anypoint-item>

package-lock.json

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@api-components/api-summary",
33
"description": "A summary view for an API base on AMF data model",
4-
"version": "4.6.4",
4+
"version": "4.6.5",
55
"license": "Apache-2.0",
66
"main": "index.js",
77
"module": "index.js",

src/ApiSummary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ export class ApiSummary extends AmfHelperMixin(LitElement) {
412412
const description = this._computeDescription(server);
413413
return html`<li>
414414
${uri}
415-
<arc-marked .markdown=${description} class="server-description"></arc-marked>
415+
<arc-marked .markdown=${description} class="server-description" sanitize></arc-marked>
416416
</li>`;
417417
}
418418

0 commit comments

Comments
 (0)