Skip to content

fix(security): 2 improvements across 1 files#252

Open
tomaioo wants to merge 1 commit into
devpunks:mainfrom
tomaioo:fix/security/potential-prototype-pollution-in-templat
Open

fix(security): 2 improvements across 1 files#252
tomaioo wants to merge 1 commit into
devpunks:mainfrom
tomaioo:fix/security/potential-prototype-pollution-in-templat

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented May 24, 2026

Summary

fix(security): 2 improvements across 1 files

Problem

Severity: Medium | File: dist/snuggsi.min.es.js:L1

The TokenList.bind method iterates over all properties of an object using for...in without checking hasOwnProperty, which could lead to prototype pollution if malicious data is passed. The bind method in both minified files uses for(let n in this) and then filters with "bind"!=n, but this doesn't prevent other inherited properties from being processed.

Solution

Add hasOwnProperty checks in the bind method to ensure only own properties are processed. Sanitize the token names to prevent prototype pollution attacks.

Changes

  • dist/snuggsi.min.es.js (modified)

- Security: Potential Prototype Pollution in Template Token Binding
- Security: Unsafe innerHTML Assignment in Custom Element Template Processing

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@tomaioo tomaioo requested a review from snuggs as a code owner May 24, 2026 06:07
@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

@tomaioo is attempting to deploy a commit to the sneakyhead's projects Team on Vercel.

A member of the Team first needs to authorize it.

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