If you like BoxMatrix then please contribute Supportdata, Supportdata2, Firmware and/or Hardware (get in touch).
My metamonk@yahoo.com is not reachable by me since years. Please use hippie2000@webnmail.de instead.

0
U

Property:security.lua

From BoxMatrix


BoxMatrix >> Webinterface >> security.lua @ BoxMatrix   -   IRC-Chat   -   Translate: de es fr it nl pl
News Selectors Models Accessories Components Environment Config Commands System Webif Software Develop Lexicon Community Project Media

UI-Structure UI-Modules HTML-Files XML-Files Lua-Scripts Javascript Browser SSI-Files SSI-Directives HTML-Text Event-Text Help-Pages CSS-Files Graphics Research

Lua-Script

Goto:   Functions  -  Dependencies   -   Model-Matrix   -   SMW-Browser

Details

This is an "in-section" name collision covering 2 completely different files:   -   (this will be splitted one day)
For now this article explains the REST-API file in /usr/rest_api. The Dependencies and Model-Matrix cover both files.

security.lua is the REST-API Security checker. It is included by api.lua.

It provides a method for checking the access permissions for a given <endpoint> URL and access method (lan, wan).

By default an <endpoint> is denied, and whitelisted by a per <endpoint> access mask assigned in this script.

AVM comments it: Allow-List definition which endpoint with which rights can be accessed.

Security is enabled in ui-module webui:settings/rest_api_endpoint_security, which defaults to 1.
Tests to set it to 0 using ctlmgr_ctl did not work in fw 7.50.

root@fritz1:/var/media/ftp# ctlmgr_ctl r webui settings/rest_api_endpoint_security
1
root@fritz1:/var/media/ftp# ctlmgr_ctl w webui settings/rest_api_endpoint_securityr 0
root@fritz1:/var/media/ftp# ctlmgr_ctl r webui settings/rest_api_endpoint_security
1

REST-API:

Functions

The function names of scripts often help to understand function blocks (and show gaps in the docs). fw 7.50 functions:

$ grep -e '^function' -e '^local function' /usr/rest_api/security.lua

# Get the user rights from rights UIM.
local function get_user_session_rights()

# Check if the user(session) match any of the given required rights.
local function check_authentication(required_rights)

# Check if rights for endpoints should be checked or not.
local function security_active()

# Checks if the user has the permissions to access the requested url path.
function security.permission(path, access_type) 

Dependencies

Daily updated index of all dependencies of this script. Last update: 2024-11-14 08:31 GMT.
A * in the Mod column marks info from Supportdata-Probes, which will always stay incomplete.
If an Object includes itself then this is a file with the same name but another Path and the dependencies are merged.

Relation Typ Object Mod Firmware Info Origin
Accesses uimod aura (uimod) 5 4.85 AURA - AVM USB remote architecture AVM
Accesses uimod blocked_wan_ips 22 7.63 - 8.00 TODO AVM
Accesses uimod box 44 5.01 - 8.00 Global box settings AVM
Accesses uimod boxusers 82 6.10 - 8.00 FritzBox-Users AVM
Accesses uimod capiotcp 50 7.19 - 8.00 CAPI-over-TCP remote CAPI AVM
Accesses uimod capture 66 6.10 - 7.24 AVM Packet-Capture AVM
Accesses uimod connection0 75 6.10 - 7.32 Internet connection AVM
Accesses uimod connections 43 7.39 - 8.00 TODO AVM
Accesses uimod ctlusb 98 4.85 - 8.00 USB-Host related config AVM
Accesses uimod dect (uimod) 67 6.10 - 8.00 DECT base, handsets, repeater, ULE AVM
Accesses uimod dnscfg 51 7.19 - 8.00 DNS servers and config AVM
Accesses uimod emailnotify 75 6.36 - 8.00 Push-Mail settings AVM
Accesses uimod filelinks 82 6.10 - 8.00 MyFRITZ! NAS links AVM
Accesses uimod logic 47 6.10 - 6.87 uptime and NSP (SDK) version AVM
Accesses uimod openports 51 7.24 - 8.00 TODO AVM
Accesses uimod remoteman 75 6.10 - 7.39 Remote-HTTPS AVM
Accesses uimod rights 31 7.39 - 7.63 Status of the currently logged in user AVM
Accesses uimod services (uimod) 51 7.19 - 8.00 Network-Ports list AVM
Accesses uimod sipextra 68 6.54 - 8.00 Global VoIP settings AVM
Accesses uimod storagedirectories 28 4.85 - 5.27 Storage directories and access permissions AVM
Accesses uimod storageusers 28 4.85 - 5.27 User permissions to access storage AVM
Accesses uimod telcfg 81 6.10 - 8.00 Telephony configuration AVM
Accesses uimod tr069 51 7.19 - 8.00 TR-069 settings AVM
Accesses uimod tr369 43 7.39 - 8.00 TR-369 settings AVM
Accesses uimod uimodlogic 67 6.84 - 8.00 uptime and Firmware version AVM
Accesses uimod updatecheck (uimod) 82 6.10 - 8.00 JSON or JUIS firmware update check AVM
Accesses uimod wlan (uimod) 92 5.01 - 8.00 WLAN configuration AVM
Requires lua avmluamessages.lua 31 7.39 - 7.63 REST-API Debug Message Printer AVM
Requires lua boxusers.lua 62 6.98 - 8.00 TODO AVM
Requires lua cmtable.lua 28 4.85 - 5.27 TODO AVM
Requires lua connection.lua 49 6.10 - 6.110 TODO AVM
Requires lua connection_info.lua 55 6.98 - 7.32 TODO AVM
Requires lua date.lua 29 6.36 - 6.64 TODO AVM
Requires lua fon_devices.lua 82 6.10 - 8.00 TODO AVM
Requires lua fon_numbers.lua 72 6.10 - 8.00 TODO AVM
Requires lua general.lua 28 4.85 - 5.27 TODO AVM
Requires lua href.lua 19 6.10 - 6.36 TODO AVM
Requires lua html.lua 19 6.10 - 6.36 TODO AVM
Requires lua isp.lua 75 6.10 - 7.32 TODO AVM
Requires lua myfritz_access.lua 62 6.98 - 8.00 TODO AVM
Requires lua netdev.lua 62 6.98 - 8.00 TODO AVM
Requires lua net_devices.lua 62 6.98 - 8.00 TODO AVM
Requires lua opmode.lua 43 7.39 - 8.00 TODO AVM
Requires lua pushservice.lua 39 6.98 - 7.18 TODO AVM
Requires lua rest_api_const.lua 36 7.39 - 8.00 REST-API Const Tables AVM
Requires lua retrieve_data.lua 43 7.39 - 8.00 TODO AVM
Requires lua store.lua 90 5.05 - 8.00 TODO AVM
Requires lua uimod.lua 36 7.39 - 8.00 REST-API UI-Modules API AVM
Requires lua usb_devices.lua 28 4.85 - 5.27 TODO AVM
Requires lua val.lua 28 4.85 - 5.27 TODO AVM
Requires lua wifi.lua 22 7.61 - 8.00 TODO AVM
Required by lua api.lua 36 7.39 - 8.00 REST-API Lua-Land root for scgi_server AVM
Required by lua api_generic.lua 26 7.90 - 8.00 REST-API Generic Endpoints AVM
Includes js box.js 22 5.01 - 5.27 TODO AVM
Includes lua global_lua.lua 65 4.85 - 6.110 TODO AVM
Includes js handlers.js 49 6.10 - 6.110 TODO AVM
Includes html html_end.html 65 4.85 - 6.110 TODO AVM
Includes html html_head.html 65 4.85 - 6.110 TODO AVM
Includes html page_end.html 65 4.85 - 6.110 TODO AVM
Includes html page_head.html 65 4.85 - 6.110 TODO AVM
Includes lua rdfirst.lua 62 6.98 - 8.00 TODO AVM
Includes css threecolumns.css 28 4.85 - 5.27 TODO AVM
Includes js validate.js 28 4.85 - 5.27 TODO AVM
Includes gfx icon_help.png 49 6.10 - 6.110 TODO AVM
Includes gfx icon_kennwort.gif 49 6.10 - 6.110 TODO AVM
65 dependencies for this script

Model-Matrix

Daily updated index of the presence, path and size of this script for each model. Last update: 2024-11-14 06:51 GMT.
Showing all models using this script. Click any column header (click-wait-click) to sort the list by the respective data.
The (main/scrpn/boot/arm/prx/atom/rtl) label in the Model column shows which CPU is meant for Multi-Linux models.
Note that this list is merged from Firmware-Probes of all known AVM firmware for a model, including Recovery.exe and Labor-Files.

Model Firmware Path Size/Bytes
FRITZ!Box WLAN 3270 4.86 - 5.21 /usr/www/<oem>/storage 10.1k - 13.4k
FRITZ!Box WLAN 3270 v3 4.86 - 5.23 /usr/www/<oem>/storage 10.1k - 13.4k
FRITZ!Box WLAN 3270 IT 5.23 /usr/www/<oem>/storage 11.4k
FRITZ!Box 3272 (main) 6.20 - 6.89 /usr/www/<oem>/system 38.2k - 63.2k
FRITZ!Box WLAN 3370 (main) 5.01 - 6.56 /usr/www/<oem>/storage, /usr/www/<oem>/system 10.6k - 57.4k
FRITZ!Box 3390 (main) 6.20 - 6.56 /usr/www/<oem>/system 38.2k - 57.4k
FRITZ!Box 3490 (main) 6.20 - 7.30 /usr/www/<oem>/system 20.5k - 63.0k
FRITZ!Box 4020 /usr/www/<oem>/system 28.0k - 63.0k
FRITZ!Box 4040 6.52 - 8.00 /usr/rest_api, /usr/www/<oem>/system 8.2k - 63.0k
FRITZ!Box 4050 7.58 - 7.90 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.8k
FRITZ!Box 4060 7.29 - 7.90 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.8k
FRITZ!Box 5490 (main) 6.51 - 7.29 /usr/www/<oem>/system 20.9k - 63.8k
FRITZ!Box 5491 (main) 7.01 - 7.29 /usr/www/<oem>/system 20.9k - 28.4k
FRITZ!Box 5530 Fiber (main) 7.21 - 8.00 /usr/rest_api, /usr/www/<oem>/system 7.0k - 30.5k
FRITZ!Box 5590 Fiber (main) 7.29 - 8.00 /usr/rest_api, /usr/www/<oem>/system 7.0k - 21.8k
FRITZ!Box 5590 Fiber (prx) 7.70 - 8.00 /usr/rest_api 7.0k - 14.0k
FRITZ!Box 5690 Pro (main) 7.62 - 7.90 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.8k
FRITZ!Box 6320 Cable v2 6.21 /usr/www/<oem>/system 38.3k
FRITZ!Box 6340 Cable 5.24 /usr/www/<oem>/storage 11.4k
FRITZ!Box 6360 Cable 4.86 - 6.51 /usr/www/<oem>/storage, /usr/www/<oem>/system 10.0k - 57.9k
FRITZ!Box 6430 Cable (atom) 6.84 - 7.29 /usr/www/<oem>/system 20.9k - 64.1k
FRITZ!Box 6490 Cable (arm) 6.20 - 6.64 /usr/www/<oem>/system 39.3k - 57.9k
FRITZ!Box 6490 Cable (atom) 6.20 - 7.51 /usr/rest_api, /usr/www/<oem>/system 8.2k - 64.1k
FRITZ!Box 6590 Cable (atom) 6.83 - 7.51 /usr/rest_api, /usr/www/<oem>/system 8.2k - 64.1k
FRITZ!Box 6591 Cable (arm) 7.04 - 8.00 /usr/rest_api, /usr/www/<oem>/system 14.0k - 28.4k
FRITZ!Box 6591 Cable (atom) 7.04 - 8.00 /usr/rest_api, /usr/www/<oem>/system 7.8k - 30.6k
FRITZ!Box 6660 Cable (arm) 7.90 - 8.00 /usr/rest_api 14.0k
FRITZ!Box 6660 Cable (atom) 7.14 - 8.00 /usr/rest_api, /usr/www/<oem>/system 7.8k - 30.6k
FRITZ!Box 6670 Cable (arm) 7.90 /usr/rest_api 14.0k
FRITZ!Box 6670 Cable (atom) 7.61 - 7.90 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.8k
FRITZ!Box 6690 Cable (arm) 7.90 /usr/rest_api 14.0k
FRITZ!Box 6690 Cable (atom) 7.28 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.8k - 21.8k
FRITZ!Box 6810 LTE 6.35 /usr/www/<oem>/storage, /usr/www/<oem>/system 11.4k - 38.3k
FRITZ!Box 6820 LTE v1 (main) 6.40 - 7.51 /usr/rest_api, /usr/www/<oem>/system 8.2k - 60.2k
FRITZ!Box 6820 LTE v2 (main) 6.40 - 7.51 /usr/rest_api, /usr/www/<oem>/system 8.2k - 60.2k
FRITZ!Box 6820 LTE v3 (main) 7.19 - 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 27.3k
FRITZ!Box 6840 LTE (main) 5.08 - 6.88 /usr/www/<oem>/storage, /usr/www/<oem>/system 11.4k - 64.0k
FRITZ!Box 6842 LTE /usr/www/<oem>/system 38.9k
FRITZ!Box 6850 LTE 7.21 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.8k - 30.6k
FRITZ!Box 6850 5G 7.24 - 7.90 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.8k
FRITZ!Box 6890 LTE (main) 6.84 - 7.57 /usr/rest_api, /usr/www/<oem>/system 7.8k - 63.8k
FRITZ!Box 6890 LTE v1 (main) 6.84 - 7.57 /usr/rest_api, /usr/www/<oem>/system 7.8k - 63.8k
FRITZ!Box 6890 LTE v2 (main) 6.84 - 7.57 /usr/rest_api, /usr/www/<oem>/system 7.8k - 63.8k
FRITZ!Box Fon WLAN 7112 4.86 - 4.88 /usr/www/<oem>/storage 10.1k
FRITZ!Box Fon WLAN 7170 4.86 - 4.88 /usr/www/<oem>/storage 10.1k
FRITZ!Box Fon WLAN 7170 v1 4.86 - 4.88 /usr/www/<oem>/storage 10.1k
FRITZ!Box Fon WLAN 7170 v2 4.86 - 4.88 /usr/www/<oem>/storage 10.1k
FRITZ!Box Fon WLAN 7240 4.85 - 5.22 /usr/www/<oem>/storage 6.2k - 13.4k
FRITZ!Box Fon WLAN 7270 v1 4.85 - 4.89 /usr/www/<oem>/storage 9.3k - 10.3k
FRITZ!Box Fon WLAN 7270 v2 4.85 - 5.27 /usr/www/<oem>/storage 6.2k - 13.6k
FRITZ!Box Fon WLAN 7270 v3 4.85 - 5.27 /usr/www/<oem>/storage 6.2k - 13.6k
FRITZ!Box 7272 (main) 6.10 - 6.88 /usr/www/<oem>/system 38.9k - 64.0k
FRITZ!Box 7312 5.23 - 6.56 /usr/www/<oem>/storage, /usr/www/<oem>/system 11.4k - 57.2k
FRITZ!Box Fon WLAN 7320 4.85 - 6.35 /usr/www/<oem>/storage, /usr/www/<oem>/system 10.1k - 38.9k
FRITZ!Box 7330 5.06 - 6.56 /usr/www/<oem>/storage, /usr/www/<oem>/system 11.4k - 58.2k
FRITZ!Box 7330 SL 5.08 - 6.56 /usr/www/<oem>/storage, /usr/www/<oem>/system 11.4k - 58.2k
FRITZ!Box Fon WLAN 7340 4.85 - 5.05 /usr/www/<oem>/storage, /usr/www/<oem>/system 10.0k - 38.9k
FRITZ!Box Fon WLAN 7360 SL 5.04 - 6.34 /usr/www/<oem>/storage, /usr/www/<oem>/system 11.4k - 38.9k
FRITZ!Box Fon WLAN 7360 v1 5.06 - 6.36 /usr/www/<oem>/storage, /usr/www/<oem>/system 11.4k - 38.9k
FRITZ!Box Fon WLAN 7360 v2 5.22 - 6.88 /usr/www/<oem>/storage, /usr/www/<oem>/system 11.4k - 64.0k
FRITZ!Box 7362 SL (main) 6.10 - 7.18 /usr/www/<oem>/system 28.0k - 63.8k
FRITZ!Box 7369 (main) 6.30 - 6.32 /usr/www/<oem>/system 38.9k
FRITZ!Box Fon WLAN 7390 4.85 - 5.22 /usr/www/<oem>/storage, /usr/www/<oem>/system 6.2k - 64.0k
FRITZ!Box 7412 (main) 6.21 - 6.88 /usr/www/<oem>/system 38.3k - 63.0k
FRITZ!Box 7430 (main) 6.26 - 7.31 /usr/www/<oem>/system 20.9k - 63.8k
FRITZ!Box 7490 (main) 6.20 - 7.51 /usr/rest_api, /usr/www/<oem>/system 8.2k - 64.0k
FRITZ!Box 7510 7.30 - 8.00 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.8k
FRITZ!Box 7520 6.98 - 8.00 /usr/rest_api, /usr/www/<oem>/system 8.2k - 30.6k
FRITZ!Box 7520 v2 (main) 7.30 - 8.00 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.8k
FRITZ!Box 7530 6.98 - 8.00 /usr/rest_api, /usr/www/<oem>/system 7.8k - 30.6k
FRITZ!Box 7530 AX 7.20 - 8.00 /usr/rest_api, /usr/www/<oem>/system 7.0k - 30.6k
FRITZ!Box 7560 (main) 6.51 - 7.30 /usr/www/<oem>/system 20.8k - 64.0k
FRITZ!Box Fon WLAN 7570 vDSL 4.90 - 4.92 /usr/www/<oem>/storage 10.0k
FRITZ!Box 7580 (main) 6.53 - 7.30 /usr/www/<oem>/system 20.8k - 64.0k
FRITZ!Box 7581 6.54 - 7.18 /usr/www/<oem>/system 28.4k - 63.8k
FRITZ!Box 7582 6.83 - 7.18 /usr/www/<oem>/system 28.4k - 63.8k
FRITZ!Box 7583 (main) 7.01 - 7.59 /usr/rest_api, /usr/www/<oem>/system 8.2k - 30.6k
FRITZ!Box 7583 VDSL (main) 7.19 - 8.00 /usr/rest_api, /usr/www/<oem>/system 8.2k - 30.6k
FRITZ!Box 7590 (main) 6.83 - 8.00 /usr/rest_api, /usr/www/<oem>/system 7.8k - 64.0k
FRITZ!Box 7590 AX (main) 7.19 - 8.00 /usr/rest_api, /usr/www/<oem>/system 7.0k - 30.6k
FRITZ!Box 7690 7.61 - 7.90 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.8k
FRITZ!Smart Gateway 7.52 - 7.63 /usr/www/<oem>/system 20.9k - 21.9k
FRITZ!WLAN Repeater 300E 5.01 - 6.34 /usr/www/<oem>/storage, /usr/www/<oem>/system 11.4k - 36.9k
FRITZ!WLAN Repeater 310 A 5.24 - 7.16 /usr/www/<oem>/storage, /usr/www/<oem>/system 11.4k - 60.0k
FRITZ!WLAN Repeater 310 B 6.30 - 7.16 /usr/www/<oem>/system 25.4k - 60.0k
FRITZ!WLAN Repeater 450E 6.10 - 7.15 /usr/www/<oem>/system 25.4k - 60.0k
FRITZ!Repeater 600 7.11 - 7.58 /usr/www/<oem>/system 18.7k - 27.2k
FRITZ!Repeater 600 v2 7.27 - 7.58 /usr/www/<oem>/system 18.7k - 20.9k
FRITZ!WLAN Repeater 1160 6.51 - 7.15 /usr/www/<oem>/system 25.4k - 60.0k
FRITZ!Repeater 1200 7.11 - 7.58 /usr/www/<oem>/system 18.7k - 27.2k
FRITZ!Repeater 1200 AX 7.30 - 7.58 /usr/www/<oem>/system 18.7k - 20.9k
FRITZ!WLAN Repeater 1750E 6.12 - 7.32 /usr/www/<oem>/system 18.7k - 60.0k
FRITZ!Repeater 2400 7.12 - 7.58 /usr/www/<oem>/system 18.4k - 27.2k
FRITZ!Repeater 3000 6.98 - 7.58 /usr/www/<oem>/system 18.4k - 27.2k
FRITZ!Repeater 3000 AX 7.41 - 7.58 /usr/www/<oem>/system 20.2k - 20.9k
FRITZ!Repeater 6000 7.19 - 7.58 /usr/www/<oem>/system 18.7k - 27.2k
FRITZ!WLAN Repeater DVB-C 6.12 - 7.04 /usr/www/<oem>/system 25.4k - 60.0k
FRITZ!Powerline 540E 6.20 - 7.15 /usr/www/<oem>/system 25.4k - 60.0k
FRITZ!Powerline 546E 6.20 - 7.15 /usr/www/<oem>/system 25.4k - 60.0k
FRITZ!Powerline 1240 AX 7.57 - 7.58 /usr/www/<oem>/system 20.9k
FRITZ!Powerline 1240E 6.33 - 7.16 /usr/www/<oem>/system 25.4k - 60.0k
FRITZ!Powerline 1260E 6.90 - 7.58 /usr/www/<oem>/system 18.7k - 60.0k
FRITZ!Powerline 1260 7.27 - 7.58 /usr/www/<oem>/system 18.7k - 20.9k
Speedport W 504V MK 5.04 /usr/www/<oem>/storage 13.4k
104 models use this script

SMW-Browser

Information is currently being retrieved from the backend.