$filename = $_GET['file']; $content = file_get_contents("/var/www/files/" . $filename); echo $content;
PHP
Tell us about your work experience, technology stack, and projects.
Find the vulnerability in the code that reads data from a GET parameter
class Cache { private static $data = []; public function set($key, $value) { self::$data[$key] = $value; } public function get($key) { return self::$data[$key] ?? null; } } $cacheA = new Cache(); $cacheA->set('user', 'Alice'); $cacheB = new Cache(); echo $cacheB->get('user'); // ?
What will this code output when using cache in Laravel? (question about two different cache instances)
How is the facade pattern in Laravel implemented, which appears as static calls but works as regular objects?
How would you organize work and session storage in horizontal scaling?
What is the name of the method chaining pattern in Laravel (User::where()->orderBy()->get()) and what do the methods inside it technically do to make the chain work?
How would you implement processing large volumes of tasks (millions in queue) without hitting memory and execution time limits?
Find the error in the code and the vulnerability (code with SQL concatenation via QueryBuilder)