Skip to content

Commit

Permalink
Add warnings about XSS to WAGTAILDOCS_SERVE_METHOD and WAGTAILDOCS_EX…
Browse files Browse the repository at this point in the history
…TENSIONS settings docs
  • Loading branch information
gasman committed Mar 7, 2024
1 parent 00d1d13 commit 5e5619d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/reference/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@ For this reason, Wagtail provides several serving methods that trade some of the

If `WAGTAILDOCS_SERVE_METHOD` is unspecified or set to `None`, the default method is `'redirect'` when a remote storage backend is in use (one that exposes a URL but not a local filesystem path), and `'serve_view'` otherwise. Finally, some storage backends may not expose a URL at all; in this case, serving will proceed as for `'serve_view'`.

```{warning}
Allowing direct access to document URLs within `MEDIA_ROOT` may present a security risk if untrusted users are allowed to upload documents - in this case additional configuration will be required at the webserver level to handle these securely. See [](user_uploaded_files).
```

(wagtaildocs_content_types)=

### `WAGTAILDOCS_CONTENT_TYPES`
Expand Down Expand Up @@ -436,9 +440,11 @@ WAGTAILDOCS_EXTENSIONS = ['pdf', 'docx']
```

A list of allowed document extensions that will be validated during document uploading.
If this isn't supplied all document extensions are allowed.
Warning: this doesn't always ensure that the uploaded file is valid as files can
be renamed to have an extension no matter what data they contain.
If this isn't supplied all document extensions are allowed. This doesn't ensure that the uploaded file is valid, as files can be renamed to have an extension no matter what data they contain.

```{warning}
Allowing all file types may present a security risk if untrusted users are allowed to upload documents - in this case additional configuration will be required at the webserver level to handle these securely. See [](user_uploaded_files).
```

## User Management

Expand Down

0 comments on commit 5e5619d

Please sign in to comment.