avoid-eval
/avoid-eval
Sprawdza skrypty, komponenty klienta i bundle pod kątem eval() i niebezpiecznego dynamicznego wykonywania kodu, analizując zarówno źródło, jak i ścieżkę wykonania w przeglądarce.
- Autor
- thedaviddias ↗
- Repozytorium
- front-end-checklist ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 06.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 2
Brak sygnałów. Repozytorium zmienione 06.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Sprawdza skrypty, komponenty klienta i bundle pod kątem eval() i niebezpiecznego dynamicznego wykonywania kodu, analizując zarówno źródło, jak i ścieżkę wykonania w przeglądarce.
Oryginalny opis (EN)
Use when reviewing scripts, client components, bundles, or runtime behavior related to Never use eval() or unsafe dynamic code execution. Inspect both source code and the browser execution path so fixes target the real bottleneck or bug.
Jak działa
- Quick Reference
- Check
- Fix
- Explain
- Code Review
Podgląd SKILL.md
---
name: avoid-eval
description: "Use when reviewing scripts, client components, bundles, or runtime behavior related to Never use eval() or unsafe dynamic code execution. Inspect both source code and the browser execution path so fixes target the real bottleneck or bug."
metadata:
category: javascript
priority: critical
difficulty: beginner
estimatedTime: "10"
source: frontendchecklist.io
url: https://frontendchecklist.io/rules/javascript/avoid-eval
---
# Never use eval() or unsafe dynamic code execution
eval() and its equivalents are the root cause of some of the most severe XSS vulnerabilities. If any user-controlled string reaches eval(), an attacker can execute arbitrary JavaScript in your users' browsers — stealing sessions, making requests as the user, or redirecting to malicious sites. Content Security Policy (CSP) blocks eval() but not new Function(), and there is never a legitimate use case that can't be solved without it.
## Quick Reference
- eval() executes arbitrary strings as code — any user input passed to it is a critical security hole
- new Function() is equally dangerous and not caught by CSP eval restrictions
- setTimeout('code', delay) and setInterval('code', delay) also evaluate strings — use function references instead
- Use JSON.parse() instead of eval() for parsing JSON
## Check
Search this codebase for any use of eval(), new Function(), or setTimeout/setInterval with string arguments.
## Fix
Replace eval() calls with safe alternatives: JSON.parse for data, object lookups for dynamic dispatch, and Function references for timers.
## Explain
Explain why eval() is dangerous, how it enables XSS attacks, and what safe alternatives exist for each use case.
## Code Review
Review scripts, client components, and browser execution paths related to Never use eval() or unsafe dynamic code execution. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.
---
For full implementation details, code examples, and framework-specific guidance,
see `references/rule.md`.
Rule page: https://frontendchecklist.io/rules/javascript/avoid-eval
Pliki w paczce (2)
- SKILL.md 2 KB
- references/rule.md 4 KB
Wersje
W bazie nie ma innych skilli o nazwie avoid-eval.
Migawka bazy z 13.11.2026 · wersja paczki ff627163aef1 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100immutable-patterns
Sprawdza skrypty, komponenty klienckie i bundle pod kątem stosowania niezmiennych struktur danych, analizując kod źródłowy i ścieżkę wykonania w przeglądarce. - 100es-modules
Przegląda skrypty, komponenty klienckie, bundle i zachowanie runtime pod kątem użycia modułów ES (import i export), sprawdzając kod źródłowy i ścieżkę wykonania w przeglądarce. - 100eval-code
Przeprowadza łączną ocenę jakości kodu: zbiera zmiany kodu z procesu SDD, a potem ocenia jakość zewnętrznym modelem sędziującym. - 100react-effects-audit
Audytuje komponenty React i Next.js pod kątem zbędnego lub niebezpiecznego użycia useEffect, wykrywając 9 antywzorców z tekstu You Might Not Need an Effect. - 100code-flow-analysis
Śledzi ścieżkę wykonania kodu z odwołaniami file:line i diagramem przed zmianą, przy naprawie błędu, nowej funkcji, refaktoryzacji lub cyklu TDD. - 90code-review
Przegląda zmiany w monorepo harness-eval według kryteriów dla skryptów Bash, hooków i promptów skilli.