mirror of
https://github.com/openwrt/packages.git
synced 2026-10-13 03:37:43 +04:00
90a538e3fa282e3bd71d8617aa2b4fa1efec7bce
The date format read from the UCI option ddns.global.ddns_dateformat was embedded into a command string that is later executed through "eval", both for the recurring log timestamps DATE_PROG="date +'$ddns_dateformat'" ... write_log 5 "PID '$$' started at $(eval $DATE_PROG)" and for the "last update" timestamp in the updater EPOCH_TIME="date -d @$EPOCH_TIME +'$ddns_dateformat'" write_log 7 "last update: $(eval $EPOCH_TIME)" The value is only wrapped in single quotes, so a single quote inside it closes that quote and starts a new shell word. A user who can write the ddns configuration - a delegated DDNS operator who was never granted shell access - can set ddns_dateformat="%F'; touch /tmp/pwned; '" and have arbitrary commands run as root, because the updater runs as root. The injection triggers on the next start of the updater, so in practice on the next reconfiguration or reboot. Stop building shell code from the option. Provide date_prog() as an ordinary shell function and pass the format as a single quoted argument in both places, which leaves no way for its content to be interpreted by the shell. The remaining use of ddns_dateformat in dynamic_dns_updater.sh, for NEXT_CHECK_TIME, already substituted it as a quoted argument without eval and was not affected. luci-app-ddns consumes the same option and is fixed separately in the LuCI repository. Reported-by: Matthew Hickey (Hacker Fantastic, https://hacker.house) Fixes:1c20dcb71a("ddns-scripts: update to 2.7.6-1") Assisted-by: Claude:claude-opus-5 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (cherry picked from commit7364629d70)
…
…
…
OpenWrt packages feed
Description
This is the OpenWrt "packages"-feed containing community-maintained build scripts, options and patches for applications, modules and libraries used within OpenWrt.
Installation of pre-built packages is handled directly by the opkg utility within your running OpenWrt system or by using the OpenWrt SDK on a build system.
Usage
This repository is intended to be layered on-top of an OpenWrt buildroot. If you do not have an OpenWrt buildroot installed, see the documentation at: OpenWrt Buildroot – Installation on the OpenWrt support site.
This feed is enabled by default. To install all its package definitions, run:
./scripts/feeds update packages
./scripts/feeds install -a -p packages
License
See LICENSE file.
Package Guidelines
See CONTRIBUTING.md file.
Description
Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
Readme
GPL-2.0
190 MiB
0 Stars
1 Watchers
0 Forks
Languages
Makefile
47.7%
Shell
36.6%
C
7.3%
UnrealScript
4%
C++
1.6%
Other
2.6%