# iframe-missing-sandbox

Rule `react/iframe-missing-sandbox`. Enforce sandbox attribute on iframe elements

- Source: react
- Technologies: React
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Reach: 2.1M weekly downloads of presets that enable it
- Trend: +148.4% last quarter
- Rank: #1500 by reach, #79 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react/iframe-missing-sandbox` | no | no | package `eslint-plugin-react` | [docs](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/iframe-missing-sandbox.md) |
| Oxlint | `react/iframe-missing-sandbox` | no | no | plugin `react`, category suspicious | [docs](https://oxc.rs/docs/guide/usage/linter/rules/react/iframe-missing-sandbox.html) |
| Biome | `security/useIframeSandbox` | no | no | group security, since 2.4.12 | [docs](https://biomejs.dev/linter/rules/use-iframe-sandbox/) |

## Code examples

### Incorrect: the rule reports this

```jsx
<iframe/>;
<iframe sandbox="invalid-value" />;
<iframe sandbox="allow-same-origin allow-scripts"/>;
```

### Correct: the rule accepts this

```jsx
<iframe sandbox="" />;
<iframe sandbox="allow-origin" />;
```

Examples from the Oxlint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import react from "eslint-plugin-react";

export default [
  {
    plugins: { react },
    rules: {
      "react/iframe-missing-sandbox": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "react"
  ],
  "rules": {
    "react/iframe-missing-sandbox": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "security": {
        "useIframeSandbox": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [react/forbid-elements](https://lintradar.dev/rules/react/forbid-elements.md): Disallow certain elements
- [react/jsx-props-no-spread-multi](https://lintradar.dev/rules/react/jsx-props-no-spread-multi.md): Disallow JSX prop spreading the same identifier multiple times
- [react/sort-comp](https://lintradar.dev/rules/react/sort-comp.md): Enforce component methods order
- [react/require-default-props](https://lintradar.dev/rules/react/require-default-props.md): Enforce a defaultProps definition for every prop that is not a required prop
- [react/prefer-stateless-function](https://lintradar.dev/rules/react/prefer-stateless-function.md): Enforce stateless components to be written as a pure function
- [react/prefer-exact-props](https://lintradar.dev/rules/react/prefer-exact-props.md): Prefer exact proptype definitions

---

Web page: https://lintradar.dev/rules/react/iframe-missing-sandbox. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
