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

fix: Patch for Arbitrary file read vulnerability #1299

Merged
merged 1 commit into from
Sep 26, 2019

Conversation

junorouse
Copy link
Contributor

@junorouse junorouse commented Sep 26, 2019

Arbitrary file read vulnerability (Only working on Windows os)

Date: 26 September 2019 .
Author: Woowon Kang (@wooeong2) / Juno Im (@junorouse) from Theori

Summary

Attacker can read arbitrary files on webpagetest servers running on Windows OS.

Trigger / Exploit

    $file = $_REQUEST['file'];
    if (preg_match('/[a-zA-Z0-9_\-]+\.(?P<ext>png|jpg|txt|zip|csv|mp4)/i', $file, $matches)) {

Rules does not have $ symbol, attacker can bypass with a.jpg\..\..\..\..\..\..\..\{Arbitrary File}.
Windows OS ignores not existing folder

Recommendation / Patch

- if (preg_match('/[a-zA-Z0-9_\-]+\.(?P<ext>png|jpg|txt|zip|csv|mp4)/i', $file, $matches)) {
+ if (preg_match('/[a-zA-Z0-9_\-]+\.(?P<ext>png|jpg|txt|zip|csv|mp4)$/i', $file, $matches)) {

@pmeenan
Copy link
Contributor

pmeenan commented Sep 26, 2019

Thanks for the fix!

@pmeenan pmeenan merged commit 89712ab into catchpoint:master Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants