@import should verify a file's content before importing it.
Symlink files are dumped straight in css irrespective of their content. In our tests we used -
'@import "../../../../../../../home/jake/testing/test.php"'
Which refers to '/home/jake/moodledata/master/moodle/theme/boost/scss/../../../../../../../home/jake/testing/test.php'
This happens only when webroot has a different path to actual directory. For example -
/var/www/html/master = 4 vs /home/jake/moodledata/master/moodle = 5
Besides this ideally any file with an invalid extension should not be allowed (such as .php .config, etc)