python-five9 icon indicating copy to clipboard operation
python-five9 copied to clipboard

Suggestion for large XML

Open yilun11 opened this issue 4 years ago • 2 comments

I put in a fix to handle large XML, else you get a "Invalid XML content received... huge text node" with the current lxml library. I overrode Class(Five9). I don't think it has consequences except buffer overflow attacks from Five9 (CVE-2008-4226).

class Five9_BigXML(Five9):
     def _get_authenticated_client(self, wsdl):
        """Return an authenticated SOAP client.

        Returns:
            zeep.Client: Authenticated API client.
        """
        return zeep.Client(
            wsdl % quote(self.username),
            transport=zeep.Transport(
                session=self._get_authenticated_session(),
            ),
            settings=zeep.Settings(xml_huge_tree=True)
        )

yilun11 avatar Sep 30 '21 02:09 yilun11

Hi @yilun11 Is there a way to fix this issue locally until this fix is applied on master.

saipraveenc avatar May 27 '22 16:05 saipraveenc

@saipraveenc - Add my class definition to your code and change your connect string to use the new class. E.g.

from five9 import Five9
import zeep

# add class def from above
 
client = Five9_BigXML('user', 'password')

yilun11 avatar May 27 '22 17:05 yilun11