Giter Club home page Giter Club logo

Comments (4)

sixem avatar sixem commented on May 25, 2024

I've created a fix for this here #4.

Basically, the script would use realpath to check if the current folder was above the directory of the indexer.php, this is an attempt to avoid backwards directory traversal.

Problem is that the realpath also returns the real path of any symbolic links. I tried using is_link which would work for the directory but not any subdirectories inside of it.

So, instead i added a path_checking option, which when set to weak will check if the directory is a symbolic link, if it isn't, then it'll use a similar function to realpath that just works with strings instead of actual file paths, thus not resolving the symbolic link.

Let me know if it works for you.

from ivfi-php.

camjac251 avatar camjac251 commented on May 25, 2024

It didn't work for me sadly. I double checked to make sure I had the right code downloaded too

I noticed a mistake I made with obfuscating the paths in the last code snippet so hopefully this one is less confusing. I have a base folder as the root in nginx, and inside that are symlinked folders
Fatal error: Uncaught Exception: requested path (is_dir) is below the public working directory. (1) in /directory/to/folder/userfolder/indexer.php:92 Stack trace: #0 /directory/to/folder/userfolder/indexer.php(441): Indexer->__construct('/symlinkedfolder/', Array) #1 {main} thrown in /directory/to/folder/userfolder/indexer.php on line 92

from ivfi-php.

sixem avatar sixem commented on May 25, 2024

Did you remember to set the path_checking option to weak after updating the code? That error code tells me that it was still set to strict.

from ivfi-php.

camjac251 avatar camjac251 commented on May 25, 2024

I completely missed that part. I should have read it closer. setting it to weak and it works flawlessly. Thank you very much.

from ivfi-php.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.