Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code scanning alert no. 9: Stored cross-site scripting #188

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/MemberCard/MemberCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Image from "next/image";
import Link from "next/link";
import escapeHtml from "escape-html";

import CountryFlags from "@/components/CountryFlags/CountryFlags";
import SocialLinks from "@/components/SocialLinks/SocialLinks";
Expand All @@ -12,10 +13,11 @@ interface MemberProps {

const MemberCard = (props: MemberProps) => {
const { name, slug, level, countries } = props.member;
const sanitizedPath = escapeHtml(props.member.path);

return (
<div className={"text-center"}>
<Link href={props.member.path} aria-label={name} className="block">
<Link href={sanitizedPath} aria-label={name} className="block">
{/* Image */}
<Image
src={`/img/members/${slug}.jpg`}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"remark-parse": "10.0.1",
"swr": "^2.1.5",
"typescript": "5.5.4",
"unified": "10.1.2"
"unified": "10.1.2",
"escape-html": "^1.0.3"
},
"devDependencies": {
"@chromatic-com/storybook": "1.6.1",
Expand Down