instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
protected Array makeArray(int oid, String value) throws SQLException {
return new PgArray(connection, oid, value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeArray
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
makeArray
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
public <T> List<T> search(String sql, int nb, int start, Object[][] whereParams, XWikiContext context)
throws XWikiException
{
return getStore().search(sql, nb, start, whereParams, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: search
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
search
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
public byte[] getBytes() {
if (isUrlOk() == false)
return null;
final SecurityCredentials credentials = SecurityUtils.loadSecurityCredentials(securityIdentifier);
final SecurityAuthentication authentication = SecurityUtils.getAuthenticationManager(credentials)
.create(credentials);
try {
final String host = internal.getHost();
final Long bad = BAD_HOSTS.get(host);
if (bad != null) {
if ((System.currentTimeMillis() - bad) < 1000L * 60)
return null;
BAD_HOSTS.remove(host);
}
try {
final Future<byte[]> result = EXE
.submit(requestWithGetAndResponse(internal, credentials.getProxy(), authentication, null));
final byte[] data = result.get(SecurityUtils.getSecurityProfile().getTimeout(), TimeUnit.MILLISECONDS);
if (data != null)
return data;
} catch (Exception e) {
System.err.println("issue " + host + " " + e);
}
BAD_HOSTS.put(host, System.currentTimeMillis());
return null;
} finally {
// clean up. We don't cache tokens, no expire handling. All time a re-request.
credentials.eraseCredentials();
authentication.eraseCredentials();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBytes
File: src/net/sourceforge/plantuml/security/SURL.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
getBytes
|
src/net/sourceforge/plantuml/security/SURL.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
public @Nullable SQLXML getSQLXML(String columnName) throws SQLException {
return getSQLXML(findColumn(columnName));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSQLXML
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
getSQLXML
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
private void clearApplicationRestrictions(int userId) {
// Changing app restrictions involves disk IO, offload it to the background thread.
mBackgroundHandler.post(() -> {
final List<PackageInfo> installedPackageInfos = mInjector.getPackageManager(userId)
.getInstalledPackages(MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE);
final UserHandle userHandle = UserHandle.of(userId);
for (final PackageInfo packageInfo : installedPackageInfos) {
mInjector.getUserManager().setApplicationRestrictions(
packageInfo.packageName, null /* restrictions */, userHandle);
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearApplicationRestrictions
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
clearApplicationRestrictions
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void setStyleParams() throws Exception {
assertPlotParam("style", "linespoint");
assertPlotParam("style", "points");
assertPlotParam("style", "circles");
assertPlotParam("style", "dots");
assertInvalidPlotParam("style", "dots%20[33:system(%20");
}
|
Vulnerability Classification:
- CWE: CWE-78
- CVE: CVE-2023-25826
- Severity: CRITICAL
- CVSS Score: 9.8
Description: Improved fix for #2261.
Regular expressions wouldn't catch the newlines or possibly other
control characters. Now we'll use the TAG validation code to make
sure the inputs are only plain ASCII printables first.
Fixes CVE-2018-12972, CVE-2020-35476
Function: setStyleParams
File: test/tsd/TestGraphHandler.java
Repository: OpenTSDB/opentsdb
Fixed Code:
@Test
public void setStyleParams() throws Exception {
assertPlotParam("style", "linespoint");
assertPlotParam("style", "points");
assertPlotParam("style", "circles");
assertPlotParam("style", "dots");
assertInvalidPlotParam("style", "dots%20%0a[33:system(%20");
assertInvalidPlotParam("style", "%3Bsystem%20%22cat%20/home/ubuntuvm/secret.txt%20%3E/tmp/secret.txt%22%20%22\"");
}
|
[
"CWE-78"
] |
CVE-2023-25826
|
CRITICAL
| 9.8
|
OpenTSDB/opentsdb
|
setStyleParams
|
test/tsd/TestGraphHandler.java
|
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
new EmojiService(this).init();
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_start_conversation);
Toolbar toolbar = (Toolbar) binding.toolbar;
setSupportActionBar(toolbar);
configureActionBar(getSupportActionBar());
this.binding.fab.setOnClickListener((v) -> {
if (binding.startConversationViewPager.getCurrentItem() == 0) {
String searchString = mSearchEditText != null ? mSearchEditText.getText().toString() : null;
if (searchString != null && !searchString.trim().isEmpty()) {
try {
Jid jid = Jid.of(searchString);
if (jid.getLocal() != null && jid.isBareJid() && jid.getDomain().contains(".")) {
showCreateContactDialog(jid.toString(), null);
return;
}
} catch (IllegalArgumentException ignored) {
//ignore and fall through
}
}
showCreateContactDialog(null, null);
} else {
showCreateConferenceDialog();
}
});
binding.tabLayout.setupWithViewPager(binding.startConversationViewPager);
binding.startConversationViewPager.addOnPageChangeListener(mOnPageChangeListener);
mListPagerAdapter = new ListPagerAdapter(getSupportFragmentManager());
binding.startConversationViewPager.setAdapter(mListPagerAdapter);
mConferenceAdapter = new ListItemAdapter(this, conferences);
mContactsAdapter = new ListItemAdapter(this, contacts);
mContactsAdapter.setOnTagClickedListener(this.mOnTagClickedListener);
final SharedPreferences preferences = getPreferences();
this.mHideOfflineContacts = preferences.getBoolean("hide_offline", false);
final boolean startSearching = preferences.getBoolean("start_searching",getResources().getBoolean(R.bool.start_searching));
final Intent intent;
if (savedInstanceState == null) {
intent = getIntent();
} else {
final String search = savedInstanceState.getString("search");
if (search != null) {
mInitialSearchValue.push(search);
}
intent = savedInstanceState.getParcelable("intent");
}
if (isViewIntent(intent)) {
pendingViewIntent.push(intent);
setIntent(createLauncherIntent(this));
} else if (startSearching && mInitialSearchValue.peek() == null) {
mInitialSearchValue.push("");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCreate
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
onCreate
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
private <R> R loadReport(
final String referenceId, final HttpServletResponse httpServletResponse,
final HandleReportLoadResult<R> handler) throws IOException, ServletException {
PrintJobStatus metadata;
try {
metadata = this.jobManager.getStatus(referenceId);
} catch (NoSuchReferenceException e) {
return handler.unknownReference(httpServletResponse, referenceId);
}
if (!metadata.isDone()) {
return handler.printJobPending(httpServletResponse, referenceId);
} else if (metadata.getResult() != null) {
URI pdfURI = metadata.getResult().getReportURI();
ReportLoader loader = null;
for (ReportLoader reportLoader: this.reportLoaders) {
if (reportLoader.accepts(pdfURI)) {
loader = reportLoader;
break;
}
}
if (loader == null) {
return handler.unsupportedLoader(httpServletResponse, referenceId);
} else {
return handler.successfulPrint(metadata, httpServletResponse, pdfURI, loader);
}
} else {
return handler.failedPrint(metadata, httpServletResponse);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadReport
File: core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
Repository: mapfish/mapfish-print
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-15231
|
MEDIUM
| 4.3
|
mapfish/mapfish-print
|
loadReport
|
core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
|
89155f2506b9cee822e15ce60ccae390a1419d5e
| 0
|
Analyze the following code function for security vulnerabilities
|
private String convertUsername(String username, XWikiContext context)
{
return context.getWiki().convertUsername(username, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertUsername
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/user/impl/xwiki/MyFormAuthenticator.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-601"
] |
CVE-2022-23618
|
MEDIUM
| 5.8
|
xwiki/xwiki-platform
|
convertUsername
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/user/impl/xwiki/MyFormAuthenticator.java
|
5251c02080466bf9fb55288f04a37671108f8096
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setAnonymousIdentity(String anonymousIdentity) {
setFieldValue(ANON_IDENTITY_KEY, anonymousIdentity, "");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAnonymousIdentity
File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3897
|
MEDIUM
| 4.3
|
android
|
setAnonymousIdentity
|
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
|
81be4e3aac55305cbb5c9d523cf5c96c66604b39
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) {
enforceNotIsolatedCaller("getServices");
final int callingUid = Binder.getCallingUid();
final boolean canInteractAcrossUsers = (ActivityManager.checkUidPermission(
INTERACT_ACROSS_USERS_FULL, callingUid) == PERMISSION_GRANTED);
final boolean allowed = isGetTasksAllowed("getServices", Binder.getCallingPid(),
callingUid);
synchronized (this) {
return mServices.getRunningServiceInfoLocked(maxNum, flags, callingUid,
allowed, canInteractAcrossUsers);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServices
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2018-9492
|
HIGH
| 7.2
|
android
|
getServices
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public synchronized <T extends TopLevelItem> T createProject( Class<T> type, String name ) throws IOException {
return type.cast(createProject((TopLevelItemDescriptor)getDescriptor(type),name));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createProject
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
createProject
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final Class<?> getRawClass() { return _class; }
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRawClass
File: src/main/java/com/fasterxml/jackson/databind/JavaType.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
getRawClass
|
src/main/java/com/fasterxml/jackson/databind/JavaType.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void sendReply(final HttpResponseStatus status,
final ChannelBuffer buf) {
sendBuffer(status, buf);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendReply
File: src/tsd/HttpQuery.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-25827
|
MEDIUM
| 6.1
|
OpenTSDB/opentsdb
|
sendReply
|
src/tsd/HttpQuery.java
|
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean hasValueHandler() { return _valueHandler != null; }
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasValueHandler
File: src/main/java/com/fasterxml/jackson/databind/JavaType.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
hasValueHandler
|
src/main/java/com/fasterxml/jackson/databind/JavaType.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
private void checkoutAllModifiedFilesInSubmodules(ConsoleOutputStreamConsumer outputStreamConsumer) {
log(outputStreamConsumer, "Removing modified files in submodules");
List<String> submoduleForEachRecursive = submoduleForEachRecursive(asList("git", "checkout", "."));
runOrBomb(gitWd().withArgs(submoduleForEachRecursive));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkoutAllModifiedFilesInSubmodules
File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
checkoutAllModifiedFilesInSubmodules
|
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Object stringToValue(String string) {
if ("".equals(string)) {
return string;
}
// check JSON key words true/false/null
if ("true".equalsIgnoreCase(string)) {
return Boolean.TRUE;
}
if ("false".equalsIgnoreCase(string)) {
return Boolean.FALSE;
}
if ("null".equalsIgnoreCase(string)) {
return JSONObject.NULL;
}
/*
* If it might be a number, try converting it. If a number cannot be
* produced, then the value will just be a string.
*/
char initial = string.charAt(0);
if ((initial >= '0' && initial <= '9') || initial == '-') {
try {
return stringToNumber(string);
} catch (Exception ignore) {
}
}
return string;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stringToValue
File: src/main/java/org/json/XML.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2022-45688
|
HIGH
| 7.5
|
stleary/JSON-java
|
stringToValue
|
src/main/java/org/json/XML.java
|
f566a1d9ee1f8139357017dc6c7def1da19cd8d4
| 0
|
Analyze the following code function for security vulnerabilities
|
Node getEnvelopeBodyContent(final Document envelope) {
final Node envelopeNode = envelope.getFirstChild();
final NodeList children = envelopeNode.getChildNodes();
Node envelopeBody = null;
for (int i = 0; i < children.getLength(); i++) {
final Node child = children.item(i);
if (child instanceof Element) {
final Element element = (Element) child;
if ("Body".equalsIgnoreCase(element.getLocalName())) {
envelopeBody = child;
break;
}
}
}
if (envelopeBody == null) {
return envelopeNode;
}
final NodeList bodyChildren = envelopeBody.getChildNodes();
for (int i = 0; i < bodyChildren.getLength(); i++) {
final Node child = bodyChildren.item(i);
if (child instanceof Element) {
return child;
}
}
return envelopeBody;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEnvelopeBodyContent
File: src/main/java/org/bonitasoft/connectors/ws/SecureWSConnector.java
Repository: bonitasoft/bonita-connector-webservice
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2020-36640
|
MEDIUM
| 4.9
|
bonitasoft/bonita-connector-webservice
|
getEnvelopeBodyContent
|
src/main/java/org/bonitasoft/connectors/ws/SecureWSConnector.java
|
a12ad691c05af19e9061d7949b6b828ce48815d5
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean deselect(Object itemId) throws IllegalStateException {
if (selectionModel instanceof SelectionModel.Single) {
if (isSelected(itemId)) {
return ((SelectionModel.Single) selectionModel).select(null);
}
return false;
} else if (selectionModel instanceof SelectionModel.Multi) {
return ((SelectionModel.Multi) selectionModel).deselect(itemId);
} else if (selectionModel instanceof SelectionModel.None) {
throw new IllegalStateException("Cannot deselect row '" + itemId
+ "': Grid selection is disabled "
+ "(the current selection model is "
+ selectionModel.getClass().getName() + ").");
} else {
throw new IllegalStateException("Cannot deselect row '" + itemId
+ "': Grid selection model does not implement "
+ SelectionModel.Single.class.getName() + " or "
+ SelectionModel.Multi.class.getName()
+ "(the current model is "
+ selectionModel.getClass().getName() + ").");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deselect
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
deselect
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean grantKeyPairToWifiAuth(@NonNull String alias) {
throwIfParentInstance("grantKeyPairToWifiAuth");
try {
return mService.setKeyGrantToWifiAuth(mContext.getPackageName(), alias, true);
} catch (RemoteException e) {
e.rethrowFromSystemServer();
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: grantKeyPairToWifiAuth
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
grantKeyPairToWifiAuth
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public AnnotationMetadata getAnnotationMetadata() {
return annotationMetadata;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAnnotationMetadata
File: core/src/main/java/io/micronaut/core/type/DefaultArgument.java
Repository: micronaut-projects/micronaut-core
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
getAnnotationMetadata
|
core/src/main/java/io/micronaut/core/type/DefaultArgument.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy(anyOf = {"this", "mProcLock"})
private ProcessRecord findProcessLOSP(String process, int userId, String callName) {
userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
userId, true, ALLOW_FULL_ONLY, callName, null);
ProcessRecord proc = null;
try {
int pid = Integer.parseInt(process);
synchronized (mPidsSelfLocked) {
proc = mPidsSelfLocked.get(pid);
}
} catch (NumberFormatException e) {
}
if (proc == null) {
ArrayMap<String, SparseArray<ProcessRecord>> all =
mProcessList.getProcessNamesLOSP().getMap();
SparseArray<ProcessRecord> procs = all.get(process);
if (procs != null && procs.size() > 0) {
proc = procs.valueAt(0);
if (userId != UserHandle.USER_ALL && proc.userId != userId) {
for (int i=1; i<procs.size(); i++) {
ProcessRecord thisProc = procs.valueAt(i);
if (thisProc.userId == userId) {
proc = thisProc;
break;
}
}
}
}
}
return proc;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findProcessLOSP
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
findProcessLOSP
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getServerSideKeygenP12Passwd() {
return serverSideKeygenP12Passwd;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServerSideKeygenP12Passwd
File: base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getServerSideKeygenP12Passwd
|
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isOptionEnabled(int option) {
return (mOptions & option) != 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isOptionEnabled
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
isOptionEnabled
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setItemDataMaxLengthTypesExpected() {
this.unsetTypeExpected();
this.setTypeExpected(1, TypeNames.INT);// item_id
this.setTypeExpected(2, TypeNames.INT);// max_length
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setItemDataMaxLengthTypesExpected
File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24831
|
HIGH
| 7.5
|
OpenClinica
|
setItemDataMaxLengthTypesExpected
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handleVisibleToUserChangedImpl(boolean visibleToUser) {
try {
if (visibleToUser) {
boolean pinnedHeadsUp = mHeadsUpManager.hasPinnedHeadsUp();
boolean clearNotificationEffects =
!isPanelFullyCollapsed() &&
(mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED);
int notificationLoad = mNotificationData.getActiveNotifications().size();
if (pinnedHeadsUp && isPanelFullyCollapsed()) {
notificationLoad = 1;
}
mBarService.onPanelRevealed(clearNotificationEffects, notificationLoad);
} else {
mBarService.onPanelHidden();
}
} catch (RemoteException ex) {
// Won't fail unless the world has ended.
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleVisibleToUserChangedImpl
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
handleVisibleToUserChangedImpl
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean skipMarkup(boolean balance) throws IOException {
if (DEBUG_BUFFER) {
fCurrentEntity.debugBufferIfNeeded("(skipMarkup: ");
}
int depth = 1;
boolean slashgt = false;
OUTER: while (true) {
if (fCurrentEntity.offset == fCurrentEntity.length) {
if (fCurrentEntity.load(0) == -1) {
break OUTER;
}
}
while (fCurrentEntity.hasNext()) {
char c = fCurrentEntity.getNextChar();
if (balance && c == '<') {
depth++;
}
else if (c == '>') {
depth--;
if (depth == 0) {
break OUTER;
}
}
else if (c == '/') {
if (fCurrentEntity.offset == fCurrentEntity.length) {
if (fCurrentEntity.load(0) == -1) {
break OUTER;
}
}
c = fCurrentEntity.getNextChar();
if (c == '>') {
slashgt = true;
depth--;
if (depth == 0) {
break OUTER;
}
}
else {
fCurrentEntity.rewind();
}
}
else if (c == '\r' || c == '\n') {
fCurrentEntity.rewind();
skipNewlines();
}
}
}
if (DEBUG_BUFFER) {
fCurrentEntity.debugBufferIfNeeded(")skipMarkup: ", " -> " + slashgt);
}
return slashgt;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: skipMarkup
File: src/org/cyberneko/html/HTMLScanner.java
Repository: sparklemotion/nekohtml
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-24839
|
MEDIUM
| 5
|
sparklemotion/nekohtml
|
skipMarkup
|
src/org/cyberneko/html/HTMLScanner.java
|
a800fce3b079def130ed42a408ff1d09f89e773d
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getText() {
return text;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getText
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getText
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public String toXML() throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();
Element pdElement = toDOM(document);
document.appendChild(pdElement);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
DOMSource domSource = new DOMSource(document);
StringWriter sw = new StringWriter();
StreamResult streamResult = new StreamResult(sw);
transformer.transform(domSource, streamResult);
return sw.toString();
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2022-2414
- Severity: HIGH
- CVSS Score: 7.5
Description: Disable access to external entities when parsing XML
This reduces the vulnerability of XML parsers to XXE (XML external
entity) injection.
The best way to prevent XXE is to stop using XML altogether, which we do
plan to do. Until that happens I consider it worthwhile to tighten the
security here though.
Function: toXML
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
Repository: dogtagpki/pki
Fixed Code:
public String toXML() throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();
Element pdElement = toDOM(document);
document.appendChild(pdElement);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
DOMSource domSource = new DOMSource(document);
StringWriter sw = new StringWriter();
StreamResult streamResult = new StreamResult(sw);
transformer.transform(domSource, streamResult);
return sw.toString();
}
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
toXML
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 1
|
Analyze the following code function for security vulnerabilities
|
public List<Cause> getUpstreamCauses() {
return upstreamCauses;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUpstreamCauses
File: core/src/main/java/hudson/model/Cause.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2067
|
LOW
| 3.5
|
jenkinsci/jenkins
|
getUpstreamCauses
|
core/src/main/java/hudson/model/Cause.java
|
5d57c855f3147bfc5e7fda9252317b428a700014
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getExpandedHeight() {
return getHeight();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getExpandedHeight
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3886
|
HIGH
| 7.2
|
android
|
getExpandedHeight
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
|
6ca6cd5a50311d58a1b7bf8fbef3f9aa29eadcd5
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isNewXrefType() {
return newXrefType;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isNewXrefType
File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
Repository: pdftk-java/pdftk
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2021-37819
|
HIGH
| 7.5
|
pdftk-java/pdftk
|
isNewXrefType
|
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
|
9b0cbb76c8434a8505f02ada02a94263dcae9247
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ServerBuilder annotatedService(String pathPrefix, Object service,
Function<? super HttpService, ? extends HttpService> decorator,
Object... exceptionHandlersAndConverters) {
virtualHostTemplate.annotatedService(pathPrefix, service, decorator, exceptionHandlersAndConverters);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: annotatedService
File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
line/armeria
|
annotatedService
|
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
|
df7f85824a62e997b910b5d6194a3335841065fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public ServerBuilder clientAddressSources(ClientAddressSource... clientAddressSources) {
this.clientAddressSources = ImmutableList.copyOf(
requireNonNull(clientAddressSources, "clientAddressSources"));
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clientAddressSources
File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
line/armeria
|
clientAddressSources
|
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
|
df7f85824a62e997b910b5d6194a3335841065fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int noteOp(String op, int uid, String packageName) {
// TODO moltmann: Allow to specify featureId
return mActivityManagerService.mAppOpsService
.noteOperation(AppOpsManager.strOpToOp(op), uid, packageName, null,
false, "", false).getOpMode();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: noteOp
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
noteOp
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getSignatureFileEntryName() {
return mSignatureFileEntry.getName();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSignatureFileEntryName
File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
getSignatureFileEntryName
|
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
|
41d882324288085fd32ae0bb70dc85f5fd0e2be7
| 0
|
Analyze the following code function for security vulnerabilities
|
public synchronized AbstractXMPPConnection connect() throws SmackException, IOException, XMPPException, InterruptedException {
// Check if not already connected
throwAlreadyConnectedExceptionIfAppropriate();
// Reset the connection state
saslAuthentication.init();
saslFeatureReceived.init();
lastFeaturesReceived.init();
streamId = null;
// Perform the actual connection to the XMPP service
connectInternal();
// Wait with SASL auth until the SASL mechanisms have been received
saslFeatureReceived.checkIfSuccessOrWaitOrThrow();
// Make note of the fact that we're now connected.
connected = true;
callConnectionConnectedListener();
return this;
}
|
Vulnerability Classification:
- CWE: CWE-362
- CVE: CVE-2016-10027
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Move TLS Required check at the end of connect()
It was a *very* bad idea to perform the SecurityMode.Required check in
the connection's reader thread and not at the end of
AbstractXMPPConnectin's connect(). :/
This behavior dates back to 8e750912a765f77a4f178a4f307a8b42c2afb5ae
Fixes SMACK-739
Function: connect
File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
Repository: igniterealtime/Smack
Fixed Code:
public synchronized AbstractXMPPConnection connect() throws SmackException, IOException, XMPPException, InterruptedException {
// Check if not already connected
throwAlreadyConnectedExceptionIfAppropriate();
// Reset the connection state
saslAuthentication.init();
saslFeatureReceived.init();
lastFeaturesReceived.init();
streamId = null;
// Perform the actual connection to the XMPP service
connectInternal();
// Wait with SASL auth until the SASL mechanisms have been received
saslFeatureReceived.checkIfSuccessOrWaitOrThrow();
// If TLS is required but the server doesn't offer it, disconnect
// from the server and throw an error. First check if we've already negotiated TLS
// and are secure, however (features get parsed a second time after TLS is established).
if (!isSecureConnection() && getConfiguration().getSecurityMode() == SecurityMode.required) {
throw new SecurityRequiredByClientException();
}
// Make note of the fact that we're now connected.
connected = true;
callConnectionConnectedListener();
return this;
}
|
[
"CWE-362"
] |
CVE-2016-10027
|
MEDIUM
| 4.3
|
igniterealtime/Smack
|
connect
|
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean areNotificationsEnabled(String pkg) {
return areNotificationsEnabledForPackage(pkg, Binder.getCallingUid());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: areNotificationsEnabled
File: services/core/java/com/android/server/notification/NotificationManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3884
|
MEDIUM
| 4.3
|
android
|
areNotificationsEnabled
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public Object getParent() {
return this.parents.getLast();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getParent
File: drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java
Repository: apache/incubator-kie-drools
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2014-8125
|
HIGH
| 7.5
|
apache/incubator-kie-drools
|
getParent
|
drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java
|
c48464c3b246e6ef0d4cd0dbf67e83ccd532c6d3
| 0
|
Analyze the following code function for security vulnerabilities
|
public AuthenticatedUser authenticate(String username, String password,
String ipaddress) throws AuthenticationException {
AuthenticatedUser user = null;
if (username == null || username.trim().length() == 0
|| password == null || password.trim().length() == 0) {
throw new AuthenticationException(
"Authentication failed: Invalid arguments");
}
try {
ContentManager contentManager = ContentManager.getContentManager();
List result = new ArrayList();
String sql = "SELECT * FROM " + table + " WHERE "
+ columns.get("username") + "= ? AND "
+ columns.get("password") + "= '?'";
String[] preparedVariables = new String[] {username, password};
if(log.isDebugEnabled()) {
log.debug(sql);
}
contentManager.doQuery(new Query(sql, preparedVariables, result));
if(log.isDebugEnabled()) {
log.debug("found " + result.size() + " records");
}
if(result.size() > 0) {
// get the first found row and create user object
Map row = (Map) result.get(0);
// intantiate the user class an add the map
Class clazz = Class.forName(userClass);
if(log.isDebugEnabled()) {
log.debug("creating user class " + clazz.getName());
}
DBUser dbUser = (DBUser)clazz.newInstance();
dbUser.init(row);
user = dbUser;
}
} catch (Exception e) {
log.error("Authentication failed: Finding user failed");
if (log.isDebugEnabled()) {
log.debug(e.getMessage(), e);
}
}
if (user == null) {
throw new AuthenticationException(
"Authentication failed: User not found");
}
return user;
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2013-10013
- Severity: MEDIUM
- CVSS Score: 5.2
Description: Prevent SQL-injection
Function: authenticate
File: src/java/talentum/escenic/plugins/authenticator/authenticators/DBAuthenticator.java
Repository: Bricco/authenticator-plugin
Fixed Code:
public AuthenticatedUser authenticate(String username, String password,
String ipaddress) throws AuthenticationException {
AuthenticatedUser user = null;
if (username == null || username.trim().length() == 0
|| password == null || password.trim().length() == 0) {
throw new AuthenticationException(
"Authentication failed: Invalid arguments");
}
try {
ContentManager contentManager = ContentManager.getContentManager();
List result = new ArrayList();
String sql = "SELECT * FROM " + table + " WHERE "
+ columns.get("username") + "= ? AND "
+ columns.get("password") + "= ?";
if(log.isDebugEnabled()) {
log.debug(sql);
}
contentManager.doQuery(new Query(sql, new String[] { username, password }, result));
if(log.isDebugEnabled()) {
log.debug("found " + result.size() + " records");
}
if(result.size() > 0) {
// get the first found row and create user object
Map row = (Map) result.get(0);
// intantiate the user class an add the map
Class clazz = Class.forName(userClass);
if(log.isDebugEnabled()) {
log.debug("creating user class " + clazz.getName());
}
DBUser dbUser = (DBUser)clazz.newInstance();
dbUser.init(row);
user = dbUser;
}
} catch (Exception e) {
log.error("Authentication failed: Finding user failed");
if (log.isDebugEnabled()) {
log.debug(e.getMessage(), e);
}
}
if (user == null) {
throw new AuthenticationException(
"Authentication failed: User not found");
}
return user;
}
|
[
"CWE-89"
] |
CVE-2013-10013
|
MEDIUM
| 5.2
|
Bricco/authenticator-plugin
|
authenticate
|
src/java/talentum/escenic/plugins/authenticator/authenticators/DBAuthenticator.java
|
a5456633ff75e8f13705974c7ed1ce77f3f142d5
| 1
|
Analyze the following code function for security vulnerabilities
|
private static String getClasspathForPlugin(Plugin plugin) {
final StringBuilder classpath = new StringBuilder();
File pluginDirectory = pluginManager.getPluginPath(plugin).toFile();
PluginDevEnvironment pluginEnv = pluginManager.getDevEnvironment(plugin);
PluginClassLoader pluginClassloader = pluginManager.getPluginClassloader(plugin);
for (URL url : pluginClassloader.getURLs()) {
File file = new File(url.getFile());
classpath.append(file.getAbsolutePath()).append(';');
}
// Load all jars from lib
File libDirectory = new File(pluginDirectory, "lib");
File[] libs = libDirectory.listFiles();
final int no = libs != null ? libs.length : 0;
for (int i = 0; i < no; i++) {
File libFile = libs[i];
classpath.append(libFile.getAbsolutePath()).append(';');
}
File openfireRoot = pluginDirectory.getParentFile().getParentFile().getParentFile();
File openfireLib = new File(openfireRoot, "target//lib");
classpath.append(openfireLib.getAbsolutePath()).append("//servlet-api.jar;");
classpath.append(openfireLib.getAbsolutePath()).append("//openfire.jar;");
classpath.append(openfireLib.getAbsolutePath()).append("//jasper-compiler.jar;");
classpath.append(openfireLib.getAbsolutePath()).append("//jasper-runtime.jar;");
if (pluginEnv.getClassesDir() != null) {
classpath.append(pluginEnv.getClassesDir().getAbsolutePath()).append(';');
}
return classpath.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getClasspathForPlugin
File: xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java
Repository: igniterealtime/Openfire
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2019-18393
|
MEDIUM
| 5
|
igniterealtime/Openfire
|
getClasspathForPlugin
|
xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java
|
5af6e03c25b121d01e752927c401124a4da569f7
| 0
|
Analyze the following code function for security vulnerabilities
|
private void clearDeviceOwnerLocked(ActiveAdmin admin, int userId) {
String ownersPackage = mOwners.getDeviceOwnerPackageName();
if (ownersPackage != null) {
mDeviceAdminServiceController.stopServiceForAdmin(
ownersPackage, userId, "clear-device-owner");
}
if (admin != null) {
admin.disableCamera = false;
admin.userRestrictions = null;
admin.defaultEnabledRestrictionsAlreadySet.clear();
admin.forceEphemeralUsers = false;
admin.isNetworkLoggingEnabled = false;
admin.requireAutoTime = false;
mUserManagerInternal.setForceEphemeralUsers(admin.forceEphemeralUsers);
}
final DevicePolicyData policyData = getUserData(userId);
policyData.mCurrentInputMethodSet = false;
if (policyData.mPasswordTokenHandle != 0) {
mLockPatternUtils.removeEscrowToken(policyData.mPasswordTokenHandle, userId);
policyData.mPasswordTokenHandle = 0;
}
saveSettingsLocked(userId);
mPolicyCache.onUserRemoved(userId);
final DevicePolicyData systemPolicyData = getUserData(UserHandle.USER_SYSTEM);
systemPolicyData.mLastSecurityLogRetrievalTime = -1;
systemPolicyData.mLastBugReportRequestTime = -1;
systemPolicyData.mLastNetworkLogsRetrievalTime = -1;
saveSettingsLocked(UserHandle.USER_SYSTEM);
clearUserPoliciesLocked(userId);
clearOverrideApnUnchecked();
clearApplicationRestrictions(userId);
if (!isPolicyEngineForFinanceFlagEnabled()) {
mInjector.getPackageManagerInternal().clearBlockUninstallForUser(userId);
}
mOwners.clearDeviceOwner();
mOwners.writeDeviceOwner();
updateAdminCanGrantSensorsPermissionCache(userId);
clearDeviceOwnerUserRestriction(UserHandle.of(userId));
mInjector.securityLogSetLoggingEnabledProperty(false);
mSecurityLogMonitor.stop();
setNetworkLoggingActiveInternal(false);
deleteTransferOwnershipBundleLocked(userId);
toggleBackupServiceActive(UserHandle.USER_SYSTEM, true);
if (!isPolicyEngineForFinanceFlagEnabled()) {
pushUserControlDisabledPackagesLocked(userId);
}
setGlobalSettingDeviceOwnerType(DEVICE_OWNER_TYPE_DEFAULT);
if (isPolicyEngineForFinanceFlagEnabled() || isPermissionCheckFlagEnabled()) {
mDevicePolicyEngine.removePoliciesForAdmin(
EnforcingAdmin.createEnterpriseEnforcingAdmin(
admin.info.getComponent(), userId, admin));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearDeviceOwnerLocked
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
clearDeviceOwnerLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void clearOrgOwnedProfileOwnerDeviceWidePolicies(@UserIdInt int parentId) {
Slogf.i(LOG_TAG, "Cleaning up device-wide policies left over from org-owned profile...");
// Lockscreen message
mLockPatternUtils.setDeviceOwnerInfo(null);
// Wifi config lockdown
mInjector.settingsGlobalPutInt(Global.WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN, 0);
// Security logging
if (mInjector.securityLogGetLoggingEnabledProperty()) {
mSecurityLogMonitor.stop();
mInjector.securityLogSetLoggingEnabledProperty(false);
}
// Network logging
setNetworkLoggingActiveInternal(false);
// System update policy.
final boolean hasSystemUpdatePolicy;
synchronized (getLockObject()) {
hasSystemUpdatePolicy = mOwners.getSystemUpdatePolicy() != null;
if (hasSystemUpdatePolicy) {
mOwners.clearSystemUpdatePolicy();
mOwners.writeDeviceOwner();
}
}
if (hasSystemUpdatePolicy) {
mContext.sendBroadcastAsUser(
new Intent(ACTION_SYSTEM_UPDATE_POLICY_CHANGED), UserHandle.SYSTEM);
}
// Unsuspend personal apps if needed.
suspendPersonalAppsInternal(parentId, false);
// Notify FRP agent, LSS and WindowManager to ensure they don't hold on to stale policies.
final int frpAgentUid = getFrpManagementAgentUid();
if (frpAgentUid > 0) {
notifyResetProtectionPolicyChanged(frpAgentUid);
}
mLockSettingsInternal.refreshStrongAuthTimeout(parentId);
Slogf.i(LOG_TAG, "Cleaning up device-wide policies done.");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearOrgOwnedProfileOwnerDeviceWidePolicies
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
clearOrgOwnedProfileOwnerDeviceWidePolicies
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Optional<StackTraceElement> firstNonWhitelisted(StackTraceElement... elements) {
for (StackTraceElement ste : elements) {
if (INSTANCE.isStackFrameNotWhitelisted(ste))
return Optional.ofNullable(ste);
}
return Optional.empty();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: firstNonWhitelisted
File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
Repository: ls1intum/Ares
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2024-23683
|
HIGH
| 8.2
|
ls1intum/Ares
|
firstNonWhitelisted
|
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
|
af4f28a56e2fe600d8750b3b415352a0a3217392
| 0
|
Analyze the following code function for security vulnerabilities
|
private void startListeningForFingerprint() {
if (mFingerprintRunningState == FINGERPRINT_STATE_CANCELLING) {
setFingerprintRunningState(FINGERPRINT_STATE_CANCELLING_RESTARTING);
return;
}
if (DEBUG) Log.v(TAG, "startListeningForFingerprint()");
int userId = ActivityManager.getCurrentUser();
if (isUnlockWithFingerprintPossible(userId)) {
if (mFingerprintCancelSignal != null) {
mFingerprintCancelSignal.cancel();
}
mFingerprintCancelSignal = new CancellationSignal();
mFpm.authenticate(null, mFingerprintCancelSignal, 0, mAuthenticationCallback, null, userId);
setFingerprintRunningState(FINGERPRINT_STATE_RUNNING);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startListeningForFingerprint
File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
startListeningForFingerprint
|
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
private DocumentRevisionProvider getDocumentRevisionProvider()
{
if (this.documentRevisionProvider == null) {
this.documentRevisionProvider = Utils.getComponent(DocumentRevisionProvider.class);
}
return this.documentRevisionProvider;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDocumentRevisionProvider
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
getDocumentRevisionProvider
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getPageNum() {
return pageNum;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPageNum
File: src/main/java/com/github/pagehelper/Page.java
Repository: pagehelper/Mybatis-PageHelper
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-28111
|
HIGH
| 7.5
|
pagehelper/Mybatis-PageHelper
|
getPageNum
|
src/main/java/com/github/pagehelper/Page.java
|
554a524af2d2b30d09505516adc412468a84d8fa
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isDeviceProvisioned(Context context) {
return Settings.Global.getInt(context.getContentResolver(),
Settings.Global.DEVICE_PROVISIONED, 0) != 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDeviceProvisioned
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
isDeviceProvisioned
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getLowerOrEqualsConditionSQL(String column, Object param) {
String paramStr = getParameterSQL(param);
return column + " <= " + paramStr;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLowerOrEqualsConditionSQL
File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
Repository: dashbuilder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4999
|
HIGH
| 7.5
|
dashbuilder
|
getLowerOrEqualsConditionSQL
|
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
|
8574899e3b6455547b534f570b2330ff772e524b
| 0
|
Analyze the following code function for security vulnerabilities
|
private void testIfExists() throws Exception {
Connection conn = getConnection("jdbc:h2:mem:" + getTestName(),
getUser(), getPassword());
Server server = new Server();
server.setOut(new PrintStream(new ByteArrayOutputStream()));
// -ifExists is the default
server.runTool("-web", "-webPort", "8182",
"-properties", "null", "-tcp", "-tcpPort", "9101");
try {
String url = "http://localhost:8182";
WebClient client;
String result;
client = new WebClient();
result = client.get(url);
client.readSessionId(result);
result = client.get(url, "login.jsp");
result = client.get(url, "test.do?driver=org.h2.Driver" +
"&url=jdbc:h2:mem:" + getTestName() +
"&user=" + getUser() + "&password=" +
getPassword() + "&name=_test_");
assertTrue(result.indexOf("Exception") < 0);
result = client.get(url, "test.do?driver=org.h2.Driver" +
"&url=jdbc:h2:mem:" + getTestName() + "Wrong" +
"&user=" + getUser() + "&password=" +
getPassword() + "&name=_test_");
assertContains(result, "Exception");
} finally {
server.shutdown();
conn.close();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testIfExists
File: h2/src/test/org/h2/test/server/TestWeb.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
testIfExists
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Intent getEncryptionInterstitialIntent(Context context, int quality,
boolean required, Intent unlockMethodIntent) {
return EncryptionInterstitial.createStartIntent(context, quality, required,
unlockMethodIntent);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEncryptionInterstitialIntent
File: src/com/android/settings/password/ChooseLockGeneric.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2018-9501
|
HIGH
| 7.2
|
android
|
getEncryptionInterstitialIntent
|
src/com/android/settings/password/ChooseLockGeneric.java
|
5e43341b8c7eddce88f79c9a5068362927c05b54
| 0
|
Analyze the following code function for security vulnerabilities
|
public static CertRequestInfos fromXML(String xml) throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xml)));
Element element = document.getDocumentElement();
return fromDOM(element);
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2022-2414
- Severity: HIGH
- CVSS Score: 7.5
Description: Disable access to external entities when parsing XML
This reduces the vulnerability of XML parsers to XXE (XML external
entity) injection.
The best way to prevent XXE is to stop using XML altogether, which we do
plan to do. Until that happens I consider it worthwhile to tighten the
security here though.
Function: fromXML
File: base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfos.java
Repository: dogtagpki/pki
Fixed Code:
public static CertRequestInfos fromXML(String xml) throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xml)));
Element element = document.getDocumentElement();
return fromDOM(element);
}
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
fromXML
|
base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfos.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public CommandData getCommandData() {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCommandData
File: src/main/java/de/presti/ree6/commands/impl/community/InstagramNotifier.java
Repository: Ree6-Applications/Ree6
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-39302
|
MEDIUM
| 5.4
|
Ree6-Applications/Ree6
|
getCommandData
|
src/main/java/de/presti/ree6/commands/impl/community/InstagramNotifier.java
|
459b5bc24f0ea27e50031f563373926e94b9aa0a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setFocusedStack(int stackId) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setFocusedStack
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
setFocusedStack
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
void hideMenu(boolean resize, @AnimationType int animationType) {
hideMenu(null /* animationFinishedRunnable */, true /* notifyMenuVisibility */, resize,
animationType);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hideMenu
File: libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40123
|
MEDIUM
| 5.5
|
android
|
hideMenu
|
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
|
7212a4bec2d2f1a74fa54a12a04255d6a183baa9
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean listenForDiscoveryMcRequests(Configuration pConfig) {
// Check for system props, system env and agent config
boolean sysProp = System.getProperty("jolokia." + ConfigKey.DISCOVERY_ENABLED.getKeyValue()) != null;
boolean env = System.getenv("JOLOKIA_DISCOVERY") != null;
boolean config = pConfig.getAsBoolean(ConfigKey.DISCOVERY_ENABLED);
return sysProp || env || config;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: listenForDiscoveryMcRequests
File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java
Repository: jolokia
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2014-0168
|
MEDIUM
| 6.8
|
jolokia
|
listenForDiscoveryMcRequests
|
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
|
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
| 0
|
Analyze the following code function for security vulnerabilities
|
private void sendAllJSON(HttpServletResponse pResp, String callback, JSONAware pJson) throws IOException {
OutputStream out = null;
try {
String json = pJson.toJSONString();
String content = callback == null ? json : callback + "(" + json + ");";
byte[] response = content.getBytes("UTF8");
pResp.setContentLength(response.length);
out = pResp.getOutputStream();
out.write(response);
} finally {
if (out != null) {
// Always close in order to finish the request.
// Otherwise the thread blocks.
out.close();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendAllJSON
File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java
Repository: jolokia
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2018-1000129
|
MEDIUM
| 4.3
|
jolokia
|
sendAllJSON
|
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
|
5895d5c137c335e6b473e9dcb9baf748851bbc5f
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getAvailableInput() {
try {
return getInput().available();
} catch(IOException err) {
errorMessage = err.toString();
err.printStackTrace();
}
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAvailableInput
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
getAvailableInput
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void putObject(Object o, long offset, Object x) {
PlatformDependent0.putObject(o, offset, x);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: putObject
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
putObject
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
void setHeavyWeightProcess(ActivityRecord root) {
mHeavyWeightProcess = root.app;
final Message m = PooledLambda.obtainMessage(
ActivityTaskManagerService::postHeavyWeightProcessNotification, this,
root.app, root.intent, root.mUserId);
mH.sendMessage(m);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setHeavyWeightProcess
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
setHeavyWeightProcess
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public void execSQL(String sql, Object[] bindArgs) throws SQLException {
if (bindArgs == null) {
throw new IllegalArgumentException("Empty bindArgs");
}
executeSql(sql, bindArgs);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: execSQL
File: core/java/android/database/sqlite/SQLiteDatabase.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2018-9493
|
LOW
| 2.1
|
android
|
execSQL
|
core/java/android/database/sqlite/SQLiteDatabase.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams,
Map<String, String> cookieParams, String payload, String method, URI uri) throws ApiException {
for (String authName : authNames) {
Authentication auth = authentications.get(authName);
if (auth == null) {
continue;
}
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateParamsForAuth
File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
updateParamsForAuth
|
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isAutoUpdate() {
return autoUpdate;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAutoUpdate
File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
isAutoUpdate
|
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onAudioFocusChange(int focusChange) {
switch( focusChange ) {
case AudioManager.AUDIOFOCUS_LOSS: {
if( RemoteControlCallback.isPlaying() ) {
RemoteControlCallback.stop();
initMediaSessionMetadata();
showPausedNotification();
}
break;
}
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT: {
RemoteControlCallback.pause();
initMediaSessionMetadata();
showPausedNotification();
break;
}
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK: {
if( RemoteControlCallback.isPlaying() ) {
RemoteControlCallback.setVolume(0.3f, 0.3f);
}
break;
}
case AudioManager.AUDIOFOCUS_GAIN: {
if( !RemoteControlCallback.isPlaying() ) {
RemoteControlCallback.play();
initMediaSessionMetadata();
showPlayingNotification();
}
RemoteControlCallback.setVolume(1.0f, 1.0f);
break;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onAudioFocusChange
File: Ports/Android/src/com/codename1/media/BackgroundAudioService.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
onAudioFocusChange
|
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public JsonDeserializer<?> createMapDeserializer(DeserializationContext ctxt,
MapType type, BeanDescription beanDesc)
throws JsonMappingException
{
final DeserializationConfig config = ctxt.getConfig();
JavaType keyType = type.getKeyType();
JavaType contentType = type.getContentType();
// First: is there annotation-specified deserializer for values?
@SuppressWarnings("unchecked")
JsonDeserializer<Object> contentDeser = (JsonDeserializer<Object>) contentType.getValueHandler();
// Ok: need a key deserializer (null indicates 'default' here)
KeyDeserializer keyDes = (KeyDeserializer) keyType.getValueHandler();
// Then optional type info; either attached to type, or resolved separately:
TypeDeserializer contentTypeDeser = contentType.getTypeHandler();
// but if not, may still be possible to find:
if (contentTypeDeser == null) {
contentTypeDeser = findTypeDeserializer(config, contentType);
}
// 23-Nov-2010, tatu: Custom deserializer?
JsonDeserializer<?> deser = _findCustomMapDeserializer(type, config, beanDesc,
keyDes, contentTypeDeser, contentDeser);
if (deser == null) {
// Value handling is identical for all, but EnumMap requires special handling for keys
Class<?> mapClass = type.getRawClass();
if (EnumMap.class.isAssignableFrom(mapClass)) {
ValueInstantiator inst;
// 06-Mar-2017, tatu: Should only need to check ValueInstantiator for
// custom sub-classes, see [databind#1544]
if (mapClass == EnumMap.class) {
inst = null;
} else {
inst = findValueInstantiator(ctxt, beanDesc);
}
Class<?> kt = keyType.getRawClass();
if (kt == null || !kt.isEnum()) {
throw new IllegalArgumentException("Cannot construct EnumMap; generic (key) type not available");
}
deser = new EnumMapDeserializer(type, inst, null,
contentDeser, contentTypeDeser, null);
}
// Otherwise, generic handler works ok.
/* But there is one more twist: if we are being asked to instantiate
* an interface or abstract Map, we need to either find something
* that implements the thing, or give up.
*
* Note that we do NOT try to guess based on secondary interfaces
* here; that would probably not work correctly since casts would
* fail later on (as the primary type is not the interface we'd
* be implementing)
*/
if (deser == null) {
if (type.isInterface() || type.isAbstract()) {
MapType fallback = _mapAbstractMapType(type, config);
if (fallback != null) {
type = (MapType) fallback;
mapClass = type.getRawClass();
// But if so, also need to re-check creators...
beanDesc = config.introspectForCreation(type);
} else {
// [databind#292]: Actually, may be fine, but only if polymorphic deser enabled
if (type.getTypeHandler() == null) {
throw new IllegalArgumentException("Cannot find a deserializer for non-concrete Map type "+type);
}
deser = AbstractDeserializer.constructForNonPOJO(beanDesc);
}
} else {
// 10-Jan-2017, tatu: `java.util.Collections` types need help:
deser = JavaUtilCollectionsDeserializers.findForMap(ctxt, type);
if (deser != null) {
return deser;
}
}
if (deser == null) {
ValueInstantiator inst = findValueInstantiator(ctxt, beanDesc);
// 01-May-2016, tatu: Which base type to use here gets tricky, since
// most often it ought to be `Map` or `EnumMap`, but due to abstract
// mapping it will more likely be concrete type like `HashMap`.
// So, for time being, just pass `Map.class`
MapDeserializer md = new MapDeserializer(type, inst, keyDes, contentDeser, contentTypeDeser);
JsonIgnoreProperties.Value ignorals = config.getDefaultPropertyIgnorals(Map.class,
beanDesc.getClassInfo());
Set<String> ignored = (ignorals == null) ? null
: ignorals.findIgnoredForDeserialization();
md.setIgnorableProperties(ignored);
deser = md;
}
}
}
if (_factoryConfig.hasDeserializerModifiers()) {
for (BeanDeserializerModifier mod : _factoryConfig.deserializerModifiers()) {
deser = mod.modifyMapDeserializer(config, type, beanDesc, deser);
}
}
return deser;
}
|
Vulnerability Classification:
- CWE: CWE-502
- CVE: CVE-2019-16942
- Severity: HIGH
- CVSS Score: 7.5
Description: More clean up after #2478
Function: createMapDeserializer
File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
Repository: FasterXML/jackson-databind
Fixed Code:
@Override
public JsonDeserializer<?> createMapDeserializer(DeserializationContext ctxt,
MapType type, BeanDescription beanDesc)
throws JsonMappingException
{
final DeserializationConfig config = ctxt.getConfig();
JavaType keyType = type.getKeyType();
JavaType contentType = type.getContentType();
// First: is there annotation-specified deserializer for values?
@SuppressWarnings("unchecked")
JsonDeserializer<Object> contentDeser = (JsonDeserializer<Object>) contentType.getValueHandler();
// Ok: need a key deserializer (null indicates 'default' here)
KeyDeserializer keyDes = (KeyDeserializer) keyType.getValueHandler();
// Then optional type info; either attached to type, or resolved separately:
TypeDeserializer contentTypeDeser = contentType.getTypeHandler();
// but if not, may still be possible to find:
if (contentTypeDeser == null) {
contentTypeDeser = findTypeDeserializer(config, contentType);
}
// 23-Nov-2010, tatu: Custom deserializer?
JsonDeserializer<?> deser = _findCustomMapDeserializer(type, config, beanDesc,
keyDes, contentTypeDeser, contentDeser);
if (deser == null) {
// Value handling is identical for all, but EnumMap requires special handling for keys
Class<?> mapClass = type.getRawClass();
if (EnumMap.class.isAssignableFrom(mapClass)) {
ValueInstantiator inst;
// 06-Mar-2017, tatu: Should only need to check ValueInstantiator for
// custom sub-classes, see [databind#1544]
if (mapClass == EnumMap.class) {
inst = null;
} else {
inst = findValueInstantiator(ctxt, beanDesc);
}
Class<?> kt = keyType.getRawClass();
if (kt == null || !ClassUtil.isEnumType(kt)) {
throw new IllegalArgumentException("Cannot construct EnumMap; generic (key) type not available");
}
deser = new EnumMapDeserializer(type, inst, null,
contentDeser, contentTypeDeser, null);
}
// Otherwise, generic handler works ok.
/* But there is one more twist: if we are being asked to instantiate
* an interface or abstract Map, we need to either find something
* that implements the thing, or give up.
*
* Note that we do NOT try to guess based on secondary interfaces
* here; that would probably not work correctly since casts would
* fail later on (as the primary type is not the interface we'd
* be implementing)
*/
if (deser == null) {
if (type.isInterface() || type.isAbstract()) {
MapType fallback = _mapAbstractMapType(type, config);
if (fallback != null) {
type = (MapType) fallback;
mapClass = type.getRawClass();
// But if so, also need to re-check creators...
beanDesc = config.introspectForCreation(type);
} else {
// [databind#292]: Actually, may be fine, but only if polymorphic deser enabled
if (type.getTypeHandler() == null) {
throw new IllegalArgumentException("Cannot find a deserializer for non-concrete Map type "+type);
}
deser = AbstractDeserializer.constructForNonPOJO(beanDesc);
}
} else {
// 10-Jan-2017, tatu: `java.util.Collections` types need help:
deser = JavaUtilCollectionsDeserializers.findForMap(ctxt, type);
if (deser != null) {
return deser;
}
}
if (deser == null) {
ValueInstantiator inst = findValueInstantiator(ctxt, beanDesc);
// 01-May-2016, tatu: Which base type to use here gets tricky, since
// most often it ought to be `Map` or `EnumMap`, but due to abstract
// mapping it will more likely be concrete type like `HashMap`.
// So, for time being, just pass `Map.class`
MapDeserializer md = new MapDeserializer(type, inst, keyDes, contentDeser, contentTypeDeser);
JsonIgnoreProperties.Value ignorals = config.getDefaultPropertyIgnorals(Map.class,
beanDesc.getClassInfo());
Set<String> ignored = (ignorals == null) ? null
: ignorals.findIgnoredForDeserialization();
md.setIgnorableProperties(ignored);
deser = md;
}
}
}
if (_factoryConfig.hasDeserializerModifiers()) {
for (BeanDeserializerModifier mod : _factoryConfig.deserializerModifiers()) {
deser = mod.modifyMapDeserializer(config, type, beanDesc, deser);
}
}
return deser;
}
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
createMapDeserializer
|
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 1
|
Analyze the following code function for security vulnerabilities
|
public boolean hasStructureByName (String name) {
return getStructureByName(name) != null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasStructureByName
File: src/com/dotmarketing/cache/ContentTypeCacheImpl.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-2355
|
HIGH
| 7.5
|
dotCMS/core
|
hasStructureByName
|
src/com/dotmarketing/cache/ContentTypeCacheImpl.java
|
897f3632d7e471b7a73aabed5b19f6f53d4e5562
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getPrintablePath() {
if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) {
try {
return internal.getCanonicalPath();
} catch (IOException e) {
Logme.error(e);
}
}
return "";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPrintablePath
File: src/net/sourceforge/plantuml/security/SFile.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
getPrintablePath
|
src/net/sourceforge/plantuml/security/SFile.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean getXmlStandalone() {
return doc.getXmlStandalone();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getXmlStandalone
File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
Repository: LoboEvolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000540
|
MEDIUM
| 6.8
|
LoboEvolution
|
getXmlStandalone
|
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
|
9b75694cedfa4825d4a2330abf2719d470c654cd
| 0
|
Analyze the following code function for security vulnerabilities
|
public void postAnimateForceCollapsePanels() {
mHandler.post(new Runnable() {
@Override
public void run() {
animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */);
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: postAnimateForceCollapsePanels
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
postAnimateForceCollapsePanels
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void buildLimit(StringBuilder sql, int from, int limit) {
sql.append(" LIMIT ").append(limit);
sql.append(" OFFSET ").append(from);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildLimit
File: oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2AlarmQueryDAO.java
Repository: apache/skywalking
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2020-13921
|
HIGH
| 7.5
|
apache/skywalking
|
buildLimit
|
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2AlarmQueryDAO.java
|
ddb6d9a5019a9c1fe31c364485a4e4b5066fefc3
| 0
|
Analyze the following code function for security vulnerabilities
|
void addPathParam(String name, String value, boolean encoded) {
if (relativeUrl == null) {
// The relative URL is cleared when the first query parameter is set.
throw new AssertionError();
}
relativeUrl = relativeUrl.replace("{" + name + "}", canonicalizeForPath(value, encoded));
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2018-1000850
- Severity: MEDIUM
- CVSS Score: 6.4
Description: Forbid path traversal ('.' and '..') as @Path parameters.
They're likely to have the unintended effect. For example, passing ".."
to @DELETE /account/book/{isbn}/ yields @DELETE /account/.
Function: addPathParam
File: retrofit/src/main/java/retrofit2/RequestBuilder.java
Repository: square/retrofit
Fixed Code:
void addPathParam(String name, String value, boolean encoded) {
if (relativeUrl == null) {
// The relative URL is cleared when the first query parameter is set.
throw new AssertionError();
}
String replacement = canonicalizeForPath(value, encoded);
String newRelativeUrl = relativeUrl.replace("{" + name + "}", replacement);
if (PATH_TRAVERSAL.matcher(newRelativeUrl).matches()) {
throw new IllegalArgumentException(
"@Path parameters shouldn't perform path traversal ('.' or '..'): " + value);
}
relativeUrl = newRelativeUrl;
}
|
[
"CWE-22"
] |
CVE-2018-1000850
|
MEDIUM
| 6.4
|
square/retrofit
|
addPathParam
|
retrofit/src/main/java/retrofit2/RequestBuilder.java
|
b9a7f6ad72073ddd40254c0058710e87a073047d
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public XMLBuilder2 elementBefore(String name, String namespaceURI) {
Element newElement = super.elementBeforeImpl(name, namespaceURI);
return new XMLBuilder2(newElement, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: elementBefore
File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
elementBefore
|
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isPackageSystemApp(String packageName) {
try {
ApplicationInfo applicationInfo = mPackageManager.getApplicationInfo(packageName,
PackageManager.GET_META_DATA);
if ((applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
return true;
}
} catch (PackageManager.NameNotFoundException e) {
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPackageSystemApp
File: src/com/android/server/telecom/TelecomServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0847
|
HIGH
| 7.2
|
android
|
isPackageSystemApp
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
2750faaa1ec819eed9acffea7bd3daf867fda444
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void callConnectionAuthenticatedListener(boolean resumed) {
for (ConnectionListener listener : connectionListeners) {
try {
listener.authenticated(this, resumed);
} catch (Exception e) {
// Catch and print any exception so we can recover
// from a faulty listener and finish the shutdown process
LOGGER.log(Level.SEVERE, "Exception in authenticated listener", e);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: callConnectionAuthenticatedListener
File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
Repository: igniterealtime/Smack
The code follows secure coding practices.
|
[
"CWE-362"
] |
CVE-2016-10027
|
MEDIUM
| 4.3
|
igniterealtime/Smack
|
callConnectionAuthenticatedListener
|
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
public Profile getProfile() {
if (mNativeTabAndroid == 0) return null;
return nativeGetProfileAndroid(mNativeTabAndroid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProfile
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
getProfile
|
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private long getDomainVerificationStatusLPr(PackageSetting ps, int userId) {
long result = ps.getDomainVerificationStatusForUser(userId);
// if none available, get the master status
if (result >> 32 == INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED) {
if (ps.getIntentFilterVerificationInfo() != null) {
result = ((long)ps.getIntentFilterVerificationInfo().getStatus()) << 32;
}
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDomainVerificationStatusLPr
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
getDomainVerificationStatusLPr
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
public boolean isBackgroundRestrictedNoCheck(final int uid, final String packageName) {
final int mode = getAppOpsManager().checkOpNoThrow(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND,
uid, packageName);
return mode != AppOpsManager.MODE_ALLOWED;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isBackgroundRestrictedNoCheck
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
isBackgroundRestrictedNoCheck
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public Argument createArgument()
{
return this.createArgument( false );
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createArgument
File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java
Repository: codehaus-plexus/plexus-utils
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2017-1000487
|
HIGH
| 7.5
|
codehaus-plexus/plexus-utils
|
createArgument
|
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
|
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String[] getEnabledProtocols() {
List<String> enabled = InternalThreadLocalMap.get().arrayList();
// Seems like there is no way to explict disable SSLv2Hello in openssl so it is always enabled
enabled.add(PROTOCOL_SSL_V2_HELLO);
int opts;
synchronized (this) {
if (!isDestroyed()) {
opts = SSL.getOptions(ssl);
} else {
return enabled.toArray(new String[1]);
}
}
if ((opts & SSL.SSL_OP_NO_TLSv1) == 0) {
enabled.add(PROTOCOL_TLS_V1);
}
if ((opts & SSL.SSL_OP_NO_TLSv1_1) == 0) {
enabled.add(PROTOCOL_TLS_V1_1);
}
if ((opts & SSL.SSL_OP_NO_TLSv1_2) == 0) {
enabled.add(PROTOCOL_TLS_V1_2);
}
if ((opts & SSL.SSL_OP_NO_SSLv2) == 0) {
enabled.add(PROTOCOL_SSL_V2);
}
if ((opts & SSL.SSL_OP_NO_SSLv3) == 0) {
enabled.add(PROTOCOL_SSL_V3);
}
return enabled.toArray(new String[enabled.size()]);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEnabledProtocols
File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2016-4970
|
HIGH
| 7.8
|
netty
|
getEnabledProtocols
|
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
|
bc8291c80912a39fbd2303e18476d15751af0bf1
| 0
|
Analyze the following code function for security vulnerabilities
|
private String waitSocketSignal(InputStream is) throws IOException {
byte [] sig = new byte[SOCK_SIGNAL_SIZE];
int ret = readAll(is, sig);
if (VDBG) Log.d(TAG, "waitSocketSignal read 16 bytes signal ret: " + ret);
ByteBuffer bb = ByteBuffer.wrap(sig);
bb.order(ByteOrder.nativeOrder());
int size = bb.getShort();
if(size != SOCK_SIGNAL_SIZE)
throw new IOException("Connection failure, wrong signal size: " + size);
byte [] addr = new byte[6];
bb.get(addr);
int channel = bb.getInt();
int status = bb.getInt();
String RemoteAddr = convertAddr(addr);
if (VDBG) Log.d(TAG, "waitSocketSignal: sig size: " + size + ", remote addr: "
+ RemoteAddr + ", channel: " + channel + ", status: " + status);
if(status != 0)
throw new IOException("Connection failure, status: " + status);
return RemoteAddr;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: waitSocketSignal
File: core/java/android/bluetooth/BluetoothSocket.java
Repository: Genymobile/f2ut_platform_frameworks_base
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2014-9908
|
LOW
| 3.3
|
Genymobile/f2ut_platform_frameworks_base
|
waitSocketSignal
|
core/java/android/bluetooth/BluetoothSocket.java
|
f24cec326f5f65c693544fb0b92c37f633bacda2
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getFastInt(byte[] bytes) throws NumberFormatException {
if (bytes.length == 0) {
throw FAST_NUMBER_FAILED;
}
int val = 0;
int start;
boolean neg;
if (bytes[0] == '-') {
neg = true;
start = 1;
if (bytes.length == 1 || bytes.length > 10) {
throw FAST_NUMBER_FAILED;
}
} else {
start = 0;
neg = false;
if (bytes.length > 9) {
throw FAST_NUMBER_FAILED;
}
}
while (start < bytes.length) {
byte b = bytes[start++];
if (b < '0' || b > '9') {
throw FAST_NUMBER_FAILED;
}
val *= 10;
val += b - '0';
}
if (neg) {
val = -val;
}
return val;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFastInt
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
getFastInt
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
private void writeGrantedUriPermissions() {
if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "writeGrantedUriPermissions()");
// Snapshot permissions so we can persist without lock
ArrayList<UriPermission.Snapshot> persist = Lists.newArrayList();
synchronized (this) {
final int size = mGrantedUriPermissions.size();
for (int i = 0; i < size; i++) {
final ArrayMap<GrantUri, UriPermission> perms = mGrantedUriPermissions.valueAt(i);
for (UriPermission perm : perms.values()) {
if (perm.persistedModeFlags != 0) {
persist.add(perm.snapshot());
}
}
}
}
FileOutputStream fos = null;
try {
fos = mGrantFile.startWrite();
XmlSerializer out = new FastXmlSerializer();
out.setOutput(fos, StandardCharsets.UTF_8.name());
out.startDocument(null, true);
out.startTag(null, TAG_URI_GRANTS);
for (UriPermission.Snapshot perm : persist) {
out.startTag(null, TAG_URI_GRANT);
writeIntAttribute(out, ATTR_SOURCE_USER_ID, perm.uri.sourceUserId);
writeIntAttribute(out, ATTR_TARGET_USER_ID, perm.targetUserId);
out.attribute(null, ATTR_SOURCE_PKG, perm.sourcePkg);
out.attribute(null, ATTR_TARGET_PKG, perm.targetPkg);
out.attribute(null, ATTR_URI, String.valueOf(perm.uri.uri));
writeBooleanAttribute(out, ATTR_PREFIX, perm.uri.prefix);
writeIntAttribute(out, ATTR_MODE_FLAGS, perm.persistedModeFlags);
writeLongAttribute(out, ATTR_CREATED_TIME, perm.persistedCreateTime);
out.endTag(null, TAG_URI_GRANT);
}
out.endTag(null, TAG_URI_GRANTS);
out.endDocument();
mGrantFile.finishWrite(fos);
} catch (IOException e) {
if (fos != null) {
mGrantFile.failWrite(fos);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeGrantedUriPermissions
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
writeGrantedUriPermissions
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean equals(Object o) {
return o instanceof RemoteCause && Arrays.equals(new Object[] {addr, note},
new Object[] {((RemoteCause)o).addr, ((RemoteCause)o).note});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: equals
File: core/src/main/java/hudson/model/Cause.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2067
|
LOW
| 3.5
|
jenkinsci/jenkins
|
equals
|
core/src/main/java/hudson/model/Cause.java
|
5d57c855f3147bfc5e7fda9252317b428a700014
| 0
|
Analyze the following code function for security vulnerabilities
|
private void initFromSpec(
OAEPParameterSpec pSpec)
throws NoSuchPaddingException
{
MGF1ParameterSpec mgfParams = (MGF1ParameterSpec)pSpec.getMGFParameters();
Digest digest = DigestFactory.getDigest(mgfParams.getDigestAlgorithm());
if (digest == null)
{
throw new NoSuchPaddingException("no match on OAEP constructor for digest algorithm: "+ mgfParams.getDigestAlgorithm());
}
cipher = new OAEPEncoding(new RSABlindedEngine(), digest, ((PSource.PSpecified)pSpec.getPSource()).getValue());
paramSpec = pSpec;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initFromSpec
File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-361"
] |
CVE-2016-1000345
|
MEDIUM
| 4.3
|
bcgit/bc-java
|
initFromSpec
|
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java
|
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
| 0
|
Analyze the following code function for security vulnerabilities
|
public Boolean getCommentEmailsEnabled() {
return commentEmailsEnabled;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCommentEmailsEnabled
File: src/main/java/com/erudika/scoold/core/Profile.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
getCommentEmailsEnabled
|
src/main/java/com/erudika/scoold/core/Profile.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getPermissionGrantState(ComponentName admin, String callerPackage,
String packageName, String permission) throws RemoteException {
final CallerIdentity caller = getCallerIdentity(admin, callerPackage);
Preconditions.checkCallAuthorization(isSystemUid(caller) || (caller.hasAdminComponent()
&& (isProfileOwner(caller) || isDefaultDeviceOwner(caller)
|| isFinancedDeviceOwner(caller)))
|| (caller.hasPackage() && isCallerDelegate(caller, DELEGATION_PERMISSION_GRANT)));
synchronized (getLockObject()) {
if (isFinancedDeviceOwner(caller)) {
enforcePermissionGrantStateOnFinancedDevice(packageName, permission);
}
return mInjector.binderWithCleanCallingIdentity(() -> {
int granted;
if (getTargetSdk(caller.getPackageName(), caller.getUserId())
< android.os.Build.VERSION_CODES.Q) {
// The per-Q behavior was to not check the app-ops state.
granted = mIPackageManager.checkPermission(permission, packageName,
caller.getUserId());
} else {
try {
int uid = mInjector.getPackageManager().getPackageUidAsUser(packageName,
caller.getUserId());
if (PermissionChecker.checkPermissionForPreflight(mContext, permission,
PermissionChecker.PID_UNKNOWN, uid, packageName)
!= PermissionChecker.PERMISSION_GRANTED) {
granted = PackageManager.PERMISSION_DENIED;
} else {
granted = PackageManager.PERMISSION_GRANTED;
}
} catch (NameNotFoundException e) {
throw new RemoteException("Cannot check if " + permission
+ "is a runtime permission", e, false, true);
}
}
int permFlags = mInjector.getPackageManager().getPermissionFlags(
permission, packageName, caller.getUserHandle());
if ((permFlags & PackageManager.FLAG_PERMISSION_POLICY_FIXED)
!= PackageManager.FLAG_PERMISSION_POLICY_FIXED) {
// Not controlled by policy
return DevicePolicyManager.PERMISSION_GRANT_STATE_DEFAULT;
} else {
// Policy controlled so return result based on permission grant state
return granted == PackageManager.PERMISSION_GRANTED
? DevicePolicyManager.PERMISSION_GRANT_STATE_GRANTED
: DevicePolicyManager.PERMISSION_GRANT_STATE_DENIED;
}
});
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPermissionGrantState
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
getPermissionGrantState
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean end() {
return this.eof && !this.usePrevious;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: end
File: src/main/java/org/json/JSONTokener.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2022-45690
|
HIGH
| 7.5
|
stleary/JSON-java
|
end
|
src/main/java/org/json/JSONTokener.java
|
7a124d857dc8da1165c87fa788e53359a317d0f7
| 0
|
Analyze the following code function for security vulnerabilities
|
public abstract BaseXMLBuilder d(byte[] data);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: d
File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
d
|
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setKeySize(Integer keySize) {
if (keySize == null) return;
attributes.put(KEY_SIZE, Integer.toString(keySize));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setKeySize
File: base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setKeySize
|
base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getWorkingDirectoryAsString()
{
return workingDir;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWorkingDirectoryAsString
File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
Repository: codehaus-plexus/plexus-utils
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2017-1000487
|
HIGH
| 7.5
|
codehaus-plexus/plexus-utils
|
getWorkingDirectoryAsString
|
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
|
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean matches(String domain) {
return pattern.matcher(domain).matches();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: matches
File: projects/core/src/main/java/dan200/computercraft/core/apis/http/options/AddressPredicate.java
Repository: cc-tweaked/CC-Tweaked
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2023-37262
|
HIGH
| 8.8
|
cc-tweaked/CC-Tweaked
|
matches
|
projects/core/src/main/java/dan200/computercraft/core/apis/http/options/AddressPredicate.java
|
4bbde8c50c00bc572578ab2cff609b3443d10ddf
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setClient(ProgressBar progressBar) {
mLoginWebView.setWebViewClient(new WebViewClient() {
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
webViewFidoU2fBridge.delegateShouldInterceptRequest(view, request);
webViewWebauthnBridge.delegateShouldInterceptRequest(view, request);
return super.shouldInterceptRequest(view, request);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
webViewFidoU2fBridge.delegateOnPageStarted(view, url, favicon);
webViewWebauthnBridge.delegateOnPageStarted(view, url, favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith(getString(R.string.login_data_own_scheme) + PROTOCOL_SUFFIX + "login/")) {
parseAndLoginFromWebView(url);
return true;
}
return false;
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
progressBar.setVisibility(View.GONE);
mLoginWebView.setVisibility(View.VISIBLE);
ThemeUtils.colorStatusBar(AuthenticatorActivity.this, primaryColor);
getWindow().setNavigationBarColor(primaryColor);
}
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
X509Certificate cert = getX509CertificateFromError(error);
try {
if (cert != null && NetworkUtils.isCertInKnownServersStore(cert, getApplicationContext())) {
handler.proceed();
} else {
showUntrustedCertDialog(cert, error, handler);
}
} catch (Exception e) {
Log_OC.e(TAG, "Cert could not be verified");
}
}
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
progressBar.setVisibility(View.GONE);
mLoginWebView.setVisibility(View.VISIBLE);
InputStream resources = getResources().openRawResource(R.raw.custom_error);
String customError = DisplayUtils.getData(resources);
if (!customError.isEmpty()) {
mLoginWebView.loadData(customError, "text/html; charset=UTF-8", null);
}
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setClient
File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-248"
] |
CVE-2021-32694
|
MEDIUM
| 4.3
|
nextcloud/android
|
setClient
|
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
|
9343bdd85d70625a90e0c952897957a102c2421b
| 0
|
Analyze the following code function for security vulnerabilities
|
@HotPath(caller = HotPath.PROCESS_CHANGE)
@Override
public void preBindApplication(WindowProcessController wpc) {
synchronized (mGlobalLockWithoutBoost) {
mTaskSupervisor.getActivityMetricsLogger().notifyBindApplication(wpc.mInfo);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: preBindApplication
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
preBindApplication
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public void error(SAXParseException e) throws SAXException {
addValidationException(e);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: error
File: quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
Repository: quartz-scheduler/quartz
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2019-13990
|
HIGH
| 7.5
|
quartz-scheduler/quartz
|
error
|
quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
|
a1395ba118df306c7fe67c24fb0c9a95a4473140
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isProfileOwnerOfOrganizationOwnedDevice(CallerIdentity caller) {
return isProfileOwner(caller) && isProfileOwnerOfOrganizationOwnedDevice(
caller.getUserId());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isProfileOwnerOfOrganizationOwnedDevice
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
isProfileOwnerOfOrganizationOwnedDevice
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
protected static final String modifyName(String name, short mode) {
switch (mode) {
case NAMES_UPPERCASE: return name.toUpperCase(Locale.ENGLISH);
case NAMES_LOWERCASE: return name.toLowerCase(Locale.ENGLISH);
}
return name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: modifyName
File: src/org/cyberneko/html/HTMLScanner.java
Repository: sparklemotion/nekohtml
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-24839
|
MEDIUM
| 5
|
sparklemotion/nekohtml
|
modifyName
|
src/org/cyberneko/html/HTMLScanner.java
|
a800fce3b079def130ed42a408ff1d09f89e773d
| 0
|
Analyze the following code function for security vulnerabilities
|
void loadOwners() {
synchronized (getLockObject()) {
mOwners.load();
setDeviceOwnershipSystemPropertyLocked();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadOwners
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
loadOwners
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getSignatureFileName() {
return mSignatureFileName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSignatureFileName
File: src/main/java/com/android/apksig/ApkVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
getSignatureFileName
|
src/main/java/com/android/apksig/ApkVerifier.java
|
039f815895f62c9f8af23df66622b66246f3f61e
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void customizeClientBuilder(ClientBuilder clientBuilder) {
// No-op extension point
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: customizeClientBuilder
File: samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
customizeClientBuilder
|
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void processConnectOtherProfiles (BluetoothDevice device, int firstProfileStatus){
if (getState()!= BluetoothAdapter.STATE_ON){
return;
}
HeadsetService hsService = HeadsetService.getHeadsetService();
A2dpService a2dpService = A2dpService.getA2dpService();
// if any of the profile service is null, second profile connection not required
if ((hsService == null) ||(a2dpService == null )){
return;
}
List<BluetoothDevice> a2dpConnDevList= a2dpService.getConnectedDevices();
List<BluetoothDevice> hfConnDevList= hsService.getConnectedDevices();
// Check if the device is in disconnected state and if so return
// We ned to connect other profile only if one of the profile is still in connected state
// This is required to avoide a race condition in which profiles would
// automaticlly connect if the disconnection is initiated within 6 seconds of connection
//First profile connection being rejected is an exception
if((hfConnDevList.isEmpty() && a2dpConnDevList.isEmpty())&&
(PROFILE_CONN_CONNECTED == firstProfileStatus)){
return;
}
if((hfConnDevList.isEmpty()) &&
(hsService.getPriority(device) >= BluetoothProfile.PRIORITY_ON)){
hsService.connect(device);
}
else if((a2dpConnDevList.isEmpty()) &&
(a2dpService.getPriority(device) >= BluetoothProfile.PRIORITY_ON)){
a2dpService.connect(device);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processConnectOtherProfiles
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
processConnectOtherProfiles
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.