The custom options are designed to carry only scalar options to be
added to the connector line.
This fixes a security issue when newlines are included in custom options
which can be used to add yet another, arbitrary connector lines.
See https://github.com/openwrt/packages/security/advisories/GHSA-w6q2-vr4f-49x3
Signed-off-by: Michael Heimpold <redacted>
PKG_NAME:=ser2net
PKG_VERSION:=4.6.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/ser2net
local value="$1"
local sep="${3:-,}"
+ # keep only printable ASCII characters (space through ~)
+ value="$(LC_ALL=C printf '%s' "$value" | tr -cd ' -~')"
+
eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
}