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
private void printSubmoduleStatus(ConsoleOutputStreamConsumer outputStreamConsumer) { log(outputStreamConsumer, "Git sub-module status"); CommandLine gitCmd = gitWd().withArgs("submodule", "status"); run(gitCmd, outputStreamConsumer); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: printSubmoduleStatus 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
printSubmoduleStatus
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
public static void putByte(Object data, long offset, byte value) { PlatformDependent0.putByte(data, offset, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putByte 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
putByte
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
private String randomUuid() { return UUID.randomUUID().toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: randomUuid File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
randomUuid
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public int build(String[] args, int opti) { for (; opti<args.length; opti++) { String name = args[opti]; if ("--".equals(name)) { return opti+1; } build(name); } return opti; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: build 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
build
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public int getAttributeUnsignedIntValue(int idx, int defaultValue) { int t = nativeGetAttributeDataType(mParseState, idx); if (t == ERROR_NULL_DOCUMENT) { throw new NullPointerException("Null document"); } // Note: don't attempt to convert any other types, because // we want to count on aapt doing the conversion for us. if (t >= TypedValue.TYPE_FIRST_INT && t <= TypedValue.TYPE_LAST_INT) { final int v = nativeGetAttributeData(mParseState, idx); if (v == ERROR_NULL_DOCUMENT) { throw new NullPointerException("Null document"); } return v; } return defaultValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttributeUnsignedIntValue File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getAttributeUnsignedIntValue
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
private String getDialect(File installDir) { String dialect = System.getenv(DIALECT.replace('.', '_')); if (dialect == null) { File file = new File(installDir, "conf/hibernate.properties"); dialect = FileUtils.loadProperties(file).getProperty(DIALECT); } return dialect; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDialect File: server-core/src/main/java/io/onedev/server/maintenance/Upgrade.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-552" ]
CVE-2022-39208
HIGH
7.5
theonedev/onedev
getDialect
server-core/src/main/java/io/onedev/server/maintenance/Upgrade.java
8aa94e0daf8447cdf76d4f27bfda0a85a7ea5822
0
Analyze the following code function for security vulnerabilities
@Override public void onShown(IBinder windowToken) { if (DEBUG_WAKEUP) Slog.d(TAG, "mKeyguardDelegate.ShowListener.onShown."); mHandler.sendEmptyMessage(MSG_KEYGUARD_DRAWN_COMPLETE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onShown File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
onShown
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
private void _saveCurrent() throws Exception { final List<User> users = new ArrayList<>(m_users.values()); final Userinfo userinfo = new Userinfo(); userinfo.setUsers(users); final Header header = oldHeader; if (header != null) { header.setCreated(EventConstants.formatToString(new Date())); userinfo.setHeader(header); } oldHeader = header; // marshal to a string first, then write the string to the file. This // way the original configuration // isn't lost if the XML from the marshal is hosed. final StringWriter stringWriter = new StringWriter(); JaxbUtils.marshal(userinfo, stringWriter); final String writerString = stringWriter.toString(); saveXML(writerString); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _saveCurrent File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
_saveCurrent
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
@Test public void postQuerySimplePass() throws Exception { final DataPoints[] datapoints = new DataPoints[1]; datapoints[0] = new MockDataPoints().getMock(); when(query_result.runAsync()).thenReturn( Deferred.fromResult(datapoints)); HttpQuery query = NettyMocks.postQuery(tsdb, "/api/query", "{\"start\":1425440315306,\"queries\":" + "[{\"metric\":\"somemetric\",\"aggregator\":\"sum\",\"rate\":true," + "\"rateOptions\":{\"counter\":false}}]}"); NettyMocks.mockChannelFuture(query); rpc.execute(tsdb, query); assertEquals(HttpResponseStatus.OK, query.response().getStatus()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: postQuerySimplePass File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
postQuerySimplePass
test/tsd/TestQueryRpc.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
@Override public BallColor getIconColor() { if(isDisabled()) return BallColor.DISABLED; else return super.getIconColor(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIconColor File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getIconColor
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public String getId() { return id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getId File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getId
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
State getState() { return mState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getState File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
getState
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
protected void setSingleQuotedArgumentEscaped( boolean singleQuotedArgumentEscaped ) { this.singleQuotedArgumentEscaped = singleQuotedArgumentEscaped; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSingleQuotedArgumentEscaped 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
setSingleQuotedArgumentEscaped
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
private boolean hasMaximumLiveCalls() { return MAXIMUM_LIVE_CALLS <= getNumCallsWithState(LIVE_CALL_STATES); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasMaximumLiveCalls File: src/com/android/server/telecom/CallsManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2423
MEDIUM
6.6
android
hasMaximumLiveCalls
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
public String getClassId() { return classId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClassId File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getClassId
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Deprecated public String getLanguagePreference() { return this.xwiki.getLanguagePreference(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLanguagePreference 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
getLanguagePreference
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
@Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ESCAPE) { hideMenu(); return true; } return super.onKeyUp(keyCode, event); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onKeyUp 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
onKeyUp
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
7212a4bec2d2f1a74fa54a12a04255d6a183baa9
0
Analyze the following code function for security vulnerabilities
@Override public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) { displayView(buffer, name, prefix, object, true, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayView File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-41046
MEDIUM
6.3
xwiki/xwiki-platform
displayView
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
edc52579eeaab1b4514785c134044671a1ecd839
0
Analyze the following code function for security vulnerabilities
private void addIdentity(SingleIdentityChosenEvent foundEvent) { Identity chosenIdentity = foundEvent.getChosenIdentity(); if (chosenIdentity != null) { addIdentity(chosenIdentity); } userListBox.setDirty(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addIdentity File: src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
addIdentity
src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
private PeriodicSync parsePeriodicSync(XmlPullParser parser, AuthorityInfo authorityInfo) { Bundle extras = new Bundle(); // Gets filled in later. String periodValue = parser.getAttributeValue(null, "period"); String flexValue = parser.getAttributeValue(null, "flex"); final long period; long flextime; try { period = Long.parseLong(periodValue); } catch (NumberFormatException e) { Log.e(TAG, "error parsing the period of a periodic sync", e); return null; } catch (NullPointerException e) { Log.e(TAG, "the period of a periodic sync is null", e); return null; } try { flextime = Long.parseLong(flexValue); } catch (NumberFormatException e) { flextime = calculateDefaultFlexTime(period); Log.e(TAG, "Error formatting value parsed for periodic sync flex: " + flexValue + ", using default: " + flextime); } catch (NullPointerException expected) { flextime = calculateDefaultFlexTime(period); Log.d(TAG, "No flex time specified for this sync, using a default. period: " + period + " flex: " + flextime); } PeriodicSync periodicSync; if (authorityInfo.target.target_provider) { periodicSync = new PeriodicSync(authorityInfo.target.account, authorityInfo.target.provider, extras, period, flextime); } else { Log.e(TAG, "Unknown target."); return null; } authorityInfo.periodicSyncs.add(periodicSync); return periodicSync; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parsePeriodicSync File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
parsePeriodicSync
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
public static String getJcaMessageDigestAlgorithm(DigestAlgorithm digestAlgorithm) { return digestAlgorithm.getJcaMessageDigestAlgorithm(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJcaMessageDigestAlgorithm File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeSigner.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
getJcaMessageDigestAlgorithm
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeSigner.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
@Test public void selectTxFailed(TestContext context) { postgresClient().select(Future.failedFuture("failed"), "SELECT 1", context.asyncAssertFailure()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectTxFailed File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
selectTxFailed
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
protected JsonDeserializer<?> _findCustomTreeNodeDeserializer(Class<? extends JsonNode> type, DeserializationConfig config, BeanDescription beanDesc) throws JsonMappingException { for (Deserializers d : _factoryConfig.deserializers()) { JsonDeserializer<?> deser = d.findTreeNodeDeserializer(type, config, beanDesc); if (deser != null) { return deser; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _findCustomTreeNodeDeserializer File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
_findCustomTreeNodeDeserializer
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
private static Element getFirstChildElement(Element element) { try { NodeList nodeList = element.getChildNodes(); for (int i=0; i<nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) return (Element) node; } } catch (Exception e) { log.warning("Error getting first child Element for element=" + element+", exception=" + e); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFirstChildElement File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3878
HIGH
7.5
stanfordnlp/CoreNLP
getFirstChildElement
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
e5bbe135a02a74b952396751ed3015e8b8252e99
0
Analyze the following code function for security vulnerabilities
public String getEditURL(String action, String mode, String locale) { return this.doc.getEditURL(action, mode, locale, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEditURL File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getEditURL
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public int getIndex() { return mIndex; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIndex 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
getIndex
src/main/java/com/android/apksig/ApkVerifier.java
039f815895f62c9f8af23df66622b66246f3f61e
0
Analyze the following code function for security vulnerabilities
protected String toDebugString() { return toDebugString(SystemClock.elapsedRealtime()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toDebugString File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
toDebugString
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
int broadcastIntentInPackage(String packageName, int uid, Intent intent, String resolvedType, IIntentReceiver resultTo, int resultCode, String resultData, Bundle resultExtras, String requiredPermission, Bundle bOptions, boolean serialized, boolean sticky, int userId) { synchronized(this) { intent = verifyBroadcastLocked(intent); final long origId = Binder.clearCallingIdentity(); String[] requiredPermissions = requiredPermission == null ? null : new String[] {requiredPermission}; int res = broadcastIntentLocked(null, packageName, intent, resolvedType, resultTo, resultCode, resultData, resultExtras, requiredPermissions, AppOpsManager.OP_NONE, bOptions, serialized, sticky, -1, uid, userId); Binder.restoreCallingIdentity(origId); return res; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastIntentInPackage File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
broadcastIntentInPackage
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
@Override public boolean isUserRunning(int userId, int flags) { // Holding am lock isn't required to call into user controller. return mUserController.isUserRunning(userId, flags); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUserRunning 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
isUserRunning
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public static void cleanupZipTemp() { System.out.println("Deleting temporary zip directory: " + tempWorkDir); ItemImport.deleteDirectory(new File(tempWorkDir)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanupZipTemp File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
cleanupZipTemp
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
56e76049185bbd87c994128a9d77735ad7af0199
0
Analyze the following code function for security vulnerabilities
public void setVersion(int version) { execSQL("PRAGMA user_version = " + version); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setVersion 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
setVersion
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
public Form<T> withLang(Lang lang) { return new Form<T>( this.rootName, this.backedType, this.rawData, this.files, this.errors, this.value, this.groups, this.messagesApi, this.formatters, this.validatorFactory, this.config, lang, this.directFieldAccess); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withLang File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
withLang
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
private void assertHttpMethod(String method) { for (HttpMethod httpMethod : HttpMethod.values()) { if (httpMethod.name().equalsIgnoreCase(method)) { return; } } throw new IllegalArgumentException("Invalid HTTP method: " + method); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: assertHttpMethod File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-1904
MEDIUM
4.3
spring-projects/spring-framework
assertHttpMethod
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
741b4b229ae032bd17175b46f98673ce0bd2d485
0
Analyze the following code function for security vulnerabilities
public void useSslProtocol(SSLContext context) { this.sslContextFactory = name -> context; setSocketFactory(context.getSocketFactory()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: useSslProtocol File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
useSslProtocol
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@Override public boolean start() { String value = new WebSite().getStringValueByName(Constants.AUTO_UPGRADE_VERSION_KEY); boolean checkPreview = previewAble(); if (value != null && !"".equals(value)) { AutoUpgradeVersionType autoUpgradeVersionType = AutoUpgradeVersionType.cycle(Integer.parseInt(value)); if (scheduledExecutorService != null) { scheduledExecutorService.shutdown(); } //开启了定时检查,定时器开始工作 if (autoUpgradeVersionType != AutoUpgradeVersionType.NEVER) { initExecutorService(); updateVersionTimerTask = new UpdateVersionTimerTask(checkPreview); scheduledExecutorService.schedule(updateVersionTimerTask, autoUpgradeVersionType.getCycle(), TimeUnit.SECONDS); } LOGGER.info("UpdateVersionPlugin start autoUpgradeVersionType " + autoUpgradeVersionType); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: start File: web/src/main/java/com/zrlog/web/plugin/UpdateVersionPlugin.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
start
web/src/main/java/com/zrlog/web/plugin/UpdateVersionPlugin.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
protected synchronized TransportConnectionState lookupConnectionState(ProducerId id) { return connectionStateRegister.lookupConnectionState(id); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lookupConnectionState File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
lookupConnectionState
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
public static String[] getNames(JSONObject jo) { if (jo.isEmpty()) { return null; } return jo.keySet().toArray(new String[jo.length()]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNames File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
getNames
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
IssuesWithBLOBs addIssue(IssuesUpdateRequest issuesRequest);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addIssue File: framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
addIssue
framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
private void clearCurrentMediaNotification() { mMediaNotificationKey = null; mMediaMetadata = null; if (mMediaController != null) { if (DEBUG_MEDIA) { Log.v(TAG, "DEBUG_MEDIA: Disconnecting from old controller: " + mMediaController.getPackageName()); } mMediaController.unregisterCallback(mMediaListener); } mMediaController = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearCurrentMediaNotification 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
clearCurrentMediaNotification
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public static XMLDocument load(String fileName) { XMLDocument ret = new XMLDocument(); ret.loadFile(fileName); return ret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: load 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
load
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
private boolean isPackageEnabled(String packageName, @UserIdInt int userId) { final int callingUid = Binder.getCallingUid(); final long ident = Binder.clearCallingIdentity(); try { final PackageInfo info = mInjector.getPackageManagerInternal() .getPackageInfo( packageName, MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE, callingUid, userId); return info != null && info.applicationInfo.enabled; } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPackageEnabled 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
isPackageEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static String generateConsoleAnnotationScriptAndStylesheet() { String cp = Stapler.getCurrentRequest().getContextPath(); StringBuilder buf = new StringBuilder(); for (ConsoleAnnotatorFactory f : ConsoleAnnotatorFactory.all()) { String path = cp + "/extensionList/" + ConsoleAnnotatorFactory.class.getName() + "/" + f.getClass().getName(); if (f.hasScript()) buf.append("<script src='"+path+"/script.js'></script>"); if (f.hasStylesheet()) buf.append("<link rel='stylesheet' type='text/css' href='"+path+"/style.css' />"); } for (ConsoleAnnotationDescriptor d : ConsoleAnnotationDescriptor.all()) { String path = cp+"/descriptor/"+d.clazz.getName(); if (d.hasScript()) buf.append("<script src='"+path+"/script.js'></script>"); if (d.hasStylesheet()) buf.append("<link rel='stylesheet' type='text/css' href='"+path+"/style.css' />"); } return buf.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateConsoleAnnotationScriptAndStylesheet File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
generateConsoleAnnotationScriptAndStylesheet
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
private void updateKeyguardBottomAreaAlpha() { float alpha = Math.min(getKeyguardContentsAlpha(), 1 - getQsExpansionFraction()); mKeyguardBottomArea.setAlpha(alpha); mKeyguardBottomArea.setImportantForAccessibility(alpha == 0f ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : IMPORTANT_FOR_ACCESSIBILITY_AUTO); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateKeyguardBottomAreaAlpha File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
updateKeyguardBottomAreaAlpha
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
protected void initDocumentParser() throws ParserConfigurationException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); docBuilderFactory.setNamespaceAware(true); docBuilderFactory.setValidating(true); docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema"); docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource", resolveSchemaSource()); docBuilder = docBuilderFactory.newDocumentBuilder(); docBuilder.setErrorHandler(this); NamespaceContext nsContext = new NamespaceContext() { public String getNamespaceURI(String prefix) { if (prefix == null) throw new IllegalArgumentException("Null prefix"); if (XMLConstants.XML_NS_PREFIX.equals(prefix)) return XMLConstants.XML_NS_URI; if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix)) return XMLConstants.XMLNS_ATTRIBUTE_NS_URI; if ("q".equals(prefix)) return QUARTZ_NS; return XMLConstants.NULL_NS_URI; } public Iterator<?> getPrefixes(String namespaceURI) { // This method isn't necessary for XPath processing. throw new UnsupportedOperationException(); } public String getPrefix(String namespaceURI) { // This method isn't necessary for XPath processing. throw new UnsupportedOperationException(); } }; xpath = XPathFactory.newInstance().newXPath(); xpath.setNamespaceContext(nsContext); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2019-13990 - Severity: HIGH - CVSS Score: 7.5 Description: Fixes #467 provide XML parser with a strong configuration to prevent XXE attacks Function: initDocumentParser File: quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java Repository: quartz-scheduler/quartz Fixed Code: protected void initDocumentParser() throws ParserConfigurationException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); docBuilderFactory.setNamespaceAware(true); docBuilderFactory.setValidating(true); docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema"); docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource", resolveSchemaSource()); docBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); docBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); docBuilderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false); docBuilderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); docBuilderFactory.setXIncludeAware(false); docBuilderFactory.setExpandEntityReferences(false); docBuilder = docBuilderFactory.newDocumentBuilder(); docBuilder.setErrorHandler(this); NamespaceContext nsContext = new NamespaceContext() { public String getNamespaceURI(String prefix) { if (prefix == null) throw new IllegalArgumentException("Null prefix"); if (XMLConstants.XML_NS_PREFIX.equals(prefix)) return XMLConstants.XML_NS_URI; if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix)) return XMLConstants.XMLNS_ATTRIBUTE_NS_URI; if ("q".equals(prefix)) return QUARTZ_NS; return XMLConstants.NULL_NS_URI; } public Iterator<?> getPrefixes(String namespaceURI) { // This method isn't necessary for XPath processing. throw new UnsupportedOperationException(); } public String getPrefix(String namespaceURI) { // This method isn't necessary for XPath processing. throw new UnsupportedOperationException(); } }; xpath = XPathFactory.newInstance().newXPath(); xpath.setNamespaceContext(nsContext); }
[ "CWE-611" ]
CVE-2019-13990
HIGH
7.5
quartz-scheduler/quartz
initDocumentParser
quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
a1395ba118df306c7fe67c24fb0c9a95a4473140
1
Analyze the following code function for security vulnerabilities
private void handleHideBootMessage() { synchronized (mLock) { if (!mKeyguardDrawnOnce) { mBootMessageNeedsHiding = true; return; // keyguard hasn't drawn the first time yet, not done booting } } if (mBootMsgDialog != null) { if (DEBUG_WAKEUP) Slog.d(TAG, "handleHideBootMessage: dismissing"); mBootMsgDialog.dismiss(); mBootMsgDialog = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleHideBootMessage File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
handleHideBootMessage
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
public static List getStructures(int limit) { String orderBy = "name"; return getStructures(orderBy,limit); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStructures File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
getStructures
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
@Override public final void activityDestroyed(IBinder token) { if (DEBUG_SWITCH) Slog.v(TAG, "ACTIVITY DESTROYED: " + token); synchronized (this) { ActivityStack stack = ActivityRecord.getStackLocked(token); if (stack != null) { stack.activityDestroyedLocked(token, "activityDestroyed"); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: activityDestroyed File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
activityDestroyed
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private boolean isActivityAndEnergyReportingSupported() { enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED, "Need BLUETOOTH permission"); return mAdapterProperties.isActivityAndEnergyReportingSupported(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isActivityAndEnergyReportingSupported 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
isActivityAndEnergyReportingSupported
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Test public void selectSingleTrans(TestContext context) { postgresClient = createNumbers(context, 45, 46, 47); postgresClient.startTx(asyncAssertTx(context, trans -> { postgresClient.selectSingle(trans, "SELECT i FROM numbers WHERE i IN (45, 47, 49) ORDER BY i", context.asyncAssertSuccess(select -> { postgresClient.endTx(trans, context.asyncAssertSuccess()); context.assertEquals(45, select.getInteger(0)); })); })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectSingleTrans File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
selectSingleTrans
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
void kill(String reason, boolean noisy) { if (!killedByAm) { Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "kill"); if (noisy) { Slog.i(TAG, "Killing " + toShortString() + " (adj " + setAdj + "): " + reason); } EventLog.writeEvent(EventLogTags.AM_KILL, userId, pid, processName, setAdj, reason); Process.killProcessQuiet(pid); Process.killProcessGroup(info.uid, pid); if (!persistent) { killed = true; killedByAm = true; } Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2016-2500 - Severity: MEDIUM - CVSS Score: 4.3 Description: Kill the real/isolated uid group, not the ApplicationInfo uid This is a direct reimplementation in L of fixes applied to N in these two commits: 8dc8d37c1d7d694016f1ec2b3cea5fb723567be8 e8741d23d2dd05c4cb3fed5ee6a4040ee96a60e3 Bug 19285814 Change-Id: I59bcc8f1d41c426e9da635bea9ad1d7c6756d5aa Resolve merge conflict when cp'ing ag/941553 to mnc-mr1-release branch Function: kill File: services/core/java/com/android/server/am/ProcessRecord.java Repository: android Fixed Code: void kill(String reason, boolean noisy) { if (!killedByAm) { Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "kill"); if (noisy) { Slog.i(TAG, "Killing " + toShortString() + " (adj " + setAdj + "): " + reason); } EventLog.writeEvent(EventLogTags.AM_KILL, userId, pid, processName, setAdj, reason); Process.killProcessQuiet(pid); Process.killProcessGroup(uid, pid); if (!persistent) { killed = true; killedByAm = true; } Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } }
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
kill
services/core/java/com/android/server/am/ProcessRecord.java
9878bb99b77c3681f0fda116e2964bac26f349c3
1
Analyze the following code function for security vulnerabilities
@MediumTest @Test public void testAutoSpeakerphoneIncomingBidirectional() throws Exception { // Start an incoming video call. IdPair ids = startAndMakeActiveIncomingCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA, VideoProfile.STATE_BIDIRECTIONAL); verifyAudioRoute(CallAudioState.ROUTE_SPEAKER); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testAutoSpeakerphoneIncomingBidirectional File: tests/src/com/android/server/telecom/tests/VideoCallTests.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
testAutoSpeakerphoneIncomingBidirectional
tests/src/com/android/server/telecom/tests/VideoCallTests.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
protected static void writePrimitive(Object s, ObjectOutput out) throws IOException, MessageFormatException { writePrimitive(s, out, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writePrimitive File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
writePrimitive
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
public static void writeEntry(ZipFile zipFile, ZipEntry entry, File destDir) throws IOException { File outFile = new File(destDir, entry.getName()); if (entry.isDirectory()) { outFile.mkdirs(); } else { outFile.getParentFile().mkdirs(); try (InputStream in = zipFile.getInputStream(entry)) { IOUtil.writeStream(in, outFile); } } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2018-20227 - Severity: MEDIUM - CVSS Score: 6.4 Description: Verify that zip file entries don't try to escape the parent dir + test Signed-off-by: Bart Hanssens <bart.hanssens@bosa.fgov.be> Function: writeEntry File: util/src/main/java/org/eclipse/rdf4j/common/io/ZipUtil.java Repository: eclipse-rdf4j/rdf4j Fixed Code: public static void writeEntry(ZipFile zipFile, ZipEntry entry, File destDir) throws IOException { File outFile = new File(destDir, entry.getName()); if (! outFile.getCanonicalFile().toPath().startsWith(destDir.toPath())) { throw new IOException("Zip entry outside destination directory: " + entry.getName()); } if (entry.isDirectory()) { outFile.mkdirs(); } else { outFile.getParentFile().mkdirs(); try (InputStream in = zipFile.getInputStream(entry)) { IOUtil.writeStream(in, outFile); } } }
[ "CWE-22" ]
CVE-2018-20227
MEDIUM
6.4
eclipse-rdf4j/rdf4j
writeEntry
util/src/main/java/org/eclipse/rdf4j/common/io/ZipUtil.java
df15a4d7a8f2789c043b27c9eafe1b30316cfa79
1
Analyze the following code function for security vulnerabilities
private void killRestServer(RestServer rest) { if (rest != null) { try { rest.stop(); } catch (Exception e) { // Ignore } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: killRestServer File: integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility/CompatibilityCacheFactory.java Repository: infinispan The code follows secure coding practices.
[ "CWE-502" ]
CVE-2017-15089
MEDIUM
6.5
infinispan
killRestServer
integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility/CompatibilityCacheFactory.java
69be66141eee7abb1c47d46f0a6b74b079709f4b
0
Analyze the following code function for security vulnerabilities
private static List<Node> getNonTextNodesIgnoring(final Node node, final String ignore) { final List<Node> nonTextNodes = getNonTextNodes(node); nonTextNodes.removeIf(node1 -> ((Element) node1).getTagName().equals(ignore)); return nonTextNodes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNonTextNodesIgnoring File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
getNonTextNodesIgnoring
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
public String render(XWikiContext context) throws XWikiException { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: render File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2022-23617
MEDIUM
4
xwiki/xwiki-platform
render
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
b35ef0edd4f2ff2c974cbeef6b80fcf9b5a44554
0
Analyze the following code function for security vulnerabilities
@Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { synchronized (mLock) { final long identity = Binder.clearCallingIdentity(); try { List<UserInfo> users = mUserManager.getUsers(true); final int userCount = users.size(); for (int i = 0; i < userCount; i++) { UserInfo user = users.get(i); dumpForUser(user.id, pw); } } finally { Binder.restoreCallingIdentity(identity); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dump File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
dump
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
@PUT @Operation(summary = "Put attachment", description = "Upload the attachment of a message.") @ApiResponse(responseCode = "200", description = "Ok.") @ApiResponse(responseCode = "404", description = " The identity or the portrait not found") @Path("posts/{messageKey}/attachments") @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response replyToPostAttachment(@PathParam("messageKey") Long messageKey, File64VO file64, @Context HttpServletRequest request) { String file = file64.getFile(); String filename = file64.getFilename(); byte[] fileAsBytes = Base64.decodeBase64(file); InputStream in = new ByteArrayInputStream(fileAsBytes); return attachToPost(messageKey, filename, in, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replyToPostAttachment File: src/main/java/org/olat/modules/fo/restapi/ForumWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
replyToPostAttachment
src/main/java/org/olat/modules/fo/restapi/ForumWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
@Override public String getDefaultDialerPackageForUser(int userId) { try { Log.startSession("TSI.gDDPU"); mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE, "READ_PRIVILEGED_PHONE_STATE permission required."); final long token = Binder.clearCallingIdentity(); try { return mDefaultDialerCache.getDefaultDialerApplication(userId); } finally { Binder.restoreCallingIdentity(token); } } finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultDialerPackageForUser File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
getDefaultDialerPackageForUser
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
public void setCreatedBy(String createdBy) { this.createdBy = createdBy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCreatedBy File: src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4040
MEDIUM
6.5
dotCMS/core
setCreatedBy
src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
0
Analyze the following code function for security vulnerabilities
public int getPremiumSmsPermission(String packageName) { return mUsageMonitor.getPremiumSmsPermission(packageName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPremiumSmsPermission File: src/java/com/android/internal/telephony/SMSDispatcher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3858
HIGH
9.3
android
getPremiumSmsPermission
src/java/com/android/internal/telephony/SMSDispatcher.java
df31d37d285dde9911b699837c351aed2320b586
0
Analyze the following code function for security vulnerabilities
private long readVarint64() throws TException { int shift = 0; long result = 0; if (trans_.getBytesRemainingInBuffer() >= 10) { byte[] buf = trans_.getBuffer(); int pos = trans_.getBufferPosition(); int off = 0; while (true) { byte b = buf[pos + off]; result |= (long) (b & 0x7f) << shift; if ((b & 0x80) != 0x80) { break; } shift += 7; off++; } trans_.consumeBuffer(off + 1); } else { while (true) { byte b = readByte(); result |= (long) (b & 0x7f) << shift; if ((b & 0x80) != 0x80) { break; } shift += 7; } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readVarint64 File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
readVarint64
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
private void copyFieldAttributes() { if ((loadFields == null) || fields == null) { return; } for (int i = 0; i < loadFields.length; i++) { ObjectStreamField loadField = loadFields[i]; String name = loadField.getName(); for (int j = 0; j < fields.length; j++) { ObjectStreamField field = fields[j]; if (name.equals(field.getName())) { loadField.setUnshared(field.isUnshared()); loadField.setOffset(field.getOffset()); break; } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyFieldAttributes File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
copyFieldAttributes
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
private static String getUrlContentsPrePath(String url, String host) { String urlPrePath = url; int hostIndex = url.indexOf(host); if (hostIndex >= 0) { int pathIndex = url.indexOf('/', hostIndex); if (pathIndex > 0) { urlPrePath = url.substring(0, pathIndex); } else { urlPrePath = url; } } return urlPrePath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUrlContentsPrePath File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
getUrlContentsPrePath
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
public static UnsafeAccess getInstance() { SecurityCheck.getInstance(); return INSTANCE; }
Vulnerability Classification: - CWE: CWE-863 - CVE: CVE-2022-31139 - Severity: MEDIUM - CVSS Score: 4.3 Description: Fix UnsafeAccess perm checking Function: getInstance File: api/src/main/java/io/github/karlatemp/unsafeaccessor/UnsafeAccess.java Repository: Karlatemp/UnsafeAccessor Fixed Code: public static UnsafeAccess getInstance() { SecurityCheck.AccessLimiter accessLimiter = SecurityCheck.getInstance().getLimiter(); if (accessLimiter != null) accessLimiter.preGetUnsafeAccess(); return INSTANCE; }
[ "CWE-863" ]
CVE-2022-31139
MEDIUM
4.3
Karlatemp/UnsafeAccessor
getInstance
api/src/main/java/io/github/karlatemp/unsafeaccessor/UnsafeAccess.java
4ef83000184e8f13239a1ea2847ee401d81585fd
1
Analyze the following code function for security vulnerabilities
@Override public void noteAlarmFinish(IIntentSender sender, WorkSource workSource, int sourceUid, String tag) { if (workSource != null && workSource.isEmpty()) { workSource = null; } if (sourceUid <= 0 && workSource == null) { // Try and derive a UID to attribute things to based on the caller. if (sender != null) { if (!(sender instanceof PendingIntentRecord)) { return; } final PendingIntentRecord rec = (PendingIntentRecord) sender; final int callerUid = Binder.getCallingUid(); sourceUid = rec.uid == callerUid ? SYSTEM_UID : rec.uid; } else { // TODO(narayan): Should we throw an exception in this case ? It means that we // haven't been able to derive a UID to attribute things to. return; } } if (DEBUG_POWER) { Slog.w(TAG, "noteAlarmFinish[sourceUid=" + sourceUid + ", workSource=" + workSource + ", tag=" + tag + "]"); } mBatteryStatsService.noteAlarmFinish(tag, workSource, sourceUid); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: noteAlarmFinish 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
noteAlarmFinish
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected Object readObjectOverride() throws OptionalDataException, ClassNotFoundException, IOException { if (input == null) { return null; } // Subclasses must override. throw new IOException(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readObjectOverride File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
readObjectOverride
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
protected void setReadOnlyBody(boolean readonly) { this.readonlyBody = readonly; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setReadOnlyBody File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
setReadOnlyBody
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
public String toString() { return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40315
HIGH
8
OpenNMS/opennms
toString
opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
201301e067329ababa3c0671ded5c4c43347d4a8
0
Analyze the following code function for security vulnerabilities
public void setRevokedOnTo(String revokedOnTo) { this.revokedOnTo = revokedOnTo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRevokedOnTo File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setRevokedOnTo
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public void onServiceAdded(ManagedServiceInfo info) { final INotificationListener listener = (INotificationListener) info.service; final NotificationRankingUpdate update; synchronized (mNotificationList) { update = makeRankingUpdateLocked(info); } try { listener.onListenerConnected(update); } catch (RemoteException e) { // we tried } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onServiceAdded 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
onServiceAdded
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public String getRenderedContent(Syntax targetSyntax, XWikiContext context) throws XWikiException { return getRenderedContent(targetSyntax, true, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRenderedContent File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getRenderedContent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
void setDebuggable(boolean isDebuggable) { mIsDebuggable = isDebuggable; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDebuggable 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
setDebuggable
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@SupportsCoexistence @RequiresPermission(value = SET_TIME_ZONE, conditional = true) public void setAutoTimeZoneEnabled(@Nullable ComponentName admin, boolean enabled) { throwIfParentInstance("setAutoTimeZone"); if (mService != null) { try { mService.setAutoTimeZoneEnabled(admin, mContext.getPackageName(), enabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAutoTimeZoneEnabled 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
setAutoTimeZoneEnabled
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void updateWikiPageProperties(OLATResourceable ores, WikiPage page) { saveWikiPageProperties(ores, page); if (wikiCache!=null) { wikiCache.update(OresHelper.createStringRepresenting(ores), getOrLoadWiki(ores)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateWikiPageProperties File: src/main/java/org/olat/modules/wiki/WikiManager.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
updateWikiPageProperties
src/main/java/org/olat/modules/wiki/WikiManager.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
@Override public void editProperties(IAccountManagerResponse response, final String accountType, final boolean expectActivityLaunch) { final int callingUid = Binder.getCallingUid(); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "editProperties: accountType " + accountType + ", response " + response + ", expectActivityLaunch " + expectActivityLaunch + ", caller's uid " + callingUid + ", pid " + Binder.getCallingPid()); } if (response == null) throw new IllegalArgumentException("response is null"); if (accountType == null) throw new IllegalArgumentException("accountType is null"); int userId = UserHandle.getCallingUserId(); if (!isAccountManagedByCaller(accountType, callingUid, userId) && !isSystemUid(callingUid)) { String msg = String.format( "uid %s cannot edit authenticator properites for account type: %s", callingUid, accountType); throw new SecurityException(msg); } final long identityToken = clearCallingIdentity(); try { UserAccounts accounts = getUserAccounts(userId); new Session(accounts, response, accountType, expectActivityLaunch, true /* stripAuthTokenFromResult */, null /* accountName */, false /* authDetailsRequired */) { @Override public void run() throws RemoteException { mAuthenticator.editProperties(this, mAccountType); } @Override protected String toDebugString(long now) { return super.toDebugString(now) + ", editProperties" + ", accountType " + accountType; } }.bind(); } finally { restoreCallingIdentity(identityToken); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: editProperties File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
editProperties
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override public void onCreatedFromScratch() { super.onCreatedFromScratch(); builds = createBuildRunMap(); // solicit initial contributions, especially from TransientProjectActionFactory updateTransientActions(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreatedFromScratch File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
onCreatedFromScratch
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
private void registerPongListener() { // reset ping expectation on new connection mPingID = null; if (mPongListener != null) mXMPPConnection.removePacketListener(mPongListener); mPongListener = new PacketListener() { @Override public void processPacket(Packet packet) { if (packet == null) return; if (packet instanceof IQ && packet.getFrom() != null) { IQ ping = (IQ)packet; String from_bare = getBareJID(ping.getFrom()); // check for ping error or RESULT if (ping.getType() == Type.RESULT && mucJIDs.contains(from_bare)) { Log.d(TAG, "Ping: got response from MUC " + from_bare); mucLastPong.put(from_bare, System.currentTimeMillis()); } } if (mPingID != null && mPingID.equals(packet.getPacketID())) gotServerPong(packet.getPacketID()); } }; mXMPPConnection.addPacketListener(mPongListener, new PacketTypeFilter(IQ.class)); mPingAlarmPendIntent = PendingIntent.getBroadcast(mService.getApplicationContext(), 0, mPingAlarmIntent, PendingIntent.FLAG_UPDATE_CURRENT); mPongTimeoutAlarmPendIntent = PendingIntent.getBroadcast(mService.getApplicationContext(), 0, mPongTimeoutAlarmIntent, PendingIntent.FLAG_UPDATE_CURRENT); mAlarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + AlarmManager.INTERVAL_FIFTEEN_MINUTES, AlarmManager.INTERVAL_FIFTEEN_MINUTES, mPingAlarmPendIntent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerPongListener File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
registerPongListener
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
private void updateLinkLayerStatsRssiAndScoreReport() { sendMessage(CMD_ONESHOT_RSSI_POLL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLinkLayerStatsRssiAndScoreReport File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
updateLinkLayerStatsRssiAndScoreReport
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private void fireCompletionHandlers() { if (completionHandlers != null && !completionHandlers.isEmpty()) { Display.getInstance().callSerially(new Runnable() { public void run() { if (completionHandlers != null && !completionHandlers.isEmpty()) { ArrayList<Runnable> toRun; synchronized(Video.this) { toRun = new ArrayList<Runnable>(completionHandlers); } for (Runnable r : toRun) { r.run(); } } } }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fireCompletionHandlers 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
fireCompletionHandlers
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private @NonNull List<Pair<PasspointProvider, PasspointMatch>> getAllMatchedProviders( ScanResult scanResult, boolean anqpRequestAllowed) { List<Pair<PasspointProvider, PasspointMatch>> allMatches = new ArrayList<>(); // Retrieve the relevant information elements, mainly Roaming Consortium IE and Hotspot 2.0 // Vendor Specific IE. InformationElementUtil.RoamingConsortium roamingConsortium = InformationElementUtil.getRoamingConsortiumIE(scanResult.informationElements); InformationElementUtil.Vsa vsa = InformationElementUtil.getHS2VendorSpecificIE( scanResult.informationElements); // Lookup ANQP data in the cache. long bssid; try { bssid = Utils.parseMac(scanResult.BSSID); } catch (IllegalArgumentException e) { Log.e(TAG, "Invalid BSSID provided in the scan result: " + scanResult.BSSID); return allMatches; } ANQPNetworkKey anqpKey = ANQPNetworkKey.buildKey(scanResult.SSID, bssid, scanResult.hessid, vsa.anqpDomainID); ANQPData anqpEntry = mAnqpCache.getEntry(anqpKey); if (anqpEntry == null) { if (anqpRequestAllowed) { mAnqpRequestManager.requestANQPElements(bssid, anqpKey, roamingConsortium.anqpOICount > 0, vsa.hsRelease); } Log.d(TAG, "ANQP entry not found for: " + anqpKey); return allMatches; } boolean anyProviderUpdated = false; for (Map.Entry<String, PasspointProvider> entry : mProviders.entrySet()) { PasspointProvider provider = entry.getValue(); if (provider.tryUpdateCarrierId()) { anyProviderUpdated = true; } if (mVerboseLoggingEnabled) { Log.d(TAG, "Matching provider " + provider.getConfig().getHomeSp().getFqdn() + " with " + anqpEntry.getElements().get(Constants.ANQPElementType.ANQPDomName)); } PasspointMatch matchStatus = provider.match(anqpEntry.getElements(), roamingConsortium, scanResult); if (matchStatus == PasspointMatch.HomeProvider || matchStatus == PasspointMatch.RoamingProvider) { allMatches.add(Pair.create(provider, matchStatus)); } } if (anyProviderUpdated) { mWifiConfigManager.saveToStore(true); } if (allMatches.size() != 0) { for (Pair<PasspointProvider, PasspointMatch> match : allMatches) { Log.d(TAG, String.format("Matched %s to %s as %s", scanResult.SSID, match.first.getConfig().getHomeSp().getFqdn(), match.second == PasspointMatch.HomeProvider ? "Home Provider" : "Roaming Provider")); } } else { if (mVerboseLoggingEnabled) { Log.d(TAG, "No service providers found for " + scanResult.SSID); } } return allMatches; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllMatchedProviders File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
getAllMatchedProviders
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
private JSONArray buildAvailableProjects(ID user) { ConfigBean[] projects = ProjectManager.instance.getAvailable(user); // 排序 a-z Arrays.sort(projects, Comparator.comparing(o -> o.getString("projectName"))); JSONArray navsOfProjects = new JSONArray(); JSONArray navsOfProjectsArchived = new JSONArray(); for (ConfigBean e : projects) { JSONObject item = JSONUtils.toJSONObject( NAV_ITEM_PROPS, new Object[] { e.getString("iconName"), e.getString("projectName"), NAV_PROJECT, e.getID("id") }); if (e.getInteger("status") == ProjectManager.STATUS_ARCHIVED) { navsOfProjectsArchived.add(item); } else { navsOfProjects.add(item); } } // 归档的 if (!navsOfProjectsArchived.isEmpty()) { navsOfProjects.add(JSONUtils.toJSONObject( NAV_ITEM_PROPS, new String[] { null, Language.L("已归档"), NAV_DIVIDER, "ARCHIVED" })); navsOfProjects.addAll(navsOfProjectsArchived); } // 管理员显示新建项目入口 if (UserHelper.isAdmin(user)) { JSONObject add = NAV_PROJECT__ADD.clone(); replaceLang(add); navsOfProjects.add(add); } return navsOfProjects; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildAvailableProjects File: src/main/java/com/rebuild/core/configuration/NavBuilder.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
buildAvailableProjects
src/main/java/com/rebuild/core/configuration/NavBuilder.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
public void handleNext() { if (mSaveAndFinishWorker != null) return; // TODO(b/120484642): This is a point of entry for passwords from the UI final Editable passwordText = mPasswordEntry.getText(); if (TextUtils.isEmpty(passwordText)) { return; } mChosenPassword = mIsAlphaMode ? LockscreenCredential.createPassword(passwordText) : LockscreenCredential.createPin(passwordText); if (mUiStage == Stage.Introduction) { if (validatePassword(mChosenPassword)) { mFirstPassword = mChosenPassword; mPasswordEntry.setText(""); updateStage(Stage.NeedToConfirm); } else { mChosenPassword.zeroize(); } } else if (mUiStage == Stage.NeedToConfirm) { if (mChosenPassword.equals(mFirstPassword)) { startSaveAndFinish(); } else { CharSequence tmp = mPasswordEntry.getText(); if (tmp != null) { Selection.setSelection((Spannable) tmp, 0, tmp.length()); } updateStage(Stage.ConfirmWrong); mChosenPassword.zeroize(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleNext File: src/com/android/settings/password/ChooseLockPassword.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
handleNext
src/com/android/settings/password/ChooseLockPassword.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
@Override public void installPacketFilter(byte[] filter) { sendMessage(CMD_INSTALL_PACKET_FILTER, filter); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installPacketFilter File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
installPacketFilter
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private void transform(final Node source, final DomNode parent) { final Object result = transform(source); if (result instanceof org.w3c.dom.Node) { final SgmlPage parentPage = parent.getPage(); final NodeList children = ((org.w3c.dom.Node) result).getChildNodes(); for (int i = 0; i < children.getLength(); i++) { XmlUtils.appendChild(parentPage, parent, children.item(i), true); } } else { final DomText text = new DomText(parent.getPage(), (String) result); parent.appendChild(text); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: transform File: src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XSLTProcessor.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-94" ]
CVE-2023-26119
CRITICAL
9.8
HtmlUnit/htmlunit
transform
src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XSLTProcessor.java
641325bbc84702dc9800ec7037aec061ce21956b
0
Analyze the following code function for security vulnerabilities
@Override public String getWhereSQL(Delete delete) { StringBuilder sql = new StringBuilder(); List<Condition> wheres = delete.getWheres(); boolean first = true; for (Condition condition : wheres) { if (first) { sql.append(getWhereStatement(delete)).append(" "); } else { sql.append(AND); } String str = getConditionSQL(condition); sql.append(str); first = false; } return sql.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWhereSQL 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
getWhereSQL
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
public static String toString(InputStream inputStream) { return new Scanner(inputStream, "UTF-8") .useDelimiter("\\A").next(); }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2023-46302 - Severity: CRITICAL - CVSS Score: 9.8 Description: fix unsafe deserialization via SnakeYaml in YamlEntityProvider Function: toString File: submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/provider/YamlEntityProvider.java Repository: apache/submarine Fixed Code: public static String toString(InputStream inputStream) { try (Scanner scanner = new Scanner(inputStream, StandardCharsets.UTF_8)) { return scanner.useDelimiter("\\A").next(); } }
[ "CWE-502" ]
CVE-2023-46302
CRITICAL
9.8
apache/submarine
toString
submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/provider/YamlEntityProvider.java
88e59027e644e81014ca5b5ae5a21de12ae8ca37
1
Analyze the following code function for security vulnerabilities
@Override public boolean isInPath(String path) { Path bFile = getBasefile().toPath(); Path filePath = bFile.resolve(path); Path normalizedPath = filePath.normalize(); return normalizedPath.startsWith(bFile); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInPath File: src/main/java/org/olat/core/util/vfs/LocalFolderImpl.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
isInPath
src/main/java/org/olat/core/util/vfs/LocalFolderImpl.java
336d5ce80681be61a0bbf4f73d2af5d1ff67e93a
0
Analyze the following code function for security vulnerabilities
@Beta @Deprecated public static void append(CharSequence from, File to, Charset charset) throws IOException { asCharSink(to, charset, FileWriteMode.APPEND).write(from); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: append File: guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-732" ]
CVE-2020-8908
LOW
2.1
google/guava
append
guava/src/com/google/common/io/Files.java
fec0dbc4634006a6162cfd4d0d09c962073ddf40
0
Analyze the following code function for security vulnerabilities
public Object getContentValueHandler() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentValueHandler 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
getContentValueHandler
src/main/java/com/fasterxml/jackson/databind/JavaType.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public static boolean deleteQuietly(File file) { return org.apache.commons.io.FileUtils.deleteQuietly(file); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteQuietly File: src/main/java/com/openkm/util/FileUtils.java Repository: openkm/document-management-system The code follows secure coding practices.
[ "CWE-377" ]
CVE-2022-3969
MEDIUM
5.5
openkm/document-management-system
deleteQuietly
src/main/java/com/openkm/util/FileUtils.java
c069e4d73ab8864345c25119d8459495f45453e1
0
Analyze the following code function for security vulnerabilities
@Override ResolveListAdapter createAdapter(Context context, List<Intent> payloadIntents, Intent[] initialIntents, List<ResolveInfo> rList, int launchedFromUid, boolean filterLastUsed) { final ChooserListAdapter adapter = new ChooserListAdapter(context, payloadIntents, initialIntents, rList, launchedFromUid, filterLastUsed); if (DEBUG) Log.d(TAG, "Adapter created; querying services"); queryTargetServices(adapter); return adapter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createAdapter File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
createAdapter
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
public void onDeleted(TopLevelItem item) throws IOException { for (ItemListener l : ItemListener.all()) l.onDeleted(item); items.remove(item.getName()); for (View v : views) v.onJobRenamed(item, item.getName(), null); save(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDeleted 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
onDeleted
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public ConnectionFactory load(Properties properties, String prefix) { ConnectionFactoryConfigurator.load(this, (Map) properties, prefix); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: load File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
load
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public static <T> T readObject(ObjectDataInput in) throws IOException { boolean isBinary = in.readBoolean(); if (isBinary) { return (T) in.readData(); } return in.readObject(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readObject File: hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
readObject
hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private void pendingAssistExtrasTimedOut(PendingAssistExtras pae) { IAssistDataReceiver receiver; synchronized (mGlobalLock) { mPendingAssistExtras.remove(pae); receiver = pae.receiver; } if (receiver != null) { // Caller wants result sent back to them. Bundle sendBundle = new Bundle(); // At least return the receiver extras sendBundle.putBundle(ASSIST_KEY_RECEIVER_EXTRAS, pae.receiverExtras); try { pae.receiver.onHandleAssistData(sendBundle); } catch (RemoteException e) { } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pendingAssistExtrasTimedOut 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
pendingAssistExtrasTimedOut
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public List<ServerConfiguration> getServers() { return servers; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServers 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
getServers
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 static float interpolate(float t, float start, float end) { return (1 - t) * start + t * end; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: interpolate File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
interpolate
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
void stopLockTaskModeInternal(@Nullable IBinder token, boolean isSystemCaller) { final int callingUid = Binder.getCallingUid(); final long ident = Binder.clearCallingIdentity(); try { synchronized (mGlobalLock) { Task task = null; if (token != null) { final ActivityRecord r = ActivityRecord.forTokenLocked(token); if (r == null) { return; } task = r.getTask(); } getLockTaskController().stopLockTaskMode(task, isSystemCaller, callingUid); } // Launch in-call UI if a call is ongoing. This is necessary to allow stopping the lock // task and jumping straight into a call in the case of emergency call back. TelecomManager tm = (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE); if (tm != null) { tm.showInCallScreen(false); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopLockTaskModeInternal 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
stopLockTaskModeInternal
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public Iterator<String> getComponentTypes() { return componentMap.keySet().iterator(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getComponentTypes File: impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-14371
MEDIUM
5
eclipse-ee4j/mojarra
getComponentTypes
impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java
1b434748d9239f42eae8aa7d37d7a0930c061e24
0