ties / compal_CH7465LG_py

Python interface for the Ziggo Connect Box/Compal CH7465LG
MIT License
116 stars 19 forks source link

Magenta - issue with login #25

Closed thoro closed 2 years ago

thoro commented 3 years ago

Hi,

I got a magenta COMPAL CH7465LG-LC and the login there seems to be a bit different.

Firmware and Hardware: CH7465LG-NCIP-6.12.18.26-3p7-1-NOSH 5.01

I got the error that no session Id is returned, because the modem returns not a urlencoded string, but something like this:

successful;SID=1025573888

which can't be parsed here:

https://github.com/ties/compal_CH7465LG_py/blob/46203d284d25d0b35a2c8368d2be10001ba40ea0/compal/__init__.py#L210

Additionally they are using a username of NULL and not admin, which mean that one would need to be configurable!

Kiskae commented 3 years ago

I've run into this issue and tracked it down to this python issue that was resolved with the latest security updates: https://bugs.python.org/issue42967

Basically the parse_qs method no longer splits on ; to avoid certain cachebusting exploits, but this results in the key being read as successful;SID instead of SID. This ends up making the library think the login failed.

This can be fixed either through introspection as per https://bugs.python.org/msg387756 or by creating a very simple parsing method for this specific piece of data.

Additionally they are using a username of NULL and not admin

I dont think the software actually uses the username for anything, it seems to be arbitrary

ties commented 3 years ago

Hi,

I just released version 0.3.1 which contains the fix by @Kiskae. Thanks for reporting the issue and for the investigation, it should now be fixed.