Closed rjt-gupta closed 5 years ago
Please, close another pr if you want only this to be merged. And resolve test problems
Yes, that is I was trying to resolve and apparently the run
method in aiodocker tries to pull the image template_injection:latest
which doesn't exist in our case. Maybe I will try create
method in this?
What about jinja2? What is the problem with that engine?
Only basic payloads were working like {{7*7}}
, I tried but haven't found a way to execute more complex payloads securely.
Another engine I tried was twig
, here twig specific payloads worked like charm like {{7*'7'}} -> 49 but there was no output for complex payloads. I can't see the problem with this bcoz there were no errors from php sandbox whatsoever it just returns empty output.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
tanner/utils/aiodocker_helper.py | 2 | 3 | 66.67% | ||
<!-- | Total: | 47 | 48 | 97.92% | --> |
Totals | |
---|---|
Change from base Build 1066: | 0.7% |
Covered Lines: | 1355 |
Relevant Lines: | 1744 |
Done finally :)
Are tests passing locally?
Are tests passing locally?
Yes, snare side is also fine :)
I have exactly the same problem locally, on test_handle_mako (tanner.tests.test_template_injection.TestTemplateInjection) ...
it just frezees
In the execution this code causes the problem:
with open(work_dir, 'r') as f: mako_template = f.read().format(payload)
work_dir
is a magick mock object, so reading fails and tests are frozen
The problem is in the test_server.py
file. Config is replaced by mock and since it's a static class, it remains the mock after this test.
You can check this probably https://stackoverflow.com/questions/11746431/any-way-to-reset-a-mocked-method-to-its-original-state-python-mock-mock-1-0
Done :)
I dont know why I am not able to reproduce this locally, everything worked perfectly.
Have you tested it? When I try to test it I got HTTP 504 error. And I do not see any logs. Could you please verify
path
/index.php?p={{7*7}}
Have you tested it? When I try to test it I got HTTP 504 error. And I do not see any logs. Could you please verify
path
/index.php?p={{7*7}}
Okay So, this problem is bcoz of using python instead of python3, the dockerfile itself is installing only python 3 but still..
Can you try it now?
Can you try it now?
I still have the same behavior. Can you reproduce it?
I still have the same behavior. Can you reproduce it?
It seems to work fine for me:
tornado -
mako -
Can you try setup.py install
for new build?
Can you try
setup.py install
for new build?
:) For sure
Docker container is created, but not deleted, so somewhere in between some problem exists
Further investigation shows that the problem in the function
await self.docker_client.images.build(**params)
Might be some docker related issue https://github.com/aio-libs/aiodocker/blob/master/tests/test_images.py#L11 look at the API requirements
upd: Changing the API from 1.26 to 1.40 didn't help
Further investigation shows that the problem in the function
await self.docker_client.images.build(**params)
Might be some docker related issue https://github.com/aio-libs/aiodocker/blob/master/tests/test_images.py#L11 look at the API requirements
I guess for now aiodocker
only supports 18.03.1
and 17.12.1
versions. But we are using latest 18.09
.
For both of them api_version
is above 1.27
.
upd: Changing the API from 1.26 to 1.40 didn't help
Should I try tar method then?
Done.
Added tests and order=4
logic :)
Please, close another pr if you want only this to be merged. And resolve test problems