This commit escapes `<` `>` and related characters in the serialized state that is encoded into the `<script id=__FRSH_STATE>` tag. This prevents XSS attack occuring through injection of a `</script>` string in island props.
16 lines
493 B
TypeScript
16 lines
493 B
TypeScript
import Counter from "../../islands/Counter.tsx";
|
|
import KebabCaseFileNameTest from "../../islands/kebab-case-counter-test.tsx";
|
|
import Test from "../../islands/Test.tsx";
|
|
|
|
export default function Home() {
|
|
return (
|
|
<div>
|
|
<Counter id="counter1" start={3} />
|
|
<Counter id="counter2" start={10} />
|
|
<KebabCaseFileNameTest id="kebab-case-file-counter" start={5} />
|
|
<Test message="" />
|
|
<Test message={`</script><script>alert('test')</script>`} />
|
|
</div>
|
|
);
|
|
}
|