mirror of
https://github.com/openwrt/packages.git
synced 2026-12-04 00:25:30 +04:00
ser2net: filter non-printable characters from custom options
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 <mhei@heimpold.de>
This commit is contained in:
1 parent
98124d5f25
commit
a871f12fb7
2 files changed
+4
-1
No files matched your search
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
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
|
||||
|
||||
@@ -15,6 +15,9 @@ list_cb_append() {
|
||||
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\""
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user