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

Sending invalid XML causes an exception #9

Open
judgej opened this issue Jun 28, 2018 · 2 comments
Open

Sending invalid XML causes an exception #9

judgej opened this issue Jun 28, 2018 · 2 comments

Comments

@judgej
Copy link

judgej commented Jun 28, 2018

Sending broken XML to the application throws an exception. The middleware must not trust the XML so much that it assumes it is valid. That's a potential attack vector.

{
    "message": "simplexml_load_string(): Entity: line 1: parser error : Opening and ending tag mismatch: Document line 1 and xDocument",
    "exception": "ErrorException",
    "file": "/.../vendor/tucker-eric/laravel-xml-middleware/src/XmlRequestServiceProvider.php",
    "line": 27,
    "trace": [
        {
            "function": "handleError",
            "class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions",
            "type": "->"
        },
        {
            "file": "/.../vendor/tucker-eric/laravel-xml-middleware/src/XmlRequestServiceProvider.php",
            "line": 27,
            "function": "simplexml_load_string"
        },
        {
            "function": "XmlMiddleware\\{closure}",
            "class": "Illuminate\\Http\\Request",
            "type": "->"
        },
        ...
}
@Tucker-Eric
Copy link
Owner

Good point. We'll add some error handling. I'd be happy to merge a PR for this.

@judgej judgej changed the title Sending invalid XMl causes an exception Sending invalid XML causes an exception Jun 28, 2018
@judgej
Copy link
Author

judgej commented Jun 28, 2018

Okay, I'm just putting some project stuff together at the moment. If/when I make the necessary changes, I'll make sure it's a PR.

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