Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 449b63a

Browse filesBrowse files
committed
docs: warn about runtimeCompiler security best practices
1 parent 0769c4f commit 449b63a
Copy full SHA for 449b63a

2 files changed

+15Lines changed: 15 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docs/4.api/6.nuxt-config.md‎

Copy file name to clipboardExpand all lines: docs/4.api/6.nuxt-config.md
+6Lines changed: 6 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1896,9 +1896,15 @@ Enable reactive destructure for `defineProps`
18961896

18971897
Include Vue compiler in runtime bundle.
18981898

1899+
Enabling this allows components to compile templates at runtime (for example, string `template` options or templates supplied via data).
1900+
18991901
- **Type**: `boolean`
19001902
- **Default:** `false`
19011903

1904+
::warning
1905+
Runtime template compilation executes the compiled template as JavaScript. Never compile templates built from user-provided or otherwise untrusted input; doing so is equivalent to `eval` and can lead to cross-site scripting or remote code execution. See the [Vue security guide](https://vuejs.org/guide/best-practices/security.html).
1906+
::
1907+
19021908
### `transformAssetUrls`
19031909

19041910
#### `image`
Collapse file

‎packages/schema/src/types/schema.ts‎

Copy file name to clipboardExpand all lines: packages/schema/src/types/schema.ts
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ export interface ConfigSchema {
109109

110110
/**
111111
* Include Vue compiler in runtime bundle.
112+
*
113+
* Enabling this allows components to compile templates at runtime (for example,
114+
* string `template` options or templates supplied via data).
115+
*
116+
* Runtime-compiled templates can execute arbitrary JavaScript. Never pass
117+
* user-provided or otherwise untrusted content to a runtime-compiled template;
118+
* treat any string that reaches the compiler as executable code.
119+
*
120+
* @see [Vue security guide](https://vuejs.org/guide/best-practices/security.html)
112121
*/
113122
runtimeCompiler: boolean
114123

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.