instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public static void writeModel(OWLOntologyManager m, OWLOntology o, OWLDocumentFormat f, String outPath) { OutputStream out = null; try { out = new FileOutputStream(outPath); m.saveOntology(o, f, out); out.close(); } catch (Exception ex) { logger.error("Error while writing the model to file " + ex.getMessage()); if (out != null) { try { out.close(); } catch (Exception e) { } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeModel File: src/main/java/widoco/WidocoUtils.java Repository: dgarijo/Widoco The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-4772
HIGH
7.8
dgarijo/Widoco
writeModel
src/main/java/widoco/WidocoUtils.java
f2279b76827f32190adfa9bd5229b7d5a147fa92
0
Analyze the following code function for security vulnerabilities
private void resetStandardTemplate(RemoteViews contentView) { resetNotificationHeader(contentView); contentView.setViewVisibility(R.id.right_icon, View.GONE); contentView.setViewVisibility(R.id.title, View.GONE); contentView.setTextViewText(R.id.title, null); contentView.setViewVisibility(R.id.text, View.GONE); contentView.setTextViewText(R.id.text, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetStandardTemplate File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
resetStandardTemplate
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public String getGroups() { return groups; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getGroups File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getGroups
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public boolean requestAssistContextExtras(int requestType, IAssistDataReceiver receiver, Bundle receiverExtras, IBinder activityToken, boolean checkActivityIsTop, boolean newSessionId) { return enqueueAssistContext(requestType, null, null, receiver, receiverExtras, activityToken, checkActivityIsTop, newSessionId, UserHandle.getCallingUserId(), null, PENDING_ASSIST_EXTRAS_LONG_TIMEOUT, 0) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestAssistContextExtras 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
requestAssistContextExtras
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
boolean drawChild(Canvas canvas, View child, long drawingTime);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: drawChild File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
drawChild
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private void setFlag(int mask, boolean value) { if (value) { mFlags |= mask; } else { mFlags &= ~mask; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFlag File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setFlag
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
float getDisplayDensity() { return mDisplayMetrics.density; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDisplayDensity File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
getDisplayDensity
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public void hideTextEditor() { InPlaceEditView.hideActiveTextEditor(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hideTextEditor File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
hideTextEditor
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private void updateAlarmVisibilities() { mAlarmStatus.setVisibility(mAlarmShowing && mShowFullAlarm ? View.VISIBLE : View.INVISIBLE); mAlarmStatusCollapsed.setVisibility(mAlarmShowing ? View.VISIBLE : View.INVISIBLE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateAlarmVisibilities File: packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3886
HIGH
7.2
android
updateAlarmVisibilities
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
6ca6cd5a50311d58a1b7bf8fbef3f9aa29eadcd5
0
Analyze the following code function for security vulnerabilities
PackageManagerInternal getPackageManagerInternal() { return LocalServices.getService(PackageManagerInternal.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageManagerInternal 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
getPackageManagerInternal
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean setLegacyUserConnectChoice(@NonNull final WifiConfiguration selected, int rssi) { boolean change = false; Collection<WifiConfiguration> configuredNetworks = getInternalConfiguredNetworks(); ArrayList<WifiConfiguration> networksInRange = new ArrayList<>(); String key = selected.getProfileKey(); for (WifiConfiguration network : configuredNetworks) { WifiConfiguration.NetworkSelectionStatus status = network.getNetworkSelectionStatus(); if (network.networkId == selected.networkId) { if (status.getConnectChoice() != null) { localLog("Remove user selection preference of " + status.getConnectChoice() + " from " + network.SSID + " : " + network.networkId); clearConnectChoiceInternal(network); change = true; } continue; } if (status.getSeenInLastQualifiedNetworkSelection()) { setConnectChoiceInternal(network, key, rssi); change = true; networksInRange.add(network); } } for (OnNetworkUpdateListener listener : mListeners) { listener.onConnectChoiceSet(networksInRange, key, rssi); } return change; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLegacyUserConnectChoice 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
setLegacyUserConnectChoice
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public void setFileMappers(final FileMapper[] fileMappers) { this.fileMappers = fileMappers; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFileMappers File: src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java Repository: codehaus-plexus/plexus-archiver The code follows secure coding practices.
[ "CWE-22", "CWE-61" ]
CVE-2023-37460
CRITICAL
9.8
codehaus-plexus/plexus-archiver
setFileMappers
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
54759839fbdf85caf8442076f001d5fd64e0dcb2
0
Analyze the following code function for security vulnerabilities
@POST @Path("test/{nodeId}/configuration/report") @Operation(summary = "Update the configuration of report", description = "Update the configuration of the reports in the test course node") @ApiResponse(responseCode = "200", description = "The course node configuration", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = SurveyConfigVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = SurveyConfigVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course node was not found") @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response postTestReportConfiguration(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, TestReportConfigVO config, @Context HttpServletRequest request) { FullConfigDelegate delegate = new TestReportFullConfig(config); attachNodeConfig(courseId, nodeId, delegate, request); return getTestReportConfiguration(courseId, nodeId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: postTestReportConfiguration File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
postTestReportConfiguration
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
@Override public Route.Definition put(final String path, final Route.ZeroArgHandler handler) { return appendDefinition(PUT, path, handler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
put
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
protected String getSkinFolder() { return "skins/" + this.id + '/'; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSkinFolder File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/skin/AbstractResourceSkin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-29253
MEDIUM
4
xwiki/xwiki-platform
getSkinFolder
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/skin/AbstractResourceSkin.java
4917c8f355717bb636d763844528b1fe0f95e8e2
0
Analyze the following code function for security vulnerabilities
public boolean isUninstallInQueue(String packageName) { try { return mService.isUninstallInQueue(packageName); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUninstallInQueue 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
isUninstallInQueue
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void setFileName(String fileName) { this.fileName = fileName; CurrentGui.getInstance().getGui().updateDiagramName(handler, handler.getName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFileName File: umlet-swing/src/main/java/com/baselet/diagram/io/DiagramFileHandler.java Repository: umlet The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000548
MEDIUM
6.8
umlet
setFileName
umlet-swing/src/main/java/com/baselet/diagram/io/DiagramFileHandler.java
e1c4cc6ae692cc8d1c367460dbf79343e996f9bd
0
Analyze the following code function for security vulnerabilities
public void setPackageScreenCompatMode(String packageName, int mode) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(packageName); data.writeInt(mode); mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); reply.readException(); reply.recycle(); data.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPackageScreenCompatMode File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setPackageScreenCompatMode
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
protected void inflateViews(Entry entry, ViewGroup parent) { PackageManager pmUser = getPackageManagerForUser(mContext, entry.notification.getUser().getIdentifier()); final StatusBarNotification sbn = entry.notification; if (entry.row != null) { entry.reset(); updateNotification(entry, pmUser, sbn, entry.row); } else { new RowInflaterTask().inflate(mContext, parent, entry, row -> { bindRow(entry, pmUser, sbn, row); updateNotification(entry, pmUser, sbn, row); }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: inflateViews File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
inflateViews
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public List<CodeAction> doCodeActions(CodeActionContext context, Range range, DOMDocument document, XMLFormattingOptions formattingSettings) { return codeActions.doCodeActions(context, range, document, formattingSettings); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doCodeActions File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
doCodeActions
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
e37c399aa266be1b7a43061d4afc43dc230410d2
0
Analyze the following code function for security vulnerabilities
public void setProperty(final String key, final Object value) { act.runOnUiThread(new Runnable() { public void run() { WebSettings s = web.getSettings(); if(key.equalsIgnoreCase("useragent")) { s.setUserAgentString((String)value); return; } try { s.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); } catch(Throwable t) { // the method isn't available in Android 4.x } String methodName = "set" + key; for (Method m : s.getClass().getMethods()) { if (m.getName().equalsIgnoreCase(methodName) && m.getParameterTypes().length == 1) { try { m.invoke(s, value); } catch (Exception ex) { ex.printStackTrace(); } return; } } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProperty File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
setProperty
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private void splitHeader(AppendableCharSequence sb) { final int length = sb.length(); int nameStart; int nameEnd; int colonEnd; int valueStart; int valueEnd; nameStart = findNonWhitespace(sb, 0); for (nameEnd = nameStart; nameEnd < length; nameEnd ++) { char ch = sb.charAtUnsafe(nameEnd); // https://tools.ietf.org/html/rfc7230#section-3.2.4 // // No whitespace is allowed between the header field-name and colon. In // the past, differences in the handling of such whitespace have led to // security vulnerabilities in request routing and response handling. A // server MUST reject any received request message that contains // whitespace between a header field-name and colon with a response code // of 400 (Bad Request). A proxy MUST remove any such whitespace from a // response message before forwarding the message downstream. if (ch == ':' || // In case of decoding a request we will just continue processing and header validation // is done in the DefaultHttpHeaders implementation. // // In the case of decoding a response we will "skip" the whitespace. (!isDecodingRequest() && Character.isWhitespace(ch))) { break; } } for (colonEnd = nameEnd; colonEnd < length; colonEnd ++) { if (sb.charAtUnsafe(colonEnd) == ':') { colonEnd ++; break; } } name = sb.subStringUnsafe(nameStart, nameEnd); valueStart = findNonWhitespace(sb, colonEnd); if (valueStart == length) { value = EMPTY_VALUE; } else { valueEnd = findEndOfString(sb); value = sb.subStringUnsafe(valueStart, valueEnd); } }
Vulnerability Classification: - CWE: CWE-444 - CVE: CVE-2019-20444 - Severity: MEDIUM - CVSS Score: 6.4 Description: Detect missing colon when parsing http headers with no value Motivation: Technical speaking its valid to have http headers with no values so we should support it. That said we need to detect if these are "generated" because of an "invalid" fold. Modifications: - Detect if a colon is missing when parsing headers. - Add unit test Result: Fixes https://github.com/netty/netty/issues/9866 Function: splitHeader File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java Repository: netty Fixed Code: private void splitHeader(AppendableCharSequence sb) { final int length = sb.length(); int nameStart; int nameEnd; int colonEnd; int valueStart; int valueEnd; nameStart = findNonWhitespace(sb, 0); for (nameEnd = nameStart; nameEnd < length; nameEnd ++) { char ch = sb.charAtUnsafe(nameEnd); // https://tools.ietf.org/html/rfc7230#section-3.2.4 // // No whitespace is allowed between the header field-name and colon. In // the past, differences in the handling of such whitespace have led to // security vulnerabilities in request routing and response handling. A // server MUST reject any received request message that contains // whitespace between a header field-name and colon with a response code // of 400 (Bad Request). A proxy MUST remove any such whitespace from a // response message before forwarding the message downstream. if (ch == ':' || // In case of decoding a request we will just continue processing and header validation // is done in the DefaultHttpHeaders implementation. // // In the case of decoding a response we will "skip" the whitespace. (!isDecodingRequest() && Character.isWhitespace(ch))) { break; } } if (nameEnd == length) { // There was no colon present at all. throw new IllegalArgumentException("No colon found"); } for (colonEnd = nameEnd; colonEnd < length; colonEnd ++) { if (sb.charAtUnsafe(colonEnd) == ':') { colonEnd ++; break; } } name = sb.subStringUnsafe(nameStart, nameEnd); valueStart = findNonWhitespace(sb, colonEnd); if (valueStart == length) { value = EMPTY_VALUE; } else { valueEnd = findEndOfString(sb); value = sb.subStringUnsafe(valueStart, valueEnd); } }
[ "CWE-444" ]
CVE-2019-20444
MEDIUM
6.4
netty
splitHeader
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
6ad40c8c17199299b75a04225da10ebda5b377f2
1
Analyze the following code function for security vulnerabilities
private void populateRegistrationModel(Map<String, String> parameters, Model model) { for(Map.Entry<String, String> parameter : parameters.entrySet()) { // handle all parameters except the password String name = parameter.getKey(); if(!name.equals("userPassword") && !name.equals("_csrf")) { String value = parameter.getValue().trim(); if(!value.isEmpty()) { model.addAttribute(name, value); } } } }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2018-25084 - Severity: MEDIUM - CVSS Score: 4.0 Description: Added html escaping to help with XSS. Added frame busting to help with XFS. Added a method override filter so that only GETs and POSTs are accepted. Disabled autocomplete for password fields. Added ability for customer to set their HPKP headers. Function: populateRegistrationModel File: src/main/java/com/unboundid/webapp/ssam/SSAMController.java Repository: pingidentity/ssam Fixed Code: private void populateRegistrationModel(Map<String, String> parameters, Model model) { for(Map.Entry<String, String> parameter : parameters.entrySet()) { // handle all parameters except the password String name = parameter.getKey(); if(!name.equals("userPassword") && !name.equals("_csrf")) { String value = parameter.getValue().trim(); if(!value.isEmpty()) { model.addAttribute(name, HtmlUtils.htmlEscape(value)); } } } }
[ "CWE-79" ]
CVE-2018-25084
MEDIUM
4
pingidentity/ssam
populateRegistrationModel
src/main/java/com/unboundid/webapp/ssam/SSAMController.java
f64b10d63bb19ca2228b0c2d561a1a6e5a3bf251
1
Analyze the following code function for security vulnerabilities
private String localUserDN(String absoluteDN) { try { URI userURI = new URI(absoluteDN); return userURI.getPath().substring(1); } catch (URISyntaxException e) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: localUserDN File: jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java Repository: wildfly-security/jboss-negotiation The code follows secure coding practices.
[ "CWE-200" ]
CVE-2015-1849
MEDIUM
4.3
wildfly-security/jboss-negotiation
localUserDN
jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java
0dc9d191b6eb1d13b8f0189c5b02ba6576f4722e
0
Analyze the following code function for security vulnerabilities
private static void integrityCheckerXmlGenerator(final XmlGenerator gen, final Config config) { gen.node( "integrity-checker", null, "enabled", config.getIntegrityCheckerConfig().isEnabled() ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: integrityCheckerXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-522" ]
CVE-2023-33264
MEDIUM
4.3
hazelcast
integrityCheckerXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
80a502d53cc48bf895711ab55f95e3a51e344ac1
0
Analyze the following code function for security vulnerabilities
private ActivityManager.ProcessErrorStateInfo generateProcessError(ProcessRecord app, int condition, String activity, String shortMsg, String longMsg, String stackTrace) { ActivityManager.ProcessErrorStateInfo report = new ActivityManager.ProcessErrorStateInfo(); report.condition = condition; report.processName = app.processName; report.pid = app.pid; report.uid = app.info.uid; report.tag = activity; report.shortMsg = shortMsg; report.longMsg = longMsg; report.stackTrace = stackTrace; return report; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateProcessError 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
generateProcessError
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Deprecated public void clearDeviceOwnerApp(String packageName) { throwIfParentInstance("clearDeviceOwnerApp"); if (mService != null) { try { mService.clearDeviceOwner(packageName); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearDeviceOwnerApp 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
clearDeviceOwnerApp
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private BaseClass getMandatoryClass(XWikiContext context, DocumentReference classReference) throws XWikiException { XWikiDocument document = getDocument(classReference, context); if (context.get("initdone") == null) { @SuppressWarnings("deprecation") MandatoryDocumentInitializer initializer = Utils.getComponent(MandatoryDocumentInitializer.class, document.getFullName()); if (initializer.updateDocument(document)) { saveDocument(document, localizePlainOrKey("core.model.xclass.mandatoryUpdateProperty.versionSummary"), context); } } return document.getXClass(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMandatoryClass 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
getMandatoryClass
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private String getCacheKey(String systemId, boolean online) { if (online) { return "online_".concat(systemId); } return "offline_".concat(systemId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCacheKey File: src/org/opencms/xml/CmsXmlEntityResolver.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3312
MEDIUM
4
alkacon/opencms-core
getCacheKey
src/org/opencms/xml/CmsXmlEntityResolver.java
92e035423aa6967822d343e54392d4291648c0ee
0
Analyze the following code function for security vulnerabilities
private void startFinishDozeAnimationElement(View element, long delay) { element.setAlpha(0f); element.setTranslationY(element.getHeight() / 2); element.animate() .alpha(1f) .translationY(0f) .setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN) .setStartDelay(delay) .setDuration(DOZE_ANIMATION_ELEMENT_DURATION); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startFinishDozeAnimationElement File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
startFinishDozeAnimationElement
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public boolean inboundBundleCompletion(final HttpServletRequest req) throws NamespaceException { final String spaceName = RequestUtil.getParameter(req, SPACE_NAME); // Look up the place reference final WorkSpace space = lookupSpace(spaceName); if (space == null) { throw new IllegalArgumentException("No WorkSpace found using name " + spaceName); } String placeName = RequestUtil.getParameter(req, CLIENT_NAME); if (placeName == null) { placeName = req.getRemoteHost(); } final String bundleId = RequestUtil.getParameter(req, WORK_BUNDLE_ID); final boolean itWorked = RequestUtil.getBooleanParam(req, WORK_BUNDLE_STATUS); if (bundleId == null) { throw new IllegalArgumentException("Notice of bundle completion with no bundle id"); } return space.workCompleted(placeName, bundleId, itWorked); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: inboundBundleCompletion File: src/main/java/emissary/server/mvc/adapters/WorkSpaceAdapter.java Repository: NationalSecurityAgency/emissary The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
inboundBundleCompletion
src/main/java/emissary/server/mvc/adapters/WorkSpaceAdapter.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
0
Analyze the following code function for security vulnerabilities
@Test public void selectSingleParamTrans(TestContext context) { postgresClient = createNumbers(context, 55, 56, 57); postgresClient.startTx(asyncAssertTx(context, trans -> { postgresClient.selectSingle(trans, "SELECT i FROM numbers WHERE i IN (?, ?, ?) ORDER BY i", new JsonArray().add(51).add(53).add(55), context.asyncAssertSuccess(select -> { postgresClient.endTx(trans, context.asyncAssertSuccess()); context.assertEquals(55, select.getInteger(0)); })); })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectSingleParamTrans 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
selectSingleParamTrans
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private void fixIDs(Element element) { NamedNodeMap attributes = element.getAttributes(); for (int i = 0; i < attributes.getLength(); i++) { Attr attribute = (Attr) attributes.item(i); if (attribute.getLocalName().equalsIgnoreCase("id")) { element.setIdAttributeNode(attribute, true); } } NodeList children = element.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { fixIDs((Element) child); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fixIDs File: src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java Repository: FusionAuth/fusionauth-samlv2 The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-27736
MEDIUM
4
FusionAuth/fusionauth-samlv2
fixIDs
src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java
c66fb689d50010662f705d5b585c6388ce555dbd
0
Analyze the following code function for security vulnerabilities
private static Class lookup(String className) { try { Class def = AES.class.getClassLoader().loadClass(className); return def; } catch (Exception e) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lookup File: prov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/AES.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-310" ]
CVE-2016-1000339
MEDIUM
5
bcgit/bc-java
lookup
prov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/AES.java
413b42f4d770456508585c830cfcde95f9b0e93b
0
Analyze the following code function for security vulnerabilities
public static boolean isIp4Address(String ipAddress) { try { final InetAddress address = InetAddresses.forString(ipAddress); if (address instanceof Inet4Address) { return true; } } catch (IllegalArgumentException e) { // Absorb exception. } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isIp4Address File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
isIp4Address
graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
private native long nativeInit(WebContents webContents, long viewAndroidPtr, long windowAndroidPtr, HashSet<Object> retainedObjectSet);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeInit 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
nativeInit
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure, AssistContent content, Uri referrer) { PendingAssistExtras pae = (PendingAssistExtras)token; synchronized (pae) { pae.result = extras; pae.structure = structure; pae.content = content; if (referrer != null) { pae.extras.putParcelable(Intent.EXTRA_REFERRER, referrer); } pae.haveResult = true; pae.notifyAll(); if (pae.intent == null && pae.receiver == null) { // Caller is just waiting for the result. return; } } // We are now ready to launch the assist activity. IResultReceiver sendReceiver = null; Bundle sendBundle = null; synchronized (this) { buildAssistBundleLocked(pae, extras); boolean exists = mPendingAssistExtras.remove(pae); mUiHandler.removeCallbacks(pae); if (!exists) { // Timed out. return; } if ((sendReceiver=pae.receiver) != null) { // Caller wants result sent back to them. sendBundle = new Bundle(); sendBundle.putBundle(VoiceInteractionSession.KEY_DATA, pae.extras); sendBundle.putParcelable(VoiceInteractionSession.KEY_STRUCTURE, pae.structure); sendBundle.putParcelable(VoiceInteractionSession.KEY_CONTENT, pae.content); sendBundle.putBundle(VoiceInteractionSession.KEY_RECEIVER_EXTRAS, pae.receiverExtras); } } if (sendReceiver != null) { try { sendReceiver.send(0, sendBundle); } catch (RemoteException e) { } return; } long ident = Binder.clearCallingIdentity(); try { pae.intent.replaceExtras(pae.extras); pae.intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); closeSystemDialogs("assist"); try { mContext.startActivityAsUser(pae.intent, new UserHandle(pae.userHandle)); } catch (ActivityNotFoundException e) { Slog.w(TAG, "No activity to handle assist action.", e); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportAssistContextExtras File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
reportAssistContextExtras
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
private static native @NonNull SparseArray<String> nativeGetAssignedPackageIdentifiers( long ptr, boolean includeOverlays, boolean includeLoaders);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeGetAssignedPackageIdentifiers File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
nativeGetAssignedPackageIdentifiers
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Override public URL getTemplate(String name) throws IOException { return classLoader.getResource(THEME_RESOURCES_TEMPLATES + name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTemplate File: services/src/main/java/org/keycloak/theme/ClasspathThemeResourceProviderFactory.java Repository: keycloak The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-3856
MEDIUM
4.3
keycloak
getTemplate
services/src/main/java/org/keycloak/theme/ClasspathThemeResourceProviderFactory.java
73f0474008e1bebd0733e62a22aceda9e5de6743
0
Analyze the following code function for security vulnerabilities
@Override boolean check(MultiMapConfig c1, MultiMapConfig c2) { return c1 == c2 || !(c1 == null || c2 == null) && nullSafeEqual(c1.getName(), c2.getName()) && nullSafeEqual(c1.getValueCollectionType(), c2.getValueCollectionType()) && nullSafeEqual(c1.getEntryListenerConfigs(), c2.getEntryListenerConfigs()) && nullSafeEqual(c1.isBinary(), c2.isBinary()) && nullSafeEqual(c1.getBackupCount(), c2.getBackupCount()) && nullSafeEqual(c1.getAsyncBackupCount(), c2.getAsyncBackupCount()) && nullSafeEqual(c1.isStatisticsEnabled(), c2.isStatisticsEnabled()) && nullSafeEqual(c1.getQuorumName(), c2.getQuorumName()) && ConfigCompatibilityChecker.isCompatible(c1.getMergePolicyConfig(), c2.getMergePolicyConfig()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: check File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
check
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private DevicePolicyConstants loadConstants() { return DevicePolicyConstants.loadFromString( mInjector.settingsGlobalGetString(Global.DEVICE_POLICY_CONSTANTS)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadConstants 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
loadConstants
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setParsingExceptionCallback(ParsingExceptionCallback callback) { parsingExceptionCallback = callback; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setParsingExceptionCallback File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
setParsingExceptionCallback
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
@Override public boolean isPackageSuspended(ComponentName who, String callerPackage, String packageName) { final CallerIdentity caller = getCallerIdentity(who, callerPackage); Preconditions.checkCallAuthorization((caller.hasAdminComponent() && (isProfileOwner(caller) || isDefaultDeviceOwner(caller))) || (caller.hasPackage() && isCallerDelegate(caller, DELEGATION_PACKAGE_ACCESS))); synchronized (getLockObject()) { long id = mInjector.binderClearCallingIdentity(); try { return mIPackageManager.isPackageSuspendedForUser(packageName, caller.getUserId()); } catch (RemoteException re) { // Shouldn't happen. Slogf.e(LOG_TAG, "Failed talking to the package manager", re); } finally { mInjector.binderRestoreCallingIdentity(id); } return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPackageSuspended 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
isPackageSuspended
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void onDreamingStopped() { mUpdateMonitor.dispatchDreamingStopped(); synchronized (this) { if (mDeviceInteractive) { cancelDoKeyguardLaterLocked(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDreamingStopped File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
onDreamingStopped
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
private void handleSessionEnd() { CatLog.d(this, "SESSION END on "+ mSlotId); mCurrntCmd = mMenuCmd; Intent intent = new Intent(AppInterface.CAT_SESSION_END_ACTION); intent.putExtra("SLOT_ID", mSlotId); mContext.sendBroadcast(intent); }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2015-3843 - Severity: HIGH - CVSS Score: 9.3 Description: DO NOT MERGE Change to add STK_PERMISSION for stk related commands. And make stk commands protected. Bug: 21697171 Change-Id: I7649c7341428194963ac74e9ae622dfa76ea738b Function: handleSessionEnd File: src/java/com/android/internal/telephony/cat/CatService.java Repository: android Fixed Code: private void handleSessionEnd() { CatLog.d(this, "SESSION END on "+ mSlotId); mCurrntCmd = mMenuCmd; Intent intent = new Intent(AppInterface.CAT_SESSION_END_ACTION); intent.putExtra("SLOT_ID", mSlotId); mContext.sendBroadcast(intent, AppInterface.STK_PERMISSION); }
[ "CWE-264" ]
CVE-2015-3843
HIGH
9.3
android
handleSessionEnd
src/java/com/android/internal/telephony/cat/CatService.java
b48581401259439dc5ef6dcf8b0f303e4cbefbe9
1
Analyze the following code function for security vulnerabilities
@Override public boolean onCreate() { setAppOps(AppOpsManager.OP_READ_SMS, AppOpsManager.OP_WRITE_SMS); mOpenHelper = MmsSmsDatabaseHelper.getInstanceForCe(getContext()); TelephonyBackupAgent.DeferredSmsMmsRestoreService.startIfFilesExist(getContext()); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreate File: src/com/android/providers/telephony/MmsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-22" ]
CVE-2023-21268
MEDIUM
5.5
android
onCreate
src/com/android/providers/telephony/MmsProvider.java
ca4c9a19635119d95900793e7a41b820cd1d94d9
0
Analyze the following code function for security vulnerabilities
public static PageParameters paramsOf(Project project, State state) { PageParameters params = paramsOf(project); fillParams(params, state); return params; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: paramsOf File: server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-434" ]
CVE-2021-21245
HIGH
7.5
theonedev/onedev
paramsOf
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
0c060153fb97c0288a1917efdb17cc426934dacb
0
Analyze the following code function for security vulnerabilities
public Userview createUserview(AppDefinition appDef, String json, String menuId, boolean preview, String contextPath, Map requestParameters, String key, Boolean embed) { String permissionKey = Permission.DEFAULT; if (key != null && key.trim().length() == 0) { key = null; } if (key != null) { key = StringEscapeUtils.escapeHtml(key); } //process json with hash variable json = AppUtil.processHashVariable(json, null, StringUtil.TYPE_JSON, null, appDef); json = AppUtil.replaceAppMessages(json, StringUtil.TYPE_JSON); User currentUser = workflowUserManager.getCurrentUser(); if (requestParameters == null) { requestParameters = new HashMap<String, Object>(); } requestParameters = convertRequestParamMap(requestParameters); requestParameters.put("contextPath", contextPath); requestParameters.put("isPreview", Boolean.toString(preview)); requestParameters.put("embed", Boolean.toString(embed)); requestParameters.put("appId", appDef.getAppId()); requestParameters.put("appVersion", appDef.getVersion().toString()); String appId = appDef.getId(); String appVersion = appDef.getVersion().toString(); Userview userview = new Userview(); userview.setParams(requestParameters); boolean userviewPermission = false; //if screenshot, set user to null (anonymous) User currentThreadUser = currentUser; boolean isScreenCapture = workflowUserManager.isCurrentUserInRole(WorkflowUserManager.ROLE_ADMIN) && "true".equalsIgnoreCase((String) requestParameters.get("_isScreenCapture")); if (isScreenCapture) { currentUser = null; workflowUserManager.setCurrentThreadUser(WorkflowUserManager.ROLE_ANONYMOUS); } try { //set userview properties JSONObject userviewObj = new JSONObject(json); userview.setProperties(PropertyUtil.getProperties(userviewObj.getJSONObject("properties"))); //set Setting JSONObject settingObj = userviewObj.getJSONObject("setting"); UserviewSetting setting = new UserviewSetting(); setting.setProperties(PropertyUtil.getProperties(settingObj.getJSONObject("properties"))); //set theme & permission try { JSONObject themeObj = settingObj.getJSONObject("properties").getJSONObject("theme"); JSONObject themeProperties = themeObj.getJSONObject("properties"); UserviewTheme theme = (UserviewTheme) pluginManager.getPlugin(themeObj.getString("className")); if (theme == null) { String defaultTheme = ResourceBundleUtil.getMessage("generator.userview.theme"); theme = (UserviewTheme) pluginManager.getPlugin(defaultTheme); String defaultThemePropertiesKey = "generator.userview.theme." + defaultTheme + ".properties"; String defaultThemeProperties = "{" + ResourceBundleUtil.getMessage(defaultThemePropertiesKey) + "}"; themeProperties = new JSONObject(defaultThemeProperties); } theme.setProperties(PropertyUtil.getProperties(themeProperties)); theme.setRequestParameters(requestParameters); theme.setUserview(userview); setting.setTheme(theme); } catch (Exception e) { LogUtil.debug(getClass().getName(), "set theme error."); } try { if (!"true".equals(setting.getPropertyString("tempDisablePermissionChecking"))) { if (settingObj.getJSONObject("properties").has("permission_rules")) { JSONArray permissionRules = settingObj.getJSONObject("properties").getJSONArray("permission_rules"); if (permissionRules != null && permissionRules.length() > 0) { for (int i = 0; i < permissionRules.length(); i++) { JSONObject rule = permissionRules.getJSONObject(i); if (rule.has("permission")) { JSONObject permissionObj = rule.optJSONObject("permission"); userviewPermission = UserviewUtil.getPermisionResult(permissionObj, requestParameters, currentUser); if (userviewPermission) { permissionKey = rule.getString("permission_key"); break; } } } } } if (!userviewPermission) { if (settingObj.getJSONObject("properties").has("permission")) { JSONObject permissionObj = settingObj.getJSONObject("properties").getJSONObject("permission"); userviewPermission = UserviewUtil.getPermisionResult(permissionObj, requestParameters, currentUser); } else { userviewPermission = true; } } } else { userviewPermission = true; } } catch (Exception e) { LogUtil.debug(getClass().getName(), "set permission error."); } userview.setSetting(setting); //set categories Collection<UserviewCategory> categories = new ArrayList<UserviewCategory>(); if (userviewPermission) { JSONArray categoriesArray = userviewObj.getJSONArray("categories"); for (int i = 0; i < categoriesArray.length(); i++) { JSONObject categoryObj = (JSONObject) categoriesArray.get(i); UserviewCategory category = new UserviewCategory(); category.setProperties(PropertyUtil.getProperties(categoryObj.getJSONObject("properties"))); //check for permission JSONObject ruleObj = null; if (Permission.DEFAULT.equals(permissionKey)) { ruleObj = categoryObj.getJSONObject("properties"); } else if (categoryObj.getJSONObject("properties").has("permission_rules")) { JSONObject permissionRules = categoryObj.getJSONObject("properties").getJSONObject("permission_rules"); if (permissionRules != null && permissionRules.has(permissionKey)) { ruleObj = permissionRules.getJSONObject(permissionKey); } } boolean hasPermis = false; if (preview || "true".equals(setting.getPropertyString("tempDisablePermissionChecking"))) { hasPermis = true; } else { if (ruleObj != null) { if (ruleObj.has("permissionDeny") && "true".equals(ruleObj.getString("permissionDeny"))) { hasPermis = false; } else if (ruleObj.has("permission")){ try { JSONObject permissionObj = ruleObj.getJSONObject("permission"); hasPermis = UserviewUtil.getPermisionResult(permissionObj, requestParameters, currentUser); } catch (Exception e) { LogUtil.debug(getClass().getName(), "set category permission error."); } } else { hasPermis = true; } //handle for permission rule to override the default setting if (ruleObj.has("hide") && "yes".equals(ruleObj.getString("hide"))) { category.setProperty("hide", "yes"); } else { category.setProperty("hide", ""); } } else { //when no properties found for the category object hasPermis = true; category.setProperty("hide", ""); } } if (hasPermis) { //set menus JSONArray menusArray = categoryObj.getJSONArray("menus"); Collection<UserviewMenu> menus = new ArrayList<UserviewMenu>(); for (int j = 0; j < menusArray.length(); j++) { try { //set menu JSONObject menuObj = (JSONObject) menusArray.get(j); UserviewMenu menu = (UserviewMenu) pluginManager.getPlugin(menuObj.getString("className")); // check for mobile support boolean isMobileView = MobileUtil.isMobileView(); if (isMobileView && (menu instanceof MobileElement) && !((MobileElement)menu).isMobileSupported()) { // mobile not supported, skip this menu continue; } //check for deny JSONObject menuRuleObj = null; if (Permission.DEFAULT.equals(permissionKey)) { menuRuleObj = menuObj.getJSONObject("properties"); } else if (menuObj.getJSONObject("properties").has("permission_rules")) { JSONObject permissionRules = menuObj.getJSONObject("properties").getJSONObject("permission_rules"); if (permissionRules != null && permissionRules.has(permissionKey)) { menuRuleObj = permissionRules.getJSONObject(permissionKey); } } if (menuRuleObj != null && menuRuleObj.has("permissionDeny") && "true".equals(menuRuleObj.getString("permissionDeny"))) { continue; } menu.setProperties(PropertyUtil.getProperties(menuObj.getJSONObject("properties"))); menu.setRequestParameters(requestParameters); menu.setUserview(userview); String mId = getMenuId(menu); menu.setProperty("menuId", mId); if (preview) { menu.setUrl(contextPath + "/web/console/app/" + appId + "/" + appVersion + "/userview/builderPreview/" + userview.getPropertyString("id") + "/" + mId); } else { menu.setKey(key); String prefix = "/web/userview/"; if (embed) { prefix = "/web/embed/userview/"; } menu.setUrl(contextPath + prefix + appId + "/" + userview.getPropertyString("id") + "/" + ((key != null) ? StringEscapeUtils.escapeHtml(key) : Userview.USERVIEW_KEY_EMPTY_VALUE) + "/" + mId); } //set Current, if current menu id is empty, search the 1st valid menu if ((("".equals(menuId) || "index".equals(menuId) || menuId == null) && userview.getCurrent() == null && menu.isHomePageSupported()) || (menuId != null && menuId.equals(mId))) { userview.setCurrent(menu); userview.setCurrentCategory(category); } //set home menu Id if (userview.getPropertyString("homeMenuId") == null || userview.getPropertyString("homeMenuId").isEmpty() && menu.isHomePageSupported()) { userview.setProperty("homeMenuId", mId); } if (menuRuleObj == null || !menuRuleObj.has("permissionHidden") || !"true".equals(menuRuleObj.getString("permissionHidden"))) { menu = new CachedUserviewMenu(menu); menus.add(menu); } } catch (Exception e) { LogUtil.debug(getClass().getName(), "Userview Menu class file not found"); } } category.setMenus(menus); if (!"yes".equals(category.getPropertyString("hide")) && menus.size() > 0) { categories.add(category); } } } } userview.setCategories(categories); } catch (Exception ex) { LogUtil.error(getClass().getName(), ex, "Create Userview Error!!"); } finally { if (isScreenCapture) { workflowUserManager.setCurrentThreadUser(currentThreadUser); } } return userview; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2022-4560 - Severity: MEDIUM - CVSS Score: 6.1 Description: Fixed: wflow-core - Userview - Fixed XSS issue on key parameter. @7.0-SNAPSHOT Function: createUserview File: wflow-core/src/main/java/org/joget/apps/userview/service/UserviewService.java Repository: jogetworkflow/jw-community Fixed Code: public Userview createUserview(AppDefinition appDef, String json, String menuId, boolean preview, String contextPath, Map requestParameters, String key, Boolean embed) { String permissionKey = Permission.DEFAULT; if (key != null && key.trim().length() == 0) { key = null; } if (key != null) { key = StringEscapeUtils.escapeHtml(key); } //process json with hash variable json = AppUtil.processHashVariable(json, null, StringUtil.TYPE_JSON, null, appDef); json = AppUtil.replaceAppMessages(json, StringUtil.TYPE_JSON); User currentUser = workflowUserManager.getCurrentUser(); if (requestParameters == null) { requestParameters = new HashMap<String, Object>(); } requestParameters = convertRequestParamMap(requestParameters); requestParameters.put("contextPath", contextPath); requestParameters.put("isPreview", Boolean.toString(preview)); requestParameters.put("embed", Boolean.toString(embed)); requestParameters.put("appId", appDef.getAppId()); requestParameters.put("appVersion", appDef.getVersion().toString()); requestParameters.put("key", (key != null)?key:""); String appId = appDef.getId(); String appVersion = appDef.getVersion().toString(); Userview userview = new Userview(); userview.setParams(requestParameters); boolean userviewPermission = false; //if screenshot, set user to null (anonymous) User currentThreadUser = currentUser; boolean isScreenCapture = workflowUserManager.isCurrentUserInRole(WorkflowUserManager.ROLE_ADMIN) && "true".equalsIgnoreCase((String) requestParameters.get("_isScreenCapture")); if (isScreenCapture) { currentUser = null; workflowUserManager.setCurrentThreadUser(WorkflowUserManager.ROLE_ANONYMOUS); } try { //set userview properties JSONObject userviewObj = new JSONObject(json); userview.setProperties(PropertyUtil.getProperties(userviewObj.getJSONObject("properties"))); //set Setting JSONObject settingObj = userviewObj.getJSONObject("setting"); UserviewSetting setting = new UserviewSetting(); setting.setProperties(PropertyUtil.getProperties(settingObj.getJSONObject("properties"))); //set theme & permission try { JSONObject themeObj = settingObj.getJSONObject("properties").getJSONObject("theme"); JSONObject themeProperties = themeObj.getJSONObject("properties"); UserviewTheme theme = (UserviewTheme) pluginManager.getPlugin(themeObj.getString("className")); if (theme == null) { String defaultTheme = ResourceBundleUtil.getMessage("generator.userview.theme"); theme = (UserviewTheme) pluginManager.getPlugin(defaultTheme); String defaultThemePropertiesKey = "generator.userview.theme." + defaultTheme + ".properties"; String defaultThemeProperties = "{" + ResourceBundleUtil.getMessage(defaultThemePropertiesKey) + "}"; themeProperties = new JSONObject(defaultThemeProperties); } theme.setProperties(PropertyUtil.getProperties(themeProperties)); theme.setRequestParameters(requestParameters); theme.setUserview(userview); setting.setTheme(theme); } catch (Exception e) { LogUtil.debug(getClass().getName(), "set theme error."); } try { if (!"true".equals(setting.getPropertyString("tempDisablePermissionChecking"))) { if (settingObj.getJSONObject("properties").has("permission_rules")) { JSONArray permissionRules = settingObj.getJSONObject("properties").getJSONArray("permission_rules"); if (permissionRules != null && permissionRules.length() > 0) { for (int i = 0; i < permissionRules.length(); i++) { JSONObject rule = permissionRules.getJSONObject(i); if (rule.has("permission")) { JSONObject permissionObj = rule.optJSONObject("permission"); userviewPermission = UserviewUtil.getPermisionResult(permissionObj, requestParameters, currentUser); if (userviewPermission) { permissionKey = rule.getString("permission_key"); break; } } } } } if (!userviewPermission) { if (settingObj.getJSONObject("properties").has("permission")) { JSONObject permissionObj = settingObj.getJSONObject("properties").getJSONObject("permission"); userviewPermission = UserviewUtil.getPermisionResult(permissionObj, requestParameters, currentUser); } else { userviewPermission = true; } } } else { userviewPermission = true; } } catch (Exception e) { LogUtil.debug(getClass().getName(), "set permission error."); } userview.setSetting(setting); //set categories Collection<UserviewCategory> categories = new ArrayList<UserviewCategory>(); if (userviewPermission) { JSONArray categoriesArray = userviewObj.getJSONArray("categories"); for (int i = 0; i < categoriesArray.length(); i++) { JSONObject categoryObj = (JSONObject) categoriesArray.get(i); UserviewCategory category = new UserviewCategory(); category.setProperties(PropertyUtil.getProperties(categoryObj.getJSONObject("properties"))); //check for permission JSONObject ruleObj = null; if (Permission.DEFAULT.equals(permissionKey)) { ruleObj = categoryObj.getJSONObject("properties"); } else if (categoryObj.getJSONObject("properties").has("permission_rules")) { JSONObject permissionRules = categoryObj.getJSONObject("properties").getJSONObject("permission_rules"); if (permissionRules != null && permissionRules.has(permissionKey)) { ruleObj = permissionRules.getJSONObject(permissionKey); } } boolean hasPermis = false; if (preview || "true".equals(setting.getPropertyString("tempDisablePermissionChecking"))) { hasPermis = true; } else { if (ruleObj != null) { if (ruleObj.has("permissionDeny") && "true".equals(ruleObj.getString("permissionDeny"))) { hasPermis = false; } else if (ruleObj.has("permission")){ try { JSONObject permissionObj = ruleObj.getJSONObject("permission"); hasPermis = UserviewUtil.getPermisionResult(permissionObj, requestParameters, currentUser); } catch (Exception e) { LogUtil.debug(getClass().getName(), "set category permission error."); } } else { hasPermis = true; } //handle for permission rule to override the default setting if (ruleObj.has("hide") && "yes".equals(ruleObj.getString("hide"))) { category.setProperty("hide", "yes"); } else { category.setProperty("hide", ""); } } else { //when no properties found for the category object hasPermis = true; category.setProperty("hide", ""); } } if (hasPermis) { //set menus JSONArray menusArray = categoryObj.getJSONArray("menus"); Collection<UserviewMenu> menus = new ArrayList<UserviewMenu>(); for (int j = 0; j < menusArray.length(); j++) { try { //set menu JSONObject menuObj = (JSONObject) menusArray.get(j); UserviewMenu menu = (UserviewMenu) pluginManager.getPlugin(menuObj.getString("className")); // check for mobile support boolean isMobileView = MobileUtil.isMobileView(); if (isMobileView && (menu instanceof MobileElement) && !((MobileElement)menu).isMobileSupported()) { // mobile not supported, skip this menu continue; } //check for deny JSONObject menuRuleObj = null; if (Permission.DEFAULT.equals(permissionKey)) { menuRuleObj = menuObj.getJSONObject("properties"); } else if (menuObj.getJSONObject("properties").has("permission_rules")) { JSONObject permissionRules = menuObj.getJSONObject("properties").getJSONObject("permission_rules"); if (permissionRules != null && permissionRules.has(permissionKey)) { menuRuleObj = permissionRules.getJSONObject(permissionKey); } } if (menuRuleObj != null && menuRuleObj.has("permissionDeny") && "true".equals(menuRuleObj.getString("permissionDeny"))) { continue; } menu.setProperties(PropertyUtil.getProperties(menuObj.getJSONObject("properties"))); menu.setRequestParameters(requestParameters); menu.setUserview(userview); String mId = getMenuId(menu); menu.setProperty("menuId", mId); if (preview) { menu.setUrl(contextPath + "/web/console/app/" + appId + "/" + appVersion + "/userview/builderPreview/" + userview.getPropertyString("id") + "/" + mId); } else { menu.setKey(key); String prefix = "/web/userview/"; if (embed) { prefix = "/web/embed/userview/"; } menu.setUrl(contextPath + prefix + appId + "/" + userview.getPropertyString("id") + "/" + ((key != null) ? StringEscapeUtils.escapeHtml(key) : Userview.USERVIEW_KEY_EMPTY_VALUE) + "/" + mId); } //set Current, if current menu id is empty, search the 1st valid menu if ((("".equals(menuId) || "index".equals(menuId) || menuId == null) && userview.getCurrent() == null && menu.isHomePageSupported()) || (menuId != null && menuId.equals(mId))) { userview.setCurrent(menu); userview.setCurrentCategory(category); } //set home menu Id if (userview.getPropertyString("homeMenuId") == null || userview.getPropertyString("homeMenuId").isEmpty() && menu.isHomePageSupported()) { userview.setProperty("homeMenuId", mId); } if (menuRuleObj == null || !menuRuleObj.has("permissionHidden") || !"true".equals(menuRuleObj.getString("permissionHidden"))) { menu = new CachedUserviewMenu(menu); menus.add(menu); } } catch (Exception e) { LogUtil.debug(getClass().getName(), "Userview Menu class file not found"); } } category.setMenus(menus); if (!"yes".equals(category.getPropertyString("hide")) && menus.size() > 0) { categories.add(category); } } } } userview.setCategories(categories); } catch (Exception ex) { LogUtil.error(getClass().getName(), ex, "Create Userview Error!!"); } finally { if (isScreenCapture) { workflowUserManager.setCurrentThreadUser(currentThreadUser); } } return userview; }
[ "CWE-79" ]
CVE-2022-4560
MEDIUM
6.1
jogetworkflow/jw-community
createUserview
wflow-core/src/main/java/org/joget/apps/userview/service/UserviewService.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
1
Analyze the following code function for security vulnerabilities
public static void setNotificationChannel(NotificationManager nm, NotificationCompat.Builder mNotifyBuilder, Context context) { setNotificationChannel(nm, mNotifyBuilder, context, (String)null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNotificationChannel File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
setNotificationChannel
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private static void sortMemItems(List<MemItem> items) { Collections.sort(items, new Comparator<MemItem>() { @Override public int compare(MemItem lhs, MemItem rhs) { if (lhs.pss < rhs.pss) { return 1; } else if (lhs.pss > rhs.pss) { return -1; } return 0; } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sortMemItems 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
sortMemItems
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private boolean hasNegativeRollingPeriod(GaenKey key) { Integer rollingPeriod = key.getRollingPeriod(); if (key.getRollingPeriod() < 0) { logger.error("Detected key with negative rolling period {}", rollingPeriod); return true; } else { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasNegativeRollingPeriod File: dpppt-backend-sdk/dpppt-backend-sdk-ws/src/main/java/org/dpppt/backend/sdk/ws/controller/GaenController.java Repository: RadarCOVID/radar-covid-backend-dp3t-server The code follows secure coding practices.
[ "CWE-200" ]
CVE-2020-26230
LOW
2.6
RadarCOVID/radar-covid-backend-dp3t-server
hasNegativeRollingPeriod
dpppt-backend-sdk/dpppt-backend-sdk-ws/src/main/java/org/dpppt/backend/sdk/ws/controller/GaenController.java
6d30c92cc8fcbde3ded7e9518853ef278080344d
0
Analyze the following code function for security vulnerabilities
@Override public int getPasswordQuality(ComponentName who, int userHandle, boolean parent) { if (!mHasFeature) { return PASSWORD_QUALITY_UNSPECIFIED; } Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId"); final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle)); // System caller can query policy for a particular admin. Preconditions.checkCallAuthorization( who == null || isCallingFromPackage(who.getPackageName(), caller.getUid()) || canQueryAdminPolicy(caller)); synchronized (getLockObject()) { int mode = PASSWORD_QUALITY_UNSPECIFIED; if (who != null) { ActiveAdmin admin = getActiveAdminUncheckedLocked(who, userHandle, parent); return admin != null ? admin.mPasswordPolicy.quality : mode; } // Return the strictest policy across all participating admins. List<ActiveAdmin> admins = getActiveAdminsForLockscreenPoliciesLocked( getProfileParentUserIfRequested(userHandle, parent)); final int N = admins.size(); for (int i = 0; i < N; i++) { ActiveAdmin admin = admins.get(i); if (mode < admin.mPasswordPolicy.quality) { mode = admin.mPasswordPolicy.quality; } } return mode; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPasswordQuality 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
getPasswordQuality
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private IContentProvider getBlockedNumberProvider() { return mSpyContext.getContentResolver().acquireProvider(BlockedNumberContract.AUTHORITY); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBlockedNumberProvider File: tests/src/com/android/server/telecom/tests/BasicCallTests.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
getBlockedNumberProvider
tests/src/com/android/server/telecom/tests/BasicCallTests.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
private void checkAccess(DocumentReference currentAuthor, DocumentReference referencedDocReference) throws MacroExecutionException { // Current author must have view right on the target document to use it as context document try { this.authorizationManager.checkAccess(Right.VIEW, currentAuthor, referencedDocReference); } catch (AccessDeniedException e) { throw new MacroExecutionException("Author [" + currentAuthor + "] is not allowed to access target document [" + referencedDocReference + "]", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkAccess File: xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-context/src/main/java/org/xwiki/rendering/internal/macro/context/ContextMacro.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
checkAccess
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-context/src/main/java/org/xwiki/rendering/internal/macro/context/ContextMacro.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
private boolean isCredentialManagement(HttpServletRequest request) { String uri = request.getRequestURI(); return uri.endsWith("/Qaptcha") || uri.contains("/CredentialsServlet/") || uri.contains("/services/password/") || uri.contains("/services/authentication") || uri.contains("/AuthenticationServlet") || (isWebServiceRequested(request) && StringUtil.isDefined(request.getHeader(UserPrivilegeValidation.HTTP_AUTHORIZATION))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCredentialManagement File: core-war/src/main/java/org/silverpeas/web/token/SessionSynchronizerTokenValidator.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
isCredentialManagement
core-war/src/main/java/org/silverpeas/web/token/SessionSynchronizerTokenValidator.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
public void submoduleSync() { String[] syncArgs = new String[]{"submodule", "sync"}; CommandLine syncCmd = gitWd().withArgs(syncArgs); runOrBomb(syncCmd); List<String> foreachArgs = submoduleForEachRecursive(asList("git", "submodule", "sync")); CommandLine foreachCmd = gitWd().withArgs(foreachArgs); runOrBomb(foreachCmd); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: submoduleSync File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
submoduleSync
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("GoodTime") // reading system time without TimeSource public static void touch(File file) throws IOException { checkNotNull(file); if (!file.createNewFile() && !file.setLastModified(System.currentTimeMillis())) { throw new IOException("Unable to update modification time of " + file); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: touch File: android/guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
touch
android/guava/src/com/google/common/io/Files.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
public final String getAuthorizationServerEncodedUrl() { return authorizationServerEncodedUrl; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthorizationServerEncodedUrl File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java Repository: googleapis/google-oauth-java-client The code follows secure coding practices.
[ "CWE-863" ]
CVE-2020-7692
MEDIUM
6.4
googleapis/google-oauth-java-client
getAuthorizationServerEncodedUrl
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
13433cd7dd06267fc261f0b1d4764f8e3432c824
0
Analyze the following code function for security vulnerabilities
@Override public <A extends Output<E>, E extends Exception> void append(A a, CharSequence s) throws E { s = s == null ? "null" : s; append(a, s, 0, s.length()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: append File: api/jstachio/src/main/java/io/jstach/jstachio/escapers/HtmlEscaper.java Repository: jstachio The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-33962
MEDIUM
6.1
jstachio
append
api/jstachio/src/main/java/io/jstach/jstachio/escapers/HtmlEscaper.java
7b2f78377d1284df14c580be762a25af5f8dcd66
0
Analyze the following code function for security vulnerabilities
public void requestUsageTimeReport(PendingIntent receiver) { mUsageTimeReport = receiver; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestUsageTimeReport File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
requestUsageTimeReport
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
@Beta public static MappedByteBuffer map(File file) throws IOException { checkNotNull(file); return map(file, MapMode.READ_ONLY); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: map File: android/guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-732" ]
CVE-2020-8908
LOW
2.1
google/guava
map
android/guava/src/com/google/common/io/Files.java
fec0dbc4634006a6162cfd4d0d09c962073ddf40
0
Analyze the following code function for security vulnerabilities
public int read(int[] d) throws IOException { return read(d, 0, d.length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: read File: src/main/java/org/xerial/snappy/SnappyInputStream.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-34455
HIGH
7.5
xerial/snappy-java
read
src/main/java/org/xerial/snappy/SnappyInputStream.java
3bf67857fcf70d9eea56eed4af7c925671e8eaea
0
Analyze the following code function for security vulnerabilities
public void providerChanged(int appWidgetId, AppWidgetProviderInfo info) { if (isLocalBinder() && info != null) { info = info.clone(); } Message msg = mHandler.obtainMessage(HANDLE_PROVIDER_CHANGED, appWidgetId, 0, info); msg.sendToTarget(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: providerChanged File: core/java/android/appwidget/AppWidgetHost.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
providerChanged
core/java/android/appwidget/AppWidgetHost.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
private void unlockKeystore(String password, int userHandle) { if (DEBUG) Slog.v(TAG, "Unlock keystore for user: " + userHandle); final KeyStore ks = KeyStore.getInstance(); ks.unlock(userHandle, password); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unlockKeystore File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
unlockKeystore
services/core/java/com/android/server/LockSettingsService.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
void removeUserData(int userHandle) { final boolean isOrgOwned; synchronized (getLockObject()) { if (userHandle == UserHandle.USER_SYSTEM) { Slogf.w(LOG_TAG, "Tried to remove device policy file for user 0! Ignoring."); return; } updatePasswordQualityCacheForUserGroup(userHandle); mPolicyCache.onUserRemoved(userHandle); if (isManagedProfile(userHandle)) { clearManagedProfileApnUnchecked(); } isOrgOwned = mOwners.isProfileOwnerOfOrganizationOwnedDevice(userHandle); mOwners.removeProfileOwner(userHandle); mOwners.writeProfileOwner(userHandle); pushScreenCapturePolicy(userHandle); DevicePolicyData policy = mUserData.get(userHandle); if (policy != null) { mUserData.remove(userHandle); } File policyFile = new File(mPathProvider.getUserSystemDirectory(userHandle), DEVICE_POLICIES_XML); policyFile.delete(); Slogf.i(LOG_TAG, "Removed device policy file " + policyFile.getAbsolutePath()); } if (isOrgOwned) { final UserInfo primaryUser = mUserManager.getPrimaryUser(); if (primaryUser != null) { clearOrgOwnedProfileOwnerDeviceWidePolicies(primaryUser.id); } else { Slogf.wtf(LOG_TAG, "Was unable to get primary user."); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeUserData 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
removeUserData
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private static User create(String email, String passwordHash, boolean validateEmail, Response response) throws UnauthorizedException { // Check user against login whitelist, if it exists if (GribbitServer.loginWhitelistChecker == null || GribbitServer.loginWhitelistChecker.allowUserToLogin(email)) { // Check if a user of this name already exists, and if not, create user record in database. // Should probably be a transaction, although if the record is created twice within a // short period of time, one of the two account creation operations will simply have its // authorization cookie overwritten by the other, so the first session will be logged out. // Either way, users creating an account with the given email address must be in control // of that email account, so this is still secure. if (findByEmail(email) != null) { throw new UnauthorizedException("Could not create new user: user \"" + email + "\" already exists"); } User user = new User(email); user.passwordHash = passwordHash; user.createdDate = ZonedDateTime.now().format(DateTimeFormatter.ISO_ZONED_DATE_TIME); user.emailValidated = validateEmail; // Log in and save user user.logIn(response); return user; } else { // User is not authorized throw new UnauthorizedException("User is not whitelisted for account creation: " + email); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: create File: src/gribbit/auth/User.java Repository: lukehutch/gribbit The code follows secure coding practices.
[ "CWE-346" ]
CVE-2014-125071
MEDIUM
5.2
lukehutch/gribbit
create
src/gribbit/auth/User.java
620418df247aebda3dd4be1dda10fe229ea505dd
0
Analyze the following code function for security vulnerabilities
public static File getCacheFile(final URL source, final VersionString version) { if (!isCacheable(source)) throw new IllegalArgumentException(source + " is not a cacheable resource"); File cacheFile = null; final CacheLRUWrapper lruHandler = CacheLRUWrapper.getInstance(); synchronized (lruHandler) { try { lruHandler.lock(); // We need to reload the cacheOrder file each time // since another plugin/javaws instance may have updated it. lruHandler.load(); cacheFile = getCacheFileIfExist(urlToPath(source, "")); if (cacheFile == null) { // We did not find a copy of it. cacheFile = makeNewCacheFile(source, version); } else lruHandler.store(); } finally { lruHandler.unlock(); } } return cacheFile; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCacheFile File: core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
getCacheFile
core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java
2ab070cdac087bd208f64fa8138bb709f8d7680c
0
Analyze the following code function for security vulnerabilities
public DirectoryBrowserSupport doUserContent() { return new DirectoryBrowserSupport(this,getRootPath().child("userContent"),"User content","folder.png",true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doUserContent 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
doUserContent
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public static NativeArray jsFunction_rateAPI(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws ScriptException, APIManagementException { NativeArray myn = new NativeArray(0); if (args != null && args.length != 0) { String providerName = APIUtil.replaceEmailDomain((String) args[0]); String apiName = (String) args[1]; String version = (String) args[2]; String rateStr = (String) args[3]; int rate; try { rate = Integer.parseInt(rateStr.substring(0, 1)); } catch (NumberFormatException e) { log.error("Rate must to be number " + rateStr, e); return myn; } catch (Exception e) { log.error("Error from while Rating API " + rateStr, e); return myn; } APIIdentifier apiId; APIConsumer apiConsumer = getAPIConsumer(thisObj); try { apiId = new APIIdentifier(providerName, apiName, version); String user = getUsernameFromObject(thisObj); switch (rate) { //Below case 0[Rate 0] - is to remove ratings from a user case 0: { apiConsumer.rateAPI(apiId, APIRating.RATING_ZERO, user); break; } case 1: { apiConsumer.rateAPI(apiId, APIRating.RATING_ONE, user); break; } case 2: { apiConsumer.rateAPI(apiId, APIRating.RATING_TWO, user); break; } case 3: { apiConsumer.rateAPI(apiId, APIRating.RATING_THREE, user); break; } case 4: { apiConsumer.rateAPI(apiId, APIRating.RATING_FOUR, user); break; } case 5: { apiConsumer.rateAPI(apiId, APIRating.RATING_FIVE, user); break; } default: { throw new IllegalArgumentException("Can't handle " + rate); } } } catch (APIManagementException e) { log.error("Error while Rating API " + apiName + e); return myn; } catch (Exception e) { log.error("Error while Rating API " + apiName + e); return myn; } NativeObject row = new NativeObject(); row.put("name", row, apiName); row.put("provider", row, APIUtil.replaceEmailDomainBack(providerName)); row.put("version", row, version); row.put("rates", row, rateStr); row.put("newRating", row, Float.toString(apiConsumer.getAPI(apiId).getRating())); myn.put(0, myn, row); }// end of the if return myn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_rateAPI 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_rateAPI
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
@Pure @Override public int getInt(@Positive int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getInt columnIndex: {0}", columnIndex); byte[] value = getRawValue(columnIndex); if (value == null) { return 0; // SQL NULL } if (isBinary(columnIndex)) { int col = columnIndex - 1; int oid = fields[col].getOID(); if (oid == Oid.INT4) { return ByteConverter.int4(value, 0); } return (int) readLongValue(value, oid, Integer.MIN_VALUE, Integer.MAX_VALUE, "int"); } Encoding encoding = connection.getEncoding(); if (encoding.hasAsciiNumbers()) { try { return getFastInt(value); } catch (NumberFormatException ignored) { } } return toInt(getFixedString(columnIndex)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInt File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
getInt
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
private JWTClaimsSet fetchOidcProfile(BearerAccessToken accessToken) { final var userInfoRequest = new UserInfoRequest(configuration.findProviderMetadata().getUserInfoEndpointURI(), accessToken); final var userInfoHttpRequest = userInfoRequest.toHTTPRequest(); configuration.configureHttpRequest(userInfoHttpRequest); try { final var httpResponse = userInfoHttpRequest.send(); logger.debug("Token response: status={}, content={}", httpResponse.getStatusCode(), httpResponse.getContent()); final var userInfoResponse = UserInfoResponse.parse(httpResponse); if (userInfoResponse instanceof UserInfoErrorResponse) { logger.error("Bad User Info response, error={}", ((UserInfoErrorResponse) userInfoResponse).getErrorObject().toJSONObject()); throw new AuthenticationException(); } else { final var userInfoSuccessResponse = (UserInfoSuccessResponse) userInfoResponse; final JWTClaimsSet userInfoClaimsSet; if (userInfoSuccessResponse.getUserInfo() != null) { userInfoClaimsSet = userInfoSuccessResponse.getUserInfo().toJWTClaimsSet(); } else { userInfoClaimsSet = userInfoSuccessResponse.getUserInfoJWT().getJWTClaimsSet(); } return userInfoClaimsSet; } } catch (IOException | ParseException | java.text.ParseException | AuthenticationException e) { throw new TechnicalException(e); } }
Vulnerability Classification: - CWE: CWE-347 - CVE: CVE-2021-44878 - Severity: MEDIUM - CVSS Score: 5.0 Description: reinforce security on OIDC Function: fetchOidcProfile File: pac4j-oidc/src/main/java/org/pac4j/oidc/credentials/authenticator/UserInfoOidcAuthenticator.java Repository: pac4j Fixed Code: private JWTClaimsSet fetchOidcProfile(BearerAccessToken accessToken) { final var userInfoRequest = new UserInfoRequest(configuration.findProviderMetadata().getUserInfoEndpointURI(), accessToken); final var userInfoHttpRequest = userInfoRequest.toHTTPRequest(); configuration.configureHttpRequest(userInfoHttpRequest); try { final var httpResponse = userInfoHttpRequest.send(); logger.debug("Token response: status={}, content={}", httpResponse.getStatusCode(), httpResponse.getContent()); final var userInfoResponse = UserInfoResponse.parse(httpResponse); if (userInfoResponse instanceof UserInfoErrorResponse) { throw new TechnicalException("Bad User Info response, error=" + ((UserInfoErrorResponse) userInfoResponse).getErrorObject().toJSONObject()); } else { final var userInfoSuccessResponse = (UserInfoSuccessResponse) userInfoResponse; final JWTClaimsSet userInfoClaimsSet; if (userInfoSuccessResponse.getUserInfo() != null) { userInfoClaimsSet = userInfoSuccessResponse.getUserInfo().toJWTClaimsSet(); } else { userInfoClaimsSet = userInfoSuccessResponse.getUserInfoJWT().getJWTClaimsSet(); } return userInfoClaimsSet; } } catch (IOException | ParseException | java.text.ParseException e) { throw new TechnicalException(e); } }
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
fetchOidcProfile
pac4j-oidc/src/main/java/org/pac4j/oidc/credentials/authenticator/UserInfoOidcAuthenticator.java
22b82ffd702a132d9f09da60362fc6264fc281ae
1
Analyze the following code function for security vulnerabilities
private boolean impliesClusterPermission(String action) { return clusterPerms.test(action); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: impliesClusterPermission File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java Repository: opensearch-project/security The code follows secure coding practices.
[ "CWE-612", "CWE-863" ]
CVE-2022-41918
MEDIUM
6.3
opensearch-project/security
impliesClusterPermission
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
0
Analyze the following code function for security vulnerabilities
private static void finishDataDelivery(Context context, int op, @NonNull AttributionSourceState attributionSourceState, boolean fromDatasource) { Objects.requireNonNull(attributionSourceState); AppOpsManager appOpsManager = context.getSystemService(AppOpsManager.class); if (op == AppOpsManager.OP_NONE) { return; } AttributionSource current = new AttributionSource(attributionSourceState); AttributionSource next = null; while (true) { final boolean skipCurrentFinish = (fromDatasource || next != null); next = current.getNext(); // If the call is from a datasource we need to vet only the chain before it. This // way we can avoid the datasource creating an attribution context for every call. if (!(fromDatasource && current.asState() == attributionSourceState) && next != null && !current.isTrusted(context)) { return; } // The access is for oneself if this is the single receiver of data // after the data source or if this is the single attribution source // in the chain if not from a datasource. final boolean singleReceiverFromDatasource = (fromDatasource && current.asState() == attributionSourceState && next != null && next.getNext() == null); final boolean selfAccess = singleReceiverFromDatasource || next == null; final AttributionSource accessorSource = (!singleReceiverFromDatasource) ? current : next; if (selfAccess) { final String resolvedPackageName = resolvePackageName(context, accessorSource); if (resolvedPackageName == null) { return; } appOpsManager.finishOp(attributionSourceState.token, op, accessorSource.getUid(), resolvedPackageName, accessorSource.getAttributionTag()); } else { final AttributionSource resolvedAttributionSource = resolveAttributionSource(context, accessorSource); if (resolvedAttributionSource.getPackageName() == null) { return; } appOpsManager.finishProxyOp(attributionSourceState.token, AppOpsManager.opToPublicName(op), resolvedAttributionSource, skipCurrentFinish); } if (next == null || next.getNext() == null) { return; } RegisteredAttribution registered = sRunningAttributionSources.remove(current.getToken()); if (registered != null) { registered.unregister(); } current = next; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishDataDelivery File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
finishDataDelivery
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
private void cleanUpPackageForAllLoadedUsers(String packageName, @UserIdInt int packageUserId, boolean appStillExists) { synchronized (mLock) { forEachLoadedUserLocked(user -> cleanUpPackageLocked(packageName, user.getUserId(), packageUserId, appStillExists)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanUpPackageForAllLoadedUsers 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
cleanUpPackageForAllLoadedUsers
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
protected String getPlatformConfig(String platform) { IntegrationRequest request = new IntegrationRequest(); if (StringUtils.isBlank(workspaceId)) { MSException.throwException("workspace id is null"); } request.setWorkspaceId(workspaceId); request.setPlatform(platform); ServiceIntegration integration = baseIntegrationService.get(request); return integration.getConfiguration(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPlatformConfig File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getPlatformConfig
test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
@Override public KeyDeserializer createKeyDeserializer(DeserializationContext ctxt, JavaType type) throws JsonMappingException { final DeserializationConfig config = ctxt.getConfig(); KeyDeserializer deser = null; if (_factoryConfig.hasKeyDeserializers()) { BeanDescription beanDesc = config.introspectClassAnnotations(type.getRawClass()); for (KeyDeserializers d : _factoryConfig.keyDeserializers()) { deser = d.findKeyDeserializer(type, config, beanDesc); if (deser != null) { break; } } } // the only non-standard thing is this: if (deser == null) { if (type.isEnumType()) { deser = _createEnumKeyDeserializer(ctxt, type); } else { deser = StdKeyDeserializers.findStringBasedKeyDeserializer(config, type); } } // and then post-processing if (deser != null) { if (_factoryConfig.hasDeserializerModifiers()) { for (BeanDeserializerModifier mod : _factoryConfig.deserializerModifiers()) { deser = mod.modifyKeyDeserializer(config, type, deser); } } } return deser; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createKeyDeserializer File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
createKeyDeserializer
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
@Deprecated public String getCreator() { return userReferenceToString(getCreatorReference()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCreator 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
getCreator
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
@Override public void onEvent(Event event, Object source, Object data) { if (event instanceof WikiDeletedEvent) { // A wiki has been deleted onWikiDeletedEvent((WikiDeletedEvent) event); } else if (event instanceof ComponentDescriptorAddedEvent) { // A new mandatory document initializer has been installed onMandatoryDocumentInitializerAdded((ComponentDescriptorAddedEvent) event, (ComponentManager) source); } else { // Document modifications XWikiDocument doc = (XWikiDocument) source; if (event instanceof XObjectPropertyEvent) { EntityReference reference = ((XObjectPropertyEvent) event).getReference(); String modifiedProperty = reference.getName(); if ("backlinks".equals(modifiedProperty)) { this.hasBacklinks = doc.getXObject((ObjectReference) reference.getParent()).getIntValue("backlinks", getConfiguration().getProperty("xwiki.backlinks", 0)) == 1; } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onEvent 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
onEvent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public int getDefaultPort() { return 3306; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultPort File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/database/CmsUpgrader.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
getDefaultPort
publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/database/CmsUpgrader.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
@Deprecated public WearableExtender setHintHideIcon(boolean hintHideIcon) { setFlag(FLAG_HINT_HIDE_ICON, hintHideIcon); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHintHideIcon File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setHintHideIcon
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public ServerBuilder tlsSelfSigned() { virtualHostTemplate.tlsSelfSigned(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tlsSelfSigned File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
tlsSelfSigned
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
protected int regCodeToServiceState(int code) { switch (code) { case 0: // Not searching and not registered return ServiceState.STATE_OUT_OF_SERVICE; case 1: return ServiceState.STATE_IN_SERVICE; case 2: // 2 is "searching", fall through case 3: // 3 is "registration denied", fall through case 4: // 4 is "unknown", not valid in current baseband return ServiceState.STATE_OUT_OF_SERVICE; case 5:// 5 is "Registered, roaming" return ServiceState.STATE_IN_SERVICE; default: loge("regCodeToServiceState: unexpected service state " + code); return ServiceState.STATE_OUT_OF_SERVICE; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: regCodeToServiceState File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
regCodeToServiceState
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
protected void initializeNative() { if (mNativeTabAndroid == 0) nativeInit(); assert mNativeTabAndroid != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeNative File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
initializeNative
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
static boolean signaturesMatch(ArrayList<byte[]> storedSigHashes, PackageInfo target) { if (target == null) { return false; } // If the target resides on the system partition, we allow it to restore // data from the like-named package in a restore set even if the signatures // do not match. (Unlike general applications, those flashed to the system // partition will be signed with the device's platform certificate, so on // different phones the same system app will have different signatures.) if ((target.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { if (MORE_DEBUG) Slog.v(TAG, "System app " + target.packageName + " - skipping sig check"); return true; } // Allow unsigned apps, but not signed on one device and unsigned on the other // !!! TODO: is this the right policy? Signature[] deviceSigs = target.signatures; if (MORE_DEBUG) Slog.v(TAG, "signaturesMatch(): stored=" + storedSigHashes + " device=" + deviceSigs); if ((storedSigHashes == null || storedSigHashes.size() == 0) && (deviceSigs == null || deviceSigs.length == 0)) { return true; } if (storedSigHashes == null || deviceSigs == null) { return false; } // !!! TODO: this demands that every stored signature match one // that is present on device, and does not demand the converse. // Is this this right policy? final int nStored = storedSigHashes.size(); final int nDevice = deviceSigs.length; // hash each on-device signature ArrayList<byte[]> deviceHashes = new ArrayList<byte[]>(nDevice); for (int i = 0; i < nDevice; i++) { deviceHashes.add(hashSignature(deviceSigs[i])); } // now ensure that each stored sig (hash) matches an on-device sig (hash) for (int n = 0; n < nStored; n++) { boolean match = false; final byte[] storedHash = storedSigHashes.get(n); for (int i = 0; i < nDevice; i++) { if (Arrays.equals(storedHash, deviceHashes.get(i))) { match = true; break; } } // match is false when no on-device sig matched one of the stored ones if (!match) { return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: signaturesMatch 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
signaturesMatch
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public List<String> getChildren(int nb, int start) throws XWikiException { return this.doc.getChildren(nb, start, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChildren 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
getChildren
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
private boolean updateSubmoduleWithDepth(int depth) { List<String> updateArgs = new ArrayList<>(asList("submodule", "update")); updateArgs.add("--depth=" + depth); CommandLine commandLine = gitWd().withArgs(updateArgs); try { runOrBomb(commandLine); } catch (Exception e) { LOG.warn(e.getMessage(), e); return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSubmoduleWithDepth File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
updateSubmoduleWithDepth
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
@Override public void onUserSwitching(int newUserId, IRemoteCallback reply) { mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCHING, newUserId, 0, reply)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUserSwitching File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
onUserSwitching
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Override public List<Database> getAllDatabases() throws IOException { StringBuilder sql = new StringBuilder(); List<Object> condition = new ArrayList<>(1); sql.append("select * from ").append(ServiceTraffic.INDEX_NAME).append(" where "); sql.append(ServiceTraffic.NODE_TYPE).append("=? limit ").append(metadataQueryMaxSize); condition.add(NodeType.Database.value()); try (Connection connection = h2Client.getConnection()) { try (ResultSet resultSet = h2Client.executeQuery( connection, sql.toString(), condition.toArray(new Object[0]))) { List<Database> databases = new ArrayList<>(); while (resultSet.next()) { Database database = new Database(); database.setId(resultSet.getString(H2TableInstaller.ID_COLUMN)); database.setName(resultSet.getString(ServiceTraffic.NAME)); databases.add(database); } return databases; } } catch (SQLException e) { throw new IOException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllDatabases File: oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetadataQueryDAO.java Repository: apache/skywalking The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-13921
HIGH
7.5
apache/skywalking
getAllDatabases
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetadataQueryDAO.java
ddb6d9a5019a9c1fe31c364485a4e4b5066fefc3
0
Analyze the following code function for security vulnerabilities
private native void nativeEvaluateJavaScript(long nativeContentViewCoreImpl, String script, JavaScriptCallback callback, boolean startRenderer);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeEvaluateJavaScript File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
nativeEvaluateJavaScript
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@Override public Config getConfig() { return config; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfig File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
getConfig
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
public ActivityOptions setLaunchBounds(@Nullable Rect screenSpacePixelRect) { mLaunchBounds = screenSpacePixelRect != null ? new Rect(screenSpacePixelRect) : null; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLaunchBounds File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
setLaunchBounds
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
private void setStringUnchecked(String key, int userId, String value) { mStorage.writeKeyValue(key, value, userId); if (ArrayUtils.contains(SETTINGS_TO_BACKUP, key)) { BackupManager.dataChanged("com.android.providers.settings"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStringUnchecked 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
setStringUnchecked
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
0
Analyze the following code function for security vulnerabilities
private synchronized void cleanupMUCs(boolean set_offline) { // get a fresh MUC list Cursor cursor = mContentResolver.query(RosterProvider.MUCS_URI, new String[] { RosterProvider.RosterConstants.JID }, null, null, null); mucJIDs.clear(); while(cursor.moveToNext()) { mucJIDs.add(cursor.getString(0)); } cursor.close(); // delete removed MUCs StringBuilder exclusion = new StringBuilder(RosterProvider.RosterConstants.GROUP + " = ? AND " + RosterConstants.JID + " NOT IN ('"); exclusion.append(TextUtils.join("', '", mucJIDs)); exclusion.append("');"); mContentResolver.delete(RosterProvider.CONTENT_URI, exclusion.toString(), new String[] { RosterProvider.RosterConstants.MUCS }); if (set_offline) { // update all other MUCs as offline ContentValues values = new ContentValues(); values.put(RosterConstants.STATUS_MODE, StatusMode.offline.ordinal()); mContentResolver.update(RosterProvider.CONTENT_URI, values, RosterProvider.RosterConstants.GROUP + " = ?", new String[] { RosterProvider.RosterConstants.MUCS }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanupMUCs File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
cleanupMUCs
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
@Test public void testDeserializationAsEmptyArrayEnabled() throws Throwable { String json="[]"; Duration value= newMapper() .configure(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS, true) .configure(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT, true) .readerFor(Duration.class).readValue(aposToQuotes(json)); assertNull(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testDeserializationAsEmptyArrayEnabled File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java Repository: FasterXML/jackson-modules-java8 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testDeserializationAsEmptyArrayEnabled
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0
Analyze the following code function for security vulnerabilities
public static String sanitizeFileName(String filename, char substitute) { for (int i = 0; i < INVALID_NAME.size(); i++) { if (-1 != filename.indexOf(INVALID_NAME.get(i))) { filename = filename.replace(INVALID_NAME.get(i), substitute); } } return filename; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sanitizeFileName File: core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
sanitizeFileName
core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java
2ab070cdac087bd208f64fa8138bb709f8d7680c
0
Analyze the following code function for security vulnerabilities
@Override public BufferedReader getReader() throws IOException { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReader File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
getReader
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public void setStringListValue(EntityReference classReference, String fieldName, List value) { BaseObject bobject = prepareXObject(classReference); bobject.setStringListValue(fieldName, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStringListValue 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
setStringListValue
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 void uploadFiles(Context context, HttpServletRequest request) throws ServletException { FileUploadRequest wrapper = null; String filePath = null; InputStream fileInputStream = null; try { // if we already have a FileUploadRequest, use it if (Class.forName("org.dspace.app.webui.util.FileUploadRequest") .isInstance(request)) { wrapper = (FileUploadRequest) request; } else { // Wrap multipart request to get the submission info wrapper = new FileUploadRequest(request); } log.debug("Did not recoginze resumable upload, falling back to " + "simple upload."); Enumeration fileParams = wrapper.getFileParameterNames(); while (fileParams.hasMoreElements()) { String fileName = (String) fileParams.nextElement(); File temp = wrapper.getFile(fileName); //if file exists and has a size greater than zero if (temp != null && temp.length() > 0) { // Read the temp file into an inputstream fileInputStream = new BufferedInputStream( new FileInputStream(temp)); filePath = wrapper.getFilesystemName(fileName); // cleanup our temp file if (!temp.delete()) { log.error("Unable to delete temporary file"); } //save this file's info to request (for UploadStep class) request.setAttribute(fileName + "-path", filePath); request.setAttribute(fileName + "-inputstream", fileInputStream); request.setAttribute(fileName + "-description", wrapper.getParameter("description")); } } } catch (Exception e) { // Problem with uploading log.warn(LogManager.getHeader(context, "upload_error", ""), e); throw new ServletException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: uploadFiles File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31194
HIGH
7.2
DSpace
uploadFiles
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
d1dd7d23329ef055069759df15cfa200c8e3
0
Analyze the following code function for security vulnerabilities
public Set<String> getFls() { return Collections.unmodifiableSet(fls); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFls File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java Repository: opensearch-project/security The code follows secure coding practices.
[ "CWE-612", "CWE-863" ]
CVE-2022-41918
MEDIUM
6.3
opensearch-project/security
getFls
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
0
Analyze the following code function for security vulnerabilities
public Intent registerReceiver(IApplicationThread caller, String callerPackage, IIntentReceiver receiver, IntentFilter filter, String requiredPermission, int userId) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerReceiver File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
registerReceiver
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0