Skip to content

nut: improve rpcd acl / luci-app-acl effectiveness#30055

Open
danielfdickinson wants to merge 1 commit into
openwrt:masterfrom
danielfdickinson:pr-nut-improve-acl-effectiveness
Open

nut: improve rpcd acl / luci-app-acl effectiveness#30055
danielfdickinson wants to merge 1 commit into
openwrt:masterfrom
danielfdickinson:pr-nut-improve-acl-effectiveness

Conversation

@danielfdickinson

@danielfdickinson danielfdickinson commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

📦 Package Details

Maintainer: @danielfdickinson

Description:
Reduce opportunities for an untrusted user with UCI write access to escalate privileges or write arbitrary configurations (i.e. config not part of their ACL).

  • Introduces config_get_single which only allows accepts 7-bit ASCII characters from UCI configuration settings
  • Splits UCI configuration files into main for each service, and a _root config. The _root configuration holds any configuration which is or could lead to root-equivalence (such as setting RUNAS user, and defining executable notification commands).
  • Uses config_load in a subshell where needed, so that the _root configurations do not get mixed in with the non-_root configurations.
  • More validation of inputs

Hotplug scripts do not require changes, as they only use the non-root upsd configs, and have a separate variable context, so isolating their config_load in a subshell is not necessary.

Corresponding LuCI PR is openwrt/luci#8851


🧪 Run Testing Details

Lightly tested

  • OpenWrt Version: OpenWrt SNAPSHOT r35431-4f2dc5cc64
  • OpenWrt Target/Subtarget: bcm27xx/bcm2709
  • OpenWrt Device: Raspberry Pi 2 Model B Rev 1.1

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit; the commit message accurately describes the changes.


Generated by Claude Code

Comment thread net/nut/files/nut-monitor.init Outdated
Comment thread net/nut/files/nut-common.sh.functions Outdated
Comment thread net/nut/files/nut-server.init Outdated
Comment thread net/nut/files/nut-monitor-config.sh.functions Outdated
Reduce opportunities for an untrusted user with UCI write access to
escalate privileges or write arbitrary configurations (i.e. config not
part of their ACL).

* Introduces config_get_single which only allows accepts 7-bit ASCII
  characters from UCI configuration settings
* Splits UCI configuration files into main for each service, and a
  [service]_root config. The _root configuration holds any configuration
	which is or could lead to root-equivalence (such as setting RUNAS
	user, and defining executable notification commands).
* Uses config_load in a subshell where needed, so that the _root
  configurations do not get mixed in with the non-_root configurations.
* More validation of inputs

Hotplug scripts do not require changes, as they only use the non-root
upsd configs, and have a separate variable context, so isolating their
config_load in a subshell is not necessary.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
@danielfdickinson
danielfdickinson force-pushed the pr-nut-improve-acl-effectiveness branch from 4846a40 to 19955db Compare July 21, 2026 07:06
@danielfdickinson
danielfdickinson marked this pull request as ready for review July 21, 2026 07:08

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit; no new issues found.

The changes since the last review are all correct fixes: removing the duplicate check_safe_hostname_or_ip definition, correcting the log_config_load_error label to nut_monitor_root, fixing the interface_reload_delay validation (the value is now assigned from val before the check), and switching exit 1 to return 1 in loop_through_drivers for consistency with its callers.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants