(A1) path traversel lesson 7 seems broken · Issue #1103 · WebGoat/WebGoat · GitHub
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

(A1) path traversel lesson 7 seems broken #1103

Closed
shoaloak opened this issue Oct 1, 2021 · 6 comments
Closed

(A1) path traversel lesson 7 seems broken #1103

shoaloak opened this issue Oct 1, 2021 · 6 comments
Assignees
Labels
bug waiting for release Issue is fix, waiting on new release
Milestone

Comments

@shoaloak
Copy link

shoaloak commented Oct 1, 2021

The zip slip assignment appears to be broken.

The goal is to somehow override /WebGoat/images/account.png when looking at the requests.
The current location where the zip is extracted is /home/webgoat/.webgoat-8.2.1/PathTraversal/<NAME>/<INJECT_ME/FILENAME>.png

Uploading a zip with just containing an image, e.g., hack.png, marks the lesson as completed.
However, the info message is Zip file extracted successfully, failed to copy image. Please contact our helpdesk.

It is also unclear from inspecting the Docker container where the image should be put. The source seems to always call getProfilePicture, which fetches it from this.webGoatHomeDirectory, "/PathTraversal/" + webSession.getUserName(), which is where the image is already extracted?

@github-actions
Copy link

github-actions bot commented Oct 1, 2021

Thanks for submitting your first issue, we will have a look as quickly as possible.

@zubcevic
Copy link
Collaborator

It seems there are indeed some issues. One of these is that you are required to have passed lesson 2 before lesson 7.
I'll need to take a deeper look into this

@nbaars
Copy link
Collaborator

nbaars commented Oct 24, 2021

I can have a look, I have a branch were I started to write up the solution.
Did not know it will pass as well with a normal zip file :-)

@mnemo9
Copy link

mnemo9 commented Jun 3, 2022

I experience the same issue with webgoat-8.2.2

The goal is to somehow override /WebGoat/images/account.png

I don't think it is. That file is not in the profile directory (~/.webgoat-8.2.2) but part of the webserver.

I have found this seemingly-related function which weirdly enough doesn't seem to get called at all:

webgoat.customjs.profileZipSlipRetrieval = function () {
    $.get("PathTraversal/zip-slip", function (result, status) {
        document.getElementById("previewZipSlip").src = "data:image/png;base64," + result;
    });
}

The question remains - where should the uploaded picture go to ? The challenge is marked as finished sending any zip file.

Page 8 of the lesson shows that the solution is about overwriting:

.webgoat-8.2.2/PathTraversal/testuser/testuser.jpg

but uploading that didn't work for me and the profile picture remained the same.

Also the java fix code shown in the solution seems abrupt:

File profilePicture = new File(uploadDirectory, e.getName());
if (profilePicture.

@nbaars
Copy link
Collaborator

nbaars commented Jan 5, 2023

One of these is that you are required to have passed lesson 2 before lesson 7.

That is related to the reuse of the same directory. The Zip Slip lesson now cleans the directory before processing the upload of the zipfile.

@nbaars nbaars added the waiting for release Issue is fix, waiting on new release label Jan 5, 2023
@nbaars nbaars added this to the 8.2.3 milestone Jan 5, 2023
@nbaars
Copy link
Collaborator

nbaars commented Jan 6, 2023

Closing as we released 2023.3

@nbaars nbaars closed this as completed Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug waiting for release Issue is fix, waiting on new release
Projects
None yet
Development

No branches or pull requests

4 participants