react-security
/react-security
Chroni aplikację React przed XSS, zabezpiecza przepływy logowania i sprawdza zależności zewnętrzne pod kątem podatności.
- Autor
- HoangNguyen0403 ↗
- Repozytorium
- agent-skills-standard ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 12.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 3
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 12.11.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
Chroni aplikację React przed XSS, zabezpiecza przepływy logowania i sprawdza zależności zewnętrzne pod kątem podatności.
Oryginalny opis (EN)
Prevent XSS, secure auth flows, and harden React client-side applications. Use when preventing XSS, securing auth flows, or auditing third-party dependencies in React.
Jak działa
- Priority: P0 (CRITICAL)
- Prevent XSS Attacks
- Secure Authentication
- Harden Application Boundaries
- Anti-Patterns
- References
Podgląd SKILL.md
---
name: react-security
description: Prevent XSS, secure auth flows, and harden React client-side applications. Use when preventing XSS, securing auth flows, or auditing third-party dependencies in React.
metadata:
triggers:
files:
- '**/*.tsx'
- '**/*.jsx'
keywords:
- dangerouslySetInnerHTML
- token
- auth
- xss
- react security
- csp
- content security policy
- sanitize html
- secure cookie
- jwt react
- oauth react
- dompurify
---
# React Security
## **Priority: P0 (CRITICAL)**
## Prevent XSS Attacks
- **Never use `dangerouslySetInnerHTML`** without sanitization. Use **`DOMPurify.sanitize(input)`** for all user-provided HTML.
- Avoid `javascript:` protocols in `href` or `src`.
See [implementation examples](references/REFERENCE.md#xss-prevention-with-dompurify) for DOMPurify sanitization and secure cookie configuration.
## Secure Authentication
- Store **JWT/Sessions in `HttpOnly` and `Secure` cookies** to prevent theft via XSS. **Never store secrets in `localStorage`** or in built JS bundle.
- **Data Flow**: **Escape all serialized state** if injecting into HTML (e.g., in SSR). Use **Content Security Policy (CSP)** to restrict script sources and prevent inline execution.
## Harden Application Boundaries
- **CSRF Protection**: Use **CSRF tokens** for state-changing requests (PUT/POST/DELETE). Implement **SameSite=Strict** cookies where applicable.
- **Input Sanitization**: Always **validate and sanitize** user inputs on backend. Frontend validation for UX only.
- **Dependency Management**: Run **`npm audit` / `pnpm audit`** regularly. Pin specific dependency versions and use **`npm-check-updates`**.
- **Security Headers**: Ensure server sends **`X-Frame-Options: DENY`**, **`X-Content-Type-Options: nosniff`**, and **`Permissions-Policy`**.
## Anti-Patterns
- **No `eval()`**: RCE risk.
- **No Serialized State**: Don't inject JSON into DOM without escaping.
- **No Client Logic for Permissions**: Backend must validate.
## References
See [references/REFERENCE.md](references/REFERENCE.md) for DOMPurify usage, CSP headers, OAuth2/JWT auth patterns, and CSRF protection.
Pliki w paczce (3)
- SKILL.md 2 KB
- evals/evals.json 2 KB
- references/REFERENCE.md 4 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · HoangNguyen0403/agent-skills-standard | 100 | MIT |
| redhatproductsecurity/prodsec-skills | 100 | Apache-2.0 |
Migawka bazy z 13.11.2026 · wersja paczki 6545b416d6d1 (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
- 100security-testing
Skanuje pod kątem XSS, wstrzyknięć SQL, CSRF i błędów logowania wg OWASP Top 10, także w testach automatycznych. - 100jidoka-security-review
Przegląda kod pod kątem podatności, śledząc przepływ danych: wstrzyknięcia, XSS, ujawnione sekrety, zależności, dostęp i słabą kryptografię. - 100frontend-mobile-security-xss-scan
Wykrywa i usuwa ryzyka XSS w React, Vue, Angular i JavaScripcie w przeglądarce, sprawdzając ujścia wstrzyknięć i sanityzację. - 90security-audit
Sprawdza bezpieczeństwo kodu i konfiguracji, zależności pod kątem CVE oraz typowe błędy OWASP, takie jak wstrzyknięcia, XSS i CSRF. - 90angular-security
Utwardza aplikacje Angular przed XSS, naruszeniami CSP i nieautoryzowanym dostępem, w tym przez guardy tras. - 90secure-development
Pomaga pisać bezpieczny kod od początku: czyści dane wejściowe, bezpiecznie uwierzytelnia, zapobiega SQLi, XSS i SSRF oraz chroni sekrety.