diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-23 15:49:22 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-23 15:49:22 +0200 |
| commit | 73d00113f5ed5fe99e365d2053dc70a6da8a81ee (patch) | |
| tree | cb43b29be24768bf4a8f4baa5590664e279e7fb9 /docs | |
| parent | 905b7473dd3987928e9ac9c81405548ba7be4c8d (diff) | |
| download | lectio-73d00113f5ed5fe99e365d2053dc70a6da8a81ee.tar.gz lectio-73d00113f5ed5fe99e365d2053dc70a6da8a81ee.zip | |
web,liturgy: validate date against path traversal; bind lectio-web to localhost
An unvalidated ?date= query param flowed straight into
liturgy.Load's filepath.Join(dir, date+".json"/".html") before any
network call, letting a crafted date (e.g. "../../../../etc/hostname")
read an arbitrary file whose JSON, if present, unmarshals into
[]liturgy.Section and renders back to the client. Fix both layers:
resolveQuery now falls back to today() on empty or non-YYYY-MM-DD
date (mirroring requestDisplay's normalize-don't-trust pattern), and
liturgy.Load itself rejects a non-matching date before building any
cache path, protecting every caller even if a future one forgets to
validate.
Also bind lectio-web's listener to 127.0.0.1 instead of all
interfaces: it is a personal tool whose Run already prints
http://localhost:<port>, so it should not be reachable from the LAN.
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions
