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-04-23 08:48 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 12 7.90 TODO AVM
Accesses uimod box 34 5.01 - 7.90 Global box settings AVM
Accesses uimod boxusers 88 6.10 - 7.90 FritzBox-Users AVM
Accesses uimod capiotcp 61 7.19 - 7.90 CAPI-over-TCP remote CAPI AVM
Accesses uimod capture 70 6.10 - 7.24 AVM Packet-Capture AVM
Accesses uimod connection0 79 6.10 - 7.32 Internet connection AVM
Accesses uimod connections 55 7.39 - 7.90 TODO AVM
Accesses uimod ctlusb 103 4.85 - 7.90 USB-Host related config AVM
Accesses uimod dect (uimod) 75 6.10 - 7.90 DECT base, handsets, repeater, ULE AVM
Accesses uimod dnscfg 61 7.19 - 7.90 DNS servers and config AVM
Accesses uimod emailnotify 81 6.36 - 7.90 Push-Mail settings AVM
Accesses uimod filelinks 88 6.10 - 7.90 MyFRITZ! NAS links AVM
Accesses uimod logic 47 6.10 - 6.87 uptime and NSP (SDK) version AVM
Accesses uimod openports 61 7.24 - 7.90 TODO AVM
Accesses uimod remoteman 79 6.10 - 7.39 Remote-HTTPS AVM
Accesses uimod rights 49 7.39 - 7.62 Status of the currently logged in user AVM
Accesses uimod services (uimod) 61 7.19 - 7.90 Network-Ports list AVM
Accesses uimod sip 1 7.39 VoIP accounts AVM
Accesses uimod sipextra 75 6.54 - 7.90 Global VoIP settings AVM
Accesses uimod storagedirectories 27 4.85 - 5.27 Storage directories and access permissions AVM
Accesses uimod storageusers 27 4.85 - 5.27 User permissions to access storage AVM
Accesses uimod telcfg 87 6.10 - 7.90 Telephony configuration AVM
Accesses uimod tr069 61 7.19 - 7.90 TR-069 settings AVM
Accesses uimod tr369 55 7.39 - 7.90 TR-369 settings AVM
Accesses uimod uimodlogic 75 6.84 - 7.90 uptime and Firmware version AVM
Accesses uimod updatecheck (uimod) 88 6.10 - 7.90 JSON or JUIS firmware update check AVM
Accesses uimod wlan (uimod) 97 5.01 - 7.90 WLAN configuration AVM
Requires lua avmluamessages.lua 49 7.39 - 7.62 REST-API Debug Message Printer AVM
Requires lua boxusers.lua 72 6.98 - 7.90 TODO AVM
Requires lua cmtable.lua 27 4.85 - 5.27 TODO AVM
Requires lua connection.lua 50 6.10 - 6.110 TODO AVM
Requires lua connection_info.lua 61 6.98 - 7.32 TODO AVM
Requires lua date.lua 29 6.36 - 6.64 TODO AVM
Requires lua fon_devices.lua 88 6.10 - 7.90 TODO AVM
Requires lua fon_numbers.lua 79 6.10 - 7.90 TODO AVM
Requires lua general.lua 27 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 79 6.10 - 7.39 TODO AVM
Requires lua myfritz_access.lua 72 6.98 - 7.90 TODO AVM
Requires lua netdev.lua 72 6.98 - 7.90 TODO AVM
Requires lua net_devices.lua 72 6.98 - 7.90 TODO AVM
Requires lua opmode.lua 55 7.39 - 7.90 TODO AVM
Requires lua pushservice.lua 44 6.98 - 7.17 TODO AVM
Requires lua rest_api_const.lua 50 7.39 - 7.90 REST-API Const Tables AVM
Requires lua retrieve_data.lua 55 7.39 - 7.90 TODO AVM
Requires lua store.lua 96 5.05 - 7.90 TODO AVM
Requires lua uimod.lua 50 7.39 - 7.90 REST-API UI-Modules API AVM
Requires lua usb_devices.lua 27 4.85 - 5.27 TODO AVM
Requires lua val.lua 27 4.85 - 5.27 TODO AVM
Requires lua wifi.lua 16 7.59 - 7.90 TODO AVM
Required by lua api.lua 50 7.39 - 7.90 REST-API Lua-Land root for scgi_server AVM
Includes js box.js 21 5.01 - 5.27 TODO AVM
Includes lua global_lua.lua 65 4.85 - 6.110 TODO AVM
Includes js handlers.js 50 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 72 6.98 - 7.90 TODO AVM
Includes css threecolumns.css 27 4.85 - 5.27 TODO AVM
Includes js validate.js 27 4.85 - 5.27 TODO AVM
Includes gfx icon_help.png 50 6.10 - 6.110 TODO AVM
Includes gfx icon_kennwort.gif 50 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-04-23 06:22 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) label in the Model column shows which CPU is meant for models with multiple Linux instances.
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 6.20 - 6.89 /usr/www/<oem>/system 38.2k - 63.2k
FRITZ!Box WLAN 3370 5.01 - 6.56 /usr/www/<oem>/storage, /usr/www/<oem>/system 10.6k - 57.4k
FRITZ!Box 3390 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 7.39 /usr/rest_api, /usr/www/<oem>/system 8.2k - 63.0k
FRITZ!Box 4040 6.52 - 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 63.0k
FRITZ!Box 4050 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.0k
FRITZ!Box 4060 7.26 - 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 20.9k
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 - 7.80 /usr/rest_api, /usr/www/<oem>/system 7.0k - 30.5k
FRITZ!Box 5590 Fiber (arm) 7.27 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.0k - 21.7k
FRITZ!Box 5590 Fiber (prx) 7.70 - 7.90 /usr/rest_api 7.0k - 12.7k
FRITZ!Box 5690 Pro (arm) 7.59 - 7.60 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.1k
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 (arm) 6.84 - 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 64.1k
FRITZ!Box 6430 Cable (atom) 6.84 - 7.29 /usr/www/<oem>/system 20.9k - 64.1k
FRITZ!Box 6490 Cable (arm) 6.20 - 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 64.1k
FRITZ!Box 6490 Cable (atom) 6.20 - 7.51 /usr/rest_api, /usr/www/<oem>/system 8.2k - 64.1k
FRITZ!Box 6590 Cable (arm) 6.83 - 7.57 /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 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.8k - 30.6k
FRITZ!Box 6591 Cable (atom) 7.04 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.8k - 30.6k
FRITZ!Box 6660 Cable (arm) 7.14 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.8k - 30.6k
FRITZ!Box 6660 Cable (atom) 7.14 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.8k - 30.6k
FRITZ!Box 6670 Cable (arm) 7.57 - 7.62 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.1k
FRITZ!Box 6670 Cable (atom) 7.61 - 7.62 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.1k
FRITZ!Box 6690 Cable (arm) 7.28 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.8k - 21.7k
FRITZ!Box 6690 Cable (atom) 7.28 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.8k - 21.7k
FRITZ!Box 6810 LTE 6.35 /usr/www/<oem>/storage, /usr/www/<oem>/system 11.4k - 38.3k
FRITZ!Box 6820 LTE v1 6.40 - 7.51 /usr/rest_api, /usr/www/<oem>/system 8.2k - 60.2k
FRITZ!Box 6820 LTE v2 6.40 - 7.51 /usr/rest_api, /usr/www/<oem>/system 8.2k - 60.2k
FRITZ!Box 6820 LTE v3 7.19 - 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 27.3k
FRITZ!Box 6840 LTE 5.08 - 7.39 /usr/rest_api, /usr/www/<oem>/storage, /usr/www/<oem>/system 8.2k - 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.7k
FRITZ!Box 6890 LTE 6.84 - 7.51 /usr/rest_api, /usr/www/<oem>/system 7.8k - 63.8k
FRITZ!Box 6890 LTE v1 6.84 - 7.51 /usr/rest_api, /usr/www/<oem>/system 7.8k - 63.8k
FRITZ!Box 6890 LTE v2 6.84 - 7.51 /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 6.10 - 7.39 /usr/rest_api, /usr/www/<oem>/system 8.2k - 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 6.10 - 7.14 /usr/www/<oem>/system 28.0k - 63.8k
FRITZ!Box 7369 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 6.21 - 6.88 /usr/www/<oem>/system 38.3k - 63.0k
FRITZ!Box 7430 6.26 - 7.39 /usr/rest_api, /usr/www/<oem>/system 8.2k - 63.8k
FRITZ!Box 7490 (main) 6.20 - 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 64.0k
FRITZ!Box 7510 7.30 - 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 20.9k
FRITZ!Box 7520 6.98 - 7.51 /usr/rest_api, /usr/www/<oem>/system 8.2k - 30.6k
FRITZ!Box 7520 v2 (arm) 7.30 - 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 20.9k
FRITZ!Box 7530 6.98 - 7.56 /usr/rest_api, /usr/www/<oem>/system 7.8k - 30.6k
FRITZ!Box 7530 AX 7.20 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.0k - 30.6k
FRITZ!Box 7560 6.51 - 7.39 /usr/rest_api, /usr/www/<oem>/system 8.2k - 64.0k
FRITZ!Box Fon WLAN 7570 vDSL 4.90 - 4.92 /usr/www/<oem>/storage 10.0k
FRITZ!Box 7580 6.53 - 7.30 /usr/www/<oem>/system 20.8k - 64.0k
FRITZ!Box 7581 6.54 - 7.16 /usr/www/<oem>/system 28.4k - 63.8k
FRITZ!Box 7582 6.83 - 7.17 /usr/www/<oem>/system 28.4k - 63.8k
FRITZ!Box 7583 7.01 - 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 30.6k
FRITZ!Box 7583 VDSL 7.19 - 7.31 /usr/www/<oem>/system 20.9k - 30.6k
FRITZ!Box 7590 6.83 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.6k - 64.0k
FRITZ!Box 7590 AX 7.19 - 7.90 /usr/rest_api, /usr/www/<oem>/system 7.0k - 30.6k
FRITZ!Box 7690 7.59 /usr/rest_api, /usr/www/<oem>/system 8.2k - 21.1k
FRITZ!Smart Gateway 7.39 - 7.59 /usr/www/<oem>/system 20.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/rest_api, /usr/www/<oem>/system 8.2k - 27.2k
FRITZ!Repeater 600 v2 7.19 - 7.58 /usr/www/<oem>/system 18.7k - 27.2k
FRITZ!WLAN Repeater 1160 6.51 - 7.15 /usr/www/<oem>/system 25.4k - 60.0k
FRITZ!Repeater 1200 7.11 - 7.58 /usr/rest_api, /usr/www/<oem>/system 8.2k - 27.2k
FRITZ!Repeater 1200 AX 7.27 - 7.57 /usr/www/<oem>/system 18.7k - 20.9k
FRITZ!WLAN Repeater 1750E 6.12 - 7.39 /usr/rest_api, /usr/www/<oem>/system 8.2k - 60.0k
FRITZ!Repeater 2400 7.12 - 7.58 /usr/rest_api, /usr/www/<oem>/system 8.2k - 27.2k
FRITZ!Repeater 3000 6.98 - 7.58 /usr/rest_api, /usr/www/<oem>/system 8.2k - 27.2k
FRITZ!Repeater 3000 AX 7.39 - 7.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 20.9k
FRITZ!Repeater 6000 7.19 - 7.57 /usr/www/<oem>/system 18.7k - 27.2k
FRITZ!WLAN Repeater DVB-C 6.12 - 7.03 /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.51 - 7.57 /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.57 /usr/rest_api, /usr/www/<oem>/system 8.2k - 60.0k
FRITZ!Powerline 1260 7.27 - 7.57 /usr/www/<oem>/system 18.7k - 20.9k
105 models use this script

SMW-Browser

Information is currently being retrieved from the backend.