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
void updateUidReadyForBootCompletedBroadcastLocked(int uid) { for (BroadcastQueue queue : mBroadcastQueues) { queue.updateUidReadyForBootCompletedBroadcastLocked(uid); queue.scheduleBroadcastsLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateUidReadyForBootCompletedBroadcastLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
updateUidReadyForBootCompletedBroadcastLocked
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
protected String getEventGroupItemWithUnitSql(String studyIds, String sedIds, String itemIds, String dateConstraint, int datasetItemStatusId, String studySubjectIds) { return "select cvit.*, mu.oc_oid as mu_oid from (" + this.getEventGroupItemSqlSS(studyIds, sedIds, itemIds, dateConstraint, datasetItemStatusId, studySubjectIds) + " )cvit left join (select item.item_id, mu.oc_oid from versioning_map vm, item, measurement_unit mu where vm.item_id in " + itemIds + " and vm.item_id = item.item_id and item.units = mu.name )mu on cvit.item_id = mu.item_id" + " ORDER BY cvit.event_crf_id, cvit.item_group_id, cvit.item_id, cvit.item_data_ordinal"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEventGroupItemWithUnitSql File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getEventGroupItemWithUnitSql
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public void writeEmbedResponse(HttpServletRequest request, HttpServletResponse response) throws IOException { response.setCharacterEncoding("UTF-8"); response.setContentType("application/javascript; charset=UTF-8"); response.setHeader("Last-Modified", lastModified); if (request.getParameter("fetch") != null) { response.setHeader("Cache-Control", "no-store"); } OutputStream out = response.getOutputStream(); // Creates XML for stencils PrintWriter writer = new PrintWriter(out); // Writes JavaScript and adds function call with // stylesheet and stencils as arguments writer.println(createEmbedJavaScript(request)); response.setStatus(HttpServletResponse.SC_OK); writer.flush(); writer.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeEmbedResponse File: src/main/java/com/mxgraph/online/EmbedServlet2.java Repository: jgraph/drawio The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-1723
MEDIUM
5
jgraph/drawio
writeEmbedResponse
src/main/java/com/mxgraph/online/EmbedServlet2.java
7a68ebe22a64fe722704e9c4527791209fee2034
0
Analyze the following code function for security vulnerabilities
void setDisplayLayoutNeeded() { final DisplayContent dc = getDisplayContent(); if (dc != null) { dc.setLayoutNeeded(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDisplayLayoutNeeded File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
setDisplayLayoutNeeded
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override public boolean isNativeFontSchemeSupported() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNativeFontSchemeSupported 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
isNativeFontSchemeSupported
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public Response processAddSession(SessionInfo info) throws Exception { ConnectionId connectionId = info.getSessionId().getParentId(); TransportConnectionState cs = lookupConnectionState(connectionId); // Avoid replaying dup commands if (cs != null && !cs.getSessionIds().contains(info.getSessionId())) { broker.addSession(cs.getContext(), info); try { cs.addSession(info); } catch (IllegalStateException e) { e.printStackTrace(); broker.removeSession(cs.getContext(), info); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processAddSession File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
processAddSession
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
public void setSerialNumber(CertId serialNumber) { this.serialNumber = serialNumber; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSerialNumber File: base/common/src/main/java/com/netscape/certsrv/cert/CertData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setSerialNumber
base/common/src/main/java/com/netscape/certsrv/cert/CertData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private void onActionViewClicked(@NonNull PendingIntent intent, boolean isCloseAction) { try { intent.send(); } catch (PendingIntent.CanceledException e) { ProtoLog.w(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE, "%s: Failed to send action, %s", TAG, e); } if (isCloseAction) { mPipUiEventLogger.log(PipUiEventLogger.PipUiEventEnum.PICTURE_IN_PICTURE_CUSTOM_CLOSE); mAllowTouches = false; mMainExecutor.executeDelayed(() -> { hideMenu(); // TODO: it's unsafe to call onPipDismiss with a delay here since // we may have a different PiP by the time this runnable is executed. mController.onPipDismiss(); mAllowTouches = true; }, mPipForceCloseDelay); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onActionViewClicked File: libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40123
MEDIUM
5.5
android
onActionViewClicked
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
7212a4bec2d2f1a74fa54a12a04255d6a183baa9
0
Analyze the following code function for security vulnerabilities
@Transactional @Listen(1) public void on(SystemStarted event) { logger.info("Checking projects..."); cacheLock.writeLock().lock(); try { for (Project project: query()) { cache.put(project.getId(), project.getFacade()); checkSanity(project); } } finally { cacheLock.writeLock().unlock(); } taskId = taskScheduler.schedule(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: on File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
on
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
public void save(final OnmsUser onmsUser) throws Exception { update(); m_writeLock.lock(); try { User xmlUser = _getUser(onmsUser.getUsername()); if (xmlUser == null) { xmlUser = new User(); xmlUser.setUserId(onmsUser.getUsername()); } xmlUser.setFullName(onmsUser.getFullName()); xmlUser.setUserComments(onmsUser.getComments()); // Contact info _setContact(xmlUser, ContactType.email, onmsUser.getEmail()); final Password pass = new Password(); pass.setEncryptedPassword(onmsUser.getPassword()); pass.setSalt(onmsUser.getPasswordSalted()); xmlUser.setPassword(pass); if (onmsUser.getDutySchedule() != null) { xmlUser.setDutySchedules(new ArrayList<String>(onmsUser.getDutySchedule())); } if (onmsUser.getRoles() != null) { xmlUser.setRoles(new ArrayList<String>(onmsUser.getRoles())); } _writeUser(onmsUser.getUsername(), xmlUser); } finally { m_writeLock.unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
save
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
final void verifyStates() { if (injectShouldPerformVerification()) { verifyStatesInner(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifyStates 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
verifyStates
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
private void jjCheckNAdd(int state) { if (jjrounds[state] != jjround) { jjstateSet[jjnewStateCnt++] = state; jjrounds[state] = jjround; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jjCheckNAdd File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java Repository: jakartaee/expression-language The code follows secure coding practices.
[ "CWE-917" ]
CVE-2021-28170
MEDIUM
5
jakartaee/expression-language
jjCheckNAdd
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
b6a3943ac5fba71cbc6719f092e319caa747855b
0
Analyze the following code function for security vulnerabilities
@Override public int formatNdef(int nativeHandle, byte[] key) throws RemoteException { NfcPermissions.enforceUserPermissions(mContext); TagEndpoint tag; // Check if NFC is enabled if (!isNfcEnabled()) { return ErrorCodes.ERROR_NOT_INITIALIZED; } /* find the tag in the hmap */ tag = (TagEndpoint) findObject(nativeHandle); if (tag == null) { return ErrorCodes.ERROR_IO; } if (tag.formatNdef(key)) { return ErrorCodes.SUCCESS; } else { return ErrorCodes.ERROR_IO; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: formatNdef File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
formatNdef
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
public abstract BaseXMLBuilder ns(String namespaceURI);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ns File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
ns
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
public void setAutomaticRecoveryEnabled(boolean automaticRecovery) { this.automaticRecovery = automaticRecovery; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAutomaticRecoveryEnabled File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
setAutomaticRecoveryEnabled
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@Override public synchronized StompServer handler(StompServerHandler handler) { Objects.requireNonNull(handler); this.handler = handler; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handler File: src/main/java/io/vertx/ext/stomp/impl/StompServerImpl.java Repository: vert-x3/vertx-stomp The code follows secure coding practices.
[ "CWE-287" ]
CVE-2023-32081
MEDIUM
6.5
vert-x3/vertx-stomp
handler
src/main/java/io/vertx/ext/stomp/impl/StompServerImpl.java
0de4bc5a44ddb57e74d92c445f16456fa03f265b
0
Analyze the following code function for security vulnerabilities
@Override public String toPlainString() { // NOTE: This logic is duplicated between here and DecimalQuantity_SimpleStorage. StringBuilder sb = new StringBuilder(); if (isNegative()) { sb.append('-'); } if (precision == 0 || getMagnitude() < 0) { sb.append('0'); } for (int m = getUpperDisplayMagnitude(); m >= getLowerDisplayMagnitude(); m--) { sb.append((char) ('0' + getDigit(m))); if (m == 0) sb.append('.'); } return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toPlainString File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
toPlainString
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
public byte[] getBytesOnPost(Proxy proxy, SecurityAuthentication authentication, String data, Map<String, Object> headers) { if (isUrlOk() == false) return null; final Future<byte[]> result = EXE .submit(requestWithPostAndResponse(internal, proxy, authentication, data, headers)); try { return result.get(SecurityUtils.getSecurityProfile().getTimeout(), TimeUnit.MILLISECONDS); } catch (Exception e) { System.err.println("SURL response issue to " + internal.getHost() + " " + e); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBytesOnPost File: src/net/sourceforge/plantuml/security/SURL.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
getBytesOnPost
src/net/sourceforge/plantuml/security/SURL.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
public void providersChanged() { mHandler.obtainMessage(HANDLE_PROVIDERS_CHANGED).sendToTarget(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: providersChanged File: core/java/android/appwidget/AppWidgetHost.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
providersChanged
core/java/android/appwidget/AppWidgetHost.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
void startPackageOneTimeSession(@NonNull String packageName, long timeoutMillis, long revokeAfterKilledDelayMillis) { int uid; try { uid = mContext.getPackageManager().getPackageUid(packageName, 0); } catch (PackageManager.NameNotFoundException e) { Log.e(LOG_TAG, "Unknown package name " + packageName, e); return; } synchronized (mLock) { PackageInactivityListener listener = mListeners.get(uid); if (listener != null) { listener.updateSessionParameters(timeoutMillis, revokeAfterKilledDelayMillis); return; } listener = new PackageInactivityListener(uid, packageName, timeoutMillis, revokeAfterKilledDelayMillis); mListeners.put(uid, listener); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startPackageOneTimeSession File: services/core/java/com/android/server/pm/permission/OneTimePermissionUserManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21254
HIGH
7.8
android
startPackageOneTimeSession
services/core/java/com/android/server/pm/permission/OneTimePermissionUserManager.java
fa539c85503dc63bfb53c76b6f12b3549f14a709
0
Analyze the following code function for security vulnerabilities
private static String findEncodingName(ThreadContext context, IRubyObject encoding) { String rubyEncoding = null; if (encoding instanceof RubyString) { rubyEncoding = rubyStringToString((RubyString) encoding); } else if (encoding instanceof RubyFixnum) { rubyEncoding = findEncodingName(RubyFixnum.fix2int((RubyFixnum) encoding)); } if (rubyEncoding == null) { return null; } try { return Charset.forName(rubyEncoding).displayName(); } catch (UnsupportedCharsetException e) { throw context.getRuntime().newEncodingCompatibilityError(rubyEncoding + "is not supported"); } catch (IllegalCharsetNameException e) { throw context.getRuntime().newEncodingError(e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findEncodingName File: ext/java/nokogiri/Html4SaxParserContext.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-241" ]
CVE-2022-29181
MEDIUM
6.4
sparklemotion/nokogiri
findEncodingName
ext/java/nokogiri/Html4SaxParserContext.java
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting long injectUptimeMillis() { return SystemClock.uptimeMillis(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: injectUptimeMillis 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
injectUptimeMillis
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public void resizeTask(int taskId, Rect bounds, int resizeMode) { mActivityTaskManager.resizeTask(taskId, bounds, resizeMode); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resizeTask File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
resizeTask
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public File downloadFileFromResponse(Response response) throws ApiException { try { File file = prepareDownloadFile(response); Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); return file; } catch (IOException e) { throw new ApiException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: downloadFileFromResponse File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
downloadFileFromResponse
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public boolean dumpResources(String process, ParcelFileDescriptor fd, RemoteCallback callback) throws RemoteException { synchronized (this) { ProcessRecord proc = findProcessLOSP(process, UserHandle.USER_CURRENT, "dumpResources"); IApplicationThread thread; if (proc == null || (thread = proc.getThread()) == null) { throw new IllegalArgumentException("Unknown process: " + process); } thread.dumpResources(fd, callback); return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpResources File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
dumpResources
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public void setStudyEventAndFormMetaTypesExpected() { this.unsetTypeExpected(); this.setTypeExpected(1, TypeNames.INT);// definition_order this.setTypeExpected(2, TypeNames.INT); // crf_order this.setTypeExpected(3, TypeNames.INT); // edc.crf_id this.setTypeExpected(4, TypeNames.INT); // cv.crf_version_id this.setTypeExpected(5, TypeNames.STRING);// definition_oid this.setTypeExpected(6, TypeNames.STRING);// definition_name this.setTypeExpected(7, TypeNames.BOOL);// definition_repeating this.setTypeExpected(8, TypeNames.STRING);// definition_type this.setTypeExpected(9, TypeNames.STRING);// cv_oid this.setTypeExpected(10, TypeNames.STRING);// cv_name this.setTypeExpected(11, TypeNames.BOOL);// cv_required this.setTypeExpected(12, TypeNames.STRING);// null_values this.setTypeExpected(13, TypeNames.STRING);// crf_name }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStudyEventAndFormMetaTypesExpected File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
setStudyEventAndFormMetaTypesExpected
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public static void appendNotification(String type, String body, String image, String category, Context a) { try { String[] fileList = a.fileList(); byte[] data = null; for (int iter = 0; iter < fileList.length; iter++) { if (fileList[iter].equals("CN1$AndroidPendingNotifications")) { InputStream is = a.openFileInput("CN1$AndroidPendingNotifications"); if(is != null) { data = readInputStream(is); sCleanup(a); break; } } } DataOutputStream os = new DataOutputStream(a.openFileOutput("CN1$AndroidPendingNotifications", 0)); if(data != null) { data[0]++; os.write(data); } else { os.writeByte(1); } String bodyType = type; if (image != null || category != null) { type = "99"; } if(type != null) { os.writeBoolean(true); os.writeUTF(type); } else { os.writeBoolean(false); } if ("99".equals(type)) { String msg = "body="+java.net.URLEncoder.encode(body, "UTF-8") +"&type="+java.net.URLEncoder.encode(bodyType, "UTF-8"); if (category != null) { msg += "&category="+java.net.URLEncoder.encode(category, "UTF-8"); } if (image != null) { image += "&image="+java.net.URLEncoder.encode(image, "UTF-8"); } os.writeUTF(msg); } else { os.writeUTF(body); } os.writeLong(System.currentTimeMillis()); } catch(IOException err) { err.printStackTrace(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendNotification 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
appendNotification
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public void addNfcUnlockHandler(INfcUnlockHandler unlockHandler, int[] techList) { NfcPermissions.enforceAdminPermissions(mContext); int lockscreenPollMask = computeLockscreenPollMask(techList); synchronized (NfcService.this) { mNfcUnlockManager.addUnlockHandler(unlockHandler, lockscreenPollMask); } applyRouting(false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addNfcUnlockHandler File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
addNfcUnlockHandler
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
private String getQuantityString(@PluralsRes int id, int quantity, Object... formatArgs) { return getContext().getResources().getQuantityString(id, quantity, formatArgs); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getQuantityString File: src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
getQuantityString
src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java
27559efb79d45782e000b762860658d49e9c35e9
0
Analyze the following code function for security vulnerabilities
@Override public int getSupportsTypeConstant() { return Constants.COLLECTION; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSupportsTypeConstant File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
getSupportsTypeConstant
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
public synchronized String getResponseText() { byte[] bytes = this.responseBytes; URLConnection connection = this.connection; String encoding = connection == null ? "UTF-8" : Urls.getCharset(connection); if (encoding == null) { encoding = "UTF-8"; } try { return bytes == null ? null : new String(bytes, encoding); } catch (UnsupportedEncodingException uee) { logger.error("getResponseText(): Charset '" + encoding + "' did not work. Retrying with UTF-8.", uee); try { return new String(bytes, "UTF-8"); } catch (UnsupportedEncodingException uee2) { // Ignore this time return null; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResponseText File: Testing/src/main/java/org/loboevolution/html/test/SimpleHttpRequest.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
getResponseText
Testing/src/main/java/org/loboevolution/html/test/SimpleHttpRequest.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
@Nonnull public static String rescaleImageAndEncodeAsBase64(@Nonnull final File file, final int maxSize) throws IOException { final Image image = ImageIO.read(file); if (image == null) { throw new IllegalArgumentException("Can't load image file : " + file); //NOI18N } return rescaleImageAndEncodeAsBase64(image, maxSize); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rescaleImageAndEncodeAsBase64 File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java Repository: raydac/netbeans-mmd-plugin The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000542
MEDIUM
6.8
raydac/netbeans-mmd-plugin
rescaleImageAndEncodeAsBase64
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
9fba652bf06e649186b8f9e612d60e9cc15097e9
0
Analyze the following code function for security vulnerabilities
@Override public void updateDemandHyperLink(EditTestCaseRequest request, Project project, String type) { // 添加方法体逻辑可重写改方法 }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateDemandHyperLink 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
updateDemandHyperLink
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 List<PlatformUser> getPlatformUser() { String session = zentaoClient.login(); HttpHeaders httpHeaders = new HttpHeaders(); HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(httpHeaders); RestTemplate restTemplate = new RestTemplate(); String getUser = zentaoClient.requestUrl.getUserGet(); ResponseEntity<String> responseEntity = restTemplate.exchange(getUser + session, HttpMethod.GET, requestEntity, String.class); String body = responseEntity.getBody(); Map obj = JSON.parseMap(body); LogUtil.info("zentao user " + obj); List data = JSON.parseArray(obj.get("data").toString()); List<PlatformUser> users = new ArrayList<>(); for (int i = 0; i < data.size(); i++) { Map o = (Map) data.get(i); PlatformUser platformUser = new PlatformUser(); String account = o.get("account").toString(); String username = o.get("realname").toString(); platformUser.setName(username); platformUser.setUser(account); users.add(platformUser); } return users; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPlatformUser File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getPlatformUser
test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public boolean hasBeforeClientResponseEntries() { return beforeClientResponseEntries != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasBeforeClientResponseEntries File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
hasBeforeClientResponseEntries
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
protected Object[] toElements(Page page) { List<Object> elements = new ArrayList<>(); // Add wiki if (page.getWiki() != null) { elements.add(page.getWiki()); } else { elements.add(this.testUtils.getCurrentWiki()); } // Add spaces elements.add(toSpaceElement(page.getSpace())); // Add name elements.add(page.getName()); // Add translation if (StringUtils.isNotEmpty(page.getLanguage())) { elements.add(page.getLanguage()); } return elements.toArray(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toElements File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
toElements
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public static Bundle createDontSendToRestrictedAppsBundle(@Nullable Bundle bundle) { final BroadcastOptions options = BroadcastOptions.makeBasic(); options.setDontSendToRestrictedApps(true); if (bundle == null) { return options.toBundle(); } bundle.putAll(options.toBundle()); return bundle; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-40095 - Severity: HIGH - CVSS Score: 7.8 Description: Fix bypass BAL via `requestGeofence` Bug: 273729172 Test: manually (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7f9be7c3c859dc82d37452570d9878b58f6437a9) Merged-In: Ia8094244f908b20d42711b6ea8f58f9b3345b563 Change-Id: Ia8094244f908b20d42711b6ea8f58f9b3345b563 Function: createDontSendToRestrictedAppsBundle File: services/core/java/com/android/server/PendingIntentUtils.java Repository: android Fixed Code: public static Bundle createDontSendToRestrictedAppsBundle(@Nullable Bundle bundle) { final BroadcastOptions options = BroadcastOptions.makeBasic(); options.setDontSendToRestrictedApps(true); options.setPendingIntentBackgroundActivityLaunchAllowed(false); if (bundle == null) { return options.toBundle(); } bundle.putAll(options.toBundle()); return bundle; }
[ "CWE-Other" ]
CVE-2023-40095
HIGH
7.8
android
createDontSendToRestrictedAppsBundle
services/core/java/com/android/server/PendingIntentUtils.java
d98abeef8f870b60510feafbadcea0c2f9cbae65
1
Analyze the following code function for security vulnerabilities
private JsonObject getJsonObjectFromQueryParameters(RoutingContext ctx) throws UnsupportedEncodingException { JsonObjectBuilder input = Json.createObjectBuilder(); // Query String query = stripNewlinesAndTabs(readQueryParameter(ctx, QUERY)); if (query != null && !query.isEmpty()) { input.add(QUERY, URLDecoder.decode(query, StandardCharsets.UTF_8.name())); } // OperationName String operationName = readQueryParameter(ctx, OPERATION_NAME); if (operationName != null && !operationName.isEmpty()) { input.add(OPERATION_NAME, URLDecoder.decode(query, StandardCharsets.UTF_8.name())); } // Variables String variables = stripNewlinesAndTabs(readQueryParameter(ctx, VARIABLES)); if (variables != null && !variables.isEmpty()) { JsonObject jsonObject = toJsonObject(URLDecoder.decode(variables, StandardCharsets.UTF_8.name())); input.add(VARIABLES, jsonObject); } // Extensions String extensions = stripNewlinesAndTabs(readQueryParameter(ctx, EXTENSIONS)); if (extensions != null && !extensions.isEmpty()) { JsonObject jsonObject = toJsonObject(URLDecoder.decode(extensions, StandardCharsets.UTF_8.name())); input.add(EXTENSIONS, jsonObject); } return input.build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJsonObjectFromQueryParameters File: extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-444" ]
CVE-2022-2466
CRITICAL
9.8
quarkusio/quarkus
getJsonObjectFromQueryParameters
extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java
08e5c3106ce4bfb18b24a38514eeba6464668b07
0
Analyze the following code function for security vulnerabilities
protected SwipeHelper.LongPressListener getNotificationLongClicker() { return new SwipeHelper.LongPressListener() { @Override public boolean onLongPress(View v, final int x, final int y, MenuItem item) { if (!(v instanceof ExpandableNotificationRow)) { return false; } if (v.getWindowToken() == null) { Log.e(TAG, "Trying to show notification guts, but not attached to window"); return false; } final ExpandableNotificationRow row = (ExpandableNotificationRow) v; if (row.isDark()) { return false; } if (row.areGutsExposed()) { closeAndSaveGuts(false /* removeLeavebehind */, false /* force */, true /* removeControls */, -1 /* x */, -1 /* y */, true /* resetMenu */); return false; } bindGuts(row, item); NotificationGuts guts = row.getGuts(); // Assume we are a status_bar_notification_row if (guts == null) { // This view has no guts. Examples are the more card or the dismiss all view return false; } mMetricsLogger.action(MetricsEvent.ACTION_NOTE_CONTROLS); // ensure that it's laid but not visible until actually laid out guts.setVisibility(View.INVISIBLE); // Post to ensure the the guts are properly laid out. guts.post(new Runnable() { @Override public void run() { if (row.getWindowToken() == null) { Log.e(TAG, "Trying to show notification guts, but not attached to " + "window"); return; } closeAndSaveGuts(true /* removeLeavebehind */, true /* force */, true /* removeControls */, -1 /* x */, -1 /* y */, false /* resetMenu */); guts.setVisibility(View.VISIBLE); final double horz = Math.max(guts.getWidth() - x, x); final double vert = Math.max(guts.getHeight() - y, y); final float r = (float) Math.hypot(horz, vert); final Animator a = ViewAnimationUtils.createCircularReveal(guts, x, y, 0, r); a.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD); a.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN); a.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); // Move the notification view back over the menu row.resetTranslation(); } }); a.start(); final boolean needsFalsingProtection = (mState == StatusBarState.KEYGUARD && !mAccessibilityManager.isTouchExplorationEnabled()); guts.setExposed(true /* exposed */, needsFalsingProtection); row.closeRemoteInput(); mStackScroller.onHeightChanged(row, true /* needsAnimation */); mNotificationGutsExposed = guts; mGutsMenuItem = item; } }); return true; } }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNotificationLongClicker 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
getNotificationLongClicker
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public int getQuietPeriod() { return quietPeriod!=null ? quietPeriod : Jenkins.getInstance().getQuietPeriod(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getQuietPeriod File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getQuietPeriod
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override public void onRoleHoldersChanged(String roleName, UserHandle user) { if (RoleManager.ROLE_HOME.equals(roleName)) { injectPostToHandler(() -> handleOnDefaultLauncherChanged(user.getIdentifier())); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onRoleHoldersChanged 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
onRoleHoldersChanged
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public String toString() { return System.lineSeparator() + " tenant=" + tenant + System.lineSeparator() + " readWrite=" + readWrite; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString 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
toString
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
0
Analyze the following code function for security vulnerabilities
@Override public int reconnect(int nativeHandle) throws RemoteException { NfcPermissions.enforceUserPermissions(mContext); TagEndpoint tag = null; // Check if NFC is enabled if (!isNfcEnabled()) { return ErrorCodes.ERROR_NOT_INITIALIZED; } /* find the tag in the hmap */ tag = (TagEndpoint) findObject(nativeHandle); if (tag != null) { if (tag.reconnect()) { return ErrorCodes.SUCCESS; } else { return ErrorCodes.ERROR_DISCONNECT; } } return ErrorCodes.ERROR_DISCONNECT; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reconnect File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
reconnect
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
private void renderComponentResources(FacesContext context, UIViewRoot viewRoot) throws IOException { ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); PartialResponseWriter writer = context.getPartialViewContext().getPartialResponseWriter(); boolean updateStarted = false; for (UIComponent resource : viewRoot.getComponentResources(context)) { String name = (String) resource.getAttributes().get("name"); String library = (String) resource.getAttributes().get("library"); if (resource.getChildCount() == 0 && resourceHandler.getRendererTypeForResourceName(name) != null && !resourceHandler.isResourceRendered(context, name, library)) { if (!updateStarted) { writer.startUpdate("javax.faces.Resource"); updateStarted = true; } resource.encodeAll(context); } } if (updateStarted) { writer.endUpdate(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: renderComponentResources File: impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-17091
MEDIUM
4.3
eclipse-ee4j/mojarra
renderComponentResources
impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java
a3fa9573789ed5e867c43ea38374f4dbd5a8f81f
0
Analyze the following code function for security vulnerabilities
String getShellCommand() { return shellCommand; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getShellCommand File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java Repository: apache/maven-shared-utils The code follows secure coding practices.
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
getShellCommand
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
2735facbbbc2e13546328cb02dbb401b3776eea3
0
Analyze the following code function for security vulnerabilities
private File expandVariablesForDirectory(String base, Item item) { return new File(Util.replaceMacro(base, ImmutableMap.of( "JENKINS_HOME", getRootDir().getPath(), "ITEM_ROOTDIR", item.getRootDir().getPath(), "ITEM_FULLNAME", item.getFullName(), // legacy, deprecated "ITEM_FULL_NAME", item.getFullName().replace(':','$')))); // safe, see JENKINS-12251 }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: expandVariablesForDirectory 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
expandVariablesForDirectory
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public SAXParser newSAXParser() throws ParserConfigurationException { final SAXParser ret; try { ret = new XercesJAXPSAXParser(this, features, validating, handleXInclude); } catch (final SAXException se) { // Translate to ParserConfigurationException throw new OXFException(se); // so we see a decent stack trace! // throw new ParserConfigurationException(se.getMessage()); } return ret; }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2010-3260 - Severity: MEDIUM - CVSS Score: 6.4 Description: Implemented "[ #315668 ] Disable loading of external entities in XML parsing by default". Function: newSAXParser File: src/java/org/orbeon/oxf/xml/xerces/XercesSAXParserFactoryImpl.java Repository: orbeon/orbeon-forms Fixed Code: public SAXParser newSAXParser() { final SAXParser ret; try { ret = new XercesJAXPSAXParser(this, features, validating, handleXInclude); } catch (final SAXException se) { // Translate to ParserConfigurationException throw new OXFException(se); // so we see a decent stack trace! } return ret; }
[ "CWE-264" ]
CVE-2010-3260
MEDIUM
6.4
orbeon/orbeon-forms
newSAXParser
src/java/org/orbeon/oxf/xml/xerces/XercesSAXParserFactoryImpl.java
aba6681660f65af7f1676434da68c10298c30200
1
Analyze the following code function for security vulnerabilities
@Override public void onBootPhase(int phase) { if (phase == PHASE_SYSTEM_SERVICES_READY) { sInstance.initialize(UserHandle.USER_OWNER); } else if (phase == PHASE_THIRD_PARTY_APPS_CAN_START) { ContentResolver r = sInstance.mContext.getContentResolver(); boolean areEnabled = Settings.Secure.getInt(r, Settings.Secure.BACKUP_ENABLED, 0) != 0; try { sInstance.setBackupEnabled(areEnabled); } catch (RemoteException e) { // can't happen; it's a local object } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onBootPhase 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
onBootPhase
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@Override public int checkContentProviderUriPermission(Uri uri, int userId, int callingUid, int modeFlags) { return mCpHelper.checkContentProviderUriPermission(uri, userId, callingUid, modeFlags); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkContentProviderUriPermission File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
checkContentProviderUriPermission
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override protected AbstractFileResolvingResource getResource(String path) throws MalformedURLException { if (path == null || !path.startsWith("/")) { throw new MalformedURLException(path); } try { path = UriPath.canonical(path); final String addedPath = addPaths(baseResource, path); ClassPathResource resource = new ClassPathResource(addedPath); if (resource.exists() && resource.getFile().isDirectory()) { if (welcomeFile != null) { resource = new ClassPathResource(addPaths(resource.getPath(), welcomeFile)); } else { // No welcome file configured, serve nothing since it's a directory resource = null; } } return (resource != null && resource.exists()) ? resource : null; } catch (Exception e) { if (LOG.isDebugEnabled()) { LOG.debug(e.getClass().getSimpleName() + " when trying to get resource. " + e.getMessage()); } } return null; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2016-9177 - Severity: MEDIUM - CVSS Score: 5.0 Description: Fix for #700 - Arbitrary File Read Vulnerability Function: getResource File: src/main/java/spark/resource/ClassPathResourceHandler.java Repository: perwendel/spark Fixed Code: @Override protected AbstractFileResolvingResource getResource(String path) throws MalformedURLException { if (path == null || !path.startsWith("/")) { throw new MalformedURLException(path); } try { path = UriPath.canonical(path); final String addedPath = addPaths(baseResource, path); ClassPathResource resource = new ClassPathResource(addedPath); DirectoryTraversal.protectAgainstInClassPath(resource.getPath()); if (resource.exists() && resource.getFile().isDirectory()) { if (welcomeFile != null) { resource = new ClassPathResource(addPaths(resource.getPath(), welcomeFile)); } else { // No welcome file configured, serve nothing since it's a directory resource = null; } } return (resource != null && resource.exists()) ? resource : null; } catch (DirectoryTraversal.DirectoryTraversalDetection directoryTraversalDetection) { throw directoryTraversalDetection; } catch (Exception e) { if (LOG.isDebugEnabled()) { LOG.debug(e.getClass().getSimpleName() + " when trying to get resource. " + e.getMessage()); } } return null; }
[ "CWE-22" ]
CVE-2016-9177
MEDIUM
5
perwendel/spark
getResource
src/main/java/spark/resource/ClassPathResourceHandler.java
26b57d0596ee73c14c558463943ef0857e53b91f
1
Analyze the following code function for security vulnerabilities
public String dialogEnd() { return dialog(HTML_END, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dialogEnd File: src/org/opencms/workplace/CmsDialog.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
dialogEnd
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
@Override public void onOpen(Session session, EndpointConfig config) { logger.info("Connection to Kie Controller over Web Socket is now open with session id " + session.getId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onOpen File: kie-server-parent/kie-server-controller/kie-server-controller-websocket-client/src/main/java/org/kie/server/controller/websocket/client/WebSocketKieServerControllerClient.java Repository: kiegroup/droolsjbpm-integration The code follows secure coding practices.
[ "CWE-260" ]
CVE-2016-7043
MEDIUM
5
kiegroup/droolsjbpm-integration
onOpen
kie-server-parent/kie-server-controller/kie-server-controller-websocket-client/src/main/java/org/kie/server/controller/websocket/client/WebSocketKieServerControllerClient.java
e916032edd47aa46d15f3a11909b4804ee20a7e8
0
Analyze the following code function for security vulnerabilities
public void monitor() { synchronized (this) { } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: monitor 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
monitor
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void ensureGroupStateLoadedLocked(int userId) { final int[] profileIds = mSecurityPolicy.getEnabledGroupProfileIds(userId); // Careful lad, we may have already loaded the state for some // group members, so check before loading and read only the // state for the new member(s). int newMemberCount = 0; final int profileIdCount = profileIds.length; for (int i = 0; i < profileIdCount; i++) { final int profileId = profileIds[i]; if (mLoadedUserIds.indexOfKey(profileId) >= 0) { profileIds[i] = LOADED_PROFILE_ID; } else { newMemberCount++; } } if (newMemberCount <= 0) { return; } int newMemberIndex = 0; final int[] newProfileIds = new int[newMemberCount]; for (int i = 0; i < profileIdCount; i++) { final int profileId = profileIds[i]; if (profileId != LOADED_PROFILE_ID) { mLoadedUserIds.put(profileId, profileId); newProfileIds[newMemberIndex] = profileId; newMemberIndex++; } } clearProvidersAndHostsTagsLocked(); loadGroupWidgetProvidersLocked(newProfileIds); loadGroupStateLocked(newProfileIds); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ensureGroupStateLoadedLocked File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
ensureGroupStateLoadedLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
private synchronized boolean isIdle(int streamNo) { if(streamNo % 2 == streamIdCounter % 2) { // our side is controlled by us in the generated streamIdCounter return streamNo >= streamIdCounter; } else { // the other side should increase lastAssignedStreamOtherSide all the time return streamNo > lastAssignedStreamOtherSide; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isIdle File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
isIdle
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
public Object getPropertyId() { return propertyId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPropertyId File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getPropertyId
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public void setBluetoothContactSharingDisabled(@NonNull ComponentName admin, boolean disabled) { throwIfParentInstance("setBluetoothContactSharingDisabled"); if (mService != null) { try { mService.setBluetoothContactSharingDisabled(admin, disabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBluetoothContactSharingDisabled 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
setBluetoothContactSharingDisabled
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void encryptBlock(int[][] KW) { int t0 = this.C0 ^ KW[0][0]; int t1 = this.C1 ^ KW[0][1]; int t2 = this.C2 ^ KW[0][2]; int r = 1, r0, r1, r2, r3 = this.C3 ^ KW[0][3]; while (r < ROUNDS - 1) { r0 = T0[t0&255] ^ shift(T0[(t1>>8)&255], 24) ^ shift(T0[(t2>>16)&255], 16) ^ shift(T0[(r3>>24)&255], 8) ^ KW[r][0]; r1 = T0[t1&255] ^ shift(T0[(t2>>8)&255], 24) ^ shift(T0[(r3>>16)&255], 16) ^ shift(T0[(t0>>24)&255], 8) ^ KW[r][1]; r2 = T0[t2&255] ^ shift(T0[(r3>>8)&255], 24) ^ shift(T0[(t0>>16)&255], 16) ^ shift(T0[(t1>>24)&255], 8) ^ KW[r][2]; r3 = T0[r3&255] ^ shift(T0[(t0>>8)&255], 24) ^ shift(T0[(t1>>16)&255], 16) ^ shift(T0[(t2>>24)&255], 8) ^ KW[r++][3]; t0 = T0[r0&255] ^ shift(T0[(r1>>8)&255], 24) ^ shift(T0[(r2>>16)&255], 16) ^ shift(T0[(r3>>24)&255], 8) ^ KW[r][0]; t1 = T0[r1&255] ^ shift(T0[(r2>>8)&255], 24) ^ shift(T0[(r3>>16)&255], 16) ^ shift(T0[(r0>>24)&255], 8) ^ KW[r][1]; t2 = T0[r2&255] ^ shift(T0[(r3>>8)&255], 24) ^ shift(T0[(r0>>16)&255], 16) ^ shift(T0[(r1>>24)&255], 8) ^ KW[r][2]; r3 = T0[r3&255] ^ shift(T0[(r0>>8)&255], 24) ^ shift(T0[(r1>>16)&255], 16) ^ shift(T0[(r2>>24)&255], 8) ^ KW[r++][3]; } r0 = T0[t0&255] ^ shift(T0[(t1>>8)&255], 24) ^ shift(T0[(t2>>16)&255], 16) ^ shift(T0[(r3>>24)&255], 8) ^ KW[r][0]; r1 = T0[t1&255] ^ shift(T0[(t2>>8)&255], 24) ^ shift(T0[(r3>>16)&255], 16) ^ shift(T0[(t0>>24)&255], 8) ^ KW[r][1]; r2 = T0[t2&255] ^ shift(T0[(r3>>8)&255], 24) ^ shift(T0[(t0>>16)&255], 16) ^ shift(T0[(t1>>24)&255], 8) ^ KW[r][2]; r3 = T0[r3&255] ^ shift(T0[(t0>>8)&255], 24) ^ shift(T0[(t1>>16)&255], 16) ^ shift(T0[(t2>>24)&255], 8) ^ KW[r++][3]; // the final round's table is a simple function of S so we don't use a whole other four tables for it this.C0 = (S[r0&255]&255) ^ ((S[(r1>>8)&255]&255)<<8) ^ ((S[(r2>>16)&255]&255)<<16) ^ (S[(r3>>24)&255]<<24) ^ KW[r][0]; this.C1 = (S[r1&255]&255) ^ ((S[(r2>>8)&255]&255)<<8) ^ ((S[(r3>>16)&255]&255)<<16) ^ (S[(r0>>24)&255]<<24) ^ KW[r][1]; this.C2 = (S[r2&255]&255) ^ ((S[(r3>>8)&255]&255)<<8) ^ ((S[(r0>>16)&255]&255)<<16) ^ (S[(r1>>24)&255]<<24) ^ KW[r][2]; this.C3 = (S[r3&255]&255) ^ ((S[(r0>>8)&255]&255)<<8) ^ ((S[(r1>>16)&255]&255)<<16) ^ (S[(r2>>24)&255]<<24) ^ KW[r][3]; }
Vulnerability Classification: - CWE: CWE-310 - CVE: CVE-2016-1000339 - Severity: MEDIUM - CVSS Score: 5.0 Description: added better support for DH domain parameters added s box allocation to AESEngine reduced use of AESFastEngine. Function: encryptBlock File: core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java Repository: bcgit/bc-java Fixed Code: private void encryptBlock(int[][] KW) { int t0 = this.C0 ^ KW[0][0]; int t1 = this.C1 ^ KW[0][1]; int t2 = this.C2 ^ KW[0][2]; int r = 1, r0, r1, r2, r3 = this.C3 ^ KW[0][3]; while (r < ROUNDS - 1) { r0 = T0[t0&255] ^ shift(T0[(t1>>8)&255], 24) ^ shift(T0[(t2>>16)&255], 16) ^ shift(T0[(r3>>24)&255], 8) ^ KW[r][0]; r1 = T0[t1&255] ^ shift(T0[(t2>>8)&255], 24) ^ shift(T0[(r3>>16)&255], 16) ^ shift(T0[(t0>>24)&255], 8) ^ KW[r][1]; r2 = T0[t2&255] ^ shift(T0[(r3>>8)&255], 24) ^ shift(T0[(t0>>16)&255], 16) ^ shift(T0[(t1>>24)&255], 8) ^ KW[r][2]; r3 = T0[r3&255] ^ shift(T0[(t0>>8)&255], 24) ^ shift(T0[(t1>>16)&255], 16) ^ shift(T0[(t2>>24)&255], 8) ^ KW[r++][3]; t0 = T0[r0&255] ^ shift(T0[(r1>>8)&255], 24) ^ shift(T0[(r2>>16)&255], 16) ^ shift(T0[(r3>>24)&255], 8) ^ KW[r][0]; t1 = T0[r1&255] ^ shift(T0[(r2>>8)&255], 24) ^ shift(T0[(r3>>16)&255], 16) ^ shift(T0[(r0>>24)&255], 8) ^ KW[r][1]; t2 = T0[r2&255] ^ shift(T0[(r3>>8)&255], 24) ^ shift(T0[(r0>>16)&255], 16) ^ shift(T0[(r1>>24)&255], 8) ^ KW[r][2]; r3 = T0[r3&255] ^ shift(T0[(r0>>8)&255], 24) ^ shift(T0[(r1>>16)&255], 16) ^ shift(T0[(r2>>24)&255], 8) ^ KW[r++][3]; } r0 = T0[t0&255] ^ shift(T0[(t1>>8)&255], 24) ^ shift(T0[(t2>>16)&255], 16) ^ shift(T0[(r3>>24)&255], 8) ^ KW[r][0]; r1 = T0[t1&255] ^ shift(T0[(t2>>8)&255], 24) ^ shift(T0[(r3>>16)&255], 16) ^ shift(T0[(t0>>24)&255], 8) ^ KW[r][1]; r2 = T0[t2&255] ^ shift(T0[(r3>>8)&255], 24) ^ shift(T0[(t0>>16)&255], 16) ^ shift(T0[(t1>>24)&255], 8) ^ KW[r][2]; r3 = T0[r3&255] ^ shift(T0[(t0>>8)&255], 24) ^ shift(T0[(t1>>16)&255], 16) ^ shift(T0[(t2>>24)&255], 8) ^ KW[r++][3]; // the final round's table is a simple function of S so we don't use a whole other four tables for it this.C0 = (S[r0&255]&255) ^ ((S[(r1>>8)&255]&255)<<8) ^ ((s[(r2>>16)&255]&255)<<16) ^ (s[(r3>>24)&255]<<24) ^ KW[r][0]; this.C1 = (s[r1&255]&255) ^ ((S[(r2>>8)&255]&255)<<8) ^ ((S[(r3>>16)&255]&255)<<16) ^ (s[(r0>>24)&255]<<24) ^ KW[r][1]; this.C2 = (s[r2&255]&255) ^ ((S[(r3>>8)&255]&255)<<8) ^ ((S[(r0>>16)&255]&255)<<16) ^ (S[(r1>>24)&255]<<24) ^ KW[r][2]; this.C3 = (s[r3&255]&255) ^ ((s[(r0>>8)&255]&255)<<8) ^ ((s[(r1>>16)&255]&255)<<16) ^ (S[(r2>>24)&255]<<24) ^ KW[r][3]; }
[ "CWE-310" ]
CVE-2016-1000339
MEDIUM
5
bcgit/bc-java
encryptBlock
core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java
413b42f4d770456508585c830cfcde95f9b0e93b
1
Analyze the following code function for security vulnerabilities
protected void callConnectionClosedOnErrorListener(Exception e) { boolean logWarning = true; if (e instanceof StreamErrorException) { StreamErrorException see = (StreamErrorException) e; if (see.getStreamError().getCondition() == StreamError.Condition.not_authorized && wasAuthenticated) { logWarning = false; LOGGER.log(Level.FINE, "Connection closed with not-authorized stream error after it was already authenticated. The account was likely deleted/unregistered on the server"); } } if (logWarning) { LOGGER.log(Level.WARNING, "Connection " + this + " closed with error", e); } for (ConnectionListener listener : connectionListeners) { try { listener.connectionClosedOnError(e); } catch (Exception e2) { // Catch and print any exception so we can recover // from a faulty listener LOGGER.log(Level.SEVERE, "Error in listener while closing connection", e2); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: callConnectionClosedOnErrorListener 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
callConnectionClosedOnErrorListener
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
@Override void finishSync(Transaction outMergedTransaction, boolean cancel) { // This override is just for getting metrics. allFinished needs to be checked before // finish because finish resets all the states. mLastAllReadyAtSync = allSyncFinished(); super.finishSync(outMergedTransaction, cancel); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishSync File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
finishSync
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private Set getCACertificates(X509CertSelector xselector) throws CertStoreException { String[] attrs = {params.getCACertificateAttribute()}; String attrName = params.getLdapCACertificateAttributeName(); String subjectAttributeName = params .getCACertificateSubjectAttributeName(); Set set = certSubjectSerialSearch(xselector, attrs, attrName, subjectAttributeName); if (set.isEmpty()) { set.addAll(search(null, "*", attrs)); } return set; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCACertificates File: prov/src/main/java/org/bouncycastle/jce/provider/X509LDAPCertStoreSpi.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-295" ]
CVE-2023-33201
MEDIUM
5.3
bcgit/bc-java
getCACertificates
prov/src/main/java/org/bouncycastle/jce/provider/X509LDAPCertStoreSpi.java
e8c409a8389c815ea3fda5e8b94c92fdfe583bcc
0
Analyze the following code function for security vulnerabilities
private static Predicate<Provider> endsWith(final String param) { return new Predicate<Provider>() { @Override public boolean test(Provider provider) { String lowerCaseParam = param.toLowerCase(); String identifier = provider.getIdentifier(); if(identifier.toLowerCase().endsWith(lowerCaseParam)) return true; if(provider.getPerson() != null) { PersonName name = provider.getPerson().getPersonName(); if (name != null) { if (name.getGivenName().toLowerCase().endsWith(lowerCaseParam) || name.getFamilyName().toLowerCase().endsWith(lowerCaseParam) || name.getMiddleName().toLowerCase().endsWith(lowerCaseParam)) return true; } } //Check the provider name (From provider table String[] names = provider.getName().split(" "); for(String n:names) { if (n.toLowerCase().endsWith(lowerCaseParam)) return true; } return false; } }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: endsWith File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java Repository: openmrs/openmrs-module-htmlformentry The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-16521
HIGH
7.5
openmrs/openmrs-module-htmlformentry
endsWith
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
9dcd304688e65c31cac5532fe501b9816ed975ae
0
Analyze the following code function for security vulnerabilities
void setViewVisibility(int viewVisibility) { mViewVisibility = viewVisibility; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setViewVisibility File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
setViewVisibility
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public void updateNClob(@Positive int columnIndex, @Nullable Reader reader, long length) throws SQLException { throw org.postgresql.Driver.notImplemented(this.getClass(), "updateNClob(int, Reader, long)"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateNClob 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
updateNClob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public String addSession(Connection conn) throws SQLException { WebSession session = createNewSession("local"); session.setShutdownServerOnDisconnect(); session.setConnection(conn); session.put("url", conn.getMetaData().getURL()); String s = (String) session.get("sessionId"); return url + "/frame.jsp?jsessionid=" + s; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addSession File: h2/src/main/org/h2/server/web/WebServer.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
addSession
h2/src/main/org/h2/server/web/WebServer.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
protected void refreshConfiguration() { synchronized (random) { // re-keying configuration maxRekeyBytes = CoreModuleProperties.REKEY_BYTES_LIMIT.getRequired(this); maxRekeyInterval = CoreModuleProperties.REKEY_TIME_LIMIT.getRequired(this); maxRekyPackets = CoreModuleProperties.REKEY_PACKETS_LIMIT.getRequired(this); // intermittent SSH_MSG_IGNORE stream padding ignorePacketDataLength = CoreModuleProperties.IGNORE_MESSAGE_SIZE.getRequired(this); ignorePacketsFrequency = CoreModuleProperties.IGNORE_MESSAGE_FREQUENCY.getRequired(this); ignorePacketsVariance = CoreModuleProperties.IGNORE_MESSAGE_VARIANCE.getRequired(this); if (ignorePacketsVariance >= ignorePacketsFrequency) { ignorePacketsVariance = 0; } long countValue = calculateNextIgnorePacketCount( random, ignorePacketsFrequency, ignorePacketsVariance); ignorePacketsCount.set(countValue); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: refreshConfiguration File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
refreshConfiguration
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
private Configuration.Builder createInteractionJankMonitorConf(String tag) { return Configuration.Builder.withView(CUJ_LOCKSCREEN_UNLOCK_ANIMATION, mKeyguardViewControllerLazy.get().getViewRootImpl().getView()) .setTag(tag); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createInteractionJankMonitorConf 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
createInteractionJankMonitorConf
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
public List<Document> searchDocuments(String wheresql, boolean distinctbylocale, int nb, int start) throws XWikiException { return convert(this.xwiki.getStore().searchDocuments(wheresql, distinctbylocale, nb, start, getXWikiContext())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: searchDocuments File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
searchDocuments
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
@UnstableApi public ServerBuilder setHeader(CharSequence name, Object value) { virtualHostTemplate.setHeader(name, value); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHeader 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
setHeader
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
@Override public StackInfo getFocusedStackInfo() throws RemoteException { enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "getStackInfo()"); long ident = Binder.clearCallingIdentity(); try { synchronized (this) { ActivityStack focusedStack = getFocusedStack(); if (focusedStack != null) { return mStackSupervisor.getStackInfo(focusedStack.mStackId); } return null; } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFocusedStackInfo 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
getFocusedStackInfo
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public R getBuildByNumber(int n) { return builds.getByNumber(n); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBuildByNumber File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getBuildByNumber
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override public void addHostKeyVerifier(HostKeyVerifier hkv) { kexer.addHostKeyVerifier(hkv); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addHostKeyVerifier 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
addHostKeyVerifier
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
public static Range toLSPRange(XMLLocator location, XMLSyntaxErrorCode code, Object[] arguments, DOMDocument document) { int offset = location.getCharacterOffset() - 1; // adjust positions switch (code) { case SpaceRequiredBeforeStandalone: case SpaceRequiredBeforeEncodingInXMLDecl: case VersionInfoRequired: case ElementPrefixUnbound: case ElementUnterminated: case RootElementTypeMustMatchDoctypedecl: return XMLPositionUtility.selectStartTag(offset, document); case EqRequiredInAttribute: { String attrName = getString(arguments[1]); return XMLPositionUtility.selectAttributeNameFromGivenNameAt(attrName, offset, document); } case EncodingDeclRequired: case EqRequiredInXMLDecl: return XMLPositionUtility.selectAttributeNameAt(offset, document); case AttributeNSNotUnique: { String attrName = getString(arguments[1]); Range xmlns = XMLPositionUtility.selectAttributeNameFromGivenNameAt("xmlns:" + attrName, offset, document); if (xmlns != null) { return xmlns; } return XMLPositionUtility.selectAttributeNameFromGivenNameAt(attrName, offset, document); } case AttributeNotUnique: { String attrName = getString(arguments[1]); return XMLPositionUtility.selectAttributeNameFromGivenNameAt(attrName, offset, document); } case AttributePrefixUnbound: { return XMLPositionUtility.selectAttributePrefixFromGivenNameAt(getString(arguments[1]), offset, document); } case LessthanInAttValue: { String attrName = getString(arguments[1]); return XMLPositionUtility.selectAttributeValueAt(attrName, offset, document); } case QuoteRequiredInXMLDecl: { String attrName = getString(arguments[0]); return XMLPositionUtility.selectAttributeValueAt(attrName, offset, document); } case EmptyPrefixedAttName: { QName qName = (QName) arguments[0]; return XMLPositionUtility.selectAttributeValueAt(qName.rawname, offset, document); } case SDDeclInvalid: case VersionNotSupported: { String attrValue = getString(arguments[0]); return XMLPositionUtility.selectAttributeValueByGivenValueAt(attrValue, offset, document); } case ETagUnterminated: /** * Cases: * * <a> </b> * * <a> <b> </b> </c> * * <a> <a> </a> </b */ return XMLPositionUtility.selectPreviousNodesEndTag(offset, document); case CustomETag: return XMLPositionUtility.selectEndTag(offset, document); case ETagRequired: { String tag = getString(arguments[0]); return XMLPositionUtility.selectChildEndTag(tag, offset, document); } case ContentIllegalInProlog: { int endOffset = document.getText().indexOf("<"); int startOffset = offset + 1; return XMLPositionUtility.createRange(startOffset, endOffset, document); } case DashDashInComment: { int endOffset = offset + 1; int startOffset = offset - 1; return XMLPositionUtility.createRange(startOffset, endOffset, document); } case IllegalQName: case InvalidCommentStart: case MarkupNotRecognizedInContent: return XMLPositionUtility.createRange(offset, offset + 1, document); case MarkupEntityMismatch: return XMLPositionUtility.selectRootStartTag(document); case NameRequiredInReference: break; case OpenQuoteExpected: { return XMLPositionUtility.selectAttributeNameAt(offset - 1, document); } case PITargetRequired: // Working break; case PseudoAttrNameExpected: // Working // Add better message break; case SpaceRequiredInPI: int start = selectCurrentTagOffset(offset, document) + 1; int end = offset + 1; return XMLPositionUtility.createRange(start, end, document); case PrematureEOF: case XMLDeclUnterminated: break; default: } return null; }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2019-18213 - Severity: MEDIUM - CVSS Score: 6.5 Description: Add disallowDocTypeDecl & resolveExternalEntities validation settings. Signed-off-by: azerr <azerr@redhat.com> Function: toLSPRange File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/contentmodel/participants/XMLSyntaxErrorCode.java Repository: eclipse/lemminx Fixed Code: public static Range toLSPRange(XMLLocator location, XMLSyntaxErrorCode code, Object[] arguments, DOMDocument document) { int offset = location.getCharacterOffset() - 1; // adjust positions switch (code) { case SpaceRequiredBeforeStandalone: case SpaceRequiredBeforeEncodingInXMLDecl: case VersionInfoRequired: case ElementPrefixUnbound: case ElementUnterminated: case RootElementTypeMustMatchDoctypedecl: return XMLPositionUtility.selectStartTag(offset, document); case EqRequiredInAttribute: { String attrName = getString(arguments[1]); return XMLPositionUtility.selectAttributeNameFromGivenNameAt(attrName, offset, document); } case EncodingDeclRequired: case EqRequiredInXMLDecl: return XMLPositionUtility.selectAttributeNameAt(offset, document); case AttributeNSNotUnique: { String attrName = getString(arguments[1]); Range xmlns = XMLPositionUtility.selectAttributeNameFromGivenNameAt("xmlns:" + attrName, offset, document); if (xmlns != null) { return xmlns; } return XMLPositionUtility.selectAttributeNameFromGivenNameAt(attrName, offset, document); } case AttributeNotUnique: { String attrName = getString(arguments[1]); return XMLPositionUtility.selectAttributeNameFromGivenNameAt(attrName, offset, document); } case AttributePrefixUnbound: { return XMLPositionUtility.selectAttributePrefixFromGivenNameAt(getString(arguments[1]), offset, document); } case LessthanInAttValue: { String attrName = getString(arguments[1]); return XMLPositionUtility.selectAttributeValueAt(attrName, offset, document); } case QuoteRequiredInXMLDecl: { String attrName = getString(arguments[0]); return XMLPositionUtility.selectAttributeValueAt(attrName, offset, document); } case EmptyPrefixedAttName: { QName qName = (QName) arguments[0]; return XMLPositionUtility.selectAttributeValueAt(qName.rawname, offset, document); } case SDDeclInvalid: case VersionNotSupported: { String attrValue = getString(arguments[0]); return XMLPositionUtility.selectAttributeValueByGivenValueAt(attrValue, offset, document); } case ETagUnterminated: /** * Cases: * * <a> </b> * * <a> <b> </b> </c> * * <a> <a> </a> </b */ return XMLPositionUtility.selectPreviousNodesEndTag(offset, document); case CustomETag: return XMLPositionUtility.selectEndTag(offset, document); case ETagRequired: { String tag = getString(arguments[0]); return XMLPositionUtility.selectChildEndTag(tag, offset, document); } case ContentIllegalInProlog: { int endOffset = document.getText().indexOf("<"); int startOffset = offset + 1; return XMLPositionUtility.createRange(startOffset, endOffset, document); } case DashDashInComment: { int endOffset = offset + 1; int startOffset = offset - 1; return XMLPositionUtility.createRange(startOffset, endOffset, document); } case IllegalQName: case InvalidCommentStart: case MarkupNotRecognizedInContent: return XMLPositionUtility.createRange(offset, offset + 1, document); case MarkupEntityMismatch: return XMLPositionUtility.selectRootStartTag(document); case NameRequiredInReference: break; case OpenQuoteExpected: { return XMLPositionUtility.selectAttributeNameAt(offset - 1, document); } case DoctypeNotAllowed: DOMDocumentType docType = document.getDoctype(); return XMLPositionUtility.createRange(docType); case PITargetRequired: // Working break; case PseudoAttrNameExpected: // Working // Add better message break; case SpaceRequiredInPI: int start = selectCurrentTagOffset(offset, document) + 1; int end = offset + 1; return XMLPositionUtility.createRange(start, end, document); case PrematureEOF: case XMLDeclUnterminated: break; default: } return null; }
[ "CWE-611" ]
CVE-2019-18213
MEDIUM
6.5
eclipse/lemminx
toLSPRange
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/contentmodel/participants/XMLSyntaxErrorCode.java
c8bf3245a72cace50ee2aae5eee69538c58ce056
1
Analyze the following code function for security vulnerabilities
native boolean disableNative();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disableNative File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
disableNative
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@JRubyMethod(name = "replace_entities=") public IRubyObject set_replace_entities(ThreadContext context, IRubyObject value) { replaceEntities = value.isTrue(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: set_replace_entities File: ext/java/nokogiri/XmlSaxParserContext.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-241" ]
CVE-2022-29181
MEDIUM
6.4
sparklemotion/nokogiri
set_replace_entities
ext/java/nokogiri/XmlSaxParserContext.java
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
0
Analyze the following code function for security vulnerabilities
public XWikiAttachment getExactAttachment(String filename) { return this.attachmentList.getByFilename(filename); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExactAttachment File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
getExactAttachment
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
private static void enforceMaxStringLength(PersistableBundle bundle, String argName) { // Persistable bundles can have other persistable bundles as values, traverse with a queue. Queue<PersistableBundle> queue = new ArrayDeque<>(); queue.add(bundle); while (!queue.isEmpty()) { PersistableBundle current = queue.remove(); for (String key : current.keySet()) { enforceMaxStringLength(key, "key in " + argName); Object value = current.get(key); if (value instanceof String) { enforceMaxStringLength((String) value, "string value in " + argName); } else if (value instanceof String[]) { for (String str : (String[]) value) { enforceMaxStringLength(str, "string value in " + argName); } } else if (value instanceof PersistableBundle) { queue.add((PersistableBundle) value); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceMaxStringLength File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
enforceMaxStringLength
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public boolean isAdmin(Profile authUser) { return authUser != null && User.Groups.ADMINS.toString().equals(authUser.getGroups()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAdmin File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
isAdmin
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public Document clean(Reader originalHtmlContent, HTMLCleanerConfiguration configuration) { Document result; // Note: Instantiation of an HtmlCleaner object is cheap so there's no need to cache an instance of it, // especially since this makes it extra safe with regards to multithreading (even though HTML Cleaner is // already supposed to be thread safe). CleanerProperties cleanerProperties = getDefaultCleanerProperties(configuration); HtmlCleaner cleaner; if (isHTML5(configuration)) { // Use our custom provider to fix bugs, should be checked on each upgrade if still necessary. cleaner = new HtmlCleaner(this.html5TagInfoProvider, cleanerProperties); } else { cleaner = new HtmlCleaner(cleanerProperties); } TagNode cleanedNode; try { cleanedNode = cleaner.clean(originalHtmlContent); } catch (Exception e) { // This shouldn't happen since we're not doing any IO... I consider this a flaw in the design of HTML // Cleaner. throw new RuntimeException("Unhandled error when cleaning HTML", e); } try { // Ideally we would use SF's HTMLCleaner DomSerializer but there are outstanding issues with it, so we're // using a custom XWikiDOMSerializer (see its javadoc for more details). // Replace by the following when fixed: // result = new DomSerializer(cleanerProperties, false).createDOM(cleanedNode); if (isHTML5(configuration)) { cleanedNode.setDocType(new DoctypeToken(HTMLConstants.TAG_HTML, null, null, null)); } else { cleanedNode.setDocType( new DoctypeToken(HTMLConstants.TAG_HTML, "PUBLIC", "-//W3C//DTD XHTML 1.0 Strict//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd")); } result = new XWikiDOMSerializer(cleanerProperties).createDOM(getAvailableDocumentBuilder(), cleanedNode); } catch (ParserConfigurationException ex) { throw new RuntimeException("Error while serializing TagNode into w3c dom.", ex); } // Finally apply filters. for (HTMLFilter filter : configuration.getFilters()) { filter.filter(result, configuration.getParameters()); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clean File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/DefaultHTMLCleaner.java Repository: xwiki/xwiki-commons The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29201
CRITICAL
9
xwiki/xwiki-commons
clean
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/DefaultHTMLCleaner.java
b11eae9d82cb53f32962056b5faa73f3720c6182
0
Analyze the following code function for security vulnerabilities
private PollingResult _poll(TaskListener listener, SCM scm, R lb) throws IOException, InterruptedException { if (scm.requiresWorkspaceForPolling()) { // lock the workspace of the last build FilePath ws=lb.getWorkspace(); WorkspaceOfflineReason workspaceOfflineReason = workspaceOffline( lb ); if ( workspaceOfflineReason != null ) { // workspace offline for (WorkspaceBrowser browser : Jenkins.getInstance().getExtensionList(WorkspaceBrowser.class)) { ws = browser.getWorkspace(this); if (ws != null) { return pollWithWorkspace(listener, scm, lb, ws, browser.getWorkspaceList()); } } // build now, or nothing will ever be built Label label = getAssignedLabel(); if (label != null && label.isSelfLabel()) { // if the build is fixed on a node, then attempting a build will do us // no good. We should just wait for the slave to come back. listener.getLogger().print(Messages.AbstractProject_NoWorkspace()); listener.getLogger().println( " (" + workspaceOfflineReason.name() + ")"); return NO_CHANGES; } listener.getLogger().println( ws==null ? Messages.AbstractProject_WorkspaceOffline() : Messages.AbstractProject_NoWorkspace()); if (isInQueue()) { listener.getLogger().println(Messages.AbstractProject_AwaitingBuildForWorkspace()); return NO_CHANGES; } else { listener.getLogger().print(Messages.AbstractProject_NewBuildForWorkspace()); listener.getLogger().println( " (" + workspaceOfflineReason.name() + ")"); return BUILD_NOW; } } else { WorkspaceList l = lb.getBuiltOn().toComputer().getWorkspaceList(); return pollWithWorkspace(listener, scm, lb, ws, l); } } else { // polling without workspace LOGGER.fine("Polling SCM changes of " + getName()); if (pollingBaseline==null) // see NOTE-NO-BASELINE above calcPollingBaseline(lb,null,listener); PollingResult r = scm.poll(this, null, null, listener, pollingBaseline); pollingBaseline = r.remote; return r; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _poll File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
_poll
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
private void terminateSessionForID(Serializable sessionId) { try { getActiveSessionForID(sessionId).ifPresent(Session::stop); } catch (Exception e) { LOG.error("Couldn't terminate session", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: terminateSessionForID File: graylog2-server/src/main/java/org/graylog2/security/UserSessionTerminationService.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-613" ]
CVE-2023-41041
LOW
3.1
Graylog2/graylog2-server
terminateSessionForID
graylog2-server/src/main/java/org/graylog2/security/UserSessionTerminationService.java
bb88f3d0b2b0351669ab32c60b595ab7242a3fe3
0
Analyze the following code function for security vulnerabilities
private void sendLocalBroadcast(String event, String dirRemotePath, RemoteOperationResult result) { Log_OC.d(TAG, "Send broadcast " + event); Intent intent = new Intent(event); intent.putExtra(FileSyncAdapter.EXTRA_ACCOUNT_NAME, getAccount().name); if (dirRemotePath != null) { intent.putExtra(FileSyncAdapter.EXTRA_FOLDER_PATH, dirRemotePath); } if (result != null) { DataHolderUtil dataHolderUtil = DataHolderUtil.getInstance(); String dataHolderItemId = dataHolderUtil.nextItemId(); dataHolderUtil.save(dataHolderUtil.nextItemId(), result); intent.putExtra(FileSyncAdapter.EXTRA_RESULT, dataHolderItemId); } intent.setPackage(getContext().getPackageName()); LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendLocalBroadcast File: src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
sendLocalBroadcast
src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java
27559efb79d45782e000b762860658d49e9c35e9
0
Analyze the following code function for security vulnerabilities
private void migrate1(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("CodeComments.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { Element branchRefElement = element.element("branchRef"); if (branchRefElement != null) branchRefElement.detach(); } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate1 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate1
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public IIntentSender getIntentSender(int type, String packageName, IBinder token, String resultWho, int requestCode, Intent[] intents, String[] resolvedTypes, int flags, Bundle options, int userId) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntentSender File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getIntentSender
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private MinimalFileTree findFiles(String pattern) { return new SingleIncludePatternFileTree(baseDir, pattern); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findFiles File: subprojects/core/src/main/java/org/gradle/internal/resource/local/DefaultPathKeyFileStore.java Repository: gradle The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35946
MEDIUM
5.5
gradle
findFiles
subprojects/core/src/main/java/org/gradle/internal/resource/local/DefaultPathKeyFileStore.java
859eae2b2acf751ae7db3c9ffefe275aa5da0d5d
0
Analyze the following code function for security vulnerabilities
public boolean pointsTo(Job<?,?> j) { return j.getFullName().equals(upstreamProject); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pointsTo File: core/src/main/java/hudson/model/Cause.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2067
LOW
3.5
jenkinsci/jenkins
pointsTo
core/src/main/java/hudson/model/Cause.java
5d57c855f3147bfc5e7fda9252317b428a700014
0
Analyze the following code function for security vulnerabilities
void handle3GAuthRequest(SimAuthRequestData requestData) { WifiConfiguration requestingWifiConfiguration = null; if (mTargetWifiConfiguration != null && mTargetWifiConfiguration.networkId == requestData.networkId) { requestingWifiConfiguration = mTargetWifiConfiguration; logd("id matches targetWifiConfiguration"); } else if (mLastNetworkId != WifiConfiguration.INVALID_NETWORK_ID && mLastNetworkId == requestData.networkId) { requestingWifiConfiguration = getConnectedWifiConfigurationInternal(); logd("id matches currentWifiConfiguration"); } if (requestingWifiConfiguration == null) { logd("3GAuthRequest received with null target/current WifiConfiguration."); return; } SimAuthResponseData response = mWifiCarrierInfoManager .get3GAuthResponse(requestData, requestingWifiConfiguration); if (response != null) { mWifiNative.simAuthResponse( mInterfaceName, response.type, response.response); } else { mWifiNative.umtsAuthFailedResponse(mInterfaceName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handle3GAuthRequest File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
handle3GAuthRequest
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public Route.Collection path(String path, Runnable action) { this.path.addLast(Route.normalize(path)); Route.Collection collection = with(action); this.path.removeLast(); return collection; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: path 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
path
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
static File dumpStackTraces(ArrayList<Integer> firstPids, ProcessCpuTracker processCpuTracker, SparseArray<Boolean> lastPids, ArrayList<Integer> nativePids, StringWriter logExceptionCreatingFile, long[] firstPidOffsets, String subject, String criticalEventSection) { ArrayList<Integer> extraPids = null; Slog.i(TAG, "dumpStackTraces pids=" + lastPids + " nativepids=" + nativePids); // Measure CPU usage as soon as we're called in order to get a realistic sampling // of the top users at the time of the request. if (processCpuTracker != null) { processCpuTracker.init(); try { Thread.sleep(200); } catch (InterruptedException ignored) { } processCpuTracker.update(); // We'll take the stack crawls of just the top apps using CPU. final int N = processCpuTracker.countWorkingStats(); extraPids = new ArrayList<>(); for (int i = 0; i < N && extraPids.size() < 5; i++) { ProcessCpuTracker.Stats stats = processCpuTracker.getWorkingStats(i); if (lastPids.indexOfKey(stats.pid) >= 0) { if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for extra pid " + stats.pid); extraPids.add(stats.pid); } else { Slog.i(TAG, "Skipping next CPU consuming process, not a java proc: " + stats.pid); } } } final File tracesDir = new File(ANR_TRACE_DIR); // Each set of ANR traces is written to a separate file and dumpstate will process // all such files and add them to a captured bug report if they're recent enough. maybePruneOldTraces(tracesDir); // NOTE: We should consider creating the file in native code atomically once we've // gotten rid of the old scheme of dumping and lot of the code that deals with paths // can be removed. File tracesFile; try { tracesFile = createAnrDumpFile(tracesDir); } catch (IOException e) { Slog.w(TAG, "Exception creating ANR dump file:", e); if (logExceptionCreatingFile != null) { logExceptionCreatingFile.append("----- Exception creating ANR dump file -----\n"); e.printStackTrace(new PrintWriter(logExceptionCreatingFile)); } return null; } if (subject != null || criticalEventSection != null) { try (FileOutputStream fos = new FileOutputStream(tracesFile, true)) { if (subject != null) { String header = "Subject: " + subject + "\n\n"; fos.write(header.getBytes(StandardCharsets.UTF_8)); } if (criticalEventSection != null) { fos.write(criticalEventSection.getBytes(StandardCharsets.UTF_8)); } } catch (IOException e) { Slog.w(TAG, "Exception writing to ANR dump file:", e); } } Pair<Long, Long> offsets = dumpStackTraces( tracesFile.getAbsolutePath(), firstPids, nativePids, extraPids); if (firstPidOffsets != null) { if (offsets == null) { firstPidOffsets[0] = firstPidOffsets[1] = -1; } else { firstPidOffsets[0] = offsets.first; // Start offset to the ANR trace file firstPidOffsets[1] = offsets.second; // End offset to the ANR trace file } } return tracesFile; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpStackTraces File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
dumpStackTraces
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public static String getSourceFilePath(String fileName, String dataRepository, String format) { if (StringUtils.isEmpty(fileName)) { throw new IllegalArgumentException("fileName may not be null or empty"); } if (StringUtils.isEmpty(format)) { throw new IllegalArgumentException("format may not be null or empty"); } switch (format) { case SolrConstants._METS: case SolrConstants._LIDO: case SolrConstants._DENKXWEB: case SolrConstants._WORLDVIEWS: case SolrConstants._DUBLINCORE: break; default: throw new IllegalArgumentException("format must be: METS | LIDO | DENKXWEB | DUBLINCORE | WORLDVIEWS"); } StringBuilder sb = new StringBuilder(getDataRepositoryPath(dataRepository)); switch (format) { case SolrConstants._METS: sb.append(DataManager.getInstance().getConfiguration().getIndexedMetsFolder()); break; case SolrConstants._LIDO: sb.append(DataManager.getInstance().getConfiguration().getIndexedLidoFolder()); break; case SolrConstants._DENKXWEB: sb.append(DataManager.getInstance().getConfiguration().getIndexedDenkxwebFolder()); break; case SolrConstants._DUBLINCORE: sb.append(DataManager.getInstance().getConfiguration().getIndexedDublinCoreFolder()); break; case SolrConstants._WORLDVIEWS: sb.append(DataManager.getInstance().getConfiguration().getIndexedMetsFolder()); break; } sb.append('/').append(fileName); return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSourceFilePath File: goobi-viewer-core/src/main/java/io/goobi/viewer/controller/DataFileTools.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-15124
MEDIUM
4
intranda/goobi-viewer-core
getSourceFilePath
goobi-viewer-core/src/main/java/io/goobi/viewer/controller/DataFileTools.java
44ceb8e2e7e888391e8a941127171d6366770df3
0
Analyze the following code function for security vulnerabilities
@Override public void keyguardGoingAway(int flags) { enforceNotIsolatedCaller("keyguardGoingAway"); final long token = Binder.clearCallingIdentity(); try { synchronized (this) { mKeyguardController.keyguardGoingAway(flags); } } finally { Binder.restoreCallingIdentity(token); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: keyguardGoingAway 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
keyguardGoingAway
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public com.codename1.ui.Transform getTransform(Object graphics) { com.codename1.ui.Transform t = ((AndroidGraphics) graphics).getTransform(); if (t == null) { return Transform.makeIdentity(); } Transform t2 = Transform.makeIdentity(); t2.setTransform(t); return t2; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTransform 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
getTransform
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Nullable public List<Integer> getIsolatedProcesses(int uid) { synchronized (ActivityManagerService.this) { return mProcessList.getIsolatedProcessesLocked(uid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIsolatedProcesses File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
getIsolatedProcesses
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
static String getEncryptKey() { try { String sdEncKey = SystemKeyStore.getInstance().retrieveKeyHexString( SD_ENCRYPTION_KEYSTORE_NAME); if (sdEncKey == null) { sdEncKey = SystemKeyStore.getInstance().generateNewKeyHexString(128, SD_ENCRYPTION_ALGORITHM, SD_ENCRYPTION_KEYSTORE_NAME); if (sdEncKey == null) { Slog.e(TAG, "Failed to create encryption keys"); return null; } } return sdEncKey; } catch (NoSuchAlgorithmException nsae) { Slog.e(TAG, "Failed to create encryption keys with exception: " + nsae); return null; } catch (IOException ioe) { Slog.e(TAG, "Failed to retrieve encryption keys with exception: " + ioe); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEncryptKey File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
getEncryptKey
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@ModelAttribute("settings") public SSAMSettings settings() { return settings; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: settings File: src/main/java/com/unboundid/webapp/ssam/SSAMController.java Repository: pingidentity/ssam The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-25084
MEDIUM
4
pingidentity/ssam
settings
src/main/java/com/unboundid/webapp/ssam/SSAMController.java
f64b10d63bb19ca2228b0c2d561a1a6e5a3bf251
0
Analyze the following code function for security vulnerabilities
public String formatShortDate(Date date) { Context ctx = Context.getCurrentContext(); return formatShortDate(date, ctx.getLocale()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: formatShortDate File: java/code/src/com/redhat/rhn/common/localization/LocalizationService.java Repository: spacewalkproject/spacewalk The code follows secure coding practices.
[ "CWE-79" ]
CVE-2016-3079
MEDIUM
4.3
spacewalkproject/spacewalk
formatShortDate
java/code/src/com/redhat/rhn/common/localization/LocalizationService.java
7b9ff9ad
0
Analyze the following code function for security vulnerabilities
private boolean doGetBoolean(String key, Object o) throws JSONException { if (o.equals(Boolean.FALSE) || (o instanceof String && ((String)o).equalsIgnoreCase("false"))) { return false; } else if (o.equals(Boolean.TRUE) || (o instanceof String && ((String)o).equalsIgnoreCase("true"))) { return true; } throw new JSONException("JSONObject[" + quote(key) + "] is not a Boolean."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doGetBoolean File: src/main/java/org/codehaus/jettison/json/JSONObject.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
doGetBoolean
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
public static String issueJwt(String id, String subject, String issuer, Long period, List<String> roles, Map<String, Object> customClaimMap){ if (customClaimMap == null) { customClaimMap = new HashMap<>(8); } if (roles != null && !roles.isEmpty()) { customClaimMap.put(SurenessConstant.ROLES, roles); } return issueJwtAll(id, subject, issuer, period, null, null, null, null, customClaimMap); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: issueJwt File: core/src/main/java/com/usthe/sureness/util/JsonWebTokenUtil.java Repository: dromara/sureness The code follows secure coding practices.
[ "CWE-798" ]
CVE-2023-31581
CRITICAL
9.8
dromara/sureness
issueJwt
core/src/main/java/com/usthe/sureness/util/JsonWebTokenUtil.java
4f5fefaf673168d74820020a191fab2904629742
0
Analyze the following code function for security vulnerabilities
private void gotDisconnect(SSHPacket buf) throws TransportException { try { final DisconnectReason code = DisconnectReason.fromInt(buf.readUInt32AsInt()); final String message = buf.readString(); log.info("Received SSH_MSG_DISCONNECT (reason={}, msg={})", code, message); throw new TransportException(code, message); } catch (Buffer.BufferException be) { throw new TransportException(be); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gotDisconnect 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
gotDisconnect
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
public abstract boolean isFingerprintConfigured();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFingerprintConfigured File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
isFingerprintConfigured
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0