Skip to content
Back to skills

Stackblitz Security Basics

ASecurity

Secure WebContainer deployments: CSP headers, sandbox isolation, input validation. Use when working with WebContainers or StackBlitz SDK. Trigger: "stackblitz security".

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
securitytypescriptsecurity

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add aibot88/sec_skill_store --skill stackblitz-security-basics --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Stackblitz Security Basics?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Stackblitz Security Basics
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aibot88-stackblitz-security-basics/badge)](https://www.skillsdirectory.com/skills/aibot88-stackblitz-security-basics)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: stackblitz-security-basics
description: |
  Secure WebContainer deployments: CSP headers, sandbox isolation, input validation.
  Use when working with WebContainers or StackBlitz SDK.
  Trigger: "stackblitz security".
allowed-tools: Read, Write, Grep
version: 1.0.0
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
tags: [saas, ide, webcontainers, stackblitz]
compatible-with: claude-code
---

# StackBlitz Security Basics

## Overview

Secure WebContainer deployments: CSP headers, sandbox isolation, input validation.

## Instructions

### Step 1: WebContainer Security Model

WebContainers run in the browser sandbox -- no access to host filesystem, network is limited to HTTP, and all code runs in the user's browser tab. Key security points:

```typescript
// WebContainers are inherently sandboxed:
// - No file system access to host
// - No raw network sockets
// - Memory isolated to browser tab
// - Cross-origin isolation via COOP/COEP headers
```

### Step 2: Validate User Input

```typescript
// If users can provide code to run in WebContainer, validate:
function sanitizeFileTree(tree: FileSystemTree): FileSystemTree {
  const sanitized: FileSystemTree = {};
  for (const [name, entry] of Object.entries(tree)) {
    // Block path traversal
    if (name.includes('..') || name.startsWith('/')) continue;
    // Block sensitive files
    if (name === '.env' || name.endsWith('.key')) continue;
    sanitized[name] = entry;
  }
  return sanitized;
}
```

### Step 3: Content Security Policy

```
Content-Security-Policy: default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; frame-src https://*.webcontainer.io;
```

## Security Checklist

- [ ] COOP/COEP headers set correctly
- [ ] User-provided code sandboxed in WebContainer
- [ ] No secrets passed to WebContainer file system
- [ ] CSP headers configured
- [ ] Input validation on file paths

## Resources

- [WebContainer Security](https://webcontainers.io/guides/introduction)

## Next Steps

For production, see `stackblitz-prod-checklist`.

Files in this skill

  • SKILL.md2 KB
  • source.json733 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.