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
boolean isDefer(String name, XWikiContext context) { String defaultDeferString = context.getWiki().Param(DEFER_DEFAULT_PARAM); boolean defaultDefer = StringUtils.isEmpty(defaultDeferString) || Boolean.parseBoolean(defaultDeferString); return BooleanUtils.toBooleanDefaultIfNull((Boolean) getParameter("defer", name, context), defaultDefer); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDefer File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29206
MEDIUM
5.4
xwiki/xwiki-platform
isDefer
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
0
Analyze the following code function for security vulnerabilities
public List<MetaDataDiff> getMetaDataDiff(Document origdoc, Document newdoc) throws XWikiException { try { if ((origdoc == null) && (newdoc == null)) { return Collections.emptyList(); } if (origdoc == null) { return this.doc.getMetaDataDiff(new XWikiDocument(newdoc.getDocumentReference()), newdoc.doc, getXWikiContext()); } if (newdoc == null) { return this.doc.getMetaDataDiff(origdoc.doc, new XWikiDocument(origdoc.getDocumentReference()), getXWikiContext()); } return this.doc.getMetaDataDiff(origdoc.doc, newdoc.doc, getXWikiContext()); } catch (Exception e) { java.lang.Object[] args = { origdoc.getFullName(), origdoc.getVersion(), newdoc.getVersion() }; List list = new ArrayList(); XWikiException xe = new XWikiException(XWikiException.MODULE_XWIKI_DIFF, XWikiException.ERROR_XWIKI_DIFF_METADATA_ERROR, "Error while making meta data diff of {0} between version {1} and version {2}", e, args); String errormsg = Util.getHTMLExceptionMessage(xe, getXWikiContext()); list.add(errormsg); return list; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMetaDataDiff File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getMetaDataDiff
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
protected static String escapeXML(String input) { if (null == input) return input; return input .replaceAll("&", "&amp;") .replaceAll(">", "&gt;") .replaceAll("<", "&lt;") .replaceAll("\"", "&quot;") .replaceAll("\'", "&apos;"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: escapeXML File: ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java Repository: ff4j The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
escapeXML
ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java
991df72725f78adbc413d9b0fbb676201f1882e0
0
Analyze the following code function for security vulnerabilities
protected void fillDataSerializableFactories(Node node, SerializationConfig serializationConfig) { for (Node child : childElements(node)) { final String name = cleanNodeName(child); if ("data-serializable-factory".equals(name)) { final String value = getTextContent(child); final Node factoryIdNode = child.getAttributes().getNamedItem("factory-id"); if (factoryIdNode == null) { throw new IllegalArgumentException( "'factory-id' attribute of 'data-serializable-factory' is required!"); } int factoryId = Integer.parseInt(getTextContent(factoryIdNode)); serializationConfig.addDataSerializableFactoryClass(factoryId, value); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fillDataSerializableFactories File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
fillDataSerializableFactories
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); app.writeToParcel(data, 0); data.writeInt(backupRestoreMode); mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); reply.readException(); boolean success = reply.readInt() != 0; reply.recycle(); data.recycle(); return success; }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-3832 - Severity: HIGH - CVSS Score: 8.3 Description: Don't trust callers to supply app info to bindBackupAgent() Get the canonical identity and metadata about the package from the Package Manager at time of usage rather than rely on the caller to have gotten things right, even when the caller has the system uid. Bug 28795098 Change-Id: I215786bc894dedf7ca28e9c80cefabd0e40ca877 Merge conflict resolution for ag/1133474 (referencing ag/1148862) - directly to mnc-mr2-release Function: bindBackupAgent File: core/java/android/app/ActivityManagerNative.java Repository: android Fixed Code: public boolean bindBackupAgent(String packageName, int backupRestoreMode, int userId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(packageName); data.writeInt(backupRestoreMode); data.writeInt(userId); mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); reply.readException(); boolean success = reply.readInt() != 0; reply.recycle(); data.recycle(); return success; }
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
bindBackupAgent
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
1
Analyze the following code function for security vulnerabilities
private void sendChangedNotification(int userHandle) { Intent intent = new Intent(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED); intent.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); Bundle options = new BroadcastOptions() .setDeliveryGroupPolicy(BroadcastOptions.DELIVERY_GROUP_POLICY_MOST_RECENT) .setDeferralPolicy(BroadcastOptions.DEFERRAL_POLICY_UNTIL_ACTIVE) .toBundle(); mInjector.binderWithCleanCallingIdentity(() -> mContext.sendBroadcastAsUser(intent, new UserHandle(userHandle), null, options)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendChangedNotification File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
sendChangedNotification
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onComponentTag File: server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-21242
HIGH
7.5
theonedev/onedev
onComponentTag
server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
f864053176c08f59ef2d97fea192ceca46a4d9be
0
Analyze the following code function for security vulnerabilities
@Override protected XDOM extractTitleFromContent(DocumentModelBridge document, DocumentDisplayerParameters parameters) { // Note: Ideally we should apply transformations on the document's returned XDOM here since macros could // generate headings for example or some other transformations could modify headings. However we don't do this // at the moment since it would be too costly to do so. In the future we will even probably remove the feature // of generating the title from the content. List<HeaderBlock> blocks = document.getXDOM().getBlocks(new ClassBlockMatcher(HeaderBlock.class), Block.Axes.DESCENDANT); if (!blocks.isEmpty()) { HeaderBlock heading = blocks.get(0); // Check the heading depth after which we should return null if no heading was found. if (heading.getLevel().getAsInt() <= displayConfiguration.getTitleHeadingDepth()) { XDOM headingXDOM = new XDOM(Collections.<Block> singletonList(heading)); try { TransformationContext txContext = new TransformationContext(headingXDOM, document.getSyntax(), parameters.isTransformationContextRestricted()); txContext.setTargetSyntax(parameters.getTargetSyntax()); transformationManager.performTransformations(headingXDOM, txContext); Block headingBlock = headingXDOM.getChildren().size() > 0 ? headingXDOM.getChildren().get(0) : null; if (headingBlock instanceof HeaderBlock) { return new XDOM(headingBlock.getChildren()); } } catch (TransformationException e) { getLogger().warn("Failed to extract title from document content."); } } } return null; }
Vulnerability Classification: - CWE: CWE-459 - CVE: CVE-2023-36468 - Severity: HIGH - CVSS Score: 8.8 Description: XWIKI-20594: Mark old revisions and deleted documents as restricted * Introduce a new "restricted" attribute on XWikiDocument * Mark any document that is restored from XML as restricted * Deny script right when the secure document is restricted * Make transformations restricted when the document is restricted * Do not execute Velocity in titles when the document is restricted * Make sure saved documents aren't restricted. * Add tests * Display a warning when a document is rendered in restricted mode and the user is advanced or there is actually an error in the output. Function: extractTitleFromContent File: xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/java/org/xwiki/display/internal/DocumentTitleDisplayer.java Repository: xwiki/xwiki-platform Fixed Code: @Override protected XDOM extractTitleFromContent(DocumentModelBridge document, DocumentDisplayerParameters parameters) { // Note: Ideally we should apply transformations on the document's returned XDOM here since macros could // generate headings for example or some other transformations could modify headings. However we don't do this // at the moment since it would be too costly to do so. In the future we will even probably remove the feature // of generating the title from the content. List<HeaderBlock> blocks = document.getXDOM().getBlocks(new ClassBlockMatcher(HeaderBlock.class), Block.Axes.DESCENDANT); if (!blocks.isEmpty()) { HeaderBlock heading = blocks.get(0); // Check the heading depth after which we should return null if no heading was found. if (heading.getLevel().getAsInt() <= displayConfiguration.getTitleHeadingDepth()) { XDOM headingXDOM = new XDOM(Collections.<Block> singletonList(heading)); try { TransformationContext txContext = new TransformationContext(headingXDOM, document.getSyntax(), parameters.isTransformationContextRestricted() || document.isRestricted()); txContext.setTargetSyntax(parameters.getTargetSyntax()); transformationManager.performTransformations(headingXDOM, txContext); Block headingBlock = headingXDOM.getChildren().size() > 0 ? headingXDOM.getChildren().get(0) : null; if (headingBlock instanceof HeaderBlock) { return new XDOM(headingBlock.getChildren()); } } catch (TransformationException e) { getLogger().warn("Failed to extract title from document content."); } } } return null; }
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
extractTitleFromContent
xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/java/org/xwiki/display/internal/DocumentTitleDisplayer.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
1
Analyze the following code function for security vulnerabilities
public static String name(String name) { return find().replaceAll(":template_name", name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: name File: spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
name
spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
void installEncryptionUnawareProviders(int userId) { // We're only interested in providers that are encryption unaware, and // we don't care about uninstalled apps, since there's no way they're // running at this point. final int matchFlags = GET_PROVIDERS | MATCH_DIRECT_BOOT_UNAWARE; synchronized (this) { final int NP = mProcessNames.getMap().size(); for (int ip = 0; ip < NP; ip++) { final SparseArray<ProcessRecord> apps = mProcessNames.getMap().valueAt(ip); final int NA = apps.size(); for (int ia = 0; ia < NA; ia++) { final ProcessRecord app = apps.valueAt(ia); if (app.userId != userId || app.thread == null || app.unlocked) continue; final int NG = app.pkgList.size(); for (int ig = 0; ig < NG; ig++) { try { final String pkgName = app.pkgList.keyAt(ig); final PackageInfo pkgInfo = AppGlobals.getPackageManager() .getPackageInfo(pkgName, matchFlags, userId); if (pkgInfo != null && !ArrayUtils.isEmpty(pkgInfo.providers)) { for (ProviderInfo pi : pkgInfo.providers) { // TODO: keep in sync with generateApplicationProvidersLocked final boolean processMatch = Objects.equals(pi.processName, app.processName) || pi.multiprocess; final boolean userMatch = isSingleton(pi.processName, pi.applicationInfo, pi.name, pi.flags) ? (app.userId == UserHandle.USER_SYSTEM) : true; if (processMatch && userMatch) { Log.v(TAG, "Installing " + pi); app.thread.scheduleInstallProvider(pi); } else { Log.v(TAG, "Skipping " + pi); } } } } catch (RemoteException ignored) { } } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installEncryptionUnawareProviders 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
installEncryptionUnawareProviders
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void setZoomControlsDelegate(ZoomControlsDelegate zoomControlsDelegate) { if (zoomControlsDelegate == null) { mZoomControlsDelegate = NO_OP_ZOOM_CONTROLS_DELEGATE; return; } mZoomControlsDelegate = zoomControlsDelegate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setZoomControlsDelegate File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-1021" ]
CVE-2015-1241
MEDIUM
4.3
chromium
setZoomControlsDelegate
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
public static void replyAll(Context launcher, Account account, Message message) { launch(launcher, account, message, REPLY_ALL, null, null, null, null, null /* extraValues */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replyAll File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
replyAll
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private static void maybeSetupDirectReplyTo(RMQMessage message, String replyTo) throws JMSException { if (replyTo != null && replyTo.startsWith(DIRECT_REPLY_TO)) { RMQDestination replyToDestination = new RMQDestination(DIRECT_REPLY_TO, "", replyTo, replyTo); message.setJMSReplyTo(replyToDestination); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maybeSetupDirectReplyTo File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
maybeSetupDirectReplyTo
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
@Override protected String getResourceURI() { return "/VAADIN/static/push/*"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceURI File: flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java Repository: vaadin/osgi The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-31407
MEDIUM
5
vaadin/osgi
getResourceURI
flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java
3e17674c2e3f88b6e682872c42b7d0ad7d9c4ad8
0
Analyze the following code function for security vulnerabilities
@Override public Duration deserialize(JsonParser parser, DeserializationContext context) throws IOException { switch (parser.getCurrentTokenId()) { case JsonTokenId.ID_NUMBER_FLOAT: BigDecimal value = parser.getDecimalValue(); long seconds = value.longValue(); int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); return Duration.ofSeconds(seconds, nanoseconds); case JsonTokenId.ID_NUMBER_INT: if(context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { return Duration.ofSeconds(parser.getLongValue()); } return Duration.ofMillis(parser.getLongValue()); case JsonTokenId.ID_STRING: String string = parser.getText().trim(); if (string.length() == 0) { return null; } try { return Duration.parse(string); } catch (DateTimeException e) { return _handleDateTimeException(context, e, string); } case JsonTokenId.ID_EMBEDDED_OBJECT: // 20-Apr-2016, tatu: Related to [databind#1208], can try supporting embedded // values quite easily return (Duration) parser.getEmbeddedObject(); case JsonTokenId.ID_START_ARRAY: return _deserializeFromArray(parser, context); } return _handleUnexpectedToken(context, parser, JsonToken.VALUE_STRING, JsonToken.VALUE_NUMBER_INT, JsonToken.VALUE_NUMBER_FLOAT); }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2018-1000873 - Severity: MEDIUM - CVSS Score: 4.3 Description: Avoid latency problems converting decimal to time. Fixes https://github.com/FasterXML/jackson-databind/issues/2141 Function: deserialize File: datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/DurationDeserializer.java Repository: FasterXML/jackson-modules-java8 Fixed Code: @Override public Duration deserialize(JsonParser parser, DeserializationContext context) throws IOException { switch (parser.getCurrentTokenId()) { case JsonTokenId.ID_NUMBER_FLOAT: BigDecimal value = parser.getDecimalValue(); return DecimalUtils.extractSecondsAndNanos(value, Duration::ofSeconds); case JsonTokenId.ID_NUMBER_INT: if(context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { return Duration.ofSeconds(parser.getLongValue()); } return Duration.ofMillis(parser.getLongValue()); case JsonTokenId.ID_STRING: String string = parser.getText().trim(); if (string.length() == 0) { return null; } try { return Duration.parse(string); } catch (DateTimeException e) { return _handleDateTimeException(context, e, string); } case JsonTokenId.ID_EMBEDDED_OBJECT: // 20-Apr-2016, tatu: Related to [databind#1208], can try supporting embedded // values quite easily return (Duration) parser.getEmbeddedObject(); case JsonTokenId.ID_START_ARRAY: return _deserializeFromArray(parser, context); } return _handleUnexpectedToken(context, parser, JsonToken.VALUE_STRING, JsonToken.VALUE_NUMBER_INT, JsonToken.VALUE_NUMBER_FLOAT); }
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
deserialize
datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/DurationDeserializer.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
1
Analyze the following code function for security vulnerabilities
protected LongRunningProcessStatus internalCompactionStatus(boolean authoritative) { validateTopicOwnership(topicName, authoritative); validateTopicOperation(topicName, TopicOperation.COMPACT); PersistentTopic topic = (PersistentTopic) getTopicReference(topicName); return topic.compactionStatus(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalCompactionStatus 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
internalCompactionStatus
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Override @PasswordComplexity public int getPasswordComplexity(boolean parent) { final CallerIdentity caller = getCallerIdentity(); DevicePolicyEventLogger .createEvent(DevicePolicyEnums.GET_USER_PASSWORD_COMPLEXITY_LEVEL) .setStrings(parent ? CALLED_FROM_PARENT : NOT_CALLED_FROM_PARENT, mInjector.getPackageManager().getPackagesForUid(caller.getUid())) .write(); enforceUserUnlocked(caller.getUserId()); if (parent) { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller) || isSystemUid(caller), "Only profile owner, device owner and system may call this method on parent."); } else { if (isPermissionCheckFlagEnabled()) { Preconditions.checkCallAuthorization( hasCallingOrSelfPermission(REQUEST_PASSWORD_COMPLEXITY) || hasCallingOrSelfPermission(MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS) || isDefaultDeviceOwner(caller) || isProfileOwner(caller), "Must have " + REQUEST_PASSWORD_COMPLEXITY + " or " + MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS + " permissions, or be a profile owner or device owner."); } else { Preconditions.checkCallAuthorization( hasCallingOrSelfPermission(REQUEST_PASSWORD_COMPLEXITY) || isDefaultDeviceOwner(caller) || isProfileOwner(caller), "Must have " + REQUEST_PASSWORD_COMPLEXITY + " permission, or be a profile owner or device owner."); } } synchronized (getLockObject()) { final int credentialOwner = getCredentialOwner(caller.getUserId(), parent); PasswordMetrics metrics = mLockSettingsInternal.getUserPasswordMetrics(credentialOwner); return metrics == null ? PASSWORD_COMPLEXITY_NONE : metrics.determineComplexity(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPasswordComplexity File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getPasswordComplexity
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(anyOf = {android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}) @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public @UserOperationResult int logoutUser() { // TODO(b/214336184): add CTS test try { return mService.logoutUserInternal(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logoutUser 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
logoutUser
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public int engineGetBlockSize() { if (engine.getCipher() != null) { return engine.getCipher().getBlockSize(); } else { return 0; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineGetBlockSize File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineGetBlockSize
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
@Override public String getSystemDialerPackage() { return mContext.getResources().getString(R.string.ui_default_package); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSystemDialerPackage File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
getSystemDialerPackage
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
void reportUidInfoMessageLocked(String tag, String msg, int uid) { Slog.i(TAG, msg); synchronized (mOomAdjObserverLock) { if (mCurOomAdjObserver != null && uid == mCurOomAdjUid) { mUiHandler.obtainMessage(DISPATCH_OOM_ADJ_OBSERVER_MSG, msg).sendToTarget(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportUidInfoMessageLocked 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
reportUidInfoMessageLocked
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public Set<Product> importProducts(File[] products, ProductImporter importer) throws IOException { Set<Product> productsToImport = new HashSet<Product>(); for (File product : products) { // Skip product.pem's, we just need the json to import: if (product.getName().endsWith(".json")) { log.debug("Import product: " + product.getName()); Reader reader = null; try { reader = new FileReader(product); productsToImport.add(importer.createObject(mapper, reader)); } finally { if (reader != null) { reader.close(); } } } } // TODO: Do we need to cleanup unused products? Looked at this earlier and it // looks somewhat complex and a little bit dangerous, so we're leaving them // around for now. return productsToImport; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: importProducts File: src/main/java/org/candlepin/sync/Importer.java Repository: candlepin The code follows secure coding practices.
[ "CWE-264" ]
CVE-2012-6119
LOW
2.1
candlepin
importProducts
src/main/java/org/candlepin/sync/Importer.java
f4d93230e58b969c506b4c9778e04482a059b08c
0
Analyze the following code function for security vulnerabilities
@Override public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver, IBinder activityToken) { return enqueueAssistContext(requestType, null, null, receiver, activityToken, UserHandle.getCallingUserId(), null, PENDING_ASSIST_EXTRAS_LONG_TIMEOUT) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestAssistContextExtras File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
requestAssistContextExtras
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public UIComponent createComponent(FacesContext context, Resource componentResource, ExpressionFactory expressionFactory) throws FacesException { // RELEASE_PENDING (rlubke,driscoll) this method needs review. notNull(CONTEXT, context); notNull("componentResource", componentResource); UIComponent result = null; // Use the application defined in the FacesContext as we may be calling // overriden methods Application app = context.getApplication(); ViewDeclarationLanguage vdl = app.getViewHandler().getViewDeclarationLanguage(context, context.getViewRoot().getViewId()); BeanInfo componentMetadata = vdl.getComponentMetadata(context, componentResource); if (componentMetadata != null) { BeanDescriptor componentBeanDescriptor = componentMetadata.getBeanDescriptor(); // Step 1. See if the composite component author explicitly // gave a componentType as part of the composite component metadata ValueExpression valueExpression = (ValueExpression) componentBeanDescriptor.getValue(COMPOSITE_COMPONENT_TYPE_KEY); if (valueExpression != null) { String componentType = (String) valueExpression.getValue(context.getELContext()); if (!isEmpty(componentType)) { result = app.createComponent(componentType); } } } // Step 2. If that didn't work, if a script based resource can be // found for the scriptComponentResource, see if a component can be generated from it if (result == null) { Resource scriptComponentResource = vdl.getScriptComponentResource(context, componentResource); if (scriptComponentResource != null) { result = createComponentFromScriptResource(context, scriptComponentResource, componentResource); } } // Step 3. Use the libraryName of the resource as the java package // and use the resourceName as the class name. See // if a Java class can be loaded if (result == null) { String packageName = componentResource.getLibraryName(); String className = componentResource.getResourceName(); className = packageName + '.' + className.substring(0, className.lastIndexOf('.')); try { Class<?> clazz = (Class<?>) componentMap.get(className); if (clazz == null) { clazz = loadClass(className, this); } if (clazz != ComponentResourceClassNotFound.class) { if (!associate.isDevModeEnabled()) { componentMap.put(className, clazz); } result = (UIComponent) clazz.newInstance(); } } catch (ClassNotFoundException ex) { if (!associate.isDevModeEnabled()) { componentMap.put(className, ComponentResourceClassNotFound.class); } } catch (InstantiationException | IllegalAccessException | ClassCastException ie) { throw new FacesException(ie); } } // Step 4. Use javax.faces.NamingContainer as the component type if (result == null) { result = app.createComponent("javax.faces.NamingContainer"); } result.setRendererType("javax.faces.Composite"); Map<String, Object> attrs = result.getAttributes(); attrs.put(COMPONENT_RESOURCE_KEY, componentResource); attrs.put(BEANINFO_KEY, componentMetadata); associate.getAnnotationManager().applyComponentAnnotations(context, result); pushDeclaredDefaultValuesToAttributesMap(context, componentMetadata, attrs, result, expressionFactory); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createComponent File: impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-14371
MEDIUM
5
eclipse-ee4j/mojarra
createComponent
impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java
1b434748d9239f42eae8aa7d37d7a0930c061e24
0
Analyze the following code function for security vulnerabilities
protected EntityNameValidationConfiguration getEntityNameValidationConfiguration() { if (this.entityNameValidationConfiguration == null) { this.entityNameValidationConfiguration = Utils.getComponent(EntityNameValidationConfiguration.class); } return this.entityNameValidationConfiguration; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEntityNameValidationConfiguration 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
getEntityNameValidationConfiguration
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
private PendingIntent pendingActivity(Intent intent) { return PendingIntent.getActivityAsUser(mContext, 0, intent, 0, null, UserHandle.CURRENT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pendingActivity File: packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3854
MEDIUM
5
android
pendingActivity
packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
05e0705177d2078fa9f940ce6df723312cfab976
0
Analyze the following code function for security vulnerabilities
@Override public void clearPackagePersistentPreferredActivities(ComponentName who, String callerPackageName, String packageName) { CallerIdentity caller; if (isPolicyEngineForFinanceFlagEnabled()) { caller = getCallerIdentity(who, callerPackageName); } else { caller = getCallerIdentity(who); } final int userId = caller.getUserId(); if (isPolicyEngineForFinanceFlagEnabled()) { EnforcingAdmin enforcingAdmin; if (who == null) { enforcingAdmin = enforcePermissionAndGetEnforcingAdmin( who, MANAGE_DEVICE_POLICY_LOCK_TASK, caller.getPackageName(), userId); } else { Preconditions.checkCallAuthorization(isProfileOwner(caller) || isDefaultDeviceOwner(caller) || isFinancedDeviceOwner(caller)); enforcingAdmin = getEnforcingAdminForCaller(who, callerPackageName); } clearPackagePersistentPreferredActivitiesFromPolicyEngine( enforcingAdmin, packageName, userId); } else { Objects.requireNonNull(who, "ComponentName is null"); Preconditions.checkCallAuthorization(isProfileOwner(caller) || isDefaultDeviceOwner(caller) || isFinancedDeviceOwner(caller)); synchronized (getLockObject()) { long id = mInjector.binderClearCallingIdentity(); try { mIPackageManager.clearPackagePersistentPreferredActivities(packageName, userId); mIPackageManager.flushPackageRestrictionsAsUser(userId); } catch (RemoteException re) { // Shouldn't happen Slogf.wtf( LOG_TAG, "Error when clearing package persistent preferred activities", re); } finally { mInjector.binderRestoreCallingIdentity(id); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearPackagePersistentPreferredActivities File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
clearPackagePersistentPreferredActivities
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void writeFullBackupScheduleAsync() { mBackupHandler.removeCallbacks(mFullBackupScheduleWriter); mBackupHandler.post(mFullBackupScheduleWriter); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeFullBackupScheduleAsync File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
writeFullBackupScheduleAsync
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public String toJBossSubsystemConfig(RealmModel realmModel, ClientModel clientModel, URI baseUri) { StringBuffer buffer = new StringBuffer(); buffer.append("<secure-deployment name=\"WAR MODULE NAME.war\">\n"); buffer.append(" <realm>").append(realmModel.getName()).append("</realm>\n"); buffer.append(" <auth-server-url>").append(baseUri.toString()).append("</auth-server-url>\n"); if (clientModel.isBearerOnly()){ buffer.append(" <bearer-only>true</bearer-only>\n"); } else if (clientModel.isPublicClient()) { buffer.append(" <public-client>true</public-client>\n"); } buffer.append(" <ssl-required>").append(realmModel.getSslRequired().name()).append("</ssl-required>\n"); buffer.append(" <resource>").append(clientModel.getClientId()).append("</resource>\n"); String cred = clientModel.getSecret(); if (showClientCredentialsAdapterConfig(clientModel)) { Map<String, Object> adapterConfig = getClientCredentialsAdapterConfig(clientModel); for (Map.Entry<String, Object> entry : adapterConfig.entrySet()) { buffer.append(" <credential name=\"" + entry.getKey() + "\">"); Object value = entry.getValue(); if (value instanceof Map) { buffer.append("\n"); Map<String, Object> asMap = (Map<String, Object>) value; for (Map.Entry<String, Object> credEntry : asMap.entrySet()) { buffer.append(" <" + credEntry.getKey() + ">" + credEntry.getValue().toString() + "</" + credEntry.getKey() + ">\n"); } buffer.append(" </credential>\n"); } else { buffer.append(value.toString()).append("</credential>\n"); } } } if (clientModel.getRoles().size() > 0) { buffer.append(" <use-resource-role-mappings>true</use-resource-role-mappings>\n"); } buffer.append("</secure-deployment>\n"); return buffer.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toJBossSubsystemConfig File: services/src/main/java/org/keycloak/services/managers/ClientManager.java Repository: keycloak The code follows secure coding practices.
[ "CWE-798" ]
CVE-2019-14837
MEDIUM
6.4
keycloak
toJBossSubsystemConfig
services/src/main/java/org/keycloak/services/managers/ClientManager.java
9a7c1a91a59ab85e7f8889a505be04a71580777f
0
Analyze the following code function for security vulnerabilities
@Override public ParcelableGranteeMap getKeyPairGrants(String callerPackage, String alias) { final CallerIdentity caller = getCallerIdentity(callerPackage); Preconditions.checkCallAuthorization(canChooseCertificates(caller)); final ArrayMap<Integer, Set<String>> result = new ArrayMap<>(); mInjector.binderWithCleanCallingIdentity(() -> { try (KeyChainConnection keyChainConnection = KeyChain.bindAsUser(mContext, caller.getUserHandle())) { final int[] granteeUids = keyChainConnection.getService().getGrants(alias); final PackageManager pm = mInjector.getPackageManager(caller.getUserId()); for (final int uid : granteeUids) { final String[] packages = pm.getPackagesForUid(uid); if (packages == null) { Slogf.wtf(LOG_TAG, "No packages found for uid " + uid); continue; } result.put(uid, new ArraySet<String>(packages)); } } catch (RemoteException e) { Slogf.e(LOG_TAG, "Querying keypair grants", e); } catch (InterruptedException e) { Slogf.w(LOG_TAG, "Interrupted while querying keypair grants", e); Thread.currentThread().interrupt(); } }); return new ParcelableGranteeMap(result); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKeyPairGrants 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
getKeyPairGrants
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public String getCaption() { return Messages.Hudson_Computer_Caption(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCaption File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getCaption
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@GuardedBy("mPm.mInstallLock") private File decompressPackage(String packageName, String codePath) { if (!compressedFileExists(codePath)) { if (DEBUG_COMPRESSION) { Slog.i(TAG, "No files to decompress at: " + codePath); } return null; } final File dstCodePath = PackageManagerServiceUtils.getNextCodePath(Environment.getDataAppDirectory(null), packageName); int ret = PackageManagerServiceUtils.decompressFiles(codePath, dstCodePath, packageName); if (ret == PackageManager.INSTALL_SUCCEEDED) { ret = PackageManagerServiceUtils.extractNativeBinaries(dstCodePath, packageName); } if (ret == PackageManager.INSTALL_SUCCEEDED) { // NOTE: During boot, we have to delay releasing cblocks for no other reason than // we cannot retrieve the setting {@link Secure#RELEASE_COMPRESS_BLOCKS_ON_INSTALL}. // When we no longer need to read that setting, cblock release can occur always // occur here directly if (!mPm.isSystemReady()) { if (mPm.mReleaseOnSystemReady == null) { mPm.mReleaseOnSystemReady = new ArrayList<>(); } mPm.mReleaseOnSystemReady.add(dstCodePath); } else { final ContentResolver resolver = mContext.getContentResolver(); F2fsUtils.releaseCompressedBlocks(resolver, dstCodePath); } } else { if (!dstCodePath.exists()) { return null; } new RemovePackageHelper(mPm).removeCodePathLI(dstCodePath); return null; } return dstCodePath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decompressPackage File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
decompressPackage
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
protected abstract String getBaseDirectory();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBaseDirectory File: codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java Repository: netty The code follows secure coding practices.
[ "CWE-378", "CWE-379" ]
CVE-2021-21290
LOW
1.9
netty
getBaseDirectory
codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
c735357bf29d07856ad171c6611a2e1a0e0000ec
0
Analyze the following code function for security vulnerabilities
public Object fromXML(InputStream input) { return unmarshal(hierarchicalStreamDriver.createReader(input), null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromXML File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
fromXML
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
private void handleDiscoveryStrategy(Node node, ManagedList<BeanDefinition> discoveryStrategyConfigs) { BeanDefinitionBuilder discoveryStrategyConfigBuilder = createBeanBuilder(DiscoveryStrategyConfig.class); NamedNodeMap attributes = node.getAttributes(); Node classNameNode = attributes.getNamedItem("class-name"); String className = getTextContent(classNameNode).trim(); Node implNode = attributes.getNamedItem("discovery-strategy-factory"); String implementation = getTextContent(implNode).trim(); isTrue(!className.isEmpty() || !implementation.isEmpty(), "One of 'class-name' or 'implementation' attributes is required to create DiscoveryStrategyConfig!"); if (!implementation.isEmpty()) { discoveryStrategyConfigBuilder.addConstructorArgReference(implementation); } else { discoveryStrategyConfigBuilder.addConstructorArgValue(className); } for (Node child : childElements(node)) { String name = cleanNodeName(child); if ("properties".equals(name)) { ManagedMap properties = parseProperties(child); if (!properties.isEmpty()) { discoveryStrategyConfigBuilder.addConstructorArgValue(properties); } } } discoveryStrategyConfigs.add(discoveryStrategyConfigBuilder.getBeanDefinition()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleDiscoveryStrategy File: hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
handleDiscoveryStrategy
hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private void migrate103(File dataDir, Stack<Integer> versions) { VersionedXmlDoc projectUpdatesDom; File projectUpdatesFile = new File(dataDir, "ProjectUpdates.xml"); projectUpdatesDom = new VersionedXmlDoc(); Element listElement = projectUpdatesDom.addElement("list"); for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Projects.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { String projectId = element.elementTextTrim("id"); Element updateDateElement = element.element("updateDate"); element.addElement("update").setText(projectId); Element updateElement = listElement.addElement("io.onedev.server.model.ProjectUpdate"); updateElement.addAttribute("revision", "0.0"); updateElement.addElement("id").setText(projectId); updateElement.addElement("date").setText(updateDateElement.getText().trim()); updateDateElement.detach(); element.addElement("codeAnalysisSetting"); } dom.writeToFile(file, false); } else if (file.getName().startsWith("Settings.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { if (element.elementTextTrim("key").equals("PERFORMANCE")) { Element valueElement = element.element("value"); if (valueElement != null) { valueElement.element("serverJobExecutorCpuQuota").detach(); valueElement.element("serverJobExecutorMemoryQuota").detach(); valueElement.element("cpuIntensiveTaskConcurrency").detach(); } } else if (element.elementTextTrim("key").equals("JOB_EXECUTORS")) { Element valueElement = element.element("value"); if (valueElement != null) { for (Element executorElement: valueElement.elements()) { Element mountDockerSockElement = executorElement.element("mountDockerSock"); if (mountDockerSockElement != null && mountDockerSockElement.attribute("defined-in") != null) mountDockerSockElement.detach(); } } } } dom.writeToFile(file, false); } } projectUpdatesDom.writeToFile(projectUpdatesFile, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate103 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
migrate103
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public ApiClient setServerVariables(Map<String, String> serverVariables) { this.serverVariables = serverVariables; updateBasePath(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServerVariables 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
setServerVariables
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
@Override public List<String> getAllCrossProfilePackages(int userId) { if (!mHasFeature) { return Collections.emptyList(); } final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization( isSystemUid(caller) || isRootUid(caller) || hasCallingPermission( permission.INTERACT_ACROSS_USERS) || hasCallingPermission( permission.INTERACT_ACROSS_USERS_FULL) || hasPermissionForPreflight( caller, permission.INTERACT_ACROSS_PROFILES)); synchronized (getLockObject()) { final List<ActiveAdmin> admins = getProfileOwnerAdminsForProfileGroup(userId); final List<String> packages = getCrossProfilePackagesForAdmins(admins); packages.addAll(getDefaultCrossProfilePackages()); return packages; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllCrossProfilePackages File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getAllCrossProfilePackages
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Deprecated public String printStrackTrace(Throwable e) { StringWriter strwriter = new StringWriter(); PrintWriter writer = new PrintWriter(strwriter); e.printStackTrace(writer); return strwriter.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: printStrackTrace File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
printStrackTrace
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public String getAssistiveCaption() { return getState(false).assistiveCaption; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAssistiveCaption 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
getAssistiveCaption
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public int getIsSyncable(Account account, String providerName) { return getIsSyncableAsUser(account, providerName, UserHandle.getCallingUserId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIsSyncable File: services/core/java/com/android/server/content/ContentService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2426
MEDIUM
4.3
android
getIsSyncable
services/core/java/com/android/server/content/ContentService.java
63363af721650e426db5b0bdfb8b2d4fe36abdb0
0
Analyze the following code function for security vulnerabilities
public String includeTopic(String topic) throws XWikiException { return includeTopic(topic, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: includeTopic File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
includeTopic
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
@Override public Integer getInt(K name) { V v = get(name); try { return v != null ? toInt(name, v) : null; } catch (RuntimeException ignore) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInt File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
getInt
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
private void handleGet(HttpServerResponse response, RoutingContext ctx, String requestedCharset) { if (allowGet) { try { JsonObject input = getJsonObjectFromQueryParameters(ctx); if (input.containsKey(QUERY)) { doRequest(input, response, ctx, requestedCharset); } else { response.setStatusCode(400).end(MISSING_OPERATION); } } catch (UnsupportedEncodingException uee) { throw new RuntimeException(uee); } } else { response.setStatusCode(405).end(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleGet File: extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-444" ]
CVE-2022-2466
CRITICAL
9.8
quarkusio/quarkus
handleGet
extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java
08e5c3106ce4bfb18b24a38514eeba6464668b07
0
Analyze the following code function for security vulnerabilities
public HttpRequest keepAlive(final HttpResponse httpResponse, final boolean doContinue) { boolean keepAlive = httpResponse.isConnectionPersistent(); if (keepAlive) { final HttpConnection previousConnection = httpResponse.getHttpRequest().httpConnection; if (previousConnection != null) { // keep using the connection! this.httpConnection = previousConnection; this.httpConnectionProvider = httpResponse.getHttpRequest().connectionProvider(); } //keepAlive = true; (already set) } else { // close previous connection httpResponse.close(); // force keep-alive on new request keepAlive = true; } // if we don't want to continue with this persistent session, mark this connection as closed if (!doContinue) { keepAlive = false; } connectionKeepAlive(keepAlive); // if connection is not opened, open it using previous connection provider if (httpConnection == null) { open(httpResponse.getHttpRequest().connectionProvider()); } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: keepAlive File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
keepAlive
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
private void migrate67(File dataDir, Stack<Integer> versions) { Map<String, Element> compareContexts = new HashMap<>(); for (File file: dataDir.listFiles()) { if (file.getName().startsWith("JestTestMetric.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) element.setName("io.onedev.server.model.UnitTestMetric"); String newFileName = file.getName().replace("Jest", "Unit"); dom.writeToFile(new File(dataDir, newFileName), false); FileUtils.deleteFile(file); } else if (file.getName().startsWith("CloverMetric.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) element.setName("io.onedev.server.model.CoverageMetric"); String newFileName = file.getName().replace("Clover", "Coverage"); dom.writeToFile(new File(dataDir, newFileName), false); FileUtils.deleteFile(file); } else if (file.getName().startsWith("CheckstyleMetric.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) element.setName("io.onedev.server.model.ProblemMetric"); String newFileName = file.getName().replace("Checkstyle", "Problem"); dom.writeToFile(new File(dataDir, newFileName), false); FileUtils.deleteFile(file); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate67 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
migrate67
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public static NativeArray jsFunction_getTopRatedAPIs(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws ScriptException, APIManagementException { NativeArray myn = new NativeArray(0); if (args != null && isStringArray(args)) { String limitArg = args[0].toString(); int limit = Integer.parseInt(limitArg); Set<API> apiSet; APIConsumer apiConsumer = getAPIConsumer(thisObj); try { apiSet = apiConsumer.getTopRatedAPIs(limit); } catch (APIManagementException e) { log.error("Error from Registry API while getting Top Rated APIs Information", e); return myn; } catch (Exception e) { log.error("Error while getting Top Rated APIs Information", e); return myn; } Iterator it = apiSet.iterator(); int i = 0; while (it.hasNext()) { NativeObject row = new NativeObject(); Object apiObject = it.next(); API api = (API) apiObject; APIIdentifier apiIdentifier = api.getId(); row.put("name", row, apiIdentifier.getApiName()); row.put("provider", row, APIUtil.replaceEmailDomainBack(apiIdentifier.getProviderName())); row.put("version", row, apiIdentifier.getVersion()); row.put("description", row, api.getDescription()); row.put("rates", row, api.getRating()); myn.put(i, myn, row); i++; } }// end of the if return myn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_getTopRatedAPIs File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_getTopRatedAPIs
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
public String getHelpFile(Klass<?> clazz, String fieldName) { String v = helpRedirect.get(fieldName); if (v!=null) return v; for (Klass<?> c : clazz.getAncestors()) { String page = "/descriptor/" + getId() + "/help"; String suffix; if(fieldName==null) { suffix=""; } else { page += '/'+fieldName; suffix='-'+fieldName; } try { if(Stapler.getCurrentRequest().getView(c,"help"+suffix)!=null) return page; } catch (IOException e) { throw new Error(e); } if(getStaticHelpUrl(c, suffix) !=null) return page; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHelpFile File: core/src/main/java/hudson/model/Descriptor.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getHelpFile
core/src/main/java/hudson/model/Descriptor.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override public boolean accepts(String url) { return isNotBlank(url) && url.startsWith("jdbc:postgresql:"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: accepts File: db-support/db-support-postgresql/src/main/java/com/thoughtworks/go/server/database/pg/PostgresqlBackupProcessor.java Repository: gocd The code follows secure coding practices.
[ "CWE-532" ]
CVE-2023-28630
MEDIUM
4.4
gocd
accepts
db-support/db-support-postgresql/src/main/java/com/thoughtworks/go/server/database/pg/PostgresqlBackupProcessor.java
6545481e7b36817dd6033bf614585a8db242070d
0
Analyze the following code function for security vulnerabilities
@Override public StaticHandler setMaxCacheSize(int maxCacheSize) { if (maxCacheSize < 1) { throw new IllegalArgumentException("maxCacheSize must be >= 1"); } this.maxCacheSize = maxCacheSize; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMaxCacheSize File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-12542
HIGH
7.5
vert-x3/vertx-web
setMaxCacheSize
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
private String columnName(String name, boolean shortName) { String out = name; if (shortName) { String[] p = name.split("\\."); out = p[p.length - 1]; } return out; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: columnName File: console/src/main/java/org/jline/console/impl/DefaultPrinter.java Repository: jline/jline3 The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-50572
MEDIUM
5.5
jline/jline3
columnName
console/src/main/java/org/jline/console/impl/DefaultPrinter.java
f3c60a3e6255e8e0c20d5043a4fe248446f292bb
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") private static Map describeBean(Object o) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException { Map<?,?> m = PropertyUtils.describe(o); for (Entry e : m.entrySet()) { Object v = e.getValue(); if (v instanceof char[]) { char[] chars = (char[]) v; e.setValue(new String(chars)); } } return m; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: describeBean File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
describeBean
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
@Override public CleanResults getResults() { return results; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResults File: src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-28367
MEDIUM
4.3
nahsra/antisamy
getResults
src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
0199e7e194dba5e7d7197703f43ebe22401e61ae
0
Analyze the following code function for security vulnerabilities
private void handleNetworkDisconnect(boolean newConnectionInProgress, int disconnectReason) { mWifiMetrics.reportNetworkDisconnect(mInterfaceName, disconnectReason, mWifiInfo.getRssi(), mWifiInfo.getLinkSpeed()); if (mVerboseLoggingEnabled) { Log.v(getTag(), "handleNetworkDisconnect: newConnectionInProgress: " + newConnectionInProgress, new Throwable()); } WifiConfiguration wifiConfig = getConnectedWifiConfigurationInternal(); if (wifiConfig != null) { ScanResultMatchInfo matchInfo = ScanResultMatchInfo.fromWifiConfiguration(wifiConfig); // WakeupController should only care about the primary, internet providing network if (isPrimary()) { mWakeupController.setLastDisconnectInfo(matchInfo); } } stopRssiMonitoringOffload(); clearTargetBssid("handleNetworkDisconnect"); // Don't stop DHCP if Fils connection is in progress. if (newConnectionInProgress && mIpClientWithPreConnection) { if (mVerboseLoggingEnabled) { log("handleNetworkDisconnect: Don't stop IpClient as fils connection in progress: " + " mLastNetworkId: " + mLastNetworkId + " mTargetNetworkId" + mTargetNetworkId); } } else { stopDhcpSetup(); } // DISASSOC_AP_BUSY could be received in both after L3 connection is successful or right // after BSSID association if the AP can't accept more stations. if (disconnectReason == StaIfaceReasonCode.DISASSOC_AP_BUSY) { mWifiConfigManager.setRecentFailureAssociationStatus( mWifiInfo.getNetworkId(), WifiConfiguration.RECENT_FAILURE_DISCONNECTION_AP_BUSY); } mWifiScoreReport.stopConnectedNetworkScorer(); /* Reset data structures */ mWifiScoreReport.reset(); mWifiInfo.reset(); /* Reset roaming parameters */ mIsAutoRoaming = false; sendNetworkChangeBroadcast(DetailedState.DISCONNECTED); if (mNetworkAgent != null) { mNetworkAgent.unregister(); mNetworkAgent = null; mQosPolicyRequestHandler.setNetworkAgent(null); } /* Clear network properties */ clearLinkProperties(); mLastBssid = null; mLastLinkLayerStats = null; registerDisconnected(); mLastNetworkId = WifiConfiguration.INVALID_NETWORK_ID; mLastSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; mCurrentConnectionDetectedCaptivePortal = false; mLastSimBasedConnectionCarrierName = null; checkAbnormalDisconnectionAndTakeBugReport(); mWifiScoreCard.resetConnectionState(mInterfaceName); updateLayer2Information(); // If there is new connection in progress, this is for the new connection, so keept it. if (!newConnectionInProgress) { mIsUserSelected = false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleNetworkDisconnect File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
handleNetworkDisconnect
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private void clearManagedProfileApnUnchecked() { if (!mHasTelephonyFeature) { return; } if (!LocalServices.getService(SystemServiceManager.class).isBootCompleted()) { Slogf.i(LOG_TAG, "Skip clearing managed profile Apn before boot completed"); // Cannot talk to APN content provider before system boots // Ideally we should delay the cleanup post boot_completed, not just // skipping it altogether. return; } final List<ApnSetting> apns = getOverrideApnsUnchecked(); for (ApnSetting apn : apns) { if (apn.getApnTypeBitmask() == ApnSetting.TYPE_ENTERPRISE) { removeOverrideApnUnchecked(apn.getId()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearManagedProfileApnUnchecked File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
clearManagedProfileApnUnchecked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public int getPrivateFlagsForUid(int uid) { synchronized (mPackages) { Object obj = mSettings.getUserIdLPr(UserHandle.getAppId(uid)); if (obj instanceof SharedUserSetting) { final SharedUserSetting sus = (SharedUserSetting) obj; return sus.pkgPrivateFlags; } else if (obj instanceof PackageSetting) { final PackageSetting ps = (PackageSetting) obj; return ps.pkgPrivateFlags; } } return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPrivateFlagsForUid 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
getPrivateFlagsForUid
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public int installExistingPackageAsUser(String packageName, int userId) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.INSTALL_PACKAGES, null); PackageSetting pkgSetting; final int uid = Binder.getCallingUid(); enforceCrossUserPermission(uid, userId, true, true, "installExistingPackage for user " + userId); if (isUserRestricted(userId, UserManager.DISALLOW_INSTALL_APPS)) { return PackageManager.INSTALL_FAILED_USER_RESTRICTED; } long callingId = Binder.clearCallingIdentity(); try { boolean sendAdded = false; // writer synchronized (mPackages) { pkgSetting = mSettings.mPackages.get(packageName); if (pkgSetting == null) { return PackageManager.INSTALL_FAILED_INVALID_URI; } if (!pkgSetting.getInstalled(userId)) { pkgSetting.setInstalled(true, userId); pkgSetting.setHidden(false, userId); mSettings.writePackageRestrictionsLPr(userId); sendAdded = true; } } if (sendAdded) { sendPackageAddedForUser(packageName, pkgSetting, userId); } } finally { Binder.restoreCallingIdentity(callingId); } return PackageManager.INSTALL_SUCCEEDED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installExistingPackageAsUser 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
installExistingPackageAsUser
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public int[] getAppWidgetIds() { try { if (sService == null) { bindService(); } return sService.getAppWidgetIdsForHost(mContextOpPackageName, mHostId); } catch (RemoteException e) { throw new RuntimeException("system server dead?", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppWidgetIds File: core/java/android/appwidget/AppWidgetHost.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
getAppWidgetIds
core/java/android/appwidget/AppWidgetHost.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("deprecation") public static ProgramWorkflow getWorkflow(String identifier) { ProgramWorkflow workflow = null; if (identifier != null) { identifier = identifier.trim(); // first try to fetch by id try { Integer id = Integer.valueOf(identifier); workflow = getWorkflow(id); if (workflow != null) { return workflow; } } catch (NumberFormatException e) {} // if not, try to fetch by uuid if (isValidUuidFormat(identifier)) { workflow = Context.getProgramWorkflowService().getWorkflowByUuid(identifier); if (workflow != null) { return workflow; } } // finally, try to fetch by concept map // handle mapping id: xyz:ht int index = identifier.indexOf(":"); if (index != -1) { Concept concept = getConcept(identifier); // iterate through workflows until we see if we find a match if (concept != null) { for (Program program : Context.getProgramWorkflowService().getAllPrograms(false)) { for (ProgramWorkflow w : program.getAllWorkflows()) { if (w.getConcept().equals(concept)) { return w; } } } } } } return workflow; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWorkflow File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java Repository: openmrs/openmrs-module-htmlformentry The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-16521
HIGH
7.5
openmrs/openmrs-module-htmlformentry
getWorkflow
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
9dcd304688e65c31cac5532fe501b9816ed975ae
0
Analyze the following code function for security vulnerabilities
public static PSystemVersion createShowAuthors2(UmlSource source) { // Duplicate in OptionPrint final List<String> strings = getAuthorsStrings(true); return new PSystemVersion(source, true, strings); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createShowAuthors2 File: src/net/sourceforge/plantuml/version/PSystemVersion.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
createShowAuthors2
src/net/sourceforge/plantuml/version/PSystemVersion.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
String reportOnTime() { long now = mClock.getWallClockMillis(); StringBuilder sb = new StringBuilder(); // Report stats since last report int on = mOnTime - mOnTimeLastReport; mOnTimeLastReport = mOnTime; int tx = mTxTime - mTxTimeLastReport; mTxTimeLastReport = mTxTime; int rx = mRxTime - mRxTimeLastReport; mRxTimeLastReport = mRxTime; int period = (int) (now - mLastOntimeReportTimeStamp); mLastOntimeReportTimeStamp = now; sb.append("[on:" + on + " tx:" + tx + " rx:" + rx + " period:" + period + "]"); // Report stats since Screen State Changed on = mOnTime - mOnTimeScreenStateChange; period = (int) (now - mLastScreenStateChangeTimeStamp); sb.append(" from screen [on:" + on + " period:" + period + "]"); return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportOnTime File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
reportOnTime
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private boolean ensureConfigAndVisibilityAfterUpdate(ActivityRecord starting, int changes) { boolean kept = true; final ActivityStack mainStack = mStackSupervisor.getFocusedStack(); // mainStack is null during startup. if (mainStack != null) { if (changes != 0 && starting == null) { // If the configuration changed, and the caller is not already // in the process of starting an activity, then find the top // activity to check if its configuration needs to change. starting = mainStack.topRunningActivityLocked(); } if (starting != null) { kept = starting.ensureActivityConfiguration(changes, false /* preserveWindow */); // And we need to make sure at this point that all other activities // are made visible with the correct configuration. mStackSupervisor.ensureActivitiesVisibleLocked(starting, changes, !PRESERVE_WINDOWS); } } return kept; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ensureConfigAndVisibilityAfterUpdate 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
ensureConfigAndVisibilityAfterUpdate
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public VerifyCredentialResponse checkPattern(String pattern, int userId) throws RemoteException { return doVerifyPattern(pattern, false, 0, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPattern File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-255" ]
CVE-2016-3749
MEDIUM
4.6
android
checkPattern
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
0
Analyze the following code function for security vulnerabilities
@Override protected void onDestroy() { super.onDestroy(); AndroidNativeUtil.onDestroy(); if (isBillingEnabled()) { getBillingSupport().onDestroy(); } unlockScreen(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDestroy File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
onDestroy
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
protected void deleteWikiPage(OLATResourceable ores, WikiPage page) { String name = page.getPageName(); // do not delete default pages if (name.equals(WikiPage.WIKI_INDEX_PAGE) || name.equals(WikiPage.WIKI_MENU_PAGE)) return; VFSContainer wikiContentContainer = getWikiContainer(ores, WIKI_RESOURCE_FOLDER_NAME); VFSContainer versionsContainer = getWikiContainer(ores, VERSION_FOLDER_NAME); //delete content and property file VFSItem item = wikiContentContainer.resolve(page.getPageId() + "." + WIKI_FILE_SUFFIX); if (item != null) item.delete(); item = wikiContentContainer.resolve(page.getPageId() + "." + WIKI_PROPERTIES_SUFFIX); if (item != null) item.delete(); //delete all version files of the page List<VFSItem> leafs = versionsContainer.getItems(new VFSLeafFilter()); if (leafs.size() > 0) { for (Iterator<VFSItem> iter = leafs.iterator(); iter.hasNext();) { VFSLeaf leaf = (VFSLeaf) iter.next(); String filename = leaf.getName(); if (filename.startsWith(page.getPageId())) { leaf.delete(); } } } log.info(Tracing.M_AUDIT, "Deleted wiki page with name: " + page.getPageName() + " from resourcable id: "+ ores.getResourceableId()); if (wikiCache!=null) { wikiCache.update(OresHelper.createStringRepresenting(ores), getOrLoadWiki(ores)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteWikiPage File: src/main/java/org/olat/modules/wiki/WikiManager.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
deleteWikiPage
src/main/java/org/olat/modules/wiki/WikiManager.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
public XWikiDocumentArchive getDocumentArchive() { // If there is a soft reference, return it. if (this.archive != null) { return this.archive.get(); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDocumentArchive File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getDocumentArchive
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public int compareTo(SFile other) { return this.internal.compareTo(other.internal); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: compareTo File: src/net/sourceforge/plantuml/security/SFile.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
compareTo
src/net/sourceforge/plantuml/security/SFile.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
public void onUpChanged(boolean isUp) { if (isUp && mFailedToResetMacAddress) { // When the firmware does a subsystem restart, wifi will disconnect but we may fail to // re-randomize the MAC address of the interface since it's undergoing recovery. Thus, // check every time the interface goes up and re-randomize if the failure was detected. if (mWifiGlobals.isConnectedMacRandomizationEnabled()) { mFailedToResetMacAddress = !mWifiNative.setStaMacAddress( mInterfaceName, MacAddressUtils.createRandomUnicastAddress()); if (mFailedToResetMacAddress) { Log.e(getTag(), "Failed to set random MAC address on interface up"); } } } // No need to handle interface down since it's already handled in the ClientModeManager. }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUpChanged File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
onUpChanged
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public void onCreate(final SQLiteDatabase db) { if (Constants.LOGVV) { Log.v(Constants.TAG, "populating new database"); } onUpgrade(db, 0, DB_VERSION); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreate 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
onCreate
src/com/android/providers/downloads/DownloadProvider.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
private Long getForkedRoot38(Map<Long, Long> forkedFroms, Long projectId) { Long forkedFrom = forkedFroms.get(projectId); if (forkedFrom != null) return getForkedRoot38(forkedFroms, forkedFrom); else return projectId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getForkedRoot38 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
getForkedRoot38
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public MainHeader getMainHeader() { return newMhd; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMainHeader File: src/main/java/com/github/junrar/Archive.java Repository: junrar The code follows secure coding practices.
[ "CWE-835" ]
CVE-2018-12418
MEDIUM
4.3
junrar
getMainHeader
src/main/java/com/github/junrar/Archive.java
ad8d0ba8e155630da8a1215cee3f253e0af45817
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public static int getReaderNumber(Collection<String> nodeIds, String localNodeId) { String[] readers = nodeIds.toArray(new String[0]); Arrays.sort(readers); return Arrays.binarySearch(readers, localNodeId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReaderNumber File: server/src/main/java/io/crate/execution/engine/collect/sources/FileCollectSource.java Repository: crate The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-24565
MEDIUM
6.5
crate
getReaderNumber
server/src/main/java/io/crate/execution/engine/collect/sources/FileCollectSource.java
4e857d675683095945dd524d6ba03e692c70ecd6
0
Analyze the following code function for security vulnerabilities
public void writeFieldEnd() {}
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeFieldEnd File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
writeFieldEnd
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
public boolean isPackageGranted(String pkg) { return pkg != null && getGrantedPackages().contains(pkg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPackageGranted File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
isPackageGranted
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
private static Bundle cloneIfLocalBinder(Bundle bundle) { // Note: this is only a shallow copy. For now this will be fine, but it could be problematic // if we start adding objects to the options. Further, it would only be an issue if keyguard // used such options. if (isLocalBinder() && bundle != null) { return (Bundle) bundle.clone(); } return bundle; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cloneIfLocalBinder File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
cloneIfLocalBinder
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@Override public final int startActivityWithConfig(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, Configuration config, Bundle options, int userId) { enforceNotIsolatedCaller("startActivityWithConfig"); userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, ALLOW_FULL_ONLY, "startActivityWithConfig", null); // TODO: Switch to user app stacks here. int ret = mStackSupervisor.startActivityMayWait(caller, -1, callingPackage, intent, resolvedType, null, null, resultTo, resultWho, requestCode, startFlags, null, null, config, options, userId, null, null); return ret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityWithConfig 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
startActivityWithConfig
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public void setUpdateUserId(Long updateUserId) { this.updateUserId = updateUserId; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-7171 - Severity: LOW - CVSS Score: 3.3 Description: fix(novel-admin): 友情链接URL格式校验 Function: setUpdateUserId File: novel-admin/src/main/java/com/java2nb/novel/domain/FriendLinkDO.java Repository: 201206030/novel-plus Fixed Code: public void setUpdateUserId(Long updateUserId) { this.updateUserId = updateUserId; }
[ "CWE-79" ]
CVE-2023-7171
LOW
3.3
201206030/novel-plus
setUpdateUserId
novel-admin/src/main/java/com/java2nb/novel/domain/FriendLinkDO.java
d6093d8182362422370d7eaf6c53afde9ee45215
1
Analyze the following code function for security vulnerabilities
public String getDomainSuffixMatch() { return getFieldValue(DOM_SUFFIX_MATCH_KEY, ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDomainSuffixMatch File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
getDomainSuffixMatch
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
private boolean isUserLimitReachedLocked() { return getAliveUsersExcludingGuestsCountLocked() >= UserManager.getMaxSupportedUsers(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUserLimitReachedLocked File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
isUserLimitReachedLocked
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
long getLastStopAppSwitchesTime() { return mLastStopAppSwitchesTime; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLastStopAppSwitchesTime 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
getLastStopAppSwitchesTime
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@RequestMapping(value = CREATE_AND_GET_URL + ".{format:\\w+}", method = RequestMethod.POST) public final void createReportAndGetNoAppId( @PathVariable final String format, @RequestBody final String requestData, @RequestParam(value = "inline", defaultValue = "false") final boolean inline, final HttpServletRequest createReportRequest, final HttpServletResponse createReportResponse) throws IOException, ServletException, InterruptedException, NoSuchAppException { setNoCache(createReportResponse); PJsonObject spec = parseJson(requestData, createReportResponse); if (spec == null) { return; } String appId = spec.optString(JSON_APP, DEFAULT_CONFIGURATION_FILE_KEY); createReportAndGet(appId, format, requestData, inline, createReportRequest, createReportResponse); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createReportAndGetNoAppId File: core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java Repository: mapfish/mapfish-print The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-15231
MEDIUM
4.3
mapfish/mapfish-print
createReportAndGetNoAppId
core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
89155f2506b9cee822e15ce60ccae390a1419d5e
0
Analyze the following code function for security vulnerabilities
public void quietlyRemoveAndMoveChildrenTo(final DomNode destination) { if (destination.getPage() != getPage()) { throw new RuntimeException("Cannot perform quiet move on nodes from different pages."); } for (final DomNode child : getChildren()) { child.basicRemove(); destination.basicAppend(child); } basicRemove(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: quietlyRemoveAndMoveChildrenTo 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
quietlyRemoveAndMoveChildrenTo
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
private void handleFromNotification() { int apiVersion = ApiUtils.getConversationApiVersion(conversationUser, new int[]{ApiUtils.APIv4, 1}); ncApi.getRooms(credentials, ApiUtils.getUrlForRooms(apiVersion, baseUrl)) .retry(3) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<RoomsOverall>() { @Override public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) { // unused atm } @Override public void onNext(@io.reactivex.annotations.NonNull RoomsOverall roomsOverall) { for (Conversation conversation : roomsOverall.getOcs().getData()) { if (roomId.equals(conversation.getRoomId())) { roomToken = conversation.getToken(); break; } } checkPermissions(); } @Override public void onError(@io.reactivex.annotations.NonNull Throwable e) { // unused atm } @Override public void onComplete() { // unused atm } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleFromNotification File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
handleFromNotification
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
private boolean deviceHasKeyguard() { for (UserInfo userInfo : mUserManager.getUsers()) { if (mLockPatternUtils.isSecure(userInfo.id)) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deviceHasKeyguard 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
deviceHasKeyguard
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Column(name = "name", nullable = false, length = 50) public String getName() { return this.name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getName File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogLogin.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
getName
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogLogin.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
public int getPendingOperationCount() { synchronized (mAuthorities) { return mPendingOperations.size(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPendingOperationCount File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
getPendingOperationCount
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
public NetworkUpdateResult addOrUpdateNetwork(WifiConfiguration config, int uid) { return addOrUpdateNetwork(config, uid, null, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addOrUpdateNetwork File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
addOrUpdateNetwork
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private void setOriginalMetadataAuthorReference(String serializedUserReference) { if (!StringUtils.isEmpty(serializedUserReference)) { UserReference userReference = userStringToUserReference(serializedUserReference); this.authors.setOriginalMetadataAuthor(userReference); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOriginalMetadataAuthorReference File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
setOriginalMetadataAuthorReference
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
private static Route[] routes(final Set<Route.Definition> routeDefs, final String method, final String path, final MediaType type, final List<MediaType> accept) { List<Route> routes = findRoutes(routeDefs, method, path, type, accept); routes.add(RouteImpl.fallback((req, rsp, chain) -> { if (!rsp.status().isPresent()) { // 406 or 415 Err ex = handle406or415(routeDefs, method, path, type, accept); if (ex != null) { throw ex; } // 405 ex = handle405(routeDefs, method, path, type, accept); if (ex != null) { throw ex; } // favicon.ico if (path.equals("/favicon.ico")) { // default /favicon.ico handler: rsp.status(Status.NOT_FOUND).end(); } else { throw new Err(Status.NOT_FOUND, req.path(true)); } } }, method, path, "err", accept)); return routes.toArray(new Route[routes.size()]); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2019-15477 - Severity: MEDIUM - CVSS Score: 4.3 Description: Avoiding possible XSS attack through the default error handler. See jooby-project/jooby#1366 Function: routes File: jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java Repository: jooby-project/jooby Fixed Code: private static Route[] routes(final Set<Route.Definition> routeDefs, final String method, final String path, final MediaType type, final List<MediaType> accept) { List<Route> routes = findRoutes(routeDefs, method, path, type, accept); routes.add(RouteImpl.fallback((req, rsp, chain) -> { if (!rsp.status().isPresent()) { // 406 or 415 Err ex = handle406or415(routeDefs, method, path, type, accept); if (ex != null) { throw ex; } // 405 ex = handle405(routeDefs, method, path, type, accept); if (ex != null) { throw ex; } // favicon.ico if (path.equals("/favicon.ico")) { // default /favicon.ico handler: rsp.status(Status.NOT_FOUND).end(); } else { throw new Err(Status.NOT_FOUND, req.path()); } } }, method, path, "err", accept)); return routes.toArray(new Route[routes.size()]); }
[ "CWE-79" ]
CVE-2019-15477
MEDIUM
4.3
jooby-project/jooby
routes
jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java
34856a738829d8fedca4ed27bd6ff413af87186f
1
Analyze the following code function for security vulnerabilities
@Override public boolean updateShortcuts(String packageName, ParceledListSlice shortcutInfoList, @UserIdInt int userId) { verifyCaller(packageName, userId); final boolean unlimited = injectHasUnlimitedShortcutsApiCallsPermission( injectBinderCallingPid(), injectBinderCallingUid()); final List<ShortcutInfo> newShortcuts = (List<ShortcutInfo>) shortcutInfoList.getList(); verifyShortcutInfoPackages(packageName, newShortcuts); final int size = newShortcuts.size(); final List<ShortcutInfo> changedShortcuts = new ArrayList<>(1); final ShortcutPackage ps; synchronized (mLock) { throwIfUserLockedL(userId); ps = getPackageShortcutsForPublisherLocked(packageName, userId); ps.ensureImmutableShortcutsNotIncluded(newShortcuts, /*ignoreInvisible=*/ true); ps.ensureNoBitmapIconIfShortcutIsLongLived(newShortcuts); ps.ensureAllShortcutsVisibleToLauncher(newShortcuts); // For update, don't fill in the default activity. Having null activity means // "don't update the activity" here. ps.enforceShortcutCountsBeforeOperation(newShortcuts, OPERATION_UPDATE); // Throttling. if (!ps.tryApiCall(unlimited)) { return false; } // Initialize the implicit ranks for ShortcutPackage.adjustRanks(). ps.clearAllImplicitRanks(); assignImplicitRanks(newShortcuts); for (int i = 0; i < size; i++) { final ShortcutInfo source = newShortcuts.get(i); fixUpIncomingShortcutInfo(source, /* forUpdate= */ true); ps.mutateShortcut(source.getId(), null, target -> { // Invisible shortcuts can't be updated. if (target == null || !target.isVisibleToPublisher()) { return; } if (target.isEnabled() != source.isEnabled()) { Slog.w(TAG, "ShortcutInfo.enabled cannot be changed with" + " updateShortcuts()"); } if (target.isLongLived() != source.isLongLived()) { Slog.w(TAG, "ShortcutInfo.longLived cannot be changed with" + " updateShortcuts()"); } // When updating the rank, we need to insert between existing ranks, // so set this setRankChanged, and also copy the implicit rank fo // adjustRanks(). if (source.hasRank()) { target.setRankChanged(); target.setImplicitRank(source.getImplicitRank()); } final boolean replacingIcon = (source.getIcon() != null); if (replacingIcon) { ps.removeIcon(target); } // Note copyNonNullFieldsFrom() does the "updatable with?" check too. target.copyNonNullFieldsFrom(source); target.setTimestamp(injectCurrentTimeMillis()); if (replacingIcon) { saveIconAndFixUpShortcutLocked(ps, target); } // When we're updating any resource related fields, re-extract the res // names and the values. if (replacingIcon || source.hasStringResources()) { fixUpShortcutResourceNamesAndValues(target); } changedShortcuts.add(target); }); } // Lastly, adjust the ranks. ps.adjustRanks(); } packageShortcutsChanged(ps, changedShortcuts.isEmpty() ? null : changedShortcuts, null); verifyStates(); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateShortcuts 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
updateShortcuts
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public GlobalVars getGlobals() { return globals; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getGlobals File: jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/parser/node/Script.java Repository: geosolutions-it/jai-ext The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-24816
HIGH
7.5
geosolutions-it/jai-ext
getGlobals
jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/parser/node/Script.java
cb1d6565d38954676b0a366da4f965fef38da1cb
0
Analyze the following code function for security vulnerabilities
public List<ZentaoBuild> getZentaoBuilds(IssuesRequest request) { try { ZentaoPlatform platform = (ZentaoPlatform) IssueFactory.createPlatform(IssuesManagePlatform.Zentao.name(), request); return platform.getBuilds(); } catch (Exception e) { LogUtil.error("get zentao builds fail."); LogUtil.error(e.getMessage(), e); MSException.throwException(Translator.get("zentao_get_project_builds_fail")); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getZentaoBuilds File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getZentaoBuilds
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
@Override public Intent getIntent() { Intent modIntent = new Intent(super.getIntent()); modIntent.putExtra(EXTRA_SHOW_FRAGMENT, getFragmentClass().getName()); return modIntent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntent 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
getIntent
src/com/android/settings/password/ChooseLockPassword.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
@Override public boolean isSecurityLoggingEnabled(ComponentName admin, String packageName) { if (!mHasFeature) { return false; } synchronized (getLockObject()) { if (!isSystemUid(getCallerIdentity())) { final CallerIdentity caller = getCallerIdentity(admin, packageName); if (isPermissionCheckFlagEnabled()) { enforcePermission(MANAGE_DEVICE_POLICY_SECURITY_LOGGING, caller.getPackageName(), UserHandle.USER_ALL); } else { if (admin != null) { Preconditions.checkCallAuthorization( isProfileOwnerOfOrganizationOwnedDevice(caller) || isDefaultDeviceOwner(caller)); } else { // A delegate app passes a null admin component, which is expected Preconditions.checkCallAuthorization( isCallerDelegate(caller, DELEGATION_SECURITY_LOGGING)); } } } return mInjector.securityLogGetLoggingEnabledProperty(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSecurityLoggingEnabled File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
isSecurityLoggingEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@HotPath(caller = HotPath.OOM_ADJUSTMENT) @Override public void onUidActive(int uid, int procState) { mActiveUids.onUidActive(uid, procState); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUidActive 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
onUidActive
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
protected String getEnctype() { return this.enctype; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEnctype File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-1904
MEDIUM
4.3
spring-projects/spring-framework
getEnctype
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
741b4b229ae032bd17175b46f98673ce0bd2d485
0
Analyze the following code function for security vulnerabilities
public void setValues(float valueIfGone, float valueIfVisible) { mValueIfGone = valueIfGone; mValueIfVisible = valueIfVisible; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValues File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setValues
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Test public void save5doNotReturnId(TestContext context) { String id = randomUuid(); createFoo(context).save(FOO, id, xPojo, /* returnId */ false, context.asyncAssertSuccess(save -> { context.assertEquals("", save); postgresClient.getById(FOO, id, context.asyncAssertSuccess(get -> { context.assertEquals("x", get.getString("key")); })); })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save5doNotReturnId File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
save5doNotReturnId
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); mEditUserInfoController.onSaveInstanceState(outState); outState.putInt(SAVE_ADDING_USER, mAddedUserId); outState.putInt(SAVE_REMOVING_USER, mRemovingUserId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSaveInstanceState File: src/com/android/settings/users/UserSettings.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3889
HIGH
7.2
android
onSaveInstanceState
src/com/android/settings/users/UserSettings.java
bd5d5176c74021e8cf4970f93f273ba3023c3d72
0
Analyze the following code function for security vulnerabilities
private boolean processStyleTag(Element ele, Node parentNode) { /* * Invoke the css parser on this element. */ CssScanner styleScanner = new CssScanner(policy, messages, policy.isEmbedStyleSheets()); try { if (ele.getChildNodes().getLength() > 0) { StringBuffer toScan = new StringBuffer(); for (int i = 0; i < ele.getChildNodes().getLength(); i++) { Node childNode = ele.getChildNodes().item(i); if (toScan.length() > 0) { toScan.append("\n"); } toScan.append(childNode.getTextContent()); } CleanResults cr = styleScanner.scanStyleSheet(toScan.toString(), policy.getMaxInputSize()); errorMessages.addAll(cr.getErrorMessages()); /* * If IE gets an empty style tag, i.e. <style/> it will * break all CSS on the page. I wish I was kidding. So, * if after validation no CSS properties are left, we * would normally be left with an empty style tag and * break all CSS. To prevent that, we have this check. */ String cleanHTML = cr.getCleanHTML(); cleanHTML = cleanHTML == null || cleanHTML.equals("") ? "/* */" : cleanHTML; ele.getFirstChild().setNodeValue(cleanHTML); /* * Remove every other node after cleaning CSS, there will * be only one node in the end, as it always should have. */ for (int i = 1; i < ele.getChildNodes().getLength(); i++) { Node childNode = ele.getChildNodes().item(i); ele.removeChild(childNode); } } } catch (DOMException | ScanException | ParseException | NumberFormatException e) { /* * ParseException shouldn't be possible anymore, but we'll leave it * here because I (Arshan) am hilariously dumb sometimes. * Batik can throw NumberFormatExceptions (see bug #48). */ addError(ErrorMessageUtil.ERROR_CSS_TAG_MALFORMED, new Object[]{HTMLEntityEncoder.htmlEntityEncode(ele.getFirstChild().getNodeValue())}); parentNode.removeChild(ele); return true; } return false; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2022-29577 - Severity: MEDIUM - CVSS Score: 4.3 Description: Fix child node removal on style tag processing Function: processStyleTag File: src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java Repository: nahsra/antisamy Fixed Code: private boolean processStyleTag(Element ele, Node parentNode) { /* * Invoke the css parser on this element. */ CssScanner styleScanner = new CssScanner(policy, messages, policy.isEmbedStyleSheets()); try { int childNodesCount = ele.getChildNodes().getLength(); if (childNodesCount > 0) { StringBuffer toScan = new StringBuffer(); for (int i = 0; i < ele.getChildNodes().getLength(); i++) { Node childNode = ele.getChildNodes().item(i); if (toScan.length() > 0) { toScan.append("\n"); } toScan.append(childNode.getTextContent()); } CleanResults cr = styleScanner.scanStyleSheet(toScan.toString(), policy.getMaxInputSize()); errorMessages.addAll(cr.getErrorMessages()); /* * If IE gets an empty style tag, i.e. <style/> it will * break all CSS on the page. I wish I was kidding. So, * if after validation no CSS properties are left, we * would normally be left with an empty style tag and * break all CSS. To prevent that, we have this check. */ String cleanHTML = cr.getCleanHTML(); cleanHTML = cleanHTML == null || cleanHTML.equals("") ? "/* */" : cleanHTML; ele.getFirstChild().setNodeValue(cleanHTML); /* * Remove every other node after cleaning CSS, there will * be only one node in the end, as it always should have. * Starting from the end due to list updating on the fly. */ for (int i = childNodesCount - 1; i >= 1; i--) { Node childNode = ele.getChildNodes().item(i); ele.removeChild(childNode); } } } catch (DOMException | ScanException | ParseException | NumberFormatException e) { /* * ParseException shouldn't be possible anymore, but we'll leave it * here because I (Arshan) am hilariously dumb sometimes. * Batik can throw NumberFormatExceptions (see bug #48). */ addError(ErrorMessageUtil.ERROR_CSS_TAG_MALFORMED, new Object[]{HTMLEntityEncoder.htmlEntityEncode(ele.getFirstChild().getNodeValue())}); parentNode.removeChild(ele); return true; } return false; }
[ "CWE-79" ]
CVE-2022-29577
MEDIUM
4.3
nahsra/antisamy
processStyleTag
src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
32e273507da0e964b58c50fd8a4c94c9d9363af0
1