Skip to content

Commit f3f04d0

Browse files
committed
docs: warn that static serving follows symlinks under web_root
Operators control web_root contents, so a symlink there is a trusted deployment artifact. Clarify that SQLPage follows such symlinks during static file serving, meaning a symlink under web_root pointing to reserved/private files (sqlpage/ config, dotfiles) or to files outside web_root would make those targets publicly reachable. Note added to SECURITY.md (Out of Scope), cross-referenced from the web_root row in configuration.md and an Unreleased CHANGELOG entry.
1 parent ada23bc commit f3f04d0

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG.md
22

3+
## Unreleased
4+
5+
- **Docs:** clarified that static file serving follows symlinks. Operators should not place symlinks under `web_root` that point to reserved/private files or to files outside `web_root`, since their targets would become publicly reachable. See [`SECURITY.md`](https://github.com/sqlpage/SQLPage/blob/main/SECURITY.md).
6+
37
## v0.44.0
48

59
This release focuses on making production SQLPage apps easier to understand, debug, and operate. Most apps should keep working without SQL changes, but maintainers should review the notes about logging and uploaded-file permissions.

‎SECURITY.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ SQLPage vulnerabilities:
129129
- An operator intentionally changes configuration to expose files, trust a
130130
different database, make an OIDC path public, weaken CSP, enable dangerous
131131
Markdown options, load SQLite extensions, or enable `allow_exec`.
132+
- A symlink placed under `web_root` exposes its target. SQLPage follows
133+
symlinks during static file serving, so operators must not create symlinks
134+
under `web_root` that point to reserved or private files, such as the
135+
`sqlpage/` configuration directory or dotfiles, or to files outside
136+
`web_root`, since those targets would then be publicly reachable over HTTP.
132137
- An attacker can modify SQL files, templates, configuration, environment
133138
variables, migrations, database code, or `sqlpage_files`.
134139
- The configured database role has broader permissions than the application

‎configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Here are the available configuration options and their default values:
2020
| `database_connection_retries` | 6 | Database connection attempts before giving up. Retries will happen every 5 seconds. |
2121
| `database_connection_acquire_timeout_seconds` | 10 | How long to wait when acquiring a database connection from the pool before giving up and returning an error. |
2222
| `sqlite_extensions` | | An array of SQLite extensions to load, such as `mod_spatialite` |
23-
| `web_root` | `.` | The root directory of the web server, where the `index.sql` file is located. |
23+
| `web_root` | `.` | The root directory of the web server, where the `index.sql` file is located. Static file serving follows symlinks, so do not place symlinks under `web_root` that point to private files (such as the `sqlpage/` config directory) or to files outside `web_root`, as their targets would become publicly reachable (see [`SECURITY.md`](./SECURITY.md)). |
2424
| `site_prefix` | `/` | Base path of the site. If you want to host SQLPage at `https://example.com/sqlpage/`, set this to `/sqlpage/`. When using a reverse proxy, this allows hosting SQLPage together with other applications on the same subdomain. |
2525
| `configuration_directory` | `./sqlpage/` | The directory where the `sqlpage.json` file is located. This is used to find the path to [`templates/`](https://sql-page.com/custom_components.sql), [`migrations/`](https://sql-page.com/your-first-sql-website/migrations.sql), and `on_connect.sql`. Obviously, this configuration parameter can be set only through environment variables, not through the `sqlpage.json` file itself in order to find the `sqlpage.json` file. Be careful not to use a path that is accessible from the public WEB_ROOT |
2626
| `allow_exec` | false | Allow usage of the `sqlpage.exec` function. Do this only if all users with write access to sqlpage query files and to the optional `sqlpage_files` table on the database are trusted. |

0 commit comments

Comments
 (0)