Skip to content

luci-app-veracrypt: add optional LuCI UI - #9031

Draft
flatstik wants to merge 1 commit into
openwrt:masterfrom
flatstik:luci-app-veracrypt
Draft

flatstik wants to merge 1 commit into
openwrt:masterfrom
flatstik:luci-app-veracrypt

Conversation

@flatstik

@flatstik flatstik commented Sep 14, 2026

Copy link
Copy Markdown

Web UI for the console veracrypt package (packages feed). Not bundled into veracrypt; apk add luci-app-veracrypt depends on +veracrypt. Calls veracrypt --text only, with passwords on stdin.

CLI reference: https://www.veracrypt.fr/en/Command%20Line%20Usage.html

Pull request details

Description

Screenshot or video of changes (if applicable)

Maintainer (preferred)

@


Tested on

OpenWrt version:
LuCI version:
Web browser(s):


Checklist

  • (Nice to have) Includes what Issue it closes (e.g. openwrt/luci#issue-number).
  • (Nice to have) Includes what it depends on (e.g. openwrt/packages#pr-number in sister repo).

Web UI for the console veracrypt package (packages feed). Not bundled
into veracrypt; apk add luci-app-veracrypt depends on +veracrypt.
Calls veracrypt --text only, with passwords on stdin.

CLI reference: https://www.veracrypt.fr/en/Command%20Line%20Usage.html

Signed-off-by: Ville Takio <ville+git@takio.fi>
@openwrt openwrt Bot added the add package Introduces a new package Makefile build script label Sep 14, 2026
@flatstik
flatstik marked this pull request as draft September 15, 2026 02:22

@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.

Commit checks

  • 13657fa "luci-app-veracrypt: add optional LuCI UI" — "with passwords on stdin" holds only for the current password; --new-password=, --protection-password= and --token-pin= are built into the argv at lines 897/908/917 of luci.veracrypt and are visible in ps. Reword to say the current password goes on stdin, and qualify the same claim in README.md:9.

Generated by Claude Code

Comment on lines +5 to +8
"ubus": {
"file": [ "list", "stat" ],
"luci.veracrypt": [ "status", "listdir", "listdev", "mkdir", "rm", "job", "job_log", "job_abort", "job_answer", "tools", "pkg_install", "run" ]
},

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.

mkdir, rm, run, job_abort and pkg_install all mutate state, but granting them in read lets a read-only ACL group create and delete files, run veracrypt and install packages. Keep only the query methods in read; the write block already lists the full set. The file ubus entry is unused too — the view never require fs.

Suggested change
"ubus": {
"file": [ "list", "stat" ],
"luci.veracrypt": [ "status", "listdir", "listdev", "mkdir", "rm", "job", "job_log", "job_abort", "job_answer", "tools", "pkg_install", "run" ]
},
"ubus": {
"luci.veracrypt": [ "status", "listdir", "listdev", "job", "job_log", "tools" ]
},

Generated by Claude Code

Comment on lines +9 to +18
"file": {
"*": [ "list", "stat" ],
"/bin/mkdir": [ "exec" ],
"/usr/bin/mkdir": [ "exec" ],
"/bin/rm": [ "exec" ],
"/usr/bin/rm": [ "exec" ],
"/bin/rmdir": [ "exec" ],
"/usr/bin/rmdir": [ "exec" ],
"/bin/busybox": [ "exec" ]
},

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.

exec on /bin/busybox combined with "file": [ "exec" ] in the write ubus block (line 23) is arbitrary root command execution for anyone holding this ACL, and "*": [ "list", "stat" ] exposes the entire filesystem. None of it is used: the view declares no require fs and only calls luci.veracrypt.*, and mkdir/rm go through the backend's own methods. Drop this block, the identical one at lines 26-34, and "file": [ "exec" ] at line 23.

Suggested change
"file": {
"*": [ "list", "stat" ],
"/bin/mkdir": [ "exec" ],
"/usr/bin/mkdir": [ "exec" ],
"/bin/rm": [ "exec" ],
"/usr/bin/rm": [ "exec" ],
"/bin/rmdir": [ "exec" ],
"/usr/bin/rmdir": [ "exec" ],
"/bin/busybox": [ "exec" ]
},

Generated by Claude Code


LUCI_TITLE:=LuCI support for VeraCrypt
LUCI_DESCRIPTION:=Optional web UI for console VeraCrypt. Uses veracrypt --text only; no VeraCrypt GUI toolkit.
LUCI_DEPENDS:=+luci-base +veracrypt

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.

There is no veracrypt package in openwrt/packages at 0a78135 — nothing matches veracrypt anywhere in that tree — so this dependency cannot resolve today. The checklist ticks "includes what it depends on" but the body names no sister PR; please link the openwrt/packages PR that adds the CLI package.


Generated by Claude Code

return 0
;;
esac
err=/tmp/vc-mkdir.err

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.

Fixed, predictable path in world-writable /tmp opened for writing as root — an unprivileged local user can pre-create it as a symlink and the 2>"$err" redirect will truncate and overwrite the target. Same pattern at line 664 (/tmp/vc-rm.err) and line 960 (/tmp/vc-umount.out).

Suggested change
err=/tmp/vc-mkdir.err
err=$(mktemp /tmp/vc-mkdir.XXXXXX) || err=/dev/null

Generated by Claude Code

return 0 ;;
esac
case $p in
/dev/*|/proc/*|/sys/*|/etc/*|/usr/*|/bin/*|/sbin/*|/lib/*|/rom/*|/overlay/*|/tmp/luci-veracrypt-job*)

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.

/www, /root and /boot are protected as exact paths in the list above but their subtrees are not covered here, so rm will delete e.g. /root/.ssh or /www/luci-static as root.

Suggested change
/dev/*|/proc/*|/sys/*|/etc/*|/usr/*|/bin/*|/sbin/*|/lib/*|/rom/*|/overlay/*|/tmp/luci-veracrypt-job*)
/dev/*|/proc/*|/sys/*|/etc/*|/usr/*|/bin/*|/sbin/*|/lib/*|/rom/*|/overlay/*|/www/*|/root/*|/boot/*|/tmp/luci-veracrypt-job*)

Generated by Claude Code

Comment on lines +1196 to +1201
vc_invoke "$pw" --text --non-interactive \
--pim="$pim_m" --protect-hidden=no \
--mount-options=nokernelcrypto \
--slot="$nslot" \
${kf:+--keyfiles="$kf"} \
"$vol_path" "$mp" >> "$JOB.log" 2>&1

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.

${kf:+...} is unquoted, so a keyfile path containing spaces or glob characters gets word-split and globbed before it reaches veracrypt — valid_path permits both. Use the set -- accumulation this function already uses at line 1184.

Suggested change
vc_invoke "$pw" --text --non-interactive \
--pim="$pim_m" --protect-hidden=no \
--mount-options=nokernelcrypto \
--slot="$nslot" \
${kf:+--keyfiles="$kf"} \
"$vol_path" "$mp" >> "$JOB.log" 2>&1
set -- --text --non-interactive \
--pim="$pim_m" --protect-hidden=no \
--mount-options=nokernelcrypto \
--slot="$nslot"
[ -n "$kf" ] && set -- "$@" --keyfiles="$kf"
vc_invoke "$pw" "$@" "$vol_path" "$mp" >> "$JOB.log" 2>&1

Generated by Claude Code

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

Labels

add package Introduces a new package Makefile build script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants