naxon / laravel-url-uploaded-file Goto Github PK
View Code? Open in Web Editor NEWA package to leverage Laravel's UploadedFile functionality from URLs.
Home Page: https://naxon.dev/blog/upload-files-from-urls-in-laravel
License: MIT License
A package to leverage Laravel's UploadedFile functionality from URLs.
Home Page: https://naxon.dev/blog/upload-files-from-urls-in-laravel
License: MIT License
When you check if the file is valid than i get some error;
$source = UrlUploadedFile::createFromUrl($url);
dump($source->isValid());
dump($source->getErrorMessage());
"The file "" was not uploaded due to an unknown error."
๐ Hello, @Naxon - @wapwn has disclosed a potential vulnerability in your repository. To validate or invalidate this potential vulnerability, please visit https://huntr.dev/bounties/1-packagist-naxon/laravel-url-uploaded-file and join our community in helping secure open-source code.
Come and join us on our Discord and a member of our team will be happy to help! ๐ค
cc - @JamieSlome
Hey,
I'm not sure if it's the responsibility of this library, but accepting a URL from user input and handling the resulting file might have some security implications.
For example:
/etc/passwd
Do you think checks / validations for the above points should / could be part of this library, or is that outside of its scope / responsibilities?
I am shifting projects over to use PHP 8 and your library that I use is locked at 7.4. Is it compatible with 8 and if so, can it be upgraded so I don't need to fork?
When i create a file from url, the file is not valid.
$source = UrlUploadedFile::createFromUrl('https://ny2m44ls0z.b-cdn.net/w_1280,h_720/s3-siris/940a5248-4d5b-4629-a00e-182c1ce4251d.jpg')
dump($source);
Response
Naxon\UrlUploadedFile\UrlUploadedFile {[#1098]()
-test: false
-originalName: ""
-mimeType: "application/octet-stream"
-error: 0
#hashName: null
path: "/tmp"
filename: "url-file-eh0Tqw"
basename: "url-file-eh0Tqw"
pathname: "/tmp/url-file-eh0Tqw"
extension: ""
realPath: "/tmp/url-file-eh0Tqw"
aTime: 2022-03-10 14:30:37
mTime: 2022-03-10 14:30:37
cTime: 2022-03-10 14:30:37
inode: 10228269
size: 192254
perms: 0100600
owner: 33
group: 1000
type: "file"
writable: true
readable: true
executable: false
file: true
dir: false
link: false
}
Is there something what i do wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.