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

User-Agent is python code #429

Closed
paalbra opened this issue Aug 1, 2019 · 2 comments · Fixed by #430
Closed

User-Agent is python code #429

paalbra opened this issue Aug 1, 2019 · 2 comments · Fixed by #430

Comments

@paalbra
Copy link
Contributor

paalbra commented Aug 1, 2019

Here the User-Agent is set to a string containing python code:

user_agent = 'PyMISP {__version__} - Python {".".join(str(x) for x in sys.version_info[:2])}'

Reproduction:

import pymisp

misp = pymisp.ExpandedPyMISP("http://localhost:1337", "asdf")
event = pymisp.MISPEvent()
misp.add_event(event)

Listening to localhost produces:

$ nc -l 1337
GET /servers/getPyMISPVersion.json HTTP/1.1
Host: localhost:1337
User-Agent: PyMISP {__version__} - Python {".".join(str(x) for x in sys.version_info[:2])}
Accept-Encoding: gzip, deflate
Accept: application/json
Connection: keep-alive
Authorization: asdf
content-type: application/json

I assume that this is not intended behavior.

paalbra added a commit to paalbra/PyMISP that referenced this issue Aug 1, 2019
@paalbra
Copy link
Contributor Author

paalbra commented Aug 1, 2019

I do believe that it might just be a missing f since this looks like an f-string. I made a PR that fixes this.

@Rafiot
Copy link
Member

Rafiot commented Aug 1, 2019

🤦‍♂️

Thank you very much...

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 a pull request may close this issue.

2 participants