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 | protected boolean usingEnterKey() {
return getBooleanPreference("display_enter_key", R.bool.display_enter_key);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: usingEnterKey
File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2018-18467 | MEDIUM | 5 | iNPUTmice/Conversations | usingEnterKey | src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 7177c523a1b31988666b9337249a4f1d0c36f479 | 0 |
Analyze the following code function for security vulnerabilities | static PhoneAccount createPhoneAccount(Context context, SipProfile profile) {
// Build a URI to represent the SIP account. Does not use SipProfile#getUriString() since
// that prototype can include transport information which we do not want to see in the
// phone account.
String sipAddress = profile.getUserName() + "@" + profile.getSipDomain();
Uri sipUri = Uri.parse(profile.getUriString());
PhoneAccountHandle accountHandle =
SipUtil.createAccountHandle(context, profile.getProfileName());
final ArrayList<String> supportedUriSchemes = new ArrayList<String>();
supportedUriSchemes.add(PhoneAccount.SCHEME_SIP);
if (useSipForPstnCalls(context)) {
supportedUriSchemes.add(PhoneAccount.SCHEME_TEL);
}
PhoneAccount.Builder builder = PhoneAccount.builder(accountHandle, profile.getDisplayName())
.setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER
| PhoneAccount.CAPABILITY_MULTI_USER)
.setAddress(sipUri)
.setShortDescription(sipAddress)
.setIcon(Icon.createWithResource(
context.getResources(), R.drawable.ic_dialer_sip_black_24dp))
.setSupportedUriSchemes(supportedUriSchemes);
return builder.build();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createPhoneAccount
File: sip/src/com/android/services/telephony/sip/SipUtil.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-0847 | HIGH | 7.2 | android | createPhoneAccount | sip/src/com/android/services/telephony/sip/SipUtil.java | a294ae5342410431a568126183efe86261668b5d | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean getExpandEntities() {
return expand;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getExpandEntities
File: core/src/java/org/jdom2/input/SAXBuilder.java
Repository: hunterhacker/jdom
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2021-33813 | MEDIUM | 5 | hunterhacker/jdom | getExpandEntities | core/src/java/org/jdom2/input/SAXBuilder.java | bd3ab78370098491911d7fe9d7a43b97144a234e | 0 |
Analyze the following code function for security vulnerabilities | private DocumentRevisionProvider getDocumentRevisionProvider()
{
if (this.documentRevisionProvider == null) {
this.documentRevisionProvider = Utils.getComponent(DocumentRevisionProvider.class);
}
return this.documentRevisionProvider;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDocumentRevisionProvider
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2022-23615 | MEDIUM | 5.5 | xwiki/xwiki-platform | getDocumentRevisionProvider | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java | 7ab0fe7b96809c7a3881454147598d46a1c9bbbe | 0 |
Analyze the following code function for security vulnerabilities | private void fixDuplicateExtra(@Nullable Parcelable original, @NonNull String extraName) {
if (original != null && extras.getParcelable(extraName) != null) {
extras.putParcelable(extraName, original);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fixDuplicateExtra
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21288 | MEDIUM | 5.5 | android | fixDuplicateExtra | core/java/android/app/Notification.java | 726247f4f53e8cc0746175265652fa415a123c0c | 0 |
Analyze the following code function for security vulnerabilities | public void redirect(final String location) {
// set the header AND a meta refresh just in case
response().headers().set("Location", location);
sendReply(HttpResponseStatus.OK,
new StringBuilder(
"<html></head><meta http-equiv=\"refresh\" content=\"0; url="
+ location + "\"></head></html>")
.toString().getBytes(this.getCharset())
);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: redirect
File: src/tsd/HttpQuery.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2023-25827 | MEDIUM | 6.1 | OpenTSDB/opentsdb | redirect | src/tsd/HttpQuery.java | ff02c1e95e60528275f69b31bcbf7b2ac625cea8 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void startFreezingScreen(int exitAnim, int enterAnim) {
if (!checkCallingPermission(android.Manifest.permission.FREEZE_SCREEN,
"startFreezingScreen()")) {
throw new SecurityException("Requires FREEZE_SCREEN permission");
}
synchronized(mWindowMap) {
if (!mClientFreezingScreen) {
mClientFreezingScreen = true;
final long origId = Binder.clearCallingIdentity();
try {
startFreezingDisplayLocked(false, exitAnim, enterAnim);
mH.removeMessages(H.CLIENT_FREEZE_TIMEOUT);
mH.sendEmptyMessageDelayed(H.CLIENT_FREEZE_TIMEOUT, 5000);
} finally {
Binder.restoreCallingIdentity(origId);
}
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startFreezingScreen
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3875 | HIGH | 7.2 | android | startFreezingScreen | services/core/java/com/android/server/wm/WindowManagerService.java | 69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c | 0 |
Analyze the following code function for security vulnerabilities | private int updateSystemBarsLw(WindowState win, int oldVis, int vis) {
// apply translucent bar vis flags
WindowState transWin = isStatusBarKeyguard() && !mHideLockScreen
? mStatusBar
: mTopFullscreenOpaqueWindowState;
vis = mStatusBarController.applyTranslucentFlagLw(transWin, vis, oldVis);
vis = mNavigationBarController.applyTranslucentFlagLw(transWin, vis, oldVis);
// prevent status bar interaction from clearing certain flags
boolean statusBarHasFocus = win.getAttrs().type == TYPE_STATUS_BAR;
if (statusBarHasFocus && !isStatusBarKeyguard()) {
int flags = View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_IMMERSIVE
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
if (mHideLockScreen) {
flags |= View.STATUS_BAR_TRANSLUCENT | View.NAVIGATION_BAR_TRANSLUCENT;
}
vis = (vis & ~flags) | (oldVis & flags);
}
if (!areTranslucentBarsAllowed() && transWin != mStatusBar) {
vis &= ~(View.NAVIGATION_BAR_TRANSLUCENT | View.STATUS_BAR_TRANSLUCENT
| View.SYSTEM_UI_TRANSPARENT);
}
// update status bar
boolean immersiveSticky =
(vis & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) != 0;
boolean hideStatusBarWM =
mTopFullscreenOpaqueWindowState != null &&
(PolicyControl.getWindowFlags(mTopFullscreenOpaqueWindowState, null)
& WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
boolean hideStatusBarSysui =
(vis & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0;
boolean hideNavBarSysui =
(vis & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 0;
boolean transientStatusBarAllowed =
mStatusBar != null && (
hideStatusBarWM
|| (hideStatusBarSysui && immersiveSticky)
|| statusBarHasFocus);
boolean transientNavBarAllowed =
mNavigationBar != null &&
hideNavBarSysui && immersiveSticky;
boolean denyTransientStatus = mStatusBarController.isTransientShowRequested()
&& !transientStatusBarAllowed && hideStatusBarSysui;
boolean denyTransientNav = mNavigationBarController.isTransientShowRequested()
&& !transientNavBarAllowed;
if (denyTransientStatus || denyTransientNav) {
// clear the clearable flags instead
clearClearableFlagsLw();
}
vis = mStatusBarController.updateVisibilityLw(transientStatusBarAllowed, oldVis, vis);
// update navigation bar
boolean oldImmersiveMode = isImmersiveMode(oldVis);
boolean newImmersiveMode = isImmersiveMode(vis);
if (win != null && oldImmersiveMode != newImmersiveMode) {
final String pkg = win.getOwningPackage();
mImmersiveModeConfirmation.immersiveModeChanged(pkg, newImmersiveMode,
isUserSetupComplete());
}
vis = mNavigationBarController.updateVisibilityLw(transientNavBarAllowed, oldVis, vis);
return vis;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateSystemBarsLw
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-0812 | MEDIUM | 6.6 | android | updateSystemBarsLw | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 84669ca8de55d38073a0dcb01074233b0a417541 | 0 |
Analyze the following code function for security vulnerabilities | @PasswordComplexity
@RequiresPermission(anyOf={MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS, REQUEST_PASSWORD_COMPLEXITY}, conditional = true)
public int getPasswordComplexity() {
if (mService == null) {
return PASSWORD_COMPLEXITY_NONE;
}
try {
return mService.getPasswordComplexity(mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPasswordComplexity
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 | getPasswordComplexity | core/java/android/app/admin/DevicePolicyManager.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | public String getAttachmentURL(String filename, String action, String queryString)
{
return this.doc.getAttachmentURL(filename, action, queryString, getXWikiContext());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAttachmentURL
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2022-23615 | MEDIUM | 5.5 | xwiki/xwiki-platform | getAttachmentURL | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java | 7ab0fe7b96809c7a3881454147598d46a1c9bbbe | 0 |
Analyze the following code function for security vulnerabilities | protected XWikiDocument prepareEditedDocument(XWikiContext context) throws XWikiException
{
// Determine the edited document (translation).
XWikiDocument editedDocument = getEditedDocument(context);
EditForm editForm = (EditForm) context.getForm();
// Update the edited document based on the template specified on the request.
editedDocument.readFromTemplate(editForm, context);
// The default values from the template can be overwritten by additional request parameters.
updateDocumentTitleAndContentFromRequest(editedDocument, context);
editedDocument.readObjectsFromForm(editForm, context);
// Set the current user as creator, author and contentAuthor when the edited document is newly created to avoid
// using XWikiGuest instead (because those fields were not previously initialized).
if (editedDocument.isNew()) {
editedDocument.setCreatorReference(context.getUserReference());
editedDocument.setAuthorReference(context.getUserReference());
editedDocument.setContentAuthorReference(context.getUserReference());
}
// Expose the edited document on the XWiki context and the Velocity context.
putDocumentOnContext(editedDocument, context);
return editedDocument;
} | Vulnerability Classification:
- CWE: CWE-862
- CVE: CVE-2022-23617
- Severity: MEDIUM
- CVSS Score: 4.0
Description: XWIKI-18430: Page content is revealed to users that don't have rights if used as a template for the creation of another page
Function: prepareEditedDocument
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/EditAction.java
Repository: xwiki/xwiki-platform
Fixed Code:
protected XWikiDocument prepareEditedDocument(XWikiContext context) throws XWikiException
{
// Determine the edited document (translation).
XWikiDocument editedDocument = getEditedDocument(context);
EditForm editForm = (EditForm) context.getForm();
// Update the edited document based on the template specified on the request.
readFromTemplate(editedDocument, editForm.getTemplate(), context);
// The default values from the template can be overwritten by additional request parameters.
updateDocumentTitleAndContentFromRequest(editedDocument, context);
editedDocument.readObjectsFromForm(editForm, context);
// Set the current user as creator, author and contentAuthor when the edited document is newly created to avoid
// using XWikiGuest instead (because those fields were not previously initialized).
if (editedDocument.isNew()) {
editedDocument.setCreatorReference(context.getUserReference());
editedDocument.setAuthorReference(context.getUserReference());
editedDocument.setContentAuthorReference(context.getUserReference());
}
// Expose the edited document on the XWiki context and the Velocity context.
putDocumentOnContext(editedDocument, context);
return editedDocument;
} | [
"CWE-862"
] | CVE-2022-23617 | MEDIUM | 4 | xwiki/xwiki-platform | prepareEditedDocument | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/EditAction.java | 30c52b01559b8ef5ed1035dac7c34aaf805764d5 | 1 |
Analyze the following code function for security vulnerabilities | public boolean isRevisionFixed() {
return revision!=-1;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isRevisionFixed
File: src/main/java/hudson/scm/SubversionSCM.java
Repository: jenkinsci/subversion-plugin
The code follows secure coding practices. | [
"CWE-255"
] | CVE-2013-6372 | LOW | 2.1 | jenkinsci/subversion-plugin | isRevisionFixed | src/main/java/hudson/scm/SubversionSCM.java | 7d4562d6f7e40de04bbe29577b51c79f07d05ba6 | 0 |
Analyze the following code function for security vulnerabilities | private void parseProduction(final Node root) throws GameParseException {
parseProductionRules(getChildren("productionRule", root));
parseProductionFrontiers(getChildren("productionFrontier", root));
parsePlayerProduction(getChildren("playerProduction", root));
parseRepairRules(getChildren("repairRule", root));
parseRepairFrontiers(getChildren("repairFrontier", root));
parsePlayerRepair(getChildren("playerRepair", root));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseProduction
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2018-1000546 | MEDIUM | 6.8 | triplea-game/triplea | parseProduction | game-core/src/main/java/games/strategy/engine/data/GameParser.java | 0f23875a4c6e166218859a63c884995f15c53895 | 0 |
Analyze the following code function for security vulnerabilities | @ApiOperation(value = "delete Node Operation")
@RequestMapping(value = "/deleteNode", method = RequestMethod.POST)
public String deleteNode(@RequestParam(value = "userId", required = true) String userId,
@RequestParam(value = "solutionId", required = false) String solutionId,
@RequestParam(value = "version", required = false) String version,
@RequestParam(value = "cid", required = false) String cid,
@RequestParam(value = "nodeId", required = true) String nodeId) {
logger.debug(EELFLoggerDelegator.debugLogger, " deleteNode() in SolutionController Begin ");
String result = "";
String resultTemplate = "{\"success\":\"%s\", \"errorMessage\":\"%s\"}";
if (null == userId && null == nodeId) {
result = String.format(resultTemplate, false, "Mandatory feild(s) missing");
} else {
try {
boolean deletedNode = solutionService.deleteNode(userId, solutionId, version, cid, nodeId);
if (deletedNode) {
result = String.format(resultTemplate, true, "");
} else {
result = String.format(resultTemplate, false, "Invalid Node Id – not found");
}
} catch (Exception e) {
logger.error(EELFLoggerDelegator.errorLogger,
" Exception in deleteNode() in SolutionController ", e);
}
}
logger.debug(EELFLoggerDelegator.debugLogger, " deleteNode() in SolutionController Ends ");
return result;
} | Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2018-25097
- Severity: MEDIUM
- CVSS Score: 4.0
Description: Senitization for CSS Vulnerability
Issue-Id : ACUMOS-1650
Description : Senitization for CSS Vulnerability - Design Studio
Change-Id: If8fd4b9b06f884219d93881f7922421870de8e3d
Signed-off-by: Ramanaiah Pirla <RP00490596@techmahindra.com>
Function: deleteNode
File: ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java
Repository: acumos/design-studio
Fixed Code:
@ApiOperation(value = "delete Node Operation")
@RequestMapping(value = "/deleteNode", method = RequestMethod.POST)
public String deleteNode(@RequestParam(value = "userId", required = true) String userId,
@RequestParam(value = "solutionId", required = false) String solutionId,
@RequestParam(value = "version", required = false) String version,
@RequestParam(value = "cid", required = false) String cid,
@RequestParam(value = "nodeId", required = true) String nodeId) {
logger.debug(EELFLoggerDelegator.debugLogger, " deleteNode() in SolutionController Begin ");
String result = "";
String resultTemplate = "{\"success\":\"%s\", \"errorMessage\":\"%s\"}";
if (null == userId && null == nodeId) {
result = String.format(resultTemplate, false, "Mandatory feild(s) missing");
} else {
try {
boolean deletedNode = solutionService.deleteNode(userId, SanitizeUtils.sanitize(solutionId), version, cid, nodeId);
if (deletedNode) {
result = String.format(resultTemplate, true, "");
} else {
result = String.format(resultTemplate, false, "Invalid Node Id – not found");
}
} catch (Exception e) {
logger.error(EELFLoggerDelegator.errorLogger,
" Exception in deleteNode() in SolutionController ", e);
}
}
logger.debug(EELFLoggerDelegator.debugLogger, " deleteNode() in SolutionController Ends ");
return result;
} | [
"CWE-79"
] | CVE-2018-25097 | MEDIUM | 4 | acumos/design-studio | deleteNode | ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java | 0df8a5e8722188744973168648e4c74c69ce67fd | 1 |
Analyze the following code function for security vulnerabilities | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException; | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDeviceConfigurationInfo
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3832 | HIGH | 8.3 | android | getDeviceConfigurationInfo | core/java/android/app/IActivityManager.java | e7cf91a198de995c7440b3b64352effd2e309906 | 0 |
Analyze the following code function for security vulnerabilities | public void hideBootMessagesLocked() {
if (DEBUG_BOOT) {
RuntimeException here = new RuntimeException("here");
here.fillInStackTrace();
Slog.i(TAG, "hideBootMessagesLocked: mDisplayEnabled=" + mDisplayEnabled
+ " mForceDisplayEnabled=" + mForceDisplayEnabled
+ " mShowingBootMessages=" + mShowingBootMessages
+ " mSystemBooted=" + mSystemBooted, here);
}
if (mShowingBootMessages) {
mShowingBootMessages = false;
mPolicy.hideBootMessages();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hideBootMessagesLocked
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3875 | HIGH | 7.2 | android | hideBootMessagesLocked | services/core/java/com/android/server/wm/WindowManagerService.java | 69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c | 0 |
Analyze the following code function for security vulnerabilities | public void select(AsyncResult<SQLConnection> conn, String sql, JsonArray params,
Handler<AsyncResult<ResultSet>> replyHandler) {
try {
if (conn.failed()) {
replyHandler.handle(Future.failedFuture(conn.cause()));
return;
}
conn.result().queryWithParams(sql, params, replyHandler);
} catch (Exception e) {
log.error("select sql: " + e.getMessage() + " - " + sql, e);
replyHandler.handle(Future.failedFuture(e));
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: select
File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2019-15534 | HIGH | 7.5 | folio-org/raml-module-builder | select | domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java | b7ef741133e57add40aa4cb19430a0065f378a94 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (mLoginWebView != null && event.getAction() == KeyEvent.ACTION_DOWN &&
keyCode == KeyEvent.KEYCODE_BACK) {
if (mLoginWebView.canGoBack()) {
mLoginWebView.goBack();
} else {
finish();
}
return true;
}
return super.onKeyDown(keyCode, event);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onKeyDown
File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
Repository: nextcloud/android
The code follows secure coding practices. | [
"CWE-248"
] | CVE-2021-32694 | MEDIUM | 4.3 | nextcloud/android | onKeyDown | src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java | 9343bdd85d70625a90e0c952897957a102c2421b | 0 |
Analyze the following code function for security vulnerabilities | protected void createWatcherThread(final File file_webapp, final File file_deployDir, final int interval,
final String virtualHost) {
if (interval <= 0)
return;
Thread watcher = new Thread("Deploy update watcher for " + (virtualHost == null ? "main" : virtualHost)) {
public void run() {
for (;;)
try {
deployWatch(file_webapp, file_deployDir, virtualHost);
} catch (Throwable t) {
if (t instanceof ThreadDeath)
throw (ThreadDeath) t;
WarRoller.this.server.log("Unhandled " + t, t);
} finally {
try {
Thread.sleep(interval);
} catch (InterruptedException e) {
break;
}
}
}
};
watcher.setDaemon(true);
watcher.start();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createWatcherThread
File: 1.x/src/rogatkin/web/WarRoller.java
Repository: drogatkin/TJWS2
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2022-4594 | CRITICAL | 9.8 | drogatkin/TJWS2 | createWatcherThread | 1.x/src/rogatkin/web/WarRoller.java | 1bac15c496ec54efe21ad7fab4e17633778582fc | 0 |
Analyze the following code function for security vulnerabilities | public void clearListeners() {
mBoundListeners.clear();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearListeners
File: src/main/java/com/owncloud/android/files/services/FileDownloader.java
Repository: nextcloud/android
The code follows secure coding practices. | [
"CWE-732"
] | CVE-2022-24886 | LOW | 2.1 | nextcloud/android | clearListeners | src/main/java/com/owncloud/android/files/services/FileDownloader.java | 27559efb79d45782e000b762860658d49e9c35e9 | 0 |
Analyze the following code function for security vulnerabilities | public String clearName(String name, XWikiContext context)
{
return clearName(name, true, true, context);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearName
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2021-32620 | MEDIUM | 4 | xwiki/xwiki-platform | clearName | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java | f9a677408ffb06f309be46ef9d8df1915d9099a4 | 0 |
Analyze the following code function for security vulnerabilities | boolean setReportResizeHints() {
return mWindowFrames.setReportResizeHints();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setReportResizeHints
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 | setReportResizeHints | services/core/java/com/android/server/wm/WindowState.java | 7428962d3b064ce1122809d87af65099d1129c9e | 0 |
Analyze the following code function for security vulnerabilities | public static <T> JsonValue encodeValue(Object modelValue,
Renderer<T> renderer, Converter<?, ?> converter,
Locale locale) {
Class<T> presentationType = renderer.getPresentationType();
T presentationValue;
if (converter == null) {
try {
presentationValue = presentationType.cast(modelValue);
} catch (ClassCastException e) {
if (presentationType == String.class) {
// If there is no converter, just fallback to using
// toString(). modelValue can't be null as
// Class.cast(null) will always succeed
presentationValue = (T) modelValue.toString();
} else {
throw new Converter.ConversionException(
"Unable to convert value of type "
+ modelValue.getClass().getName()
+ " to presentation type "
+ presentationType.getName()
+ ". No converter is set and the types are not compatible.");
}
}
} else {
assert presentationType
.isAssignableFrom(converter.getPresentationType());
@SuppressWarnings("unchecked")
Converter<T, Object> safeConverter = (Converter<T, Object>) converter;
presentationValue = safeConverter.convertToPresentation(
modelValue, safeConverter.getPresentationType(),
locale);
}
JsonValue encodedValue;
try {
encodedValue = renderer.encode(presentationValue);
} catch (Exception e) {
getLogger().log(Level.SEVERE, "Unable to encode data", e);
encodedValue = renderer.encode(null);
}
return encodedValue;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: encodeValue
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 | encodeValue | server/src/main/java/com/vaadin/ui/Grid.java | b9ba10adaa06a0977c531f878c3f0046b67f9cc0 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void finishDataDelivery(int op,
@NonNull AttributionSourceState attributionSourceState, boolean fromDataSource) {
finishDataDelivery(mContext, op, attributionSourceState,
fromDataSource);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishDataDelivery
File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-281"
] | CVE-2023-21249 | MEDIUM | 5.5 | android | finishDataDelivery | services/core/java/com/android/server/pm/permission/PermissionManagerService.java | c00b7e7dbc1fa30339adef693d02a51254755d7f | 0 |
Analyze the following code function for security vulnerabilities | public static String generateToken(int length)
{
StringBuffer rtn = new StringBuffer();
for (int i = 0; i < length; i++)
{
int offset = randomSecure.nextInt(TOKEN_ALPHABET.length());
rtn.append(TOKEN_ALPHABET.substring(offset,offset+1));
}
return rtn.toString();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateToken
File: src/main/java/com/mxgraph/online/Utils.java
Repository: jgraph/drawio
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2023-3398 | HIGH | 7.5 | jgraph/drawio | generateToken | src/main/java/com/mxgraph/online/Utils.java | 064729fec4262f9373d9fdcafda0be47cd18dd50 | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected void endOfEntryReached(InputStream inputStream) throws IOException {
verifyContent(readStoredMac(inputStream));
} | Vulnerability Classification:
- CWE: CWE-346
- CVE: CVE-2023-22899
- Severity: MEDIUM
- CVSS Score: 5.9
Description: #485 Calculate AES mac with cache and push back functionality
Function: endOfEntryReached
File: src/main/java/net/lingala/zip4j/io/inputstream/AesCipherInputStream.java
Repository: srikanth-lingala/zip4j
Fixed Code:
@Override
protected void endOfEntryReached(InputStream inputStream, int numberOfBytesPushedBack) throws IOException {
verifyContent(readStoredMac(inputStream), numberOfBytesPushedBack);
} | [
"CWE-346"
] | CVE-2023-22899 | MEDIUM | 5.9 | srikanth-lingala/zip4j | endOfEntryReached | src/main/java/net/lingala/zip4j/io/inputstream/AesCipherInputStream.java | ddd8fdc8ad0583eb4a6172dc86c72c881485c55b | 1 |
Analyze the following code function for security vulnerabilities | public static Permission getReadPermission(final URL location, final VersionString version) {
Permission result = null;
if (CacheUtil.isCacheable(location)) {
final File file = CacheUtil.getCacheFile(location, version);
result = new FilePermission(file.getPath(), FILE_READ_ACTION);
} else {
// this is what URLClassLoader does
try (final CloseableConnection conn = ConnectionFactory.openConnection(location)) {
result = conn.getPermission();
} catch (IOException ioe) {
LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, ioe);
// should try to figure out the permission
}
}
return result;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getReadPermission
File: core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices. | [
"CWE-345",
"CWE-94",
"CWE-22"
] | CVE-2019-10182 | MEDIUM | 5.8 | AdoptOpenJDK/IcedTea-Web | getReadPermission | core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java | 2ab070cdac087bd208f64fa8138bb709f8d7680c | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void changePassword(Serializable user, String oldPassword, String newPassword) {
throw new UnsupportedOperationException();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: changePassword
File: portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java
Repository: ManyDesigns/Portofino
The code follows secure coding practices. | [
"CWE-347"
] | CVE-2021-29451 | MEDIUM | 6.4 | ManyDesigns/Portofino | changePassword | portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java | 8c754a0ad234555e813dcbf9e57d637f9f23d8fb | 0 |
Analyze the following code function for security vulnerabilities | public void updateStackScrollerState(boolean goingToFullShade, boolean fromShadeLocked) {
if (mStackScroller == null) return;
boolean onKeyguard = mState == StatusBarState.KEYGUARD;
boolean publicMode = isAnyProfilePublicMode();
mStackScroller.setHideSensitive(publicMode, goingToFullShade);
mStackScroller.setDimmed(onKeyguard, fromShadeLocked /* animate */);
mStackScroller.setExpandingEnabled(!onKeyguard);
ActivatableNotificationView activatedChild = mStackScroller.getActivatedChild();
mStackScroller.setActivatedChild(null);
if (activatedChild != null) {
activatedChild.makeInactive(false /* animate */);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateStackScrollerState
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 | updateStackScrollerState | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java | c574568aaede7f652432deb7707f20ae54bbdf9a | 0 |
Analyze the following code function for security vulnerabilities | @Nullable
@SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS)
public UserHandle createAndProvisionManagedProfile(
@NonNull ManagedProfileProvisioningParams provisioningParams)
throws ProvisioningException {
if (mService == null) {
return null;
}
try {
return mService.createAndProvisionManagedProfile(
provisioningParams, mContext.getPackageName());
} catch (ServiceSpecificException e) {
throw new ProvisioningException(e, e.errorCode, getErrorMessage(e));
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createAndProvisionManagedProfile
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 | createAndProvisionManagedProfile | core/java/android/app/admin/DevicePolicyManager.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | @Nullable
public LocusId getLocusId() {
return mLocusId;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLocusId
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21288 | MEDIUM | 5.5 | android | getLocusId | core/java/android/app/Notification.java | 726247f4f53e8cc0746175265652fa415a123c0c | 0 |
Analyze the following code function for security vulnerabilities | @Override
public ActivityManager.TaskThumbnail getTaskThumbnail(int id) {
synchronized (this) {
enforceCallingPermission(android.Manifest.permission.READ_FRAME_BUFFER,
"getTaskThumbnail()");
final TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(
id, !RESTORE_FROM_RECENTS, INVALID_STACK_ID);
if (tr != null) {
return tr.getTaskThumbnailLocked();
}
}
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTaskThumbnail
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3912 | HIGH | 9.3 | android | getTaskThumbnail | services/core/java/com/android/server/am/ActivityManagerService.java | 6c049120c2d749f0c0289d822ec7d0aa692f55c5 | 0 |
Analyze the following code function for security vulnerabilities | public void onHide() {
assert mWebContents != null;
hidePopupsAndPreserveSelection();
setInjectedAccessibility(false);
mWebContents.onHide();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onHide
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-1021"
] | CVE-2015-1241 | MEDIUM | 4.3 | chromium | onHide | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java | 9d343ad2ea6ec395c377a4efa266057155bfa9c1 | 0 |
Analyze the following code function for security vulnerabilities | protected boolean editInProgress() {
return InPlaceEditView.isEditing();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: editInProgress
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 | editInProgress | Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | private boolean load(ArrayList<String> errors, File lib) {
try {
System.load(lib.getPath());
return true;
} catch (UnsatisfiedLinkError e) {
errors.add(e.getMessage());
}
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: load
File: hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java
Repository: fusesource/hawtjni
The code follows secure coding practices. | [
"CWE-94"
] | CVE-2013-2035 | MEDIUM | 4.4 | fusesource/hawtjni | load | hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java | 92c266170ce98edc200c656bd034a237098b8aa5 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onStartedWakingUp() {
mLockIcon.setDeviceInteractive(true);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onStartedWakingUp
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2017-0822 | HIGH | 7.5 | android | onStartedWakingUp | packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java | c574568aaede7f652432deb7707f20ae54bbdf9a | 0 |
Analyze the following code function for security vulnerabilities | private void checkAbnormalDisconnectionAndTakeBugReport() {
if (mDeviceConfigFacade.isAbnormalDisconnectionBugreportEnabled()) {
int reasonCode = mWifiScoreCard.detectAbnormalDisconnection(mInterfaceName);
if (reasonCode != WifiHealthMonitor.REASON_NO_FAILURE) {
String bugTitle = "Wi-Fi BugReport";
String bugDetail = "Detect abnormal "
+ WifiHealthMonitor.FAILURE_REASON_NAME[reasonCode];
mWifiDiagnostics.takeBugReport(bugTitle, bugDetail);
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkAbnormalDisconnectionAndTakeBugReport
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 | checkAbnormalDisconnectionAndTakeBugReport | service/java/com/android/server/wifi/ClientModeImpl.java | 72e903f258b5040b8f492cf18edd124b5a1ac770 | 0 |
Analyze the following code function for security vulnerabilities | private TimeZone getNitzTimeZone(int offset, boolean dst, long when) {
TimeZone guess = findTimeZone(offset, dst, when);
if (guess == null) {
// Couldn't find a proper timezone. Perhaps the DST data is wrong.
guess = findTimeZone(offset, !dst, when);
}
if (DBG) log("getNitzTimeZone returning " + (guess == null ? guess : guess.getID()));
return guess;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNitzTimeZone
File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
Repository: android
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2016-3831 | MEDIUM | 5 | android | getNitzTimeZone | src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java | f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058 | 0 |
Analyze the following code function for security vulnerabilities | public static void writeObject(ObjectDataOutput out, Object object) throws IOException {
boolean isBinary = object instanceof Data;
out.writeBoolean(isBinary);
if (isBinary) {
out.writeData((Data) object);
} else {
out.writeObject(object);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeObject
File: hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
Repository: hazelcast
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2016-10750 | MEDIUM | 6.8 | hazelcast | writeObject | hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java | c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9 | 0 |
Analyze the following code function for security vulnerabilities | public Form<T> withError(final String key, final String error, final List<Object> args) {
return withError(
new ValidationError(key, error, args != null ? new ArrayList<>(args) : new ArrayList<>()));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: withError
File: web/play-java-forms/src/main/java/play/data/Form.java
Repository: playframework
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2022-31018 | MEDIUM | 5 | playframework | withError | web/play-java-forms/src/main/java/play/data/Form.java | 15393b736df939e35e275af2347155f296c684f2 | 0 |
Analyze the following code function for security vulnerabilities | public Collection<ProfileOutput> getOutputs() {
return outputs;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOutputs
File: base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2022-2414 | HIGH | 7.5 | dogtagpki/pki | getOutputs | base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java | 16deffdf7548e305507982e246eb9fd1eac414fd | 0 |
Analyze the following code function for security vulnerabilities | public String getLogPart() throws IndexUnreachableException {
return new StringBuilder("/").append(getPersistentIdentifier())
.append('/')
.append(imageToShow)
.append('/')
.append(getLogid())
.append('/')
.toString();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLogPart
File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2023-29014 | MEDIUM | 6.1 | intranda/goobi-viewer-core | getLogPart | goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java | c29efe60e745a94d03debc17681c4950f3917455 | 0 |
Analyze the following code function for security vulnerabilities | public static void freeDirectNoCleaner(ByteBuffer buffer) {
assert USE_DIRECT_BUFFER_NO_CLEANER;
int capacity = buffer.capacity();
PlatformDependent0.freeMemory(PlatformDependent0.directBufferAddress(buffer));
decrementMemoryCounter(capacity);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: freeDirectNoCleaner
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices. | [
"CWE-668",
"CWE-378",
"CWE-379"
] | CVE-2022-24823 | LOW | 1.9 | netty | freeDirectNoCleaner | common/src/main/java/io/netty/util/internal/PlatformDependent.java | 185f8b2756a36aaa4f973f1a2a025e7d981823f1 | 0 |
Analyze the following code function for security vulnerabilities | public void update() {
setLastseen(System.currentTimeMillis());
updateVoteGains(0); // reset vote gains if they we're past the time frame
client().update(this);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: update
File: src/main/java/com/erudika/scoold/core/Profile.java
Repository: Erudika/scoold
The code follows secure coding practices. | [
"CWE-130"
] | CVE-2022-1543 | MEDIUM | 6.5 | Erudika/scoold | update | src/main/java/com/erudika/scoold/core/Profile.java | 62a0e92e1486ddc17676a7ead2c07ff653d167ce | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean isUidActive(int uid) {
synchronized (ActivityManagerService.this) {
return isUidActiveLocked(uid);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isUidActive
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 | isUidActive | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | private void maybeEnableEncryption(int quality, boolean disabled) {
DevicePolicyManager dpm = (DevicePolicyManager) getSystemService(DEVICE_POLICY_SERVICE);
if (UserManager.get(getActivity()).isAdminUser()
&& mUserId == UserHandle.myUserId()
&& LockPatternUtils.isDeviceEncryptionEnabled()
&& !LockPatternUtils.isFileEncryptionEnabled()
&& !dpm.getDoNotAskCredentialsOnBoot()) {
mEncryptionRequestQuality = quality;
mEncryptionRequestDisabled = disabled;
// Get the intent that the encryption interstitial should start for creating
// the new unlock method.
Intent unlockMethodIntent = getIntentForUnlockMethod(quality);
unlockMethodIntent.putExtra(
ChooseLockSettingsHelper.EXTRA_KEY_FOR_CHANGE_CRED_REQUIRED_FOR_BOOT,
mForChangeCredRequiredForBoot);
final Context context = getActivity();
// If accessibility is enabled and the user hasn't seen this dialog before, set the
// default state to agree with that which is compatible with accessibility
// (password not required).
final boolean accEn = AccessibilityManager.getInstance(context).isEnabled();
final boolean required = mLockPatternUtils.isCredentialRequiredToDecrypt(!accEn);
Intent intent = getEncryptionInterstitialIntent(context, quality, required,
unlockMethodIntent);
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT,
mForFingerprint);
intent.putExtra(EXTRA_HIDE_DRAWER, mHideDrawer);
startActivityForResult(
intent,
mIsSetNewPassword && mHasChallenge
? CHOOSE_LOCK_BEFORE_FINGERPRINT_REQUEST
: ENABLE_ENCRYPTION_REQUEST);
} else {
if (mForChangeCredRequiredForBoot) {
// Welp, couldn't change it. Oh well.
finish();
return;
}
updateUnlockMethodAndFinish(quality, disabled, false /* chooseLockSkipped */);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: maybeEnableEncryption
File: src/com/android/settings/password/ChooseLockGeneric.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2018-9501 | HIGH | 7.2 | android | maybeEnableEncryption | src/com/android/settings/password/ChooseLockGeneric.java | 5e43341b8c7eddce88f79c9a5068362927c05b54 | 0 |
Analyze the following code function for security vulnerabilities | private boolean isLocalUnlockedUser(int userId) {
synchronized (mUsers) {
return mLocalUnlockedUsers.get(userId);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isLocalUnlockedUser
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other",
"CWE-502"
] | CVE-2023-45777 | HIGH | 7.8 | android | isLocalUnlockedUser | services/core/java/com/android/server/accounts/AccountManagerService.java | f810d81839af38ee121c446105ca67cb12992fc6 | 0 |
Analyze the following code function for security vulnerabilities | private void cleanUpResourcesLI(List<String> allCodePaths) {
cleanUp();
removeDexFiles(allCodePaths, instructionSets);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cleanUpResourcesLI
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 | cleanUpResourcesLI | services/core/java/com/android/server/pm/PackageManagerService.java | a75537b496e9df71c74c1d045ba5569631a16298 | 0 |
Analyze the following code function for security vulnerabilities | private <T> Query<T> createQuery(Session session, String statement, Collection<?> parameterValues)
{
Query<T> query = session.createQuery(statement);
injectParameterListToQuery(LegacySessionImplementor.containsLegacyOrdinalStatement(statement) ? 0 : 1, query,
parameterValues);
return query;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createQuery
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-459"
] | CVE-2023-36468 | HIGH | 8.8 | xwiki/xwiki-platform | createQuery | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java | 15a6f845d8206b0ae97f37aa092ca43d4f9d6e59 | 0 |
Analyze the following code function for security vulnerabilities | public SupportBundleNodeManifest getManifest() {
final LoggerContext context = (LoggerContext) LogManager.getContext(false);
final Configuration config = context.getConfiguration();
final ImmutableList.Builder<LogFile> logFiles = ImmutableList.builder();
getFileAppenders(config).forEach(fileAppender -> getRollingFileLogs(fileAppender).forEach(logFiles::add));
final Optional<MemoryAppender> memAppender = getMemoryAppender(config);
memAppender.ifPresent(memoryAppender -> getMemLogFiles(memoryAppender).forEach(logFiles::add));
return new SupportBundleNodeManifest(new BundleEntries(logFiles.build()));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getManifest
File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2023-41044 | LOW | 3.8 | Graylog2/graylog2-server | getManifest | graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java | 02b8792e6f4b829f0c1d87fcbf2d58b73458b938 | 0 |
Analyze the following code function for security vulnerabilities | protected Map<Object, T> getDroppedData() {
Function<T, Object> getId = getDataProvider()::getId;
return droppedData.stream().map(getKeyMapper()::get)
.collect(Collectors.toMap(getId, i -> i));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDroppedData
File: server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
Repository: vaadin/framework
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2021-33609 | MEDIUM | 4 | vaadin/framework | getDroppedData | server/src/main/java/com/vaadin/data/provider/DataCommunicator.java | 9a93593d9f3802d2881fc8ad22dbc210d0d1d295 | 0 |
Analyze the following code function for security vulnerabilities | @Override
@Deprecated(since = "2.3M1")
public String getSyntaxId()
{
return getSyntax().toIdString();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSyntaxId
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 | getSyntaxId | 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 | public void addXObjectToRemove(BaseObject object)
{
getXObjectsToRemove().add(object);
object.setOwnerDocument(null);
setMetaDataDirty(true);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addXObjectToRemove
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-787"
] | CVE-2023-26470 | HIGH | 7.5 | xwiki/xwiki-platform | addXObjectToRemove | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java | db3d1c62fc5fb59fefcda3b86065d2d362f55164 | 0 |
Analyze the following code function for security vulnerabilities | private LookupResult resolveAllAddressesForHostname(Object key) {
try {
List<ADnsAnswer> ip4Answers = new ArrayList<>();
List<ADnsAnswer> ip6Answers = new ArrayList<>();
// UnknownHostException is a valid case when the DNS record does not exist. Silently ignore and do not log an error.
try {
ip4Answers = dnsClient.resolveIPv4AddressForHostname(key.toString(), true); // Include IP version
} catch (UnknownHostException e) {
}
try {
ip6Answers = dnsClient.resolveIPv6AddressForHostname(key.toString(), true); // Include IP version
} catch (UnknownHostException e) {
}
// Select answer for single value. Prefer use of IPv4 address. Only return IPv6 address if no IPv6 address found.
final String singleValue;
if (CollectionUtils.isNotEmpty(ip4Answers)) {
singleValue = ip4Answers.get(0).ipAddress();
} else if (CollectionUtils.isNotEmpty(ip6Answers)) {
singleValue = ip6Answers.get(0).ipAddress();
} else {
LOG.debug("Could not resolve [A/AAAA] records hostname [{}].", key);
return getEmptyResult();
}
final LookupResult.Builder builder = LookupResult.builder();
if (StringUtils.isNotBlank(singleValue)) {
builder.single(singleValue);
}
final List<ADnsAnswer> allAnswers = new ArrayList<>();
allAnswers.addAll(ip4Answers);
allAnswers.addAll(ip6Answers);
if (CollectionUtils.isNotEmpty(allAnswers)) {
builder.multiValue(Collections.singletonMap(RESULTS_FIELD, allAnswers)).stringListValue(ADnsAnswer.convertToStringListValue(allAnswers));
}
assignMinimumTTL(allAnswers, builder);
return builder.build();
} catch (Exception e) {
LOG.error("Could not resolve [A/AAAA] records for hostname [{}]. Cause [{}]", key, ExceptionUtils.getRootCauseOrMessage(e));
errorCounter.inc();
return getErrorResult();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resolveAllAddressesForHostname
File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices. | [
"CWE-345"
] | CVE-2023-41045 | MEDIUM | 5.3 | Graylog2/graylog2-server | resolveAllAddressesForHostname | graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java | 466af814523cffae9fbc7e77bab7472988f03c3e | 0 |
Analyze the following code function for security vulnerabilities | private void dumpUser(UserAccounts userAccounts, FileDescriptor fd, PrintWriter fout,
String[] args, boolean isCheckinRequest) {
if (isCheckinRequest) {
// This is a checkin request. *Only* upload the account types and the count of
// each.
synchronized (userAccounts.dbLock) {
userAccounts.accountsDb.dumpDeAccountsTable(fout);
}
} else {
Account[] accounts = getAccountsFromCache(userAccounts, null /* type */,
Process.SYSTEM_UID, null /* packageName */, false);
fout.println("Accounts: " + accounts.length);
for (Account account : accounts) {
fout.println(" " + account.toString());
}
// Add debug information.
fout.println();
synchronized (userAccounts.dbLock) {
userAccounts.accountsDb.dumpDebugTable(fout);
}
fout.println();
synchronized (mSessions) {
final long now = SystemClock.elapsedRealtime();
fout.println("Active Sessions: " + mSessions.size());
for (Session session : mSessions.values()) {
fout.println(" " + session.toDebugString(now));
}
}
fout.println();
mAuthenticatorCache.dump(fd, fout, args, userAccounts.userId);
boolean isUserUnlocked;
synchronized (mUsers) {
isUserUnlocked = isLocalUnlockedUser(userAccounts.userId);
}
// Following logs are printed only when user is unlocked.
if (!isUserUnlocked) {
return;
}
fout.println();
synchronized (userAccounts.dbLock) {
Map<Account, Map<String, Integer>> allVisibilityValues =
userAccounts.accountsDb.findAllVisibilityValues();
fout.println("Account visibility:");
for (Account account : allVisibilityValues.keySet()) {
fout.println(" " + account.name);
Map<String, Integer> visibilities = allVisibilityValues.get(account);
for (Entry<String, Integer> entry : visibilities.entrySet()) {
fout.println(" " + entry.getKey() + ", " + entry.getValue());
}
}
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpUser
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other",
"CWE-502"
] | CVE-2023-45777 | HIGH | 7.8 | android | dumpUser | services/core/java/com/android/server/accounts/AccountManagerService.java | f810d81839af38ee121c446105ca67cb12992fc6 | 0 |
Analyze the following code function for security vulnerabilities | private static void topicXmlGenerator(XmlGenerator gen, Config config) {
for (TopicConfig t : config.getTopicConfigs().values()) {
gen.open("topic", "name", t.getName())
.node("statistics-enabled", t.isStatisticsEnabled())
.node("global-ordering-enabled", t.isGlobalOrderingEnabled());
if (!t.getMessageListenerConfigs().isEmpty()) {
gen.open("message-listeners");
for (ListenerConfig lc : t.getMessageListenerConfigs()) {
gen.node("message-listener", classNameOrImplClass(lc.getClassName(), lc.getImplementation()));
}
gen.close();
}
gen.node("multi-threading-enabled", t.isMultiThreadingEnabled());
gen.close();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: topicXmlGenerator
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2016-10750 | MEDIUM | 6.8 | hazelcast | topicXmlGenerator | hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java | c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public CDATASection createCDATASection(String data) throws DOMException {
return doc.createCDATASection(data);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createCDATASection
File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
Repository: LoboEvolution
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2018-1000540 | MEDIUM | 6.8 | LoboEvolution | createCDATASection | HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java | 9b75694cedfa4825d4a2330abf2719d470c654cd | 0 |
Analyze the following code function for security vulnerabilities | public static NativeObject jsFunction_getDocument(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
throws ScriptException,
APIManagementException {
if (args == null || args.length != 2 || !isStringArray(args)) {
handleException("Invalid input parameters expected resource Url and tenantDomain");
}
NativeObject data = new NativeObject();
String username = getUsernameFromObject(thisObj);
// Set anonymous user if no user is login to the system
if (username == null) {
username = APIConstants.END_USER_ANONYMOUS;
}
String resource = (String) args[1];
String tenantDomain = (String) args[0];
if (tenantDomain == null) {
tenantDomain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
}
Map<String, Object> docResourceMap = APIUtil.getDocument(username, resource, tenantDomain);
if (!docResourceMap.isEmpty()) {
data.put("Data", data,
cx.newObject(thisObj, "Stream", new Object[] { docResourceMap.get("Data") }));
data.put("contentType", data, docResourceMap.get("contentType"));
data.put("name", data, docResourceMap.get("name"));
}
return data;
} | Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2018-20736
- Severity: LOW
- CVSS Score: 3.5
Description: Fixing issues in forum comments
Function: jsFunction_getDocument
File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
Repository: wso2/carbon-apimgt
Fixed Code:
public static NativeObject jsFunction_getDocument(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
throws ScriptException,
APIManagementException {
if (args == null || args.length != 2 || !isStringArray(args)) {
handleException("Invalid input parameters expected resource Url and tenantDomain");
}
NativeObject data = new NativeObject();
String username = getUsernameFromObject(thisObj);
// Set anonymous user if no user is login to the system
if (username == null) {
username = RegistryConstants.ANONYMOUS_USER;
}
String resource = (String) args[1];
String tenantDomain = (String) args[0];
if (tenantDomain == null) {
tenantDomain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
}
Map<String, Object> docResourceMap = APIUtil.getDocument(username, resource, tenantDomain);
if (!docResourceMap.isEmpty()) {
data.put("Data", data,
cx.newObject(thisObj, "Stream", new Object[] { docResourceMap.get("Data") }));
data.put("contentType", data, docResourceMap.get("contentType"));
data.put("name", data, docResourceMap.get("name"));
}
return data;
} | [
"CWE-79"
] | CVE-2018-20736 | LOW | 3.5 | wso2/carbon-apimgt | jsFunction_getDocument | components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java | 490f2860822f89d745b7c04fa9570bd86bef4236 | 1 |
Analyze the following code function for security vulnerabilities | public void openURL(final String url)
{
Thread launchBrowserThread
= new Thread(getClass().getName())
{
@Override
public void run()
{
try
{
launchBrowser(url);
}
catch (Exception e)
{
logger.error("Failed to launch browser", e);
}
}
};
launchBrowserThread.start();
} | Vulnerability Classification:
- CWE: CWE-77
- CVE: CVE-2022-43550
- Severity: CRITICAL
- CVSS Score: 9.8
Description: Adds a check for valid http link when opening a browser.
Function: openURL
File: modules/service/browserlauncher/src/main/java/net/java/sip/communicator/impl/browserlauncher/BrowserLauncherImpl.java
Repository: jitsi
Fixed Code:
public void openURL(final String url)
{
if (url == null || !url.startsWith("http"))
{
logger.warn("Not a valid URL to open:" + url);
return;
}
Thread launchBrowserThread
= new Thread(getClass().getName())
{
@Override
public void run()
{
try
{
launchBrowser(url);
}
catch (Exception e)
{
logger.error("Failed to launch browser", e);
}
}
};
launchBrowserThread.start();
} | [
"CWE-77"
] | CVE-2022-43550 | CRITICAL | 9.8 | jitsi | openURL | modules/service/browserlauncher/src/main/java/net/java/sip/communicator/impl/browserlauncher/BrowserLauncherImpl.java | 8aa7be58522f4264078d54752aae5483bfd854b2 | 1 |
Analyze the following code function for security vulnerabilities | private void updateStatusIconFailUserName(int failedStatusText) {
mAuthStatusIcon = R.drawable.ic_alert;
mAuthStatusText = getResources().getString(failedStatusText);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateStatusIconFailUserName
File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
Repository: nextcloud/android
The code follows secure coding practices. | [
"CWE-248"
] | CVE-2021-32694 | MEDIUM | 4.3 | nextcloud/android | updateStatusIconFailUserName | src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java | 9343bdd85d70625a90e0c952897957a102c2421b | 0 |
Analyze the following code function for security vulnerabilities | @Override
public String action() {
return action;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: action
File: src/main/java/org/elasticsearch/transport/local/LocalTransportChannel.java
Repository: elastic/elasticsearch
The code follows secure coding practices. | [
"CWE-74"
] | CVE-2015-5377 | HIGH | 7.5 | elastic/elasticsearch | action | src/main/java/org/elasticsearch/transport/local/LocalTransportChannel.java | bf3052d14c874aead7da8855c5fcadf5428a43f2 | 0 |
Analyze the following code function for security vulnerabilities | private static void throwSecurityExceptionIfNonWhitelistedFound(Supplier<String> message,
List<StackFrame> nonWhitelisted) {
if (!nonWhitelisted.isEmpty()) {
LOG.warn("NWSFs ==> {}", nonWhitelisted); //$NON-NLS-1$
var first = nonWhitelisted.get(0);
throw new SecurityException(formatLocalized("security.stackframe_add_info", message.get(), //$NON-NLS-1$
first.getLineNumber(), first.getFileName()));
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: throwSecurityExceptionIfNonWhitelistedFound
File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
Repository: ls1intum/Ares
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2024-23683 | HIGH | 8.2 | ls1intum/Ares | throwSecurityExceptionIfNonWhitelistedFound | src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java | af4f28a56e2fe600d8750b3b415352a0a3217392 | 0 |
Analyze the following code function for security vulnerabilities | public ServerBuilder maxNumRequestsPerConnection(int maxNumRequestsPerConnection) {
this.maxNumRequestsPerConnection =
validateNonNegative(maxNumRequestsPerConnection, "maxNumRequestsPerConnection");
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: maxNumRequestsPerConnection
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 | maxNumRequestsPerConnection | core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java | df7f85824a62e997b910b5d6194a3335841065fd | 0 |
Analyze the following code function for security vulnerabilities | public static int getTotalFiles(Structure structure)
{
String typeField = Field.FieldType.FILE.toString();
return getTotals(structure,typeField);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTotalFiles
File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
Repository: dotCMS/core
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2016-2355 | HIGH | 7.5 | dotCMS/core | getTotalFiles | src/com/dotmarketing/portlets/structure/factories/StructureFactory.java | 897f3632d7e471b7a73aabed5b19f6f53d4e5562 | 0 |
Analyze the following code function for security vulnerabilities | public ServerBuilder accessLogFormat(String accessLogFormat) {
return accessLogWriter(AccessLogWriter.custom(requireNonNull(accessLogFormat, "accessLogFormat")),
false);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: accessLogFormat
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 | accessLogFormat | core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java | df7f85824a62e997b910b5d6194a3335841065fd | 0 |
Analyze the following code function for security vulnerabilities | static void activityResumedLocked(IBinder token, boolean handleSplashScreenExit) {
final ActivityRecord r = ActivityRecord.forTokenLocked(token);
ProtoLog.i(WM_DEBUG_STATES, "Resumed activity; dropping state of: %s", r);
if (r == null) {
// If an app reports resumed after a long delay, the record on server side might have
// been removed (e.g. destroy timeout), so the token could be null.
return;
}
r.setCustomizeSplashScreenExitAnimation(handleSplashScreenExit);
r.setSavedState(null /* savedState */);
r.mDisplayContent.handleActivitySizeCompatModeIfNeeded(r);
r.mDisplayContent.mUnknownAppVisibilityController.notifyAppResumedFinished(r);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: activityResumedLocked
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 | activityResumedLocked | services/core/java/com/android/server/wm/ActivityRecord.java | 44aeef1b82ecf21187d4903c9e3666a118bdeaf3 | 0 |
Analyze the following code function for security vulnerabilities | private void updatePasswordQualityCacheForUserGroup(@UserIdInt int userId) {
final List<UserInfo> users;
if (userId == UserHandle.USER_ALL) {
users = mUserManager.getUsers();
} else {
users = mUserManager.getProfiles(userId);
}
for (UserInfo userInfo : users) {
final int currentUserId = userInfo.id;
mPolicyCache.setPasswordQuality(currentUserId,
getPasswordQuality(null, currentUserId, false));
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updatePasswordQualityCacheForUserGroup
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2023-21284 | MEDIUM | 5.5 | android | updatePasswordQualityCacheForUserGroup | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | private static ActivityOptions makeAspectScaledThumbnailAnimation(View source, Bitmap thumbnail,
int startX, int startY, int targetWidth, int targetHeight,
Handler handler, OnAnimationStartedListener listener, boolean scaleUp) {
ActivityOptions opts = new ActivityOptions();
opts.mPackageName = source.getContext().getPackageName();
opts.mAnimationType = scaleUp ? ANIM_THUMBNAIL_ASPECT_SCALE_UP :
ANIM_THUMBNAIL_ASPECT_SCALE_DOWN;
opts.mThumbnail = thumbnail;
int[] pts = new int[2];
source.getLocationOnScreen(pts);
opts.mStartX = pts[0] + startX;
opts.mStartY = pts[1] + startY;
opts.mWidth = targetWidth;
opts.mHeight = targetHeight;
opts.setOnAnimationStartedListener(handler, listener);
return opts;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeAspectScaledThumbnailAnimation
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-20918 | CRITICAL | 9.8 | android | makeAspectScaledThumbnailAnimation | core/java/android/app/ActivityOptions.java | 51051de4eb40bb502db448084a83fd6cbfb7d3cf | 0 |
Analyze the following code function for security vulnerabilities | public int getStatusBarHeight() {
if (mNaturalBarHeight < 0) {
final Resources res = mContext.getResources();
mNaturalBarHeight =
res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
}
return mNaturalBarHeight;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStatusBarHeight
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 | getStatusBarHeight | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java | c574568aaede7f652432deb7707f20ae54bbdf9a | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void copyFrom(DecimalQuantity _other) {
copyBcdFrom(_other);
DecimalQuantity_AbstractBCD other = (DecimalQuantity_AbstractBCD) _other;
lOptPos = other.lOptPos;
lReqPos = other.lReqPos;
rReqPos = other.rReqPos;
rOptPos = other.rOptPos;
scale = other.scale;
precision = other.precision;
flags = other.flags;
origDouble = other.origDouble;
origDelta = other.origDelta;
isApproximate = other.isApproximate;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyFrom
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 | copyFrom | icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java | 53d8c8f3d181d87a6aa925b449b51c4a2c922a51 | 0 |
Analyze the following code function for security vulnerabilities | private void addShortcutIdsToSet(ArraySet<String> ids, List<ShortcutInfo> shortcuts) {
if (CollectionUtils.isEmpty(shortcuts)) {
return;
}
final int size = shortcuts.size();
for (int i = 0; i < size; i++) {
ids.add(shortcuts.get(i).getId());
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addShortcutIdsToSet
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 | addShortcutIdsToSet | services/core/java/com/android/server/pm/ShortcutService.java | 96e0524c48c6e58af7d15a2caf35082186fc8de2 | 0 |
Analyze the following code function for security vulnerabilities | private EditConfiguration getEditConfiguration()
{
if (this.editConfiguration == null) {
this.editConfiguration = Utils.getComponent(EditConfiguration.class);
}
return this.editConfiguration;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEditConfiguration
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2021-32620 | MEDIUM | 4 | xwiki/xwiki-platform | getEditConfiguration | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java | f9a677408ffb06f309be46ef9d8df1915d9099a4 | 0 |
Analyze the following code function for security vulnerabilities | public void putCustomHeaders(Map<String, String> headers) {
customHeaders.putAll(headers);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: putCustomHeaders
File: src/main/java/spark/staticfiles/StaticFilesConfiguration.java
Repository: perwendel/spark
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2016-9177 | MEDIUM | 5 | perwendel/spark | putCustomHeaders | src/main/java/spark/staticfiles/StaticFilesConfiguration.java | 26b57d0596ee73c14c558463943ef0857e53b91f | 0 |
Analyze the following code function for security vulnerabilities | @Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Bundle args = getArguments();
return new AlertDialog.Builder(getActivity())
.setTitle(args.getInt(ARG_TITLE_RES))
.setMessage(args.getInt(ARG_MESSAGE_RES))
.setPositiveButton(R.string.unlock_disable_frp_warning_ok,
(dialog, whichButton) -> {
String unlockMethod = args.getString(ARG_UNLOCK_METHOD_TO_SET);
((ChooseLockGenericFragment) getParentFragment())
.setUnlockMethod(unlockMethod);
})
.setNegativeButton(R.string.cancel, (dialog, whichButton) -> dismiss())
.create();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCreateDialog
File: src/com/android/settings/password/ChooseLockGeneric.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2018-9501 | HIGH | 7.2 | android | onCreateDialog | src/com/android/settings/password/ChooseLockGeneric.java | 5e43341b8c7eddce88f79c9a5068362927c05b54 | 0 |
Analyze the following code function for security vulnerabilities | protected Mono<ClientResponse> httpCall(WebClient webClient, HttpMethod httpMethod, URI uri, Object requestBody,
int iteration) {
if (iteration == MAX_REDIRECTS) {
return Mono.error(new AppsmithPluginException(
AppsmithPluginError.PLUGIN_ERROR,
"Exceeded the HTTP redirect limits of " + MAX_REDIRECTS
));
}
assert requestBody instanceof BodyInserter<?, ?>;
BodyInserter<?, ?> finalRequestBody = (BodyInserter<?, ?>) requestBody;
return webClient
.method(httpMethod)
.uri(uri)
.body((BodyInserter<?, ? super ClientHttpRequest>) finalRequestBody)
.exchange()
.doOnError(e -> Mono.error(new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, e)))
.flatMap(response -> {
if (response.statusCode().is3xxRedirection()) {
String redirectUrl = response.headers().header("Location").get(0);
/**
* TODO
* In case the redirected URL is not absolute (complete), create the new URL using the relative path
* This particular scenario is seen in the URL : https://rickandmortyapi.com/api/character
* It redirects to partial URI : /api/character/
* In this scenario we should convert the partial URI to complete URI
*/
URI redirectUri;
try {
redirectUri = new URI(redirectUrl);
if (DISALLOWED_HOSTS.contains(redirectUri.getHost())
|| DISALLOWED_HOSTS.contains(InetAddress.getByName(redirectUri.getHost()).getHostAddress())) {
return Mono.error(new AppsmithPluginException(AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Host not allowed."));
}
} catch (URISyntaxException | UnknownHostException e) {
return Mono.error(new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, e));
}
return httpCall(webClient, httpMethod, redirectUri, finalRequestBody, iteration + 1);
}
return Mono.just(response);
});
} | Vulnerability Classification:
- CWE: CWE-918
- CVE: CVE-2022-4096
- Severity: MEDIUM
- CVSS Score: 6.5
Description: fix: Better support for disallowed hosts (#16842)
Function: httpCall
File: app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/TriggerUtils.java
Repository: appsmithorg/appsmith
Fixed Code:
protected Mono<ClientResponse> httpCall(WebClient webClient, HttpMethod httpMethod, URI uri, Object requestBody,
int iteration) {
if (iteration == MAX_REDIRECTS) {
return Mono.error(new AppsmithPluginException(
AppsmithPluginError.PLUGIN_ERROR,
"Exceeded the HTTP redirect limits of " + MAX_REDIRECTS
));
}
assert requestBody instanceof BodyInserter<?, ?>;
BodyInserter<?, ?> finalRequestBody = (BodyInserter<?, ?>) requestBody;
return webClient
.method(httpMethod)
.uri(uri)
.body((BodyInserter<?, ? super ClientHttpRequest>) finalRequestBody)
.exchange()
.doOnError(e -> Mono.error(new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, e)))
.flatMap(response -> {
if (response.statusCode().is3xxRedirection()) {
String redirectUrl = response.headers().header("Location").get(0);
/**
* TODO
* In case the redirected URL is not absolute (complete), create the new URL using the relative path
* This particular scenario is seen in the URL : https://rickandmortyapi.com/api/character
* It redirects to partial URI : /api/character/
* In this scenario we should convert the partial URI to complete URI
*/
final URI redirectUri;
try {
redirectUri = new URI(redirectUrl);
} catch (URISyntaxException e) {
return Mono.error(new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, e));
}
return httpCall(webClient, httpMethod, redirectUri, finalRequestBody, iteration + 1);
}
return Mono.just(response);
});
} | [
"CWE-918"
] | CVE-2022-4096 | MEDIUM | 6.5 | appsmithorg/appsmith | httpCall | app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/TriggerUtils.java | 769719ccfe667f059fe0b107a19ec9feb90f2e40 | 1 |
Analyze the following code function for security vulnerabilities | @Override
public void onIpClientCreated(IIpClient ipClient) {
// IpClient may take a very long time (many minutes) to start at boot time. But after
// that IpClient should start pretty quickly (a few seconds).
// Blocking wait for 5 seconds first (for when the wait is short)
// If IpClient is still not ready after blocking wait, async wait (for when wait is
// long). Will drop all connection requests until IpClient is ready. Other requests
// will still be processed.
sendMessageAtFrontOfQueue(CMD_CONNECTABLE_STATE_SETUP,
new IpClientManager(ipClient, getName()));
mWaitForCreationCv.open();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onIpClientCreated
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 | onIpClientCreated | service/java/com/android/server/wifi/ClientModeImpl.java | 72e903f258b5040b8f492cf18edd124b5a1ac770 | 0 |
Analyze the following code function for security vulnerabilities | private void useUnknownUser(Element element, String field) {
Element userNameElement = element.element(field + "Name");
if (userNameElement != null) {
userNameElement.detach();
if (element.element(field) == null)
element.addElement(field).setText("-2");
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: useUnknownUser
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 | useUnknownUser | server-core/src/main/java/io/onedev/server/migration/DataMigrator.java | d67dd9686897fe5e4ab881d749464aa7c06a68e5 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onReject(String ssid, boolean disconnectRequired) {
log("Reject Root CA cert for " + ssid);
sendMessage(CMD_REJECT_EAP_INSECURE_CONNECTION,
WifiMetricsProto.ConnectionEvent.AUTH_FAILURE_REJECTED_BY_USER,
disconnectRequired ? 1 : 0, ssid);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onReject
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 | onReject | service/java/com/android/server/wifi/ClientModeImpl.java | 72e903f258b5040b8f492cf18edd124b5a1ac770 | 0 |
Analyze the following code function for security vulnerabilities | @ManagedAttribute(value = "The BayeuxServer of this Oort", readonly = true)
public BayeuxServer getBayeuxServer() {
return _bayeux;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBayeuxServer
File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
Repository: cometd
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2022-24721 | MEDIUM | 5.5 | cometd | getBayeuxServer | cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java | bb445a143fbf320f17c62e340455cd74acfb5929 | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected void appendAttributes(Map<String, Object> parameters) {
appendCriteria(parameters);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendAttributes
File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java
Repository: gocd
The code follows secure coding practices. | [
"CWE-77"
] | CVE-2021-43286 | MEDIUM | 6.5 | gocd | appendAttributes | config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java | 6fa9fb7a7c91e760f1adc2593acdd50f2d78676b | 0 |
Analyze the following code function for security vulnerabilities | private static void applyAdditionalHeaders(URLConnection http, Map<String, Object> headers) {
if (headers == null || headers.isEmpty())
return;
for (Map.Entry<String, Object> header : headers.entrySet()) {
final Object value = header.getValue();
if (value instanceof String)
http.setRequestProperty(header.getKey(), (String) value);
else if (value instanceof List)
for (Object item : (List<?>) value)
if (item != null)
http.addRequestProperty(header.getKey(), item.toString());
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: applyAdditionalHeaders
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 | applyAdditionalHeaders | src/net/sourceforge/plantuml/security/SURL.java | fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e | 0 |
Analyze the following code function for security vulnerabilities | @Override
public int getPreferredActivities(List<IntentFilter> outFilters,
List<ComponentName> outActivities, String packageName) {
int num = 0;
final int userId = UserHandle.getCallingUserId();
// reader
synchronized (mPackages) {
PreferredIntentResolver pir = mSettings.mPreferredActivities.get(userId);
if (pir != null) {
final Iterator<PreferredActivity> it = pir.filterIterator();
while (it.hasNext()) {
final PreferredActivity pa = it.next();
if (packageName == null
|| (pa.mPref.mComponent.getPackageName().equals(packageName)
&& pa.mPref.mAlways)) {
if (outFilters != null) {
outFilters.add(new IntentFilter(pa));
}
if (outActivities != null) {
outActivities.add(pa.mPref.mComponent);
}
}
}
}
}
return num;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPreferredActivities
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 | getPreferredActivities | services/core/java/com/android/server/pm/PackageManagerService.java | a75537b496e9df71c74c1d045ba5569631a16298 | 0 |
Analyze the following code function for security vulnerabilities | public void addImplicitArray(Class ownerType, String fieldName) {
addImplicitCollection(ownerType, fieldName);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addImplicitArray
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2021-43859 | MEDIUM | 5 | x-stream/xstream | addImplicitArray | xstream/src/java/com/thoughtworks/xstream/XStream.java | e8e88621ba1c85ac3b8620337dd672e0c0c3a846 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void setLastInputMethodWindowLw(WindowState ime, WindowState target) {
mLastInputMethodWindow = ime;
mLastInputMethodTargetWindow = target;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLastInputMethodWindowLw
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-0812 | MEDIUM | 6.6 | android | setLastInputMethodWindowLw | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 84669ca8de55d38073a0dcb01074233b0a417541 | 0 |
Analyze the following code function for security vulnerabilities | public String get(String key) {
try {
return (String) get().getData().get(asNormalKey(key));
} catch (Exception e) {
return null;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: get
File: web/play-java-forms/src/main/java/play/data/DynamicForm.java
Repository: playframework
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2022-31018 | MEDIUM | 5 | playframework | get | web/play-java-forms/src/main/java/play/data/DynamicForm.java | 15393b736df939e35e275af2347155f296c684f2 | 0 |
Analyze the following code function for security vulnerabilities | public void truncate() {
if (scale < 0) {
shiftRight(-scale);
scale = 0;
compact();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: truncate
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 | truncate | icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java | 53d8c8f3d181d87a6aa925b449b51c4a2c922a51 | 0 |
Analyze the following code function for security vulnerabilities | public static Type<?> parseType(String input) throws InvalidSyntaxException {
return new Parser().parseTypeImpl(input);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseType
File: src/main/java/graphql/parser/Parser.java
Repository: graphql-java
The code follows secure coding practices. | [
"CWE-770"
] | CVE-2023-28867 | HIGH | 7.5 | graphql-java | parseType | src/main/java/graphql/parser/Parser.java | 8a1c884c81c0b656db201cfd95881feb0f430a55 | 0 |
Analyze the following code function for security vulnerabilities | void setFocusedStackLayer() {
mFocusedStackLayer = 0;
if (mFocusedApp != null) {
final WindowList windows = mFocusedApp.allAppWindows;
for (int i = windows.size() - 1; i >= 0; --i) {
final WindowState win = windows.get(i);
final int animLayer = win.mWinAnimator.mAnimLayer;
if (win.mAttachedWindow == null && win.isVisibleLw() &&
animLayer > mFocusedStackLayer) {
mFocusedStackLayer = animLayer + LAYER_OFFSET_FOCUSED_STACK;
}
}
}
if (DEBUG_LAYERS) Slog.v(TAG, "Setting FocusedStackFrame to layer=" +
mFocusedStackLayer);
mFocusedStackFrame.setLayer(mFocusedStackLayer);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setFocusedStackLayer
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3875 | HIGH | 7.2 | android | setFocusedStackLayer | services/core/java/com/android/server/wm/WindowManagerService.java | 69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
// Release HTTP decoder resources, including any file uploads that were received in a POST
// request and stored in /tmp
destroyDecoder();
if (cause instanceof NotSslRecordException) {
ctx.channel().close();
return;
}
if ("Connection reset by peer".equals(cause.getMessage())) {
// (No need to log the backtrace in this case)
// Log.info(cause.getMessage());
} else {
// Log exception with backtrace
Log.exception("Uncaught exception", cause);
}
if (ctx.channel().isActive()) {
sendHttpErrorResponse(ctx, null, new DefaultFullHttpResponse(HttpVersion.HTTP_1_1,
HttpResponseStatus.INTERNAL_SERVER_ERROR));
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: exceptionCaught
File: src/gribbit/request/HttpRequestHandler.java
Repository: lukehutch/gribbit
The code follows secure coding practices. | [
"CWE-346"
] | CVE-2014-125071 | MEDIUM | 5.2 | lukehutch/gribbit | exceptionCaught | src/gribbit/request/HttpRequestHandler.java | 620418df247aebda3dd4be1dda10fe229ea505dd | 0 |
Analyze the following code function for security vulnerabilities | @SuppressWarnings("javadoc")
public int computeHorizontalScrollRange() {
return mRenderCoordinates.getContentWidthPixInt();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: computeHorizontalScrollRange
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2014-3159 | MEDIUM | 6.4 | chromium | computeHorizontalScrollRange | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java | 98a50b76141f0b14f292f49ce376e6554142d5e2 | 0 |
Analyze the following code function for security vulnerabilities | public static void addFieldsFromContext(ApplicationInfo ai, Notification notification) {
notification.extras.putParcelable(EXTRA_BUILDER_APPLICATION_INFO, ai);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addFieldsFromContext
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21288 | MEDIUM | 5.5 | android | addFieldsFromContext | core/java/android/app/Notification.java | 726247f4f53e8cc0746175265652fa415a123c0c | 0 |
Analyze the following code function for security vulnerabilities | @Override
public Intent createUserRestrictionSupportIntent(int userId, String userRestriction) {
Intent intent = null;
if (getEnforcingAdminAndUserDetailsInternal(userId, userRestriction) != null) {
intent = DevicePolicyManagerService.this.createShowAdminSupportIntent(userId);
intent.putExtra(DevicePolicyManager.EXTRA_RESTRICTION, userRestriction);
}
return intent;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createUserRestrictionSupportIntent
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2023-21284 | MEDIUM | 5.5 | android | createUserRestrictionSupportIntent | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean isScreenLockSupported() {
return true;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isScreenLockSupported
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 | isScreenLockSupported | Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | @JsonProperty("expressions")
protected void setExpressions(TopList newExpressions) {
if (newExpressions != null) {
_preferenceStore.put("scripting.expressions", newExpressions);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setExpressions
File: main/src/com/google/refine/io/FileProjectManager.java
Repository: OpenRefine
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2023-37476 | HIGH | 7.8 | OpenRefine | setExpressions | main/src/com/google/refine/io/FileProjectManager.java | e9c1e65d58b47aec8cd676bd5c07d97b002f205e | 0 |
Analyze the following code function for security vulnerabilities | public boolean schedulePolling() {
if(isDisabled()) return false;
SCMTrigger scmt = getTrigger(SCMTrigger.class);
if(scmt==null) return false;
scmt.run();
return true;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: schedulePolling
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 | schedulePolling | core/src/main/java/hudson/model/AbstractProject.java | 36342d71e29e0620f803a7470ce96c61761648d8 | 0 |
Analyze the following code function for security vulnerabilities | public List<PlatformUser> getTapdProjectUsers(IssuesRequest request) {
IssuesPlatform platform = IssueFactory.createPlatform(IssuesManagePlatform.Tapd.name(), request);
return platform.getPlatformUser();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTapdProjectUsers
File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
Repository: metersphere
The code follows secure coding practices. | [
"CWE-918"
] | CVE-2022-23544 | MEDIUM | 6.1 | metersphere | getTapdProjectUsers | test-track/backend/src/main/java/io/metersphere/service/IssuesService.java | d0f95b50737c941b29d507a4cc3545f2dc6ab121 | 0 |
Analyze the following code function for security vulnerabilities | public HttpRequest cookies(final Cookie... cookies) {
if (cookies.length == 0) {
return this;
}
final StringBuilder cookieString = new StringBuilder();
boolean first = true;
for (final Cookie cookie : cookies) {
final Integer maxAge = cookie.getMaxAge();
if (maxAge != null && maxAge.intValue() == 0) {
continue;
}
if (!first) {
cookieString.append("; ");
}
first = false;
cookieString.append(cookie.getName());
cookieString.append('=');
cookieString.append(cookie.getValue());
}
headerOverwrite("cookie", cookieString.toString());
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cookies
File: src/main/java/jodd/http/HttpRequest.java
Repository: oblac/jodd-http
The code follows secure coding practices. | [
"CWE-74"
] | CVE-2022-29631 | MEDIUM | 5 | oblac/jodd-http | cookies | src/main/java/jodd/http/HttpRequest.java | e50f573c8f6a39212ade68c6eb1256b2889fa8a6 | 0 |
Analyze the following code function for security vulnerabilities | @Deprecated
@Override
public String getSpaceName()
{
return this.getSpace();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSpaceName
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-787"
] | CVE-2023-26470 | HIGH | 7.5 | xwiki/xwiki-platform | getSpaceName | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java | db3d1c62fc5fb59fefcda3b86065d2d362f55164 | 0 |
Analyze the following code function for security vulnerabilities | @Test
public void selectStreamTxException(TestContext context) {
postgresClient().selectStream(null, "SELECT 1", context.asyncAssertFailure());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectStreamTxException
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2019-15534 | HIGH | 7.5 | folio-org/raml-module-builder | selectStreamTxException | domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java | b7ef741133e57add40aa4cb19430a0065f378a94 | 0 |
Analyze the following code function for security vulnerabilities | private boolean containsVersion(XWikiDocument doc, Version targetversion, XWikiContext context)
throws XWikiException
{
for (Version version : doc.getRevisions(context)) {
if (version.equals(targetversion)) {
return true;
}
}
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: containsVersion
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-459"
] | CVE-2023-36468 | HIGH | 8.8 | xwiki/xwiki-platform | containsVersion | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java | 15a6f845d8206b0ae97f37aa092ca43d4f9d6e59 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.