Skip to content
Advertisement

Tag: xml

TransformerFactory still vulnerable to XXE attacks

I have a method like below. I’ve set the FEATURE_SECURE_PROCESSING to true. When I run my unit test below, I can list the files under project directory, meaning it is vulnerable to XXE attacks. How can I secure the TransformerFactory to such attacks? Answer You’re supplying a DOMSource to the TransformerFactory, so the DTD was processed before the TransformerFactory came

Dynamically add chips to chipgroup

I’m trying to add several chips to the chip group dynamically. The first one appears fine but others do not appear properly. But when I do it using XML it works fine. activity_main.xml In MainActivity.java style.xml standalone_chip.xml Answer In your main activity you are doing like this. Notice you are creating a new instance of chip i.e chip2 but you

Advertisement