Skip to content

Commit dc30d5b

Browse files
Copilotlimonte
andauthored
Add security note for swal-function-param (#240)
* Initial plan * Initial plan for security note Co-authored-by: limonte <[email protected]> * Add security note for swal-function-param in declarative templates docs Co-authored-by: limonte <[email protected]> * Revert bun.lock changes Co-authored-by: limonte <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: limonte <[email protected]>
1 parent 22db731 commit dc30d5b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/DeclarativeTemplates.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ export function DeclarativeTemplates() {
113113
language="xml"
114114
withoutCodepen
115115
/>
116+
<p className="center">
117+
[Security] The <strong>value</strong> attribute of <strong>swal-function-param</strong> is evaluated using{' '}
118+
<code>new Function()</code>, which behaves like <code>eval()</code>. Only use{' '}
119+
<strong>swal-function-param</strong> with trusted template content.
120+
</p>
116121
</div>
117122

118123
<div className="center-container mobile-hidden">

0 commit comments

Comments
 (0)