matcornic / matcornic/hugo-theme-learn

search.js can lock up browser when parsing certain data

Open
#417 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1.6k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Similar to #314.

I found that when the index includes a large amount of contiguous text, in our case it was a base64 encoded TLS certificate string, then the regex here can cause a lock up:

https://github.com/matcornic/hugo-theme-learn/blob/3efb32712c5cc77e644852d13ce3525780374b10/static/js/search.js#L74

I found this using both chrome and Firefox

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at static/js/search.js line 74, linked in the issue, and compare the behavior with the related issue #314. Reproduce the problem using an index containing a large contiguous text value such as a base64-encoded TLS certificate, then check in Chrome and Firefox that parsing no longer locks up the browser.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.