Let's say I am an organization with all my resources on example.com. I have a web server in the DMZ that hosts a website named app.example.com open to the internet.
The CSP for that website is Content-Security-Policy: default-src 'self' https://*.example.com
All internal servers are also on the same domain example.com. For example: internal website corporate.example.com hosts a community for internal employees. This service is internal and cannot be accessed publicly. However, it is accessible by app.example.com through https- there are no firewall rules preventing https traffic between the two.
Let's assume a threat actor comes to know that there is an internal web service named corporate.example.com.Can the threat actor then inject code on app.example.com to indirectly access images from corporate.example.com? For example:
<img src="https://corporate.example.com/profilepicture.jpg">
The example in this case is an image but could they access any resource including scripts and other objects hosted on the internal server through this method of injection? Perhaps this is not possible and I'm missing something very foundational.
If this is possible, what are some ways to prevent such a vulnerability?