1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-6328] Checkmarx - Resolve warnings (#7941)

This commit is contained in:
Oscar Hinton
2024-02-15 22:25:53 +01:00
committed by GitHub
parent c8c1ed42ba
commit 02dde0c0d3
49 changed files with 101 additions and 85 deletions

View File

@@ -75,6 +75,8 @@ export class AvatarComponent implements OnChanges {
svg.appendChild(charObj);
const html = window.document.createElement("div").appendChild(svg).outerHTML;
const svgHtml = window.btoa(unescape(encodeURIComponent(html)));
// This is safe because the only user provided value, chars is set using `textContent`
this.src = this.sanitizer.bypassSecurityTrustResourceUrl(
"data:image/svg+xml;base64," + svgHtml,
);
@@ -117,6 +119,7 @@ export class AvatarComponent implements OnChanges {
'"Open Sans","Helvetica Neue",Helvetica,Arial,' +
'sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"',
);
// Warning do not use innerHTML here, characters are user provided
textTag.textContent = character;
textTag.style.fontWeight = this.svgFontWeight.toString();
textTag.style.fontSize = this.svgFontSize + "px";

View File

@@ -104,6 +104,7 @@ component library and the other clients will follow once this work is completed.
className="link-item"
href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
target="_blank"
rel="noreferrer"
>
<span>
<strong>Data</strong>
@@ -115,13 +116,18 @@ component library and the other clients will follow once this work is completed.
<div className="subheading">Learn</div>
<div className="link-list">
<a className="link-item" href="https://storybook.js.org/docs" target="_blank">
<a className="link-item" href="https://storybook.js.org/docs" target="_blank" rel="noreferrer">
<span>
<strong>Storybook documentation</strong>
Configure, customize, and extend
</span>
</a>
<a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
<a
className="link-item"
href="https://storybook.js.org/tutorials/"
target="_blank"
rel="noreferrer"
>
<span>
<strong>In-depth guides</strong>
Best practices from leading teams