File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
plugin/Live/standAloneFiles Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 7474 error_log ("control.json.php: Config file NOT found " );
7575}
7676
77- if (!empty ($ _REQUEST ['streamerURL ' ])) {
78- $ streamerURL = $ _REQUEST ['streamerURL ' ];
79- }
77+ // SECURITY: User-supplied streamerURL is intentionally NOT accepted.
78+ // Allowing it would enable authentication bypass and SSRF via file_get_contents
79+ // on an attacker-controlled host. streamerURL MUST come from the configuration
80+ // file or be hard-coded in this file above.
8081
8182error_log ("Control.json.php start " .json_encode ($ _REQUEST ));
8283
170171 $ tolerance = 10 ; // 10 seconds
171172 $ obj ->response = false ;
172173 // check the last file change time, if is less then x seconds it is recording
173- $ files = glob ("$ record_path/ {$ obj ->name }*.flv " );
174+ // Sanitize name to prevent path-traversal characters from escaping $record_path.
175+ $ safeName = preg_replace ('/[^a-zA-Z0-9_-]/ ' , '' , $ obj ->name );
176+ $ files = glob ("$ record_path/ {$ safeName }*.flv " );
174177 foreach ($ files as $ value ) {
175178 if (time ()<=filemtime ($ value )+$ tolerance ) {
176179 $ obj ->response = true ;
You can’t perform that action at this time.
0 commit comments