Skip to content

Commit

Permalink
Fix code scanning alert no. 9: Stored cross-site scripting
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Frances Coronel <[email protected]>
  • Loading branch information
1 parent 25ad7c5 commit 3cc4210
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 3cc4210

Please sign in to comment.