Commit graph

12495 commits

Author SHA1 Message Date
Jo-Philipp Wich
f25285a6c2 luci-mod-system: sshkeys.js: prevent XSS through pubkey comments
Ensure to not display public key comments verbatim in order to prevent
injection of markup.

Reported-by: Eric McDonald <ericmcdonald@protonmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 944b55738e)
2022-09-21 14:50:02 +02:00
Jo-Philipp Wich
712bc8e52d luci-app-statistics: stat-genconfig: don't emit bools for absent uci options
Do not emit native collectd.conf boolean false options if the corresponding
uci option is unset in order to honour collectd's implicit defaults.

This fixes certain options, such as the memory plugins `ValuesAbsolute`,
being without effect if declared as default-enabled in the related plugin
uci forms.

Fixes: #5777
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f16037cec5)
2022-04-25 21:00:48 +02:00
Hannu Nyman
786ebc9c01 treewide: Backport translations and sync
Backport translations from master.
Sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-04-09 19:22:08 +03:00
Hannu Nyman
701a8d6ace timezone data: update to 2022a
Update timezone data to 2022a.

http://mm.icann.org/pipermail/tz-announce/2022-March/000070.html
* Palestine will spring forward on 2022-03-27, not 2022-03-26.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit 15bbe6979b)
2022-03-24 21:12:49 +02:00
Hannu Nyman
ab2c5eb8fe treewide: Backport translations from master - i18n
Backport translations from master.
Sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-03-13 18:29:52 +02:00
Jo-Philipp Wich
1b6c126293 luci-base: properly handle promise targets in Request.request()
Under some circumstances, ubus RPC requests may be initiated while LuCI is
still resolving the `rpcBaseURL` value. In this situation, the `target`
argument of the `request()` call will be a pending promise object which
results in an invalid URL when serialized by `expandURL()`, leading to an
`Failed to execute 'open' on 'XMLHttpRequest': Invalid URL` exception.

This commonly occured on the index status page which immediately initiates
ubus RPC calls on load to discover existing status page partials.

Solve the issue by filtering the given `target` argument through
`Promise.resolve()` before expanding the URL and initiating the actual
request.

Fixes: #3747
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 5663fd596b)
2022-02-21 15:09:48 +01:00
Hannu Nyman
36e5c1c24b treewide: Backport translations from master
Backport translations.
Sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-02-14 22:32:05 +02:00
Jo-Philipp Wich
f3debdcfd9 luci-app-openvpn: fix stray uci permission warning
The OpenVPN file view uses a dummy Map() instance to render the breadcrumb
template which triggers a uci permission error since the view is being
rendered by a form() action which does not set up the expected permission
flags. CBI Map() instances should only be used for cbi() dispatch targets.

Solve the issue by appending the breadcrumb template directly to the
SimpleForm() instance and by removing the redundant dummy Map() instance.

Fixes: #4370
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 18b1130711)
2022-01-25 22:45:15 +01:00
Hannu Nyman
88b4c07b7b treewide: Backport i18n translations from master and sync
Backport translations from master.
Sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-01-23 12:37:35 +02:00
Jo-Philipp Wich
cc8ba6e301 luci-base: sys: prevent path traversal via sys.init routines
Filter the init script name parameter through fs.basename() to avoid
invoking paths outside of /etc/init.d/.

Reported-by: Graham R <gr348@cam.ac.uk>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 8752701b0d)
2022-01-19 16:34:21 +01:00
Jo-Philipp Wich
6f349c9142 luci.js: remove unsafe fallback code from dom.parse()
Do not fallback to .innerHTML if DOMParser() failed for whatever reason.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 63d9bcb682)
2021-12-23 17:10:33 +01:00
Jo-Philipp Wich
ad33852de0 luci-base: form.js: do not execute embedded script code in stripTags()
Instead of relying on .innerHTML which executes embedded script code to
parse a given HTML fragment, use dom.parse() which utilizies DOMParser()
internally in order to extract textContent in a safe manner.

Fixes: FS#4199
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=4199
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 993151504e)
2021-12-23 17:10:32 +01:00
Hannu Nyman
e2a873196a treewide: Backport translations from master - i18n
Backport translations.
Sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-12-18 10:08:02 +02:00
Jo-Philipp Wich
ab3595b12a luci-base: cbi.js: properly handle falsy values in cbi_update_table()
Fixes: #5544
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e982c05671)
2021-11-23 19:13:00 +01:00
Jo-Philipp Wich
8bd4e78ff2 luci-base: network.js: ignore wireless ifname patterns on retrieving devices
Only treat the given identifier as Linux netdev name if we can find a
corresponding entry in the device info cache and do not consider strings
starting with "wlan", "ath" or "wl" to be existing devices.

This fixes incorrectly adding wireless sections as ifnames to network
interfaces when the wifi-iface section name begins with one of the
`iface_patterns_wireless` patterns.

Fixes: #5069
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit d4092b15ce)
2021-11-10 11:58:15 +01:00
Hannu Nyman
6335d0fed2 timezone data: update to 2021e
Update timezone data to 2021e.

http://mm.icann.org/pipermail/tz-announce/2021-September/000066.html
* Jordan now starts DST on February's last Thursday.
* Samoa no longer observes DST.
* Rename Pacific/Enderbury to Pacific/Kanton.

http://mm.icann.org/pipermail/tz-announce/2021-October/000068.html
* Fiji will suspend observance of DST for the 2021/2022 season.

http://mm.icann.org/pipermail/tz-announce/2021-October/000069.html
* Palestine will fall back 10-29 (not 10-30)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit 0740023a3c)
2021-10-28 21:30:21 +03:00
Hannu Nyman
792c94f038 treewide: Backport i18n translations
Backport translations.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-10-19 22:25:45 +03:00
Stan Grishin
fde7889c73
Merge pull request #5414 from stangri/19.07-luci-app-advanced-reboot
[19.07] luci-app-advanced-reboot: bugfix for Linksys E4200v2
2021-10-06 14:53:40 -07:00
Stan Grishin
3d193a9bbe luci-app-advanced-reboot: bugfix for Linksys E4200v2
* bugfix for Linksys E4200v2
* backport updates from master

Signed-off-by: Stan Grishin <stangri@melmac.net>
2021-10-06 21:51:59 +00:00
Jo-Philipp Wich
79af8973e0 luci-mod-network: allow literal "auto" value for distance
Fixes: #4050
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 01d5d5f929)
2021-09-28 08:58:09 -10:00
Hannu Nyman
15249724cf tree: remove erroneous luci-app-dawn ACL file
Remove ACL file accidentally added by ecd49247eb.
There is no luci-app-dawn in 19.07, so no ACL is needed.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-09-24 19:26:55 +03:00
Hannu Nyman
309cd7d507 treewide: i18n - Sync and backport translations
Backport translations from master.
Sync translations.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-09-23 18:23:31 +03:00
Hannu Nyman
fc2ff4dc62 treewide: i18n - Backport and sync translations
Backport translations from master.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-09-09 18:04:57 +03:00
Paul Spooren
53f59d35cc luci-app-attendedsysupgrade: use detail not message
The new API unifies all human readable responses in the `detail` field
to follow the newly used framework.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 2a29911121)
2021-08-25 21:52:00 -10:00
Paul Spooren
1e65672ab2 luci-app-attendedsysupgrade: use latest.json
The content is the same response as for `/api/latest.json` but
statically hosted by a webserver rather than Python generated.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit a672875402)
2021-08-25 21:52:00 -10:00
Paul Spooren
f9bc5da365 luci-app-attendedsysupgrade: show position in queue
The server provides a queue_position argument, show it.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 53ff7ca676)
2021-08-25 21:52:00 -10:00
Paul Spooren
dc626d506d luci-app-attendedsysupgrade: add timeout and catch
If the upgrade server API does not respond, show an error message.
Fix #5222

While at it, minimal code linting

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit ff24b78c80)
2021-08-25 21:52:00 -10:00
Paul Spooren
505b671c21 luci-app-attendedsysupgrade: fix empty array condition
In JavaScript (other than in Python) an empty array is considered `true`
within if statements. Fix this by checking for the array length rather
than its existence.

This fixes the issue of an empty dropdown menu in case the user is
running the latest release.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-08-25 21:52:00 -10:00
Hannu Nyman
b41f37739e treewide: i18n - Sync and backport translations
Sync translations.
Backport translations from master.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-08-10 22:11:52 +03:00
Stan Grishin
5294ba2062
Merge pull request #5228 from stangri/19.07-firewall
[19.07] luci-app-firewall: replace hh.mm.ss with hh:mm:ss
2021-08-04 18:58:08 -07:00
Stan Grishin
78a070de59 luci-app-firewall: replace hh.mm.ss with hh:mm:ss
Signed-off-by: Stan Grishin <stangri@melmac.net>
2021-08-05 01:57:02 +00:00
Stan Grishin
86a3625348
Merge pull request #5218 from stangri/19.07-luci-app-https-dns-proxy
[19.07] luci-app-https-dns-proxy: update to 2021-07-29-1
2021-08-03 22:14:31 -07:00
Stan Grishin
e259f12211 luci-app-https-dns-proxy: update to 2021-07-29-1
* add HTTP/2-only supporting providers: Mullvad, Digitale-Gesellschaft, dns.sb and Rubyfish.cn
* switch default provider from Google to Cloudflare
* add IPv6 addresses for bootstrap resolvers for Google DNS
* add secondary bootstrap resolver (Cloudflare's) to all providers with a single bootstrap resolver
* modify model/cbi file to show HTTP/2-only providers (and help texts) on HTTP/2-supporting systems

Signed-off-by: Stan Grishin <stangri@melmac.net>
2021-07-31 10:58:13 +00:00
Ansuel Smith
7b931da477 luci-mod-network: handle multiple mac for static lease
The mac section for the static lease doesn't correctly handle when multiple mac are set for a rule.
Fixes: #4291

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
(cherry picked from commit 6c9a6c334e)
2021-07-08 08:27:20 +02:00
Paul Spooren
9eb2efd141 luci-app-attendedsysupgrade: sync with master branch
Upgrade the app to stay compatible with the running upgrade server.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-07-04 18:11:06 -10:00
Hauke Mehrtens
15ca915da9 themes: Call striptags() on hostname to prevent XSS
This calls striptags() on the hostname to prevent any XSS over the
hostname. This should fix CVE-2021-33425 as far as I understood it.

If someone adds some Javascript into system.@system[0].hostname it would
have been directly added to the page, this prevents the problem.

This can only be exploited by someone being able to modify the uci
configuration, normally a user with such privileges could also just
modify the webpage.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 5cbd79d7e3)
2021-06-09 21:07:45 +02:00
Hannu Nyman
91f3929500 treewide: i18n - Backport translations from master
Backport translations.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-06-08 20:03:35 +03:00
Jo-Philipp Wich
d0cf6e4a57 luci-mod-status: fix potential XSS via specially crafted DNS names
When an upstream NS returns PTR domain names containing HTML, it is
added verbatim to the connection status table.

Prevent this issue by HTML escaping any values in the source and
destination columns.

Fixes: CVE-2021-32019
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3c66c5b165)
2021-05-12 12:03:19 +02:00
Hannu Nyman
ec81a49945 treewide: backport translations i18n
Backport translations.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-05-08 17:09:09 +03:00
Hannu Nyman
c19c7167e3 treewide: i18n - Backport translations
Backport translations from master.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-04-17 19:09:12 +03:00
Jo-Philipp Wich
d763f9767e luci-base: form.js: fix AbstractValue.textvalue() for uci list options
Serialize the uci list value into a space separated string before passing
it to String.format() for HTML escaping. Without that change, empty strings
were returned whenever the underlying uci get operation yieled an array.

Fixes: #4993
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 5c792aefc7)
2021-04-16 17:33:04 +02:00
Ptilopsis Leucotis
5b28343fbe [19.07] luci-app-fwknopd: add support for ENABLE_CMD_EXEC
Add support for execution commands on the fwknopd server.

Signed-off-by: Ptilopsis Leucotis <PtilopsisLeucotis@yandex.com>
2021-04-14 10:17:39 +03:00
Stan Grishin
c56d9f2f58
Merge pull request #4976 from stangri/19.07-luci-app-simple-adblock
[19.07 luci-app-simple-adblock: bugfix: crash when dnsmasq.ipset selected
2021-04-11 09:38:53 -07:00
Stan Grishin
bf1b37b0c2 luci-app-simple-adblock: bugfix: crash when dnsmasq.ipset selected
Signed-off-by: Stan Grishin <stangri@melmac.net>
2021-04-10 18:45:11 +00:00
Henrique de Moraes Holschuh
254083c17c luci-mod-system: implement system.description, system.notes
Implement two new text "options" for UCI system config, intended to
help humans describe the device.

"system.description" is a short, single-line description suitable for
selector UIs in remote administration applications, or remote UCI (over
ubus RPC), etc.  It would also be suitable as a default for LLDP/SNMP
"system description".

"system.notes" is a multi-line, free-form text field that can be used in
any way the user wishes, e.g. to hold installation notes, or unit serial
number and inventory number, location, etc.

Signed-off-by: Henrique de Moraes Holschuh <henrique@nic.br>
2021-04-06 23:21:46 +03:00
Hannu Nyman
7456e2aada treewide: Backport translations and sync
Backport from master and sync translations.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-03-27 11:05:01 +02:00
Jo-Philipp Wich
41ab871af0 luci-app-opkg: fix parsing empty package repository indexes
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3bcbcbf088)
2021-03-20 17:16:20 +01:00
Hannu Nyman
731d2e37d4 treewide: i18n backport and sync
Backport translations from master and sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-03-13 09:45:36 +02:00
Stan Grishin
55da49fe80
Merge pull request #4908 from stangri/19.07-luci-app-vpn-policy-routing
[19.07] luci-app-vpn-policy-routing: explicit package version
2021-03-12 19:06:27 -08:00
Stan Grishin
b1ddaa662c
Merge pull request #4905 from stangri/19.07-luci-app-simple-adblock
[19.07] luci-app-simple-adblock: explicit package version
2021-03-12 19:06:10 -08:00