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
public void execute(String sql, List<JsonArray> params, Handler<AsyncResult<List<UpdateResult>>> replyHandler) { startTx(transaction -> { if (transaction.failed()) { replyHandler.handle(Future.failedFuture(transaction.cause())); return; } execute(transaction, sql, params, result -> { if (result.failed()) { rollbackTx(transaction, rollback -> replyHandler.handle(result)); return; } endTx(transaction, end -> { if (end.failed()) { replyHandler.handle(Future.failedFuture(end.cause())); return; } replyHandler.handle(result); }); }); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: execute File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.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
execute
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private final void startProcessLocked(ProcessRecord app, String hostingType, String hostingNameStr) { startProcessLocked(app, hostingType, hostingNameStr, null /* abiOverride */, null /* entryPoint */, null /* entryPointArgs */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startProcessLocked 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
startProcessLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Nonnull public EEOI parse () throws JsonParseException { final EEOI eEOI = _readValue (); if (eEOI.isNotEndOfInput () && m_bCheckForEOI) { // Non EOF // Check for trailing whitespaces (reads a char) _skipSpaces (); final IJsonParsePosition aStartPos = _getCurrentParsePos (); // Check for expected end of input final int c = _readChar (); if (c != EOI) throw _parseEx (aStartPos, "Invalid character " + _getPrintableChar (c) + " after JSON root object"); } return eEOI; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parse File: ph-json/src/main/java/com/helger/json/parser/JsonParser.java Repository: phax/ph-commons The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34612
HIGH
7.5
phax/ph-commons
parse
ph-json/src/main/java/com/helger/json/parser/JsonParser.java
02a4d034dcfb2b6e1796b25f519bf57a6796edce
0
Analyze the following code function for security vulnerabilities
protected WapPushManDBHelper getDatabase(Context context) { if (mDbHelper == null) { if (LOCAL_LOGV) Log.v(LOG_TAG, "create new db inst."); mDbHelper = new WapPushManDBHelper(context); } return mDbHelper; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDatabase File: packages/WAPPushManager/src/com/android/smspush/WapPushManager.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2014-8507
HIGH
7.5
android
getDatabase
packages/WAPPushManager/src/com/android/smspush/WapPushManager.java
48ed835468c6235905459e6ef7df032baf3e4df6
0
Analyze the following code function for security vulnerabilities
private boolean isPackageWhitelisted(String packageName) { var packageWhitelist = configuration.whitelistedPackages(); return packageWhitelist.stream().anyMatch(pm -> pm.matches(packageName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPackageWhitelisted 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
isPackageWhitelisted
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
af4f28a56e2fe600d8750b3b415352a0a3217392
0
Analyze the following code function for security vulnerabilities
public static boolean checkQuery(Element element, String queryname) { String tag = element.getLocalName(); if (tag == null) { return false; } else if (tag.equals("Query") || tag.equals("SubjectQuery")) { NamedNodeMap nm = element.getAttributes(); int len = nm.getLength(); String attrName; Attr attr; boolean found = false; for (int j = 0; j < len; j++) { attr = (Attr) nm.item(j); attrName = attr.getLocalName(); if ((attrName != null) && (attrName.equals("type")) && (attr.getNodeValue().equals(queryname + "Type"))) { found = true; break; } } if (!found) { return false; } } else if (!tag.equals(queryname)) { return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkQuery File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java Repository: OpenIdentityPlatform/OpenAM The code follows secure coding practices.
[ "CWE-287" ]
CVE-2023-37471
CRITICAL
9.8
OpenIdentityPlatform/OpenAM
checkQuery
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
7c18543d126e8a567b83bb4535631825aaa9d742
0
Analyze the following code function for security vulnerabilities
protected byte[] sendKexInit() throws Exception { Map<KexProposalOption, String> proposal = getKexProposal(); byte[] seed; synchronized (kexState) { DefaultKeyExchangeFuture initFuture = kexInitializedFuture; if (initFuture == null) { initFuture = new DefaultKeyExchangeFuture(toString(), null); kexInitializedFuture = initFuture; } try { seed = sendKexInit(proposal); setKexSeed(seed); initFuture.setValue(Boolean.TRUE); } catch (Exception e) { initFuture.setValue(e); throw e; } } if (log.isTraceEnabled()) { log.trace("sendKexInit({}) proposal={} seed: {}", this, proposal, BufferUtils.toHex(':', seed)); } return seed; }
Vulnerability Classification: - CWE: CWE-354 - CVE: CVE-2023-48795 - Severity: MEDIUM - CVSS Score: 5.9 Description: GH-445: OpenSSH "strict KEX" protocol extension Implements the OpenSSH "strict KEX" protocol extension.[1] If both parties in a an SSH connection announce support for strict KEX in the initial KEX_INIT message, strict KEX is active; otherwise it isn't. With strict KEX active, there must be only KEX-related messages during the initial key exchange (no IGNORE or DEBUG messages are allowed), and the KEX_INIT message must be the first one to have been received after the initial version exchange. If these conditions are violated, the connection is terminated. Strict KEX also resets message sequence numbers to zero after each NEW_KEYS message sent or received. [1] https://github.com/openssh/openssh-portable/blob/master/PROTOCOL Function: sendKexInit File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd Fixed Code: protected byte[] sendKexInit() throws Exception { Map<KexProposalOption, String> proposal = doStrictKexProposal(getKexProposal()); byte[] seed; synchronized (kexState) { DefaultKeyExchangeFuture initFuture = kexInitializedFuture; if (initFuture == null) { initFuture = new DefaultKeyExchangeFuture(toString(), null); kexInitializedFuture = initFuture; } try { seed = sendKexInit(proposal); setKexSeed(seed); initFuture.setValue(Boolean.TRUE); } catch (Exception e) { initFuture.setValue(e); throw e; } } if (log.isTraceEnabled()) { log.trace("sendKexInit({}) proposal={} seed: {}", this, proposal, BufferUtils.toHex(':', seed)); } return seed; }
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
sendKexInit
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
1
Analyze the following code function for security vulnerabilities
public void sendSetAddress(String id) throws Exception { for (IConnectionServiceAdapter a : mConnectionServiceAdapters) { a.setAddress( id, mConnectionById.get(id).request.getAddress(), mConnectionById.get(id).addressPresentation, null /*Session.Info*/); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendSetAddress File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
sendSetAddress
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public String getRealPath(String path) { Request request = this.container.getRequest(); if (request instanceof ServletRequest) { return ((ServletRequest) request).getHttpServletRequest().getServletContext().getRealPath(path); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRealPath 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
getRealPath
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 int startAssistantActivity(String callingPackage, @NonNull String callingFeatureId, int callingPid, int callingUid, Intent intent, String resolvedType, Bundle bOptions, int userId) { assertPackageMatchesCallingUid(callingPackage); mAmInternal.enforceCallingPermission(BIND_VOICE_INTERACTION, "startAssistantActivity()"); userId = handleIncomingUser(callingPid, callingUid, userId, "startAssistantActivity"); final long origId = Binder.clearCallingIdentity(); try { return getActivityStartController().obtainStarter(intent, "startAssistantActivity") .setCallingUid(callingUid) .setCallingPackage(callingPackage) .setCallingFeatureId(callingFeatureId) .setResolvedType(resolvedType) .setActivityOptions(bOptions) .setUserId(userId) .setAllowBackgroundActivityStart(true) .execute(); } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startAssistantActivity 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
startAssistantActivity
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public TransferOwnershipMetadataManager newTransferOwnershipMetadataManager() { return new TransferOwnershipMetadataManager(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newTransferOwnershipMetadataManager 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
newTransferOwnershipMetadataManager
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected static Node getChildByName(Node node, String name) { NodeList children = node.getChildNodes(); // this node matches if (node.getNodeName().equals(name)) return node; // search children for (int i = 0; i < children.getLength(); i++) { Node found = getChildByName(children.item(i), name); if (found != null) return found; } // failed return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChildByName File: src/edu/stanford/nlp/ie/machinereading/common/DomReader.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3878
HIGH
7.5
stanfordnlp/CoreNLP
getChildByName
src/edu/stanford/nlp/ie/machinereading/common/DomReader.java
e5bbe135a02a74b952396751ed3015e8b8252e99
0
Analyze the following code function for security vulnerabilities
private Resources getResources(PackageItemInfo pii) { Resources res = mResourceCache.get(pii.packageName); if (res != null) return res; try { ApplicationInfo ai = mPm.getApplicationInfo(pii.packageName, 0, 0); AssetManager am = new AssetManager(); am.addAssetPath(ai.publicSourceDir); res = new Resources(am, null, null); mResourceCache.put(pii.packageName, res); return res; } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(PM_NOT_RUNNING_ERR); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResources File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
getResources
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
@Override protected List<Contentlet> findAllCurrent ( int offset, int limit ) throws ElasticsearchException { QueryBuilder builder = QueryBuilders.matchAllQuery(); SearchResponse response = client.getClient().prepareSearch() .setQuery( builder ).addFields("inode","identifier") .setSize( limit ).setFrom( offset ).execute().actionGet(); SearchHits hits = response.getHits(); List<Contentlet> cons = new ArrayList<Contentlet>(); for ( SearchHit hit : hits ) { try { cons.add( find( hit.field("inode").getValue().toString() ) ); } catch ( Exception e ) { throw new ElasticsearchException( e.getMessage(), e ); } } return cons; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findAllCurrent File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
findAllCurrent
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
public void setUserClass(String userClass) { this.userClass = userClass; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserClass File: src/java/talentum/escenic/plugins/authenticator/authenticators/DBAuthenticator.java Repository: Bricco/authenticator-plugin The code follows secure coding practices.
[ "CWE-89" ]
CVE-2013-10013
MEDIUM
5.2
Bricco/authenticator-plugin
setUserClass
src/java/talentum/escenic/plugins/authenticator/authenticators/DBAuthenticator.java
a5456633ff75e8f13705974c7ed1ce77f3f142d5
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public void clearSupportedSubscriptionTypesForUnitTest() { myModelConfig.clearSupportedSubscriptionTypesForUnitTest(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearSupportedSubscriptionTypesForUnitTest File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
clearSupportedSubscriptionTypesForUnitTest
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
public String putRecordingTextTrack(UploadedTrack track) { return recordingServiceHelper.putRecordingTextTrack(track); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putRecordingTextTrack File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-12443
HIGH
7.5
bigbluebutton
putRecordingTextTrack
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
b21ca8355a57286a1e6df96984b3a4c57679a463
0
Analyze the following code function for security vulnerabilities
public static final void writeExceptionToParcel(Parcel reply, Exception e) { int code = 0; boolean logException = true; if (e instanceof FileNotFoundException) { code = 1; logException = false; } else if (e instanceof IllegalArgumentException) { code = 2; } else if (e instanceof UnsupportedOperationException) { code = 3; } else if (e instanceof SQLiteAbortException) { code = 4; } else if (e instanceof SQLiteConstraintException) { code = 5; } else if (e instanceof SQLiteDatabaseCorruptException) { code = 6; } else if (e instanceof SQLiteFullException) { code = 7; } else if (e instanceof SQLiteDiskIOException) { code = 8; } else if (e instanceof SQLiteException) { code = 9; } else if (e instanceof OperationApplicationException) { code = 10; } else if (e instanceof OperationCanceledException) { code = 11; logException = false; } else { reply.writeException(e); Log.e(TAG, "Writing exception to parcel", e); return; } reply.writeInt(code); reply.writeString(e.getMessage()); if (logException) { Log.e(TAG, "Writing exception to parcel", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeExceptionToParcel File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
writeExceptionToParcel
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
private void read() throws IOException { if (index==fill) { if (captureStart!=-1) { captureBuffer.append(buffer, captureStart, fill-captureStart); captureStart=0; } bufferOffset += fill; fill=reader.read(buffer, 0, buffer.length); index=0; if (fill==-1) { current=-1; return; } } if (current=='\n') { line++; lineOffset=bufferOffset+index; } current=buffer[index++]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: read File: src/main/org/hjson/JsonParser.java Repository: hjson/hjson-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34620
HIGH
7.5
hjson/hjson-java
read
src/main/org/hjson/JsonParser.java
91bef056d56bf968451887421c89a44af1d692ff
0
Analyze the following code function for security vulnerabilities
protected void internalUnloadTopic(AsyncResponse asyncResponse, boolean authoritative) { log.info("[{}] Unloading topic {}", clientAppId(), topicName); try { if (topicName.isGlobal()) { validateGlobalNamespaceOwnership(namespaceName); } } catch (Exception e) { log.error("[{}] Failed to unload topic {}", clientAppId(), topicName, e); resumeAsyncResponseExceptionally(asyncResponse, e); return; } // If the topic name is a partition name, no need to get partition topic metadata again if (topicName.isPartitioned()) { internalUnloadNonPartitionedTopic(asyncResponse, authoritative); } else { getPartitionedTopicMetadataAsync(topicName, authoritative, false) .thenAccept(meta -> { if (meta.partitions > 0) { final List<CompletableFuture<Void>> futures = Lists.newArrayList(); for (int i = 0; i < meta.partitions; i++) { TopicName topicNamePartition = topicName.getPartition(i); try { futures.add(pulsar().getAdminClient().topics().unloadAsync( topicNamePartition.toString())); } catch (Exception e) { log.error("[{}] Failed to unload topic {}", clientAppId(), topicNamePartition, e); asyncResponse.resume(new RestException(e)); return; } } FutureUtil.waitForAll(futures).handle((result, exception) -> { if (exception != null) { Throwable th = exception.getCause(); if (th instanceof NotFoundException) { asyncResponse.resume(new RestException(Status.NOT_FOUND, th.getMessage())); } else if (th instanceof WebApplicationException) { asyncResponse.resume(th); } else { log.error("[{}] Failed to unload topic {}", clientAppId(), topicName, exception); asyncResponse.resume(new RestException(exception)); } } else { asyncResponse.resume(Response.noContent().build()); } return null; }); } else { internalUnloadNonPartitionedTopic(asyncResponse, authoritative); } }).exceptionally(t -> { log.error("[{}] Failed to unload topic {}", clientAppId(), topicName, t); if (t instanceof WebApplicationException) { asyncResponse.resume(t); } else { asyncResponse.resume(new RestException(t)); } return null; }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalUnloadTopic File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalUnloadTopic
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Override public void alwaysShowUnsupportedCompileSdkWarning(ComponentName activity) { synchronized (mGlobalLock) { final long origId = Binder.clearCallingIdentity(); try { mAppWarnings.alwaysShowUnsupportedCompileSdkWarning(activity); } finally { Binder.restoreCallingIdentity(origId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: alwaysShowUnsupportedCompileSdkWarning 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
alwaysShowUnsupportedCompileSdkWarning
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override @SuppressWarnings( "unchecked" ) public boolean exists( PotentialDuplicate potentialDuplicate ) throws PotentialDuplicateConflictException { if ( potentialDuplicate.getOriginal() == null || potentialDuplicate.getDuplicate() == null ) { throw new PotentialDuplicateConflictException( "Can't search for pair of potential duplicates: original and duplicate must not be null" ); } NativeQuery<BigInteger> query = getSession() .createNativeQuery( "select count(potentialduplicateid) from potentialduplicate pd " + "where (pd.teia = :original and pd.teib = :duplicate) or (pd.teia = :duplicate and pd.teib = :original)" ); query.setParameter( "original", potentialDuplicate.getOriginal() ); query.setParameter( "duplicate", potentialDuplicate.getDuplicate() ); return query.getSingleResult().intValue() != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: exists File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/deduplication/hibernate/HibernatePotentialDuplicateStore.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
exists
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/deduplication/hibernate/HibernatePotentialDuplicateStore.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
0
Analyze the following code function for security vulnerabilities
public int getStartColumnNumber() { return startColumnNumber_; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStartColumnNumber File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
getStartColumnNumber
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
public String parameterToString(Object param) { if (param == null) { return ""; } else if (param instanceof Date) { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } b.append(String.valueOf(o)); } return b.toString(); } else { return String.valueOf(param); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parameterToString File: samples/client/petstore/java/jersey2-java8-localdatetime/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
parameterToString
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Nullable XmlResourceParser injectXmlMetaData(ActivityInfo activityInfo, String key) { return activityInfo.loadXmlMetaData(mContext.getPackageManager(), key); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: injectXmlMetaData File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
injectXmlMetaData
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public void setTransformInverse(Object nativeTransform) throws com.codename1.ui.Transform.NotInvertibleException { CN1Matrix4f m = (CN1Matrix4f)nativeTransform; if (!m.invert()) { throw new com.codename1.ui.Transform.NotInvertibleException(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTransformInverse 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
setTransformInverse
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public String getAdminAddress() { String v = adminAddress; if(v==null) v = Messages.Mailer_Address_Not_Configured(); return v; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAdminAddress File: core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-254" ]
CVE-2014-9634
MEDIUM
5
jenkinsci/jenkins
getAdminAddress
core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java
582128b9ac179a788d43c1478be8a5224dc19710
0
Analyze the following code function for security vulnerabilities
public void close() throws IOException { if (fd != -1) { close(fd); fd = -1; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: close File: classpath/java/io/FileOutputStream.java Repository: ReadyTalk/avian The code follows secure coding practices.
[ "CWE-190", "CWE-787" ]
CVE-2020-28371
HIGH
7.5
ReadyTalk/avian
close
classpath/java/io/FileOutputStream.java
0871979b298add320ca63f65060acb7532c8a0dd
0
Analyze the following code function for security vulnerabilities
public boolean switchUser(int userid) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(userid); mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); reply.readException(); boolean result = reply.readInt() != 0; reply.recycle(); data.recycle(); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchUser File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
switchUser
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public boolean setShowMode(@SoftKeyboardShowMode int showMode) { final IAccessibilityServiceConnection connection = AccessibilityInteractionClient.getInstance().getConnection( mService.mConnectionId); if (connection != null) { try { return connection.setSoftKeyboardShowMode(showMode); } catch (RemoteException re) { Log.w(LOG_TAG, "Failed to set soft keyboard behavior", re); re.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setShowMode File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
setShowMode
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
public void autoSwitch(WebSession session, UserDTO user) { // 用户有 last_project_id 权限 if (hasLastProjectPermission(user)) { return; } // 用户有 last_workspace_id 权限 if (hasLastWorkspacePermission(user)) { return; } // 判断其他权限 checkNewWorkspaceAndProject(session, user); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: autoSwitch File: framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-32699
MEDIUM
6.5
metersphere
autoSwitch
framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
c59e381d368990214813085a1a4877c5ef865411
0
Analyze the following code function for security vulnerabilities
public static String toDebugString(String name, ByteBuffer byteBuffer) { return name + "(pos:" + byteBuffer.position() + " lim:" + byteBuffer.limit() + " remain:" + byteBuffer.remaining() + " cap:" + byteBuffer.capacity() + ")"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toDebugString 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
toDebugString
hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@SystemApi @RequiresPermission(anyOf = { android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS, android.Manifest.permission.PROVISION_DEMO_DEVICE}) public void provisionFullyManagedDevice( @NonNull FullyManagedDeviceProvisioningParams provisioningParams) throws ProvisioningException { if (mService != null) { try { mService.provisionFullyManagedDevice(provisioningParams, mContext.getPackageName()); } catch (ServiceSpecificException e) { throw new ProvisioningException(e, e.errorCode, getErrorMessage(e)); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: provisionFullyManagedDevice 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
provisionFullyManagedDevice
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public boolean isCommitted() { return this.outputStream.isCommitted(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCommitted File: src/java/winstone/WinstoneResponse.java Repository: jenkinsci/winstone The code follows secure coding practices.
[ "CWE-79" ]
CVE-2011-4344
LOW
2.6
jenkinsci/winstone
isCommitted
src/java/winstone/WinstoneResponse.java
410ed3001d51c689cf59085b7417466caa2ded7b
0
Analyze the following code function for security vulnerabilities
public abstract BaseXMLBuilder i(String target, String data);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: i 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
i
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
public void signalPersistentProcesses(int sig) throws RemoteException { if (sig != SIGNAL_USR1) { throw new SecurityException("Only SIGNAL_USR1 is allowed"); } synchronized (this) { if (checkCallingPermission(android.Manifest.permission.SIGNAL_PERSISTENT_PROCESSES) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.SIGNAL_PERSISTENT_PROCESSES); } for (int i = mLruProcesses.size() - 1 ; i >= 0 ; i--) { ProcessRecord r = mLruProcesses.get(i); if (r.thread != null && r.persistent) { sendSignal(r.pid, sig); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: signalPersistentProcesses 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
signalPersistentProcesses
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected Node composeMappingNode(String anchor) { MappingStartEvent startEvent = (MappingStartEvent) parser.getEvent(); String tag = startEvent.getTag(); Tag nodeTag; boolean resolved = false; if (tag == null || tag.equals("!")) { nodeTag = resolver.resolve(NodeId.mapping, null, startEvent.getImplicit()); resolved = true; } else { nodeTag = new Tag(tag); } final List<NodeTuple> children = new ArrayList<NodeTuple>(); MappingNode node = new MappingNode(nodeTag, resolved, children, startEvent.getStartMark(), null, startEvent.getFlowStyle()); if (startEvent.isFlow()) { node.setBlockComments(blockCommentsCollector.consume()); } if (anchor != null) { node.setAnchor(anchor); anchors.put(anchor, node); } while (!parser.checkEvent(Event.ID.MappingEnd)) { blockCommentsCollector.collectEvents(); if (parser.checkEvent(Event.ID.MappingEnd)) { break; } composeMappingChildren(children, node); } if (startEvent.isFlow()) { node.setInLineComments(inlineCommentsCollector.collectEvents().consume()); } Event endEvent = parser.getEvent(); node.setEndMark(endEvent.getEndMark()); inlineCommentsCollector.collectEvents(); if(!inlineCommentsCollector.isEmpty()) { node.setInLineComments(inlineCommentsCollector.consume()); } return node; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: composeMappingNode File: src/main/java/org/yaml/snakeyaml/composer/Composer.java Repository: snakeyaml The code follows secure coding practices.
[ "CWE-776" ]
CVE-2022-25857
HIGH
7.5
snakeyaml
composeMappingNode
src/main/java/org/yaml/snakeyaml/composer/Composer.java
fc300780da21f4bb92c148bc90257201220cf174
0
Analyze the following code function for security vulnerabilities
private String getDownloadIdFromUri(final Uri uri) { return uri.getPathSegments().get(1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDownloadIdFromUri File: src/com/android/providers/downloads/DownloadProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-0848
HIGH
7.2
android
getDownloadIdFromUri
src/com/android/providers/downloads/DownloadProvider.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
@Deprecated public CharSequence getCancelLabel() { return mCancelLabel; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCancelLabel File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getCancelLabel
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public void setDetailsVisible(T item, boolean visible) { detailsManager.setDetailsVisible(item, visible); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDetailsVisible 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
setDetailsVisible
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
void updateBatteryStats(ActivityRecord component, boolean resumed) { final Message m = PooledLambda.obtainMessage(ActivityManagerInternal::updateBatteryStats, mAmInternal, component.mActivityComponent, component.app.mUid, component.mUserId, resumed); mH.sendMessage(m); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateBatteryStats 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
updateBatteryStats
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private void parsePlayerTech(final List<Element> elements) throws GameParseException { for (final Element current : elements) { final PlayerId player = getPlayerId(current, "player", true); final TechnologyFrontierList categories = player.getTechnologyFrontierList(); parseCategories(getChildren("category", current), categories); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parsePlayerTech 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
parsePlayerTech
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
public Set<String> concreteIndexNames(final User user, final IndexNameExpressionResolver resolver, final ClusterService cs) { return getResolvedIndexPattern(user, resolver, cs, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: concreteIndexNames File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java Repository: opensearch-project/security The code follows secure coding practices.
[ "CWE-612", "CWE-863" ]
CVE-2022-41918
MEDIUM
6.3
opensearch-project/security
concreteIndexNames
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
0
Analyze the following code function for security vulnerabilities
public String getName() { return name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getName File: jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java Repository: geosolutions-it/jai-ext The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-24816
HIGH
7.5
geosolutions-it/jai-ext
getName
jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java
cb1d6565d38954676b0a366da4f965fef38da1cb
0
Analyze the following code function for security vulnerabilities
Call getHeldCall() { return getFirstCallWithState(CallState.ON_HOLD); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHeldCall 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
getHeldCall
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public <T> T deserialize(Response response, GenericType<T> returnType) throws ApiException { if (response == null || returnType == null) { return null; } if ("byte[]".equals(returnType.toString())) { // Handle binary response (byte array). return (T) response.readEntity(byte[].class); } else if (returnType.getRawType() == File.class) { // Handle file downloading. T file = (T) downloadFileFromResponse(response); return file; } String contentType = null; List<Object> contentTypes = response.getHeaders().get("Content-Type"); if (contentTypes != null && !contentTypes.isEmpty()) contentType = String.valueOf(contentTypes.get(0)); // read the entity stream multiple times response.bufferEntity(); return response.readEntity(returnType); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deserialize File: samples/client/petstore/java/okhttp-gson-parcelableModel/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
deserialize
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public ServerBuilder http1MaxInitialLineLength(int http1MaxInitialLineLength) { this.http1MaxInitialLineLength = validateNonNegative( http1MaxInitialLineLength, "http1MaxInitialLineLength"); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: http1MaxInitialLineLength 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
http1MaxInitialLineLength
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
private void migrate88(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("CodeComments.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) element.addElement("resolved").setText("false"); dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate88 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate88
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public JSONArray getJSONArray(int index) throws JSONException { Object o = get(index); if (o instanceof JSONArray) { return (JSONArray)o; } throw new JSONException("JSONArray[" + index + "] is not a JSONArray."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJSONArray File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
getJSONArray
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
public DependencyList getDependencyList() { return dependencyList; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDependencyList File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
getDependencyList
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
@Test(description = "Test ballerina version") public void testBallerinaVersion() throws Exception { LogLeecher clientLeecher = new LogLeecher(RepoUtils.getBallerinaVersion()); balClient.runMain("version", new String[0], envVariables, new String[]{}, new LogLeecher[]{clientLeecher}, tempProjectDirectory.toString()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testBallerinaVersion File: tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PackagingTestCase.java Repository: ballerina-platform/ballerina-lang The code follows secure coding practices.
[ "CWE-306" ]
CVE-2021-32700
MEDIUM
5.8
ballerina-platform/ballerina-lang
testBallerinaVersion
tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PackagingTestCase.java
4609ffee1744ecd16aac09303b1783bf0a525816
0
Analyze the following code function for security vulnerabilities
public boolean canUsbDataSignalingBeDisabled() { throwIfParentInstance("canUsbDataSignalingBeDisabled"); if (mService != null) { try { return mService.canUsbDataSignalingBeDisabled(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canUsbDataSignalingBeDisabled 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
canUsbDataSignalingBeDisabled
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, int nb, int start, XWikiContext context) throws XWikiException { return searchDocuments(wheresql, distinctbylanguage, customMapping, nb, start, null, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: searchDocuments File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
searchDocuments
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
private String readToken(InputStream in, StringBuffer sb, char endOfToken) throws IOException { sb.setLength(0); while (true) { int ch = in.read(); if (ch == -1) { if (sb.length() == 0) { return null; } throw new IOException("Unexpected EOF"); } if (ch == endOfToken) { return sb.toString(); } sb.append((char)ch); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readToken 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
readToken
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public abstract void onCancel(AjaxRequestTarget target);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCancel File: server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/artifacts/ArtifactUploadPanel.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-38301
HIGH
8.8
theonedev/onedev
onCancel
server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/artifacts/ArtifactUploadPanel.java
5b6a19c1f7fe9c271acc4268bcd261a9a1cbb3ea
0
Analyze the following code function for security vulnerabilities
private static boolean validateImsManifest(Document doc) { try { //do not throw exception already here, as it might be only a generic zip file if (doc == null) return false; // get all organization elements. need to set namespace Element rootElement = doc.getRootElement(); String nsuri = rootElement.getNamespace().getURI(); Map<String,String> nsuris = new HashMap<>(1); nsuris.put("ns", nsuri); // Check for organiztaion element. Must provide at least one... title gets ectracted from either // the (optional) <title> element or the mandatory identifier attribute. // This makes sure, at least a root node gets created in CPManifestTreeModel. XPath meta = rootElement.createXPath("//ns:organization"); meta.setNamespaceURIs(nsuris); Element orgaEl = (Element) meta.selectSingleNode(rootElement); if (orgaEl == null) { return false; } // Check for at least one <item> element referencing a <resource>, which will serve as an entry point. // This is mandatory, as we need an entry point as the user has the option of setting // CPDisplayController to not display a menu at all, in which case the first <item>/<resource> // element pair gets displayed. XPath resourcesXPath = rootElement.createXPath("//ns:resources"); resourcesXPath.setNamespaceURIs(nsuris); Element elResources = (Element)resourcesXPath.selectSingleNode(rootElement); if (elResources == null) { return false; // no <resources> element. } XPath itemsXPath = rootElement.createXPath("//ns:item"); itemsXPath.setNamespaceURIs(nsuris); List items = itemsXPath.selectNodes(rootElement); if (items.size() == 0) { return false; // no <item> element. } for (Iterator iter = items.iterator(); iter.hasNext();) { Element item = (Element) iter.next(); String identifierref = item.attributeValue("identifierref"); if (identifierref == null) continue; XPath resourceXPath = rootElement.createXPath("//ns:resource[@identifier='" + identifierref + "']"); resourceXPath.setNamespaceURIs(nsuris); Element elResource = (Element)resourceXPath.selectSingleNode(elResources); if (elResource == null) { return false; } if (elResource.attribute("scormtype") != null) { return false; } if (elResource.attribute("scormType") != null) { return false; } if (elResource.attribute("SCORMTYPE") != null) { return false; } if (elResource.attributeValue("href") != null) { return true; // success. } } } catch (Exception e) { log.warn("", e); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateImsManifest File: src/main/java/org/olat/fileresource/types/ImsCPFileResource.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
validateImsManifest
src/main/java/org/olat/fileresource/types/ImsCPFileResource.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
public static void setUseStreamManagementResumptionDefault(boolean useSmResumptionDefault) { if (useSmResumptionDefault) { // Also enable SM is resumption is enabled setUseStreamManagementDefault(useSmResumptionDefault); } XMPPTCPConnection.useSmResumptionDefault = useSmResumptionDefault; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUseStreamManagementResumptionDefault File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
setUseStreamManagementResumptionDefault
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
void setDragResizing() { final boolean resizing = computeDragResizing(); if (resizing == mDragResizing) { return; } mDragResizing = resizing; final Task task = getTask(); if (task != null && task.isDragResizing()) { mResizeMode = task.getDragResizeMode(); } else { mResizeMode = mDragResizing && getDisplayContent().mDividerControllerLocked.isResizing() ? DRAG_RESIZE_MODE_DOCKED_DIVIDER : DRAG_RESIZE_MODE_FREEFORM; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDragResizing File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
setDragResizing
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private boolean areTranslucentBarsAllowed() { return mTranslucentDecorEnabled && !mAccessibilityManager.isTouchExplorationEnabled(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: areTranslucentBarsAllowed 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
areTranslucentBarsAllowed
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
public @Nullable Clob getClob(String columnName) throws SQLException { return getClob(findColumn(columnName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClob 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
getClob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public void createOrUpdateCaptureType( CaptureType value ) { if( value == null || value.getLabel() == null || value.getUrlSuffix() == null ) { throw new IllegalArgumentException( "The CaptureType, it's label and url_suffix must not be null." ); } CaptureType persistent = em.find( CaptureType.class, value.getUrlSuffix() ); if( persistent != null ) { persistent.setLabel( value.getLabel() ); persistent.setCaptureFilter( value.getCaptureFilter() ); } else { em.persist( value ); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createOrUpdateCaptureType File: src/main/java/com/rtds/svc/CaptureTypeService.java Repository: jdhwpgmbca/pcapture The code follows secure coding practices.
[ "CWE-754" ]
CVE-2021-39196
MEDIUM
6.8
jdhwpgmbca/pcapture
createOrUpdateCaptureType
src/main/java/com/rtds/svc/CaptureTypeService.java
0f74f431e0970a2e5784dbd955cfa4760e3b1ef7
0
Analyze the following code function for security vulnerabilities
boolean canBeHiddenByKeyguard() { // Keyguard visibility of window from activities are determined over activity visibility. if (mActivityRecord != null) { return false; } switch (mAttrs.type) { case TYPE_NOTIFICATION_SHADE: case TYPE_STATUS_BAR: case TYPE_NAVIGATION_BAR: case TYPE_WALLPAPER: return false; default: // Hide only windows below the keyguard host window. return mPolicy.getWindowLayerLw(this) < mPolicy.getWindowLayerFromTypeLw(TYPE_NOTIFICATION_SHADE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canBeHiddenByKeyguard File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
canBeHiddenByKeyguard
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private String getPath(HttpServletRequest request) { String path = null; try { path = new URI(request.getRequestURI()).getPath(); } catch (URISyntaxException e) { LOGGER.error("parse request to path error", e); } return path; }
Vulnerability Classification: - CWE: CWE-290 - CVE: CVE-2021-29441 - Severity: HIGH - CVSS Score: 7.5 Description: Fix #4701 Function: getPath File: core/src/main/java/com/alibaba/nacos/core/code/ControllerMethodsCache.java Repository: alibaba/nacos Fixed Code: private String getPath(HttpServletRequest request) { try { return new URI(request.getRequestURI()).getPath(); } catch (URISyntaxException e) { LOGGER.error("parse request to path error", e); throw new NacosRuntimeException(NacosException.NOT_FOUND, "Invalid URI"); } }
[ "CWE-290" ]
CVE-2021-29441
HIGH
7.5
alibaba/nacos
getPath
core/src/main/java/com/alibaba/nacos/core/code/ControllerMethodsCache.java
91d16023d91ea21a5e58722c751485a0b9bbeeb3
1
Analyze the following code function for security vulnerabilities
public void deleteVersion(String space, String page, String version) { deleteVersions(space, page, version, version); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteVersion File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
deleteVersion
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
KeyInterceptionInfo getKeyInterceptionInfo() { if (mKeyInterceptionInfo == null || mKeyInterceptionInfo.layoutParamsPrivateFlags != getAttrs().privateFlags || mKeyInterceptionInfo.layoutParamsType != getAttrs().type || mKeyInterceptionInfo.windowTitle != getWindowTag()) { mKeyInterceptionInfo = new KeyInterceptionInfo(getAttrs().type, getAttrs().privateFlags, getWindowTag().toString()); } return mKeyInterceptionInfo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKeyInterceptionInfo File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
getKeyInterceptionInfo
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof ClassPathResource) { ClassPathResource otherRes = (ClassPathResource) obj; ClassLoader thisLoader = this.classLoader; ClassLoader otherLoader = otherRes.classLoader; return (this.path.equals(otherRes.path) && thisLoader.equals(otherLoader) && this.clazz.equals(otherRes.clazz)); } return false; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2018-9159 - Severity: MEDIUM - CVSS Score: 5.0 Description: Fix for #981, patch 2 (#988) Function: equals File: src/main/java/spark/resource/ClassPathResource.java Repository: perwendel/spark Fixed Code: @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof ClassPathResource) { ClassPathResource otherRes = (ClassPathResource) obj; ClassLoader thisLoader = this.classLoader; ClassLoader otherLoader = otherRes.classLoader; return (this.path.equals(otherRes.path) && thisLoader.equals(otherLoader) && this.clazz.equals(otherRes.clazz)); } return false; }
[ "CWE-22" ]
CVE-2018-9159
MEDIUM
5
perwendel/spark
equals
src/main/java/spark/resource/ClassPathResource.java
030e9d00125cbd1ad759668f85488aba1019c668
1
Analyze the following code function for security vulnerabilities
@Override public void revokeUriPermission(IApplicationThread caller, String targetPackage, Uri uri, final int modeFlags, int userId) { enforceNotIsolatedCaller("revokeUriPermission"); synchronized (this) { final ProcessRecord r = getRecordForAppLOSP(caller); if (r == null) { throw new SecurityException("Unable to find app for caller " + caller + " when revoking permission to uri " + uri); } if (uri == null) { Slog.w(TAG, "revokeUriPermission: null uri"); return; } if (!Intent.isAccessUriMode(modeFlags)) { return; } final String authority = uri.getAuthority(); final ProviderInfo pi = mCpHelper.getProviderInfoLocked(authority, userId, MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE); if (pi == null) { Slog.w(TAG, "No content provider found for permission revoke: " + uri.toSafeString()); return; } mUgmInternal.revokeUriPermission(targetPackage, r.uid, new GrantUri(userId, uri, modeFlags), modeFlags); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: revokeUriPermission 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
revokeUriPermission
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public List<V2SchemeSignerInfo> getV2SchemeSigners() { return mV2SchemeSigners; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getV2SchemeSigners 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
getV2SchemeSigners
src/main/java/com/android/apksig/ApkVerifier.java
039f815895f62c9f8af23df66622b66246f3f61e
0
Analyze the following code function for security vulnerabilities
private void addEntry(Entry shadeEntry) { boolean isHeadsUped = shouldPeek(shadeEntry); if (isHeadsUped) { mHeadsUpManager.showNotification(shadeEntry); // Mark as seen immediately setNotificationShown(shadeEntry.notification); } addNotificationViews(shadeEntry); // Recalculate the position of the sliding windows and the titles. setAreThereNotifications(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addEntry 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
addEntry
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Test // If the mtime of a file is in the future, we don't use it. public void staleCacheFileInTheFuture() throws Exception { PowerMockito.mockStatic(System.class); final HttpQuery query = fakeHttpQuery(); final File cachedfile = fakeFile("/cache/fake-file"); final long now = 1000L; when(System.currentTimeMillis()).thenReturn(now); when(cachedfile.lastModified()).thenReturn(now + 1000L); final long end_time = now; assertTrue("File is stale", staleCacheFile(query, end_time, 10, cachedfile)); verify(cachedfile).lastModified(); // Ensure we do a single stat() call. PowerMockito.verifyStatic(); // Verify that ... System.currentTimeMillis(); // ... this was called only once. }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: staleCacheFileInTheFuture File: test/tsd/TestGraphHandler.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2023-25826
CRITICAL
9.8
OpenTSDB/opentsdb
staleCacheFileInTheFuture
test/tsd/TestGraphHandler.java
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
0
Analyze the following code function for security vulnerabilities
private boolean hasSigningCertificate(String packageName, String certificateString) { if (packageName == null || certificateString == null) { return false; } byte[] certificate; try { certificate = new Signature(certificateString).toByteArray(); } catch (IllegalArgumentException e) { Slogf.w(LOG_TAG, "Cannot parse signing certificate: " + certificateString, e); return false; } PackageManager pm = mInjector.getPackageManager(); return pm.hasSigningCertificate( packageName, certificate, PackageManager.CERT_INPUT_SHA256); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasSigningCertificate 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
hasSigningCertificate
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Deprecated int updateNullByEmptyString(@Param("fieldName") String fieldName);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateNullByEmptyString File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45208
MEDIUM
4.3
jeecgboot/jeecg-boot
updateNullByEmptyString
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysUserMapper.java
51e2227bfe54f5d67b09411ee9a336750164e73d
0
Analyze the following code function for security vulnerabilities
public boolean hasUser(final String userName) throws IOException { update(); m_readLock.lock(); try { return m_users.containsKey(userName); } finally { m_readLock.unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasUser 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
hasUser
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
private void updateCurrentProfilesCache() { synchronized (mCurrentProfiles) { mCurrentProfiles.clear(); if (mUserManager != null) { for (UserInfo user : mUserManager.getProfiles(mCurrentUserId)) { mCurrentProfiles.put(user.id, user); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateCurrentProfilesCache 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
updateCurrentProfilesCache
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public String getRegisterActivitySubtitle() { return registerActivitySubtitle.getExpressionString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRegisterActivitySubtitle File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getRegisterActivitySubtitle
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { ((HttpBearerAuth) auth).setBearerToken(bearerToken); return this; } } throw new RuntimeException("No Bearer authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBearerToken File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/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
setBearerToken
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
void showPlayingNotification() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { createChannel(); } NotificationCompat.Builder builder = MediaStyleHelper.from(BackgroundAudioService.this, mMediaSessionCompat); if( builder == null ) { return; } builder.addAction(new NotificationCompat.Action(android.R.drawable.ic_media_previous, "Prev", MediaButtonReceiver.buildMediaButtonPendingIntent(this, PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS))); builder.addAction(new NotificationCompat.Action(android.R.drawable.ic_media_pause, "Pause", MediaButtonReceiver.buildMediaButtonPendingIntent(this, PlaybackStateCompat.ACTION_PLAY_PAUSE))); builder.addAction(new NotificationCompat.Action(android.R.drawable.ic_media_next, "Next", MediaButtonReceiver.buildMediaButtonPendingIntent(this, PlaybackStateCompat.ACTION_SKIP_TO_NEXT))); builder.setStyle(new MediaStyle() .setShowActionsInCompactView(0, 1, 2) .setShowCancelButton(true) .setCancelButtonIntent(MediaButtonReceiver.buildMediaButtonPendingIntent( this, PlaybackStateCompat.ACTION_STOP)) .setMediaSession(mMediaSessionCompat.getSessionToken())); builder.setSmallIcon(android.R.drawable.stat_notify_sync); Notification notification = builder.build(); NotificationManagerCompat.from(BackgroundAudioService.this).notify(1, notification); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showPlayingNotification 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
showPlayingNotification
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public int userIdAt(int n) { return mUidMap.keyAt(n); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: userIdAt 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
userIdAt
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Deprecated public int getCustomContentHeight() { return mCustomContentHeight; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCustomContentHeight File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getCustomContentHeight
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public JSONObject getErrorJSON(int pErrorCode, Throwable pExp, JmxRequest pJmxReq) { JSONObject jsonObject = new JSONObject(); jsonObject.put("status",pErrorCode); jsonObject.put("error",getExceptionMessage(pExp)); jsonObject.put("error_type", pExp.getClass().getName()); addErrorInfo(jsonObject, pExp, pJmxReq); if (backendManager.isDebug()) { backendManager.error("Error " + pErrorCode,pExp); } if (pJmxReq != null) { jsonObject.put("request",pJmxReq.toJSON()); } return jsonObject; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getErrorJSON File: agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
getErrorJSON
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
private void addAccount(String accountType) { Bundle addAccountOptions = new Bundle(); mPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(), 0); addAccountOptions.putParcelable(KEY_CALLER_IDENTITY, mPendingIntent); addAccountOptions.putBoolean(EXTRA_HAS_MULTIPLE_USERS, Utils.hasMultipleUsers(this)); AccountManager.get(this).addAccountAsUser( accountType, null, /* authTokenType */ null, /* requiredFeatures */ addAccountOptions, null, mCallback, null /* handler */, mUserHandle); mAddAccountCalled = true; }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2014-8609 - Severity: HIGH - CVSS Score: 7.2 Description: SECURITY: Don't pass a usable Pending Intent to 3rd parties. Unfortunately the Settings app has super powers. We shouldn't let untrusted 3rd party authenticators re-purpose those powers to their own nefarious ends. This means that we shouldn't pass along PendingIntents that can have addressing information (component, action, category) filled in by third parties. Bug: 17356824 Change-Id: I397d26c5f465ddfb0e58bbc66cd44756e58cc507 Function: addAccount File: src/com/android/settings/accounts/AddAccountSettings.java Repository: android Fixed Code: private void addAccount(String accountType) { Bundle addAccountOptions = new Bundle(); /* * The identityIntent is for the purposes of establishing the identity * of the caller and isn't intended for launching activities, services * or broadcasts. * * Unfortunately for legacy reasons we still need to support this. But * we can cripple the intent so that 3rd party authenticators can't * fill in addressing information and launch arbitrary actions. */ Intent identityIntent = new Intent(); identityIntent.setComponent(new ComponentName(SHOULD_NOT_RESOLVE, SHOULD_NOT_RESOLVE)); identityIntent.setAction(SHOULD_NOT_RESOLVE); identityIntent.addCategory(SHOULD_NOT_RESOLVE); mPendingIntent = PendingIntent.getBroadcast(this, 0, identityIntent, 0); addAccountOptions.putParcelable(KEY_CALLER_IDENTITY, mPendingIntent); addAccountOptions.putBoolean(EXTRA_HAS_MULTIPLE_USERS, Utils.hasMultipleUsers(this)); AccountManager.get(this).addAccountAsUser( accountType, null, /* authTokenType */ null, /* requiredFeatures */ addAccountOptions, null, mCallback, null /* handler */, mUserHandle); mAddAccountCalled = true; }
[ "CWE-264" ]
CVE-2014-8609
HIGH
7.2
android
addAccount
src/com/android/settings/accounts/AddAccountSettings.java
f5d3e74ecc2b973941d8adbe40c6b23094b5abb7
1
Analyze the following code function for security vulnerabilities
public IntentBuilder setForFace(boolean forFace) { mIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FACE, forFace); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setForFace 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
setForFace
src/com/android/settings/password/ChooseLockPassword.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
public void publishContentProviders(IApplicationThread caller, List<ContentProviderHolder> providers) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(caller != null ? caller.asBinder() : null); data.writeTypedList(providers); mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: publishContentProviders File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
publishContentProviders
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
protected void setAllowMethods(HttpMethod method, MutableHttpResponse response) { response.header(ACCESS_CONTROL_ALLOW_METHODS, method); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAllowMethods File: http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
setAllowMethods
http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
@Override public int setErrorParameter(BeforeEnterEvent event, ErrorParameter<NotFoundException> parameter) { String path = event.getLocation().getPath(); String additionalInfo = ""; if (parameter.hasCustomMessage()) { additionalInfo = "Reason: " + parameter.getCustomMessage(); } path = Jsoup.clean(path, Whitelist.none()); additionalInfo = Jsoup.clean(additionalInfo, Whitelist.none()); boolean productionMode = event.getUI().getSession().getConfiguration() .isProductionMode(); String template = getErrorHtml(productionMode); if (template.contains("{{routes}}")) { template = template.replace("{{routes}}", getRoutes(event)); } template = template.replace("{{additionalInfo}}", additionalInfo); template = template.replace("{{path}}", path); getElement().appendChild(new Html(template).getElement()); return HttpServletResponse.SC_NOT_FOUND; }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2021-31412 - Severity: MEDIUM - CVSS Score: 4.3 Description: chore: add a comment which explains the order Function: setErrorParameter File: flow-server/src/main/java/com/vaadin/flow/router/RouteNotFoundError.java Repository: vaadin/flow Fixed Code: @Override public int setErrorParameter(BeforeEnterEvent event, ErrorParameter<NotFoundException> parameter) { String path = event.getLocation().getPath(); String additionalInfo = ""; if (parameter.hasCustomMessage()) { additionalInfo = "Reason: " + parameter.getCustomMessage(); } path = Jsoup.clean(path, Whitelist.none()); additionalInfo = Jsoup.clean(additionalInfo, Whitelist.none()); boolean productionMode = event.getUI().getSession().getConfiguration() .isProductionMode(); String template = getErrorHtml(productionMode); // {{routes}} should be replaced first so that it's not possible to // insert {{routes}} snippet via other template values which may result // in the listing of all available routes when this shouldn't not happen if (template.contains("{{routes}}")) { template = template.replace("{{routes}}", getRoutes(event)); } template = template.replace("{{additionalInfo}}", additionalInfo); template = template.replace("{{path}}", path); getElement().appendChild(new Html(template).getElement()); return HttpServletResponse.SC_NOT_FOUND; }
[ "CWE-20" ]
CVE-2021-31412
MEDIUM
4.3
vaadin/flow
setErrorParameter
flow-server/src/main/java/com/vaadin/flow/router/RouteNotFoundError.java
bbc6cf881f43031e4c6e7ae9ac178b5128bc6347
1
Analyze the following code function for security vulnerabilities
public void dial(String phoneNumber) { Intent dialer = new Intent(android.content.Intent.ACTION_DIAL, Uri.parse("tel:" + phoneNumber)); getContext().startActivity(dialer); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dial 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
dial
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void unmuteConversation(final Conversation conversation) { conversation.setMutedTill(0); this.activity.xmppConnectionService.updateConversation(conversation); this.activity.onConversationsListItemUpdated(); refresh(); getActivity().invalidateOptionsMenu(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unmuteConversation File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
unmuteConversation
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private void checkFreed() throws SQLException { if (freed) { throw new PSQLException(GT.tr("This SQLXML object has already been freed."), PSQLState.OBJECT_NOT_IN_STATE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkFreed File: pgjdbc/src/main/java/org/postgresql/jdbc/PgSQLXML.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-611" ]
CVE-2020-13692
MEDIUM
6.8
pgjdbc
checkFreed
pgjdbc/src/main/java/org/postgresql/jdbc/PgSQLXML.java
14b62aca4764d496813f55a43d050b017e01eb65
0
Analyze the following code function for security vulnerabilities
@Override public boolean clearResetPasswordToken(ComponentName admin) { if (!mHasFeature || !mLockPatternUtils.hasSecureLockScreen()) { return false; } final CallerIdentity caller = getCallerIdentity(admin); Preconditions.checkCallAuthorization( isProfileOwner(caller) || isDefaultDeviceOwner(caller)); synchronized (getLockObject()) { final int userHandle = caller.getUserId(); DevicePolicyData policy = getUserData(userHandle); if (policy.mPasswordTokenHandle != 0) { return mInjector.binderWithCleanCallingIdentity(() -> { boolean result = mLockPatternUtils.removeEscrowToken( policy.mPasswordTokenHandle, userHandle); policy.mPasswordTokenHandle = 0; saveSettingsLocked(userHandle); return result; }); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearResetPasswordToken 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
clearResetPasswordToken
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private boolean readIf(char ch) throws IOException { if (current!=ch) { return false; } read(); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readIf File: src/main/org/hjson/JsonParser.java Repository: hjson/hjson-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34620
HIGH
7.5
hjson/hjson-java
readIf
src/main/org/hjson/JsonParser.java
91bef056d56bf968451887421c89a44af1d692ff
0
Analyze the following code function for security vulnerabilities
private File generatorUpgradeWarFile(String warName) throws IOException { ZipUtil.unZip(file.toString(), tempFilePath + File.separator); updateProcessMsg("解压安装包 " + file); Map<String, String> copyFileMap = new LinkedHashMap<>(); copyFileMap.put(PathKit.getWebRootPath() + "/WEB-INF/db.properties", tempFilePath + "/WEB-INF/"); copyFileMap.put(PathKit.getWebRootPath() + "/WEB-INF/install.lock", tempFilePath + "/WEB-INF/"); copyFileMap.put(PathKit.getWebRootPath() + Constants.ATTACHED_FOLDER, tempFilePath.toString()); copyFileMap.put(PathKit.getWebRootPath() + "/favicon.ico", tempFilePath.toString()); copyFileMap.put(PathKit.getWebRootPath() + "/error", tempFilePath.toString()); fillTemplateCopyInfo(tempFilePath, copyFileMap); doCopy(copyFileMap); List<File> fileList = new ArrayList<>(); fileList.add(tempFilePath); File tempWarFile = new File(tempFilePath.getParent() + File.separator + warName); JarPackageUtil.inJar(fileList, tempFilePath + File.separator, tempWarFile.toString()); updateProcessMsg("合成更新包 " + tempWarFile); return tempWarFile; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generatorUpgradeWarFile File: web/src/main/java/com/zrlog/web/plugin/WarUpdateVersionThread.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
generatorUpgradeWarFile
web/src/main/java/com/zrlog/web/plugin/WarUpdateVersionThread.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
@Override public boolean checkShowToOwnerOnly(WindowManager.LayoutParams attrs) { // If this switch statement is modified, modify the comment in the declarations of // the type in {@link WindowManager.LayoutParams} as well. switch (attrs.type) { default: // These are the windows that by default are shown only to the user that created // them. If this needs to be overridden, set // {@link WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS} in // {@link WindowManager.LayoutParams}. Note that permission // {@link android.Manifest.permission.INTERNAL_SYSTEM_WINDOW} is required as well. if ((attrs.privateFlags & PRIVATE_FLAG_SHOW_FOR_ALL_USERS) == 0) { return true; } break; // These are the windows that by default are shown to all users. However, to // protect against spoofing, check permissions below. case TYPE_APPLICATION_STARTING: case TYPE_BOOT_PROGRESS: case TYPE_DISPLAY_OVERLAY: case TYPE_HIDDEN_NAV_CONSUMER: case TYPE_KEYGUARD_SCRIM: case TYPE_KEYGUARD_DIALOG: case TYPE_MAGNIFICATION_OVERLAY: case TYPE_NAVIGATION_BAR: case TYPE_NAVIGATION_BAR_PANEL: case TYPE_PHONE: case TYPE_POINTER: case TYPE_PRIORITY_PHONE: case TYPE_SEARCH_BAR: case TYPE_STATUS_BAR: case TYPE_STATUS_BAR_PANEL: case TYPE_STATUS_BAR_SUB_PANEL: case TYPE_SYSTEM_DIALOG: case TYPE_UNIVERSE_BACKGROUND: case TYPE_VOLUME_OVERLAY: case TYPE_PRIVATE_PRESENTATION: break; } // Check if third party app has set window to system window type. return mContext.checkCallingOrSelfPermission( android.Manifest.permission.INTERNAL_SYSTEM_WINDOW) != PackageManager.PERMISSION_GRANTED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkShowToOwnerOnly 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
checkShowToOwnerOnly
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override public String getSessionControlBeanName() { return "userNotification"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSessionControlBeanName File: core-war/src/main/java/org/silverpeas/web/notificationuser/servlets/UserNotificationRequestRouter.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
getSessionControlBeanName
core-war/src/main/java/org/silverpeas/web/notificationuser/servlets/UserNotificationRequestRouter.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") protected final Object readResolve() throws ObjectStreamException { /* Second run */ if (this.userBean != null && this.userBeanBytes.length == 0) { return this.userBean; } /* First run */ try (ObjectInputStream in = new LookAheadObjectInputStream(new ByteArrayInputStream(this.userBeanBytes))) { this.userBean = in.readObject(); this.unloadedProperties = (Map<String, ResultLoaderMap.LoadPair>) in.readObject(); this.objectFactory = (ObjectFactory) in.readObject(); this.constructorArgTypes = (Class<?>[]) in.readObject(); this.constructorArgs = (Object[]) in.readObject(); } catch (final IOException ex) { throw (ObjectStreamException) new StreamCorruptedException().initCause(ex); } catch (final ClassNotFoundException ex) { throw (ObjectStreamException) new InvalidClassException(ex.getLocalizedMessage()).initCause(ex); } final Map<String, ResultLoaderMap.LoadPair> arrayProps = new HashMap<>(this.unloadedProperties); final List<Class<?>> arrayTypes = Arrays.asList(this.constructorArgTypes); final List<Object> arrayValues = Arrays.asList(this.constructorArgs); return this.createDeserializationProxy(userBean, arrayProps, objectFactory, arrayTypes, arrayValues); }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2020-26945 - Severity: MEDIUM - CVSS Score: 5.1 Description: Output warning when deserializing object stream with no JEP-290 filter defined Function: readResolve File: src/main/java/org/apache/ibatis/executor/loader/AbstractSerialStateHolder.java Repository: mybatis/mybatis-3 Fixed Code: @SuppressWarnings("unchecked") protected final Object readResolve() throws ObjectStreamException { /* Second run */ if (this.userBean != null && this.userBeanBytes.length == 0) { return this.userBean; } SerialFilterChecker.check(); /* First run */ try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(this.userBeanBytes))) { this.userBean = in.readObject(); this.unloadedProperties = (Map<String, ResultLoaderMap.LoadPair>) in.readObject(); this.objectFactory = (ObjectFactory) in.readObject(); this.constructorArgTypes = (Class<?>[]) in.readObject(); this.constructorArgs = (Object[]) in.readObject(); } catch (final IOException ex) { throw (ObjectStreamException) new StreamCorruptedException().initCause(ex); } catch (final ClassNotFoundException ex) { throw (ObjectStreamException) new InvalidClassException(ex.getLocalizedMessage()).initCause(ex); } final Map<String, ResultLoaderMap.LoadPair> arrayProps = new HashMap<>(this.unloadedProperties); final List<Class<?>> arrayTypes = Arrays.asList(this.constructorArgTypes); final List<Object> arrayValues = Arrays.asList(this.constructorArgs); return this.createDeserializationProxy(userBean, arrayProps, objectFactory, arrayTypes, arrayValues); }
[ "CWE-502" ]
CVE-2020-26945
MEDIUM
5.1
mybatis/mybatis-3
readResolve
src/main/java/org/apache/ibatis/executor/loader/AbstractSerialStateHolder.java
9caf480e05c389548c9889362c2cb080d728b5d8
1
Analyze the following code function for security vulnerabilities
public void excludeHosts( String hosts ) { flags.addExcludedHost( hosts ) ; }
Vulnerability Classification: - CWE: CWE-78 - CVE: CVE-2018-17228 - Severity: HIGH - CVSS Score: 7.5 Description: Adding hosts validation fixing https://github.com/narkisr/nmap4j/issues/9 Function: excludeHosts File: src/main/java/org/nmap4j/Nmap4j.java Repository: narkisr/nmap4j Fixed Code: public void excludeHosts(String hosts) { flags.addExcludedHost(hosts); }
[ "CWE-78" ]
CVE-2018-17228
HIGH
7.5
narkisr/nmap4j
excludeHosts
src/main/java/org/nmap4j/Nmap4j.java
06b58aa3345d2f977553685a026b93e61f0c491e
1
Analyze the following code function for security vulnerabilities
@Override public void clearCrossProfileIntentFilters(ComponentName who) { Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization( isProfileOwner(caller) || isDefaultDeviceOwner(caller)); int callingUserId = caller.getUserId(); synchronized (getLockObject()) { long id = mInjector.binderClearCallingIdentity(); try { UserInfo parent = mUserManager.getProfileParent(callingUserId); if (parent == null) { Slogf.e(LOG_TAG, "Cannot call clearCrossProfileIntentFilter if there is no " + "parent"); return; } // Removing those that go from the managed profile to the parent. mIPackageManager.clearCrossProfileIntentFilters( callingUserId, who.getPackageName()); // And those that go from the parent to the managed profile. // If we want to support multiple managed profiles, we will have to only remove // those that have callingUserId as their target. mIPackageManager.clearCrossProfileIntentFilters(parent.id, who.getPackageName()); } catch (RemoteException re) { // Shouldn't happen } finally { mInjector.binderRestoreCallingIdentity(id); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearCrossProfileIntentFilters 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
clearCrossProfileIntentFilters
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void sessionClosed(boolean deleteSubscriptions) { Iterator<Subscription> iterator = subscriptions.values().iterator(); while (iterator.hasNext()) { Subscription s = iterator.next(); s.setStateListener(null); if (deleteSubscriptions) { server.getSubscriptions().remove(s.getId()); server.getEventBus().post(new SubscriptionDeletedEvent(s)); List<BaseMonitoredItem<?>> deletedItems = s.deleteSubscription(); /* * Notify AddressSpaces the items for this subscription are deleted. */ byMonitoredItemType( deletedItems, dataItems -> server.getAddressSpaceManager().onDataItemsDeleted(dataItems), eventItems -> server.getAddressSpaceManager().onEventItemsDeleted(eventItems) ); server.getMonitoredItemCount().getAndUpdate(count -> count - deletedItems.size()); } iterator.remove(); } if (deleteSubscriptions) { while (publishQueue.isNotEmpty()) { ServiceRequest publishService = publishQueue.poll(); if (publishService != null) { publishService.setServiceFault(StatusCodes.Bad_SessionClosed); } } } }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2022-25897 - Severity: HIGH - CVSS Score: 7.5 Description: Allow max MonitoredItems per session to be configured via OpcUaServerConfigLimits Function: sessionClosed File: opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java Repository: eclipse/milo Fixed Code: public void sessionClosed(boolean deleteSubscriptions) { Iterator<Subscription> iterator = subscriptions.values().iterator(); while (iterator.hasNext()) { Subscription s = iterator.next(); s.setStateListener(null); if (deleteSubscriptions) { server.getSubscriptions().remove(s.getId()); server.getEventBus().post(new SubscriptionDeletedEvent(s)); List<BaseMonitoredItem<?>> deletedItems = s.deleteSubscription(); /* * Notify AddressSpaces the items for this subscription are deleted. */ byMonitoredItemType( deletedItems, dataItems -> server.getAddressSpaceManager().onDataItemsDeleted(dataItems), eventItems -> server.getAddressSpaceManager().onEventItemsDeleted(eventItems) ); monitoredItemCount.getAndUpdate(count -> count - deletedItems.size()); server.getMonitoredItemCount().getAndUpdate(count -> count - deletedItems.size()); } iterator.remove(); } if (deleteSubscriptions) { while (publishQueue.isNotEmpty()) { ServiceRequest publishService = publishQueue.poll(); if (publishService != null) { publishService.setServiceFault(StatusCodes.Bad_SessionClosed); } } } }
[ "CWE-770" ]
CVE-2022-25897
HIGH
7.5
eclipse/milo
sessionClosed
opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java
4534381760d7d9f0bf00cbf6a8449bb0d13c6ce5
1
Analyze the following code function for security vulnerabilities
public static boolean verifyDomain(String domain) { return copyright.verify(CommonConstants.CMS_FILEPATH + CommonConstants.LICENSE_FILENAME, domain); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifyDomain File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-29784
MEDIUM
5
sanluan/PublicCMS
verifyDomain
publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java
d8d7626cf51e4968fb384e1637a3c0c9921f33e9
0
Analyze the following code function for security vulnerabilities
protected InternetResource createDynamicResource(String path, Class<?> instatiate) throws ResourceNotFoundException { if (InternetResource.class.isAssignableFrom(instatiate)) { InternetResource resource; try { resource = (InternetResource) instatiate.newInstance(); addResource(path, resource); } catch (Exception e) { String message = Messages.getMessage( Messages.INSTANTIATE_RESOURCE_ERROR, instatiate .toString()); log.error(message, e); throw new ResourceNotFoundException(message, e); } return resource; } throw new FacesException(Messages .getMessage(Messages.INSTANTIATE_CLASS_ERROR)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createDynamicResource File: framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java Repository: nuxeo/richfaces-3.3 The code follows secure coding practices.
[ "CWE-502" ]
CVE-2013-4521
HIGH
7.5
nuxeo/richfaces-3.3
createDynamicResource
framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
6cbad2a6dcb70d3e33a6ce5879b1a3ad79eb1aec
0
Analyze the following code function for security vulnerabilities
public String getRemoveLinkName() { return removeLink.getComponent().getComponentName(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRemoveLinkName 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
getRemoveLinkName
src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0