Skip to content

Commit

Permalink
Clear vunerability warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Keeqler committed Jun 3, 2024
1 parent 02a562a commit 85ead11
Show file tree
Hide file tree
Showing 9 changed files with 5,012 additions and 2,655 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
FROM node:19
WORKDIR /opt/app

ENV NODE_ENV production
RUN chown -R node:node /opt/app
USER node

Expand All @@ -15,6 +14,7 @@ RUN npm install
COPY --chown=node:node . /opt/app
RUN npm run lint

ENV NODE_ENV production
RUN npm run build
CMD [ "npm", "run", "start" ]

Expand Down
3 changes: 2 additions & 1 deletion components/BigDumbMarkdown.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import escapeHTML from 'escape-html'
import markdownStyles from './markdown-styles.module.css'

export default function BigDumbMarkdown({ content }: { content: string }) {
return (
<div className="flex flex-col items-center py-8">
<div className={markdownStyles['markdown']}>
<div dangerouslySetInnerHTML={{ __html: content }} />
<div dangerouslySetInnerHTML={{ __html: escapeHTML(content) }} />
</div>
</div>
)
Expand Down
14 changes: 6 additions & 8 deletions components/ProjectCard.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faArrowRight } from '@fortawesome/free-solid-svg-icons'
import escapeHTML from 'escape-html'
import Image from 'next/image'

import { faGithub } from '@fortawesome/free-brands-svg-icons'
import { faTwitter } from '@fortawesome/free-brands-svg-icons'
import Link from 'next/link'
import { faArrowRight } from '@fortawesome/free-solid-svg-icons'

import { ProjectItem } from '../utils/types'
import PaymentModal from './PaymentModal'
import ShareButtons from './ShareButtons'

export type ProjectCardProps = {
Expand All @@ -24,7 +22,7 @@ const ProjectCard: React.FC<ProjectCardProps> = ({
return (
<figure className=" bg-white space-y-4 border border-lightgray rounded-xl h-full">
<div className="relative h-64 w-full">
<Link href={`/projects/${slug}`} passHref>
<Link href={`/projects/${escapeHTML(slug)}`} passHref>
<div className='relative h-64 w-full'>
<Image
alt={title}
Expand All @@ -42,7 +40,7 @@ const ProjectCard: React.FC<ProjectCardProps> = ({
<h2>{title}</h2>
<p>
by{' '}
<Link href={personalWebsite} passHref legacyBehavior>
<Link href={escapeHTML(personalWebsite)} passHref legacyBehavior>
<a className="projectlist">{nym}</a>
</Link>
</p>
Expand All @@ -58,7 +56,7 @@ const ProjectCard: React.FC<ProjectCardProps> = ({
Donate
</button> }
<div className="flex items-center justify-center basis-1/2">
<Link href={`/projects/${slug}`} passHref legacyBehavior>
<Link href={`/projects/${escapeHTML(slug)}`} passHref legacyBehavior>
<a className="projectlist">View Details</a>
</Link>
<FontAwesomeIcon
Expand Down
7 changes: 4 additions & 3 deletions components/ShareButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@ import { faGithub, faTwitter } from "@fortawesome/free-brands-svg-icons"
import { faLink } from "@fortawesome/free-solid-svg-icons"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import Link from "next/link"
import escapeHTML from "escape-html"
import { ProjectItem } from "../utils/types"

const ShareButtons: React.FC<{ project: ProjectItem }> = ({ project }) => {
const { git, twitter, website } = project;
return (
<div className="flex space-x-4">
<Link href={git} passHref legacyBehavior>
<Link href={escapeHTML(git)} passHref legacyBehavior>

Check warning

Code scanning / CodeQL

Client-side URL redirect Medium

Untrusted URL redirection depends on a
user-provided value
.
<a className="projectlist">
<FontAwesomeIcon
icon={faGithub}
className="w-[2rem] h-[2rem] hover:text-primary cursor-pointer"
/>
</a>
</Link>
<Link href={`https://twitter.com/${twitter}`} passHref legacyBehavior>
<Link href={`https://twitter.com/${escapeHTML(twitter)}`} passHref legacyBehavior>
<a className="projectlist">
<FontAwesomeIcon
icon={faTwitter}
className="w-[2rem] h-[2rem] hover:text-primary cursor-pointer"
/>
</a>
</Link>
{website && <Link href={website} passHref legacyBehavior>
{website && <Link href={escapeHTML(website)} passHref legacyBehavior>

Check warning

Code scanning / CodeQL

Client-side URL redirect Medium

Untrusted URL redirection depends on a
user-provided value
.
<a className="projectlist">
<FontAwesomeIcon
icon={faLink}
Expand Down
Loading

0 comments on commit 85ead11

Please sign in to comment.