Files
codeql/java/ql/src/Security/CWE/CWE-470/FragmentInjectionInPreferenceActivity.ql
Tony Torralba f0e9b768f2 Apply suggestions from code review
Co-authored-by: Felicity Chapman <felicitymay@github.com>
2021-12-15 16:53:47 +01:00

23 lines
815 B
Plaintext

/**
* @name Android fragment injection in PreferenceActivity
* @description An insecure implementation of the 'isValidFragment' method
* of the 'PreferenceActivity' class may allow a malicious application to bypass access controls,
* exposing the application to unintended effects.
* @kind problem
* @problem.severity error
* @security-severity 9.8
* @precision high
* @id java/android/fragment-injection-preference-activity
* @tags security
* external/cwe/cwe-470
*/
import java
import semmle.code.java.security.FragmentInjection
from IsValidFragmentMethod m
where m.isUnsafe()
select m,
"The 'isValidFragment' method always returns true. This makes the exported Activity $@ vulnerable to Fragment Injection.",
m.getDeclaringType(), m.getDeclaringType().getName()