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

Access index.php returns file contents instead of being executed #215

Open
RimuruChan opened this issue Nov 28, 2024 · 2 comments
Open

Access index.php returns file contents instead of being executed #215

RimuruChan opened this issue Nov 28, 2024 · 2 comments

Comments

@RimuruChan
Copy link

Description of the problem

Using docker from https://hub.docker.com/r/domjudge/domserver
When access http://host/index.php it returns php file content instead of index page.

Your environment

  • DOMjudge 8.3.1
  • Ubuntu 22.04
  • Webserver nginx

Steps to reproduce

curl http://127.0.0.1/index.php

Expected behaviour

Return index page

Actual behaviour

Return the content of index.php

@vmcj vmcj transferred this issue from DOMjudge/domjudge Nov 28, 2024
@vmcj
Copy link
Member

vmcj commented Nov 28, 2024

Can you try as: curl http://127.0.0.1?

@RimuruChan
Copy link
Author

RimuruChan commented Nov 29, 2024

@vmcj Yes, it works. I know this works. I just accidentally discovered that there will be problems when accessing index.php directly. I have now temporarily added an nginx rule to fix this vulnerability.

location ~ ^/index.php(/|$) {
        return 301 /;
}

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

No branches or pull requests

2 participants