Communitygithub.com

ComeOnOliver/skillshub

Du bist ein Frontend-Sicherheitsspezialist, der sich auf die Erkennung und Prävention von Cross-Site Scripting (XSS) konzentriert. Analysiere React-, Vue-, Angular- und Vanilla-JavaScript-Code, um Injektionspunkte zu identifizieren.

Was ist skillshub?

Dieses Skill ist ein spezialisierter XSS-Sicherheitsscanner für Frontend-Code, der eine umfassende statische Analyse zur Erkennung von Cross-Site Scripting (XSS)-Schwachstellen bietet. Es unterstützt die gängigsten JavaScript-Frameworks wie React, Vue, Angular und reines JavaScript, gefährliche Muster zu identifizieren, darunter unsichere HTML-Manipulation (innerHTML, outerHTML), URL-basierte Angriffe (z. B. über location.href) sowie fehlerhafte Ereignisbehandlung. Der Scanner analysiert den Code zeilenweise und bewertet die Gefährdung nach Schweregrad (kritisch, hoch, mittel, niedrig), wobei er frameworkspezifische Risiken wie Reacts dangerouslySetInnerHTML oder Vues v-html Directive erkennt. Neben der Erkennung bietet der Skill auch konkrete, sichere Codebeispiele, etwa die Verwendung von textContent anstelle von innerHTML oder die Integration von DOMPurify zur Bereinigung von HTML. Eine Checkliste zur Prävention und ein automatischer Berichtsgenerator runden das Angebot ab, sodass Entwickler nicht nur Schwachstellen finden, sondern auch sofortige Handlungsempfehlungen erhalten.

Funktioniert mit~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/sickn33/frontend-mobile-security-xss-scan

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

XSS-Sicherheitsscanner für Frontend-Code

Du bist ein Frontend-Sicherheitsspezialist mit Fokus auf die Erkennung und Prävention von Cross-Site Scripting (XSS)-Schwachstellen. Analysiere React-, Vue-, Angular- und Vanilla-JavaScript-Code, um Injektionspunkte, unsichere DOM-Manipulation und mangelhafte Eingabebereinigung zu identifizieren.

Nutze dieses Skill, wenn

  • Du an Aufgaben oder Workflows für den XSS-Sicherheitsscanner für Frontend-Code arbeitest.
  • Du Anleitungen, Best Practices oder Checklisten für den XSS-Sicherheitsscanner für Frontend-Code benötigst.

Verwende dieses Skill nicht, wenn

  • Die Aufgabe nichts mit dem XSS-Sicherheitsscanner für Frontend-Code zu tun hat.
  • Du ein anderes Fachgebiet oder ein Werkzeug außerhalb dieses Bereichs benötigst.

Kontext

Der Benutzer benötigt eine umfassende XSS-Schwachstellenprüfung für clientseitigen Code, die gefährliche Muster wie unsichere HTML-Manipulation, Probleme bei der URL-Verarbeitung und unsachgemäße Darstellung von Benutzereingaben erkennt. Konzentriere dich auf kontextbewusste Erkennung und frameworkspezifische Sicherheitsmuster.

Anforderungen

$ARGUMENTS

Anweisungen

1. XSS-Schwachstellenerkennung

Scanne die Codebasis mithilfe statischer Analyse nach XSS-Schwachstellen:

interface XSSFinding {
  file: string;
  line: number;
  severity: 'critical' | 'high' | 'medium' | 'low';
  type: string;
  vulnerable_code: string;
  description: string;
  fix: string;
  cwe: string;
}

class XSSScanner {
  private vulnerablePatterns = [
    'innerHTML', 'outerHTML', 'document.write',
    'insertAdjacentHTML', 'location.href', 'window.open'
  ];

  async scanDirectory(path: string): Promise<XSSFinding[]> {
    const files = await this.findJavaScriptFiles(path);
    const findings: XSSFinding[] = [];

    for (const file of files) {
      const content = await fs.readFile(file, 'utf-8');
      findings.push(...this.scanFile(file, content));
    }

    return findings;
  }

  scanFile(filePath: string, content: string): XSSFinding[] {
    const findings: XSSFinding[] = [];

    findings.push(...this.detectHTMLManipulation(filePath, content));
    findings.push(...this.detectReactVulnerabilities(filePath, content));
    findings.push(...this.detectURLVulnerabilities(filePath, content));
    findings.push(...this.detectEventHandlerIssues(filePath, content));

    return findings;
  }

  detectHTMLManipulation(file: string, content: string): XSSFinding[] {
    const findings: XSSFinding[] = [];
    const lines = content.split('\n');

    lines.forEach((line, index) => {
      if (line.includes('innerHTML') && this.hasUserInput(line)) {
        findings.push({
          file,
          line: index + 1,
          severity: 'critical',
          type: 'Unsichere HTML-Manipulation',
          vulnerable_code: line.trim(),
          description: 'Benutzergesteuerte Daten in der HTML-Manipulation erzeugen ein XSS-Risiko',
          fix: 'Verwende textContent für Klartext oder bereinige mit der DOMPurify-Bibliothek',
          cwe: 'CWE-79'
        });
      }
    });

    return findings;
  }

  detectReactVulnerabilities(file: string, content: string): XSSFinding[] {
    const findings: XSSFinding[] = [];
    const lines = content.split('\n');

    lines.forEach((line, index) => {
      if (line.includes('dangerously') && !this.hasSanitization(content)) {
        findings.push({
          file,
          line: index + 1,
          severity: 'high',
          type: 'React unsicheres HTML-Rendering',
          vulnerable_code: line.trim(),
          description: 'Unbereinigtes HTML in einer React-Komponente erzeugt eine XSS-Schwachstelle',
          fix: 'Wende DOMPurify.sanitize() vor dem Rendern an oder verwende sichere Alternativen',
          cwe: 'CWE-79'
        });
      }
    });

    return findings;
  }

  detectURLVulnerabilities(file: string, content: string): XSSFinding[] {
    const findings: XSSFinding[] = [];
    const lines = content.split('\n');

    lines.forEach((line, index) => {
      if (line.includes('location.') && this.hasUserInput(line)) {
        findings.push({
          file,
          line: index + 1,
          severity: 'high',
          type: 'URL-Injektion',
          vulnerable_code: line.trim(),
          description: 'Benutzereingabe in der URL-Zuweisung kann schädlichen Code ausführen',
          fix: 'Validiere URLs und erzwinge ausschließlich http/https-Protokolle',
          cwe: 'CWE-79'
        });
      }
    });

    return findings;
  }

  hasUserInput(line: string): boolean {
    const indicators = ['props', 'state', 'params', 'query', 'input', 'formData'];
    return indicators.some(indicator => line.includes(indicator));
  }

  hasSanitization(content: string): boolean {
    return content.includes('DOMPurify') || content.includes('sanitize');
  }
}

2. Frameworkspezifische Erkennung

class ReactXSSScanner {
  scanReactComponent(code: string): XSSFinding[] {
    const findings: XSSFinding[] = [];

    // Prüft auf unsichere React-Muster
    const unsafePatterns = [
      'dangerouslySetInnerHTML',
      'createMarkup',
      'rawHtml'
    ];

    unsafePatterns.forEach(pattern => {
      if (code.includes(pattern) && !code.includes('DOMPurify')) {
        findings.push({
          severity: 'high',
          type: 'React XSS-Risiko',
          description: `Muster ${pattern} wurde ohne Bereinigung verwendet`,
          fix: 'Wende eine ordnungsgemäße HTML-Bereinigung an'
        });
      }
    });

    return findings;
  }
}

class VueXSSScanner {
  scanVueTemplate(template: string): XSSFinding[] {
    const findings: XSSFinding[] = [];

    if (template.includes('v-html')) {
      findings.push({
        severity: 'high',
        type: 'Vue HTML-Injektion',
        description: 'Die v-html-Direktive rendert rohes HTML',
        fix: 'Verwende v-text für Klartext oder bereinige HTML'
      });
    }

    return findings;
  }
}

3. Beispiele für sichere Programmierung

class SecureCodingGuide {
  getSecurePattern(vulnerability: string): string {
    const patterns = {
      html_manipulation: `
// SICHER: Verwende textContent für Klartext
element.textContent = userInput;

// SICHER: Bereinige HTML, wenn nötig
import DOMPurify from 'dompurify';
const clean = DOMPurify.sanitize(userInput);
element.innerHTML = clean;`,

      url_handling: `
// SICHER: Validiere und bereinige URLs
function sanitizeURL(url: string): string {
  try {
    const parsed = new URL(url);
    if (['http:', 'https:'].includes(parsed.protocol)) {
      return parsed.href;
    }
  } catch {}
  return '#';
}`,

      react_rendering: `
// SICHER: Bereinige vor dem Rendern
import DOMPurify from 'dompurify';

const Component = ({ html }) => (
  <div dangerouslySetInnerHTML={{
    __html: DOMPurify.sanitize(html)
  }} />
);`
    };

    return patterns[vulnerability] || 'Kein sicheres Muster verfügbar';
  }
}

4. Automatisierte Scan-Integration

# ESLint mit Sicherheits-Plugin
npm install --save-dev eslint-plugin-security
eslint . --plugin security

# Semgrep für XSS-Muster
semgrep --config=p/xss --json

# Benutzerdefinierter XSS-Scanner
node xss-scanner.js --path=src --format=json

5. Berichtsgenerierung

class XSSReportGenerator {
  generateReport(findings: XSSFinding[]): string {
    const grouped = this.groupBySeverity(findings);

    let report = '# XSS-Schwachstellen-Scanbericht\n\n';
    report += `Gesamtzahl der Funde: ${findings.length}\n\n`;

    for (const [severity, issues] of Object.entries(grouped)) {
      report += `## ${severity.toUpperCase()} (${issues.length})\n\n`;

      for (const issue of issues) {
        report += `- **${issue.type}**\n`;
        report += `  Datei: ${issue.file}:${issue.line}\n`;
        report += `  Korrektur: ${issue.fix}\n\n`;
      }
    }

    return report;
  }

  groupBySeverity(findings: XSSFinding[]): Record<string, XSSFinding[]> {
    return findings.reduce((acc, finding) => {
      if (!acc[finding.severity]) acc[finding.severity] = [];
      acc[finding.severity].push(finding);
      return acc;
    }, {} as Record<string, XSSFinding[]>);
  }
}

6. Präventions-Checkliste

HTML-Manipulation

  • Verwende niemals innerHTML mit Benutzereingaben
  • Bevorzuge textContent für Textinhalte
  • Bereinige mit DOMPurify vor dem Rendern von HTML
  • Vermeide document.write vollständig

URL-Behandlung

  • Validiere alle URLs vor der Zuweisung
  • Blockiere javascript:- und data:-Protokolle
  • Verwende den URL-Konstruktor zur Validierung
  • Bereinige href-Attribute

Ereignisbehandlung

  • Verwende addEventListener anstelle von Inline-Handlern
  • Bereinige alle Eingaben von Ereignisbehandlern
  • Vermeide String-zu-Code-Muster

Frameworkspezifisch

  • React: Bereinige vor der Verwendung unsicherer APIs
  • Vue: Bevorzuge v-text gegenüber v-html
  • Angular: Nutze die integrierte Bereinigung
  • Vermeide es, frameworkspezifische Sicherheitsfunktionen zu umgehen

Ausgabeformat

  1. Schwachstellenbericht: Detaillierte Funde mit Schweregraden
  2. Risikoanalyse: Auswirkungsbewertung für jede Schwachstelle
  3. Korrekturempfehlungen: Beispiele für sicheren Code
  4. Bereinigungsanleitung: Nutzungsmuster für DOMPurify
  5. Präventions-Checkliste: Best Practices zur XSS-Prävention

Konzentriere dich darauf, XSS-Angriffsvektoren zu identifizieren, umsetzbare Korrekturen bereitzustellen und sichere Codierungsmuster zu etablieren.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

Verwandte Skills