Skip to content

Fix PDF font fallback crash and escape bullet HTML injection#20

Open
Jaimin2687 wants to merge 1 commit into
sunilkumar2170:mainfrom
Jaimin2687:main
Open

Fix PDF font fallback crash and escape bullet HTML injection#20
Jaimin2687 wants to merge 1 commit into
sunilkumar2170:mainfrom
Jaimin2687:main

Conversation

@Jaimin2687
Copy link
Copy Markdown

This PR is submitted as part of GSSoC 2026 contributions.

Issue
Two critical issues were found in the resume import flow:

Crash on missing PDF font objects - commonObjs.get(pdfFontName) can return undefined, then fontObj.name throws during parsing.
XSS risk in bullet editor - bullet strings were injected into a contentEditable HTML string without escaping, allowing HTML/script injection.
What changed
Added a safe fallback when PDF font objects are missing to prevent parser crashes.
Escaped bullet text before converting it to HTML so user input cannot inject HTML.
Testing
npm run test:ci

@Jaimin2687
Copy link
Copy Markdown
Author

Hey @sunilkumar2170 , I just opened this PR patching the PDF.js text-chunking crash and the XSS vulnerability in the contentEditable flow. Because the XSS flaw currently allows arbitrary script injection during resume imports, I strongly recommend prioritizing this review before the GSSoC traffic scales up. Let me know if you need any adjustments to the sanitization logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant