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
@Override public void onNetworkEapIdentityRequest() { synchronized (mLock) { mNetworkHal.logCallback("onNetworkEapIdentityRequest"); mWifiMonitor.broadcastNetworkIdentityRequestEvent( mIfaceName, mFrameworkNetworkId, mSsid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onNetworkEapIdentityRequest File: service/java/com/android/server/wifi/SupplicantStaNetworkCallbackAidlImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
onNetworkEapIdentityRequest
service/java/com/android/server/wifi/SupplicantStaNetworkCallbackAidlImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private static Object decodeArray(Method method, Class<?> type, int index, JsonValue argValue) { if (argValue.getType() != JsonType.ARRAY) { String msg = String.format("Class '%s' has the method '%s' " + "whose parameter %d refers to the array type '%s' " + "but received value is not an array, its type is '%s'", method.getDeclaringClass().getName(), method.getName(), index, type.getName(), argValue.getType().name()); throw new IllegalArgumentException(msg); } Class<?> componentType = type.getComponentType(); JsonArray array = (JsonArray) argValue; Object result = Array.newInstance(componentType, array.length()); for (int i = 0; i < array.length(); i++) { Array.set(result, i, decodeArg(null, method, componentType, index, array.get(i))); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decodeArray File: flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25500
MEDIUM
4.3
vaadin/flow
decodeArray
flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java
1fa4976902a117455bf2f98b191f8c80692b53c8
0
Analyze the following code function for security vulnerabilities
public ConnectionInfo getConnectionInfo(int kexNumber) throws IOException { return km.getOrWaitForConnectionInfo(kexNumber); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConnectionInfo File: src/main/java/com/trilead/ssh2/transport/TransportManager.java Repository: connectbot/sshlib The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
connectbot/sshlib
getConnectionInfo
src/main/java/com/trilead/ssh2/transport/TransportManager.java
5c8b534f6e97db7ac0e0e579331213aa25c173ab
0
Analyze the following code function for security vulnerabilities
public boolean isRecognizedAsAdmin(User u) { return u.isAdmin() || ADMINS.contains(u.getIdentifier()) || ADMINS.stream().filter(s -> s.equalsIgnoreCase(u.getEmail())).findAny().isPresent(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRecognizedAsAdmin File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
isRecognizedAsAdmin
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public static final boolean isIsolated() { return isIsolated(myUid()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isIsolated File: core/java/android/os/Process.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3911
HIGH
9.3
android
isIsolated
core/java/android/os/Process.java
2c7008421cb67f5d89f16911bdbe36f6c35311ad
0
Analyze the following code function for security vulnerabilities
private List<External> getExternals(AbstractProject context) throws IOException { Map<AbstractProject, List<External>> projectExternalsCache = getProjectExternalsCache(); List<External> projectExternals; synchronized (projectExternalsCache) { projectExternals = projectExternalsCache.get(context); } if (projectExternals == null) { projectExternals = parseExternalsFile(context); synchronized (projectExternalsCache) { if (!projectExternalsCache.containsKey(context)) { projectExternalsCache.put(context, projectExternals); } } } return projectExternals; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExternals 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
getExternals
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
@Override public void writeToSocketStream(Object socket, byte[] data) { ((SocketImpl)socket).writeToStream(data); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeToSocketStream 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
writeToSocketStream
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public List<CertPath> getCertsList() { return new ArrayList<>(certs.keySet()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCertsList File: core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.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
getCertsList
core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java
2fd1e4b769911f2c6f7f3902f7ea21568ddc2f99
0
Analyze the following code function for security vulnerabilities
@Nonnull public static String getFirstLine(@Nonnull final String text) { return text.replace("\r", "").split("\\n")[0]; //NOI18N }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFirstLine File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java Repository: raydac/netbeans-mmd-plugin The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000542
MEDIUM
6.8
raydac/netbeans-mmd-plugin
getFirstLine
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
9fba652bf06e649186b8f9e612d60e9cc15097e9
0
Analyze the following code function for security vulnerabilities
private @PolyNull String trimMoney(@PolyNull String s) { if (s == null) { return null; } // if we don't have at least 2 characters it can't be money. if (s.length() < 2) { return s; } // Handle Money char ch = s.charAt(0); // optimise for non-money type: return immediately with one check // if the first char cannot be '(', '$' or '-' if (ch > '-') { return s; } if (ch == '(') { s = "-" + PGtokenizer.removePara(s).substring(1); } else if (ch == '$') { s = s.substring(1); } else if (ch == '-' && s.charAt(1) == '$') { s = "-" + s.substring(2); } return s; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: trimMoney File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
trimMoney
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public void refreshNativeTitle(){ if (getActivity() == null || com.codename1.ui.Toolbar.isGlobalToolbar()) { return; } Form f = getCurrentForm(); if (f != null && isNativeTitle() && !(f instanceof Dialog)) { getActivity().runOnUiThread(new SetCurrentFormImpl(getActivity(), f)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: refreshNativeTitle 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
refreshNativeTitle
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public boolean canForwardTo(Intent intent, String resolvedType, int sourceUserId, int targetUserId) { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, null); List<CrossProfileIntentFilter> matches = getMatchingCrossProfileIntentFilters(intent, resolvedType, sourceUserId); if (matches != null) { int size = matches.size(); for (int i = 0; i < size; i++) { if (matches.get(i).getTargetUserId() == targetUserId) return true; } } if (hasWebURI(intent)) { // cross-profile app linking works only towards the parent. final UserInfo parent = getProfileParent(sourceUserId); synchronized(mPackages) { CrossProfileDomainInfo xpDomainInfo = getCrossProfileDomainPreferredLpr( intent, resolvedType, 0, sourceUserId, parent.id); return xpDomainInfo != null; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canForwardTo 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
canForwardTo
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
protected void fireCharacterDataChanged(final CharacterDataChangeEvent event) { DomNode toInform = this; while (toInform != null) { final List<CharacterDataChangeListener> listeners = safeGetCharacterDataListeners(); if (listeners != null) { for (final CharacterDataChangeListener listener : listeners) { listener.characterDataChanged(event); } } toInform = toInform.getParentNode(); } }
Vulnerability Classification: - CWE: CWE-787 - CVE: CVE-2023-2798 - Severity: HIGH - CVSS Score: 7.5 Description: remove recursion to make the fuzzer happy Function: fireCharacterDataChanged File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit Fixed Code: protected void fireCharacterDataChanged(final CharacterDataChangeEvent event) { DomNode toInform = this; while (toInform != null) { final List<CharacterDataChangeListener> listeners = toInform.safeGetCharacterDataListeners(); if (listeners != null) { for (final CharacterDataChangeListener listener : listeners) { listener.characterDataChanged(event); } } toInform = toInform.getParentNode(); } }
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
fireCharacterDataChanged
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
1
Analyze the following code function for security vulnerabilities
public String getComment() { return comment; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getComment File: src/com/dotmarketing/cms/comment/struts/CommentsForm.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-254", "CWE-264" ]
CVE-2016-8600
MEDIUM
5
dotCMS/core
getComment
src/com/dotmarketing/cms/comment/struts/CommentsForm.java
cb84b130065c9eed1d1df9e4770ffa5d4bd30569
0
Analyze the following code function for security vulnerabilities
@Deprecated public String getDatabase() { return getDocumentReference().getWikiReference().getName(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDatabase 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
getDatabase
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public String getURL(DocumentReference reference) throws XWikiException { return this.xwiki.getURL(reference, "view", getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getURL
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
private final boolean checkHoldingPermissionsInternalLocked(IPackageManager pm, ProviderInfo pi, GrantUri grantUri, int uid, final int modeFlags, boolean considerUidPermissions) { if (pi.applicationInfo.uid == uid) { return true; } else if (!pi.exported) { return false; } boolean readMet = (modeFlags & Intent.FLAG_GRANT_READ_URI_PERMISSION) == 0; boolean writeMet = (modeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) == 0; try { // check if target holds top-level <provider> permissions if (!readMet && pi.readPermission != null && considerUidPermissions && (pm.checkUidPermission(pi.readPermission, uid) == PERMISSION_GRANTED)) { readMet = true; } if (!writeMet && pi.writePermission != null && considerUidPermissions && (pm.checkUidPermission(pi.writePermission, uid) == PERMISSION_GRANTED)) { writeMet = true; } // track if unprotected read/write is allowed; any denied // <path-permission> below removes this ability boolean allowDefaultRead = pi.readPermission == null; boolean allowDefaultWrite = pi.writePermission == null; // check if target holds any <path-permission> that match uri final PathPermission[] pps = pi.pathPermissions; if (pps != null) { final String path = grantUri.uri.getPath(); int i = pps.length; while (i > 0 && (!readMet || !writeMet)) { i--; PathPermission pp = pps[i]; if (pp.match(path)) { if (!readMet) { final String pprperm = pp.getReadPermission(); if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Checking read perm for " + pprperm + " for " + pp.getPath() + ": match=" + pp.match(path) + " check=" + pm.checkUidPermission(pprperm, uid)); if (pprperm != null) { if (considerUidPermissions && pm.checkUidPermission(pprperm, uid) == PERMISSION_GRANTED) { readMet = true; } else { allowDefaultRead = false; } } } if (!writeMet) { final String ppwperm = pp.getWritePermission(); if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Checking write perm " + ppwperm + " for " + pp.getPath() + ": match=" + pp.match(path) + " check=" + pm.checkUidPermission(ppwperm, uid)); if (ppwperm != null) { if (considerUidPermissions && pm.checkUidPermission(ppwperm, uid) == PERMISSION_GRANTED) { writeMet = true; } else { allowDefaultWrite = false; } } } } } } // grant unprotected <provider> read/write, if not blocked by // <path-permission> above if (allowDefaultRead) readMet = true; if (allowDefaultWrite) writeMet = true; } catch (RemoteException e) { return false; } return readMet && writeMet; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkHoldingPermissionsInternalLocked 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
checkHoldingPermissionsInternalLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void initOverallUi() { mHostUrlInput = findViewById(R.id.host_url_input); mAuthStatusView = findViewById(R.id.auth_status_text); mServerStatusView = findViewById(R.id.server_status_text); ImageView scanQR = findViewById(R.id.scan_qr); if (deviceInfo.hasCamera(this)) { scanQR.setOnClickListener(v -> onScan()); ThemeUtils.tintDrawable(scanQR.getDrawable(), getResources().getColor(R.color.login_text_color)); } else { scanQR.setVisibility(View.GONE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initOverallUi 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
initOverallUi
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
9343bdd85d70625a90e0c952897957a102c2421b
0
Analyze the following code function for security vulnerabilities
public String getVersion() throws Exception { Xwiki xwiki = rest().getResource("", null); return xwiki.getVersion(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVersion File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getVersion
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public int getConnectTimeout() { return connectionTimeout; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConnectTimeout File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getConnectTimeout
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public boolean setBlockUninstallForUser(String packageName, boolean blockUninstall, int userId) { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.DELETE_PACKAGES, null); synchronized (mPackages) { PackageSetting ps = mSettings.mPackages.get(packageName); if (ps == null) { Log.i(TAG, "Package doesn't exist in set block uninstall " + packageName); return false; } if (!ps.getInstalled(userId)) { // Can't block uninstall for an app that is not installed or enabled. Log.i(TAG, "Package not installed in set block uninstall " + packageName); return false; } ps.setBlockUninstall(blockUninstall, userId); mSettings.writePackageRestrictionsLPr(userId); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBlockUninstallForUser 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
setBlockUninstallForUser
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public List<? extends Post> getAnswers(Profile authUser, Profile showUser, boolean isMyProfile, Pager itemcount) { if (utils.postsNeedApproval() && (isMyProfile || utils.isMod(authUser))) { List<Reply> alist = new ArrayList<>(); Pager p = new Pager(itemcount.getPage(), itemcount.getLimit()); alist.addAll(showUser.getAllAnswers(itemcount)); alist.addAll(showUser.getAllUnapprovedAnswers(p)); itemcount.setCount(itemcount.getCount() + p.getCount()); return alist; } else { return showUser.getAllAnswers(itemcount); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAnswers File: src/main/java/com/erudika/scoold/controllers/ProfileController.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getAnswers
src/main/java/com/erudika/scoold/controllers/ProfileController.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public Collection findByGroup(Context context, Group group) throws SQLException { return collectionDAO.findByGroup(context, group); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findByGroup File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
findByGroup
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
protected String getCurrentSource(MacroTransformationContext context) { String currentSource = null; if (context != null) { currentSource = context.getTransformationContext() != null ? context.getTransformationContext().getId() : null; MacroBlock currentMacroBlock = context.getCurrentMacroBlock(); if (currentMacroBlock != null) { MetaDataBlock metaDataBlock = currentMacroBlock.getFirstBlock(new MetadataBlockMatcher(MetaData.SOURCE), Axes.ANCESTOR_OR_SELF); if (metaDataBlock != null) { currentSource = (String) metaDataBlock.getMetaData().getMetaData(MetaData.SOURCE); } } } return currentSource; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCurrentSource File: xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-macro/src/main/java/org/xwiki/rendering/async/internal/AbstractExecutedContentMacro.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-26471
HIGH
8.8
xwiki/xwiki-platform
getCurrentSource
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-macro/src/main/java/org/xwiki/rendering/async/internal/AbstractExecutedContentMacro.java
00532d9f1404287cf3ec3a05056640d809516006
0
Analyze the following code function for security vulnerabilities
@Override public void setFocusable(final boolean focusable) { // EDT super.setFocusable(focusable); if (getActivity() == null) { return; } getActivity().runOnUiThread(new Runnable() { public void run() { v.setFocusable(focusable); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFocusable 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
setFocusable
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public boolean isQuietModeEnabled() { debugLog("isQuetModeEnabled() - Enabled = " + mQuietmode); return mQuietmode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isQuietModeEnabled File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
isQuietModeEnabled
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Override protected PasswordAuthentication getPasswordAuthentication() { return (new PasswordAuthentication(this.proxy.getUserName(), this.proxy.getPassword().toCharArray())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPasswordAuthentication File: compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/converters/URIDryConverter.java Repository: ballerina-platform/ballerina-lang The code follows secure coding practices.
[ "CWE-306" ]
CVE-2021-32700
MEDIUM
5.8
ballerina-platform/ballerina-lang
getPasswordAuthentication
compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/converters/URIDryConverter.java
4609ffee1744ecd16aac09303b1783bf0a525816
0
Analyze the following code function for security vulnerabilities
private static String findGnuplotHelperScript() { if(!GnuplotInstaller.FOUND_GP) { LOG.warn("Skipping Gnuplot Shell Script Install since Gnuplot executable was not found"); return null; } if(!GnuplotInstaller.GP_FILE.exists()) { GnuplotInstaller.installMyGnuPlot(); } if(GnuplotInstaller.GP_FILE.exists() && GnuplotInstaller.GP_FILE.canExecute()) { LOG.info("Auto Installed Gnuplot Invoker at [{}]", GnuplotInstaller.GP_FILE.getAbsolutePath()); return GnuplotInstaller.GP_FILE.getAbsolutePath(); } final URL url = GraphHandler.class.getClassLoader().getResource(WRAPPER); if (url == null) { throw new RuntimeException("Couldn't find " + WRAPPER + " on the" + " CLASSPATH: " + System.getProperty("java.class.path")); } final String path = url.getFile(); LOG.debug("Using Gnuplot wrapper at {}", path); final File file = new File(path); final String error; if (!file.exists()) { error = "non-existent"; } else if (!file.canExecute()) { error = "non-executable"; } else if (!file.canRead()) { error = "unreadable"; } else { return path; } throw new RuntimeException("The " + WRAPPER + " found on the" + " CLASSPATH (" + path + ") is a " + error + " file... WTF?" + " CLASSPATH=" + System.getProperty("java.class.path")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findGnuplotHelperScript File: src/tsd/GraphHandler.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2023-25826
CRITICAL
9.8
OpenTSDB/opentsdb
findGnuplotHelperScript
src/tsd/GraphHandler.java
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
0
Analyze the following code function for security vulnerabilities
public static boolean jsFunction_isEnableEmailUsername(Context cx, Scriptable thisObj, Object[] args, Function funObj) { return Boolean.parseBoolean(CarbonUtils.getServerConfiguration().getFirstProperty("EnableEmailUserName")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_isEnableEmailUsername File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_isEnableEmailUsername
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
@Beta public static boolean equal(File file1, File file2) throws IOException { checkNotNull(file1); checkNotNull(file2); if (file1 == file2 || file1.equals(file2)) { return true; } /* * Some operating systems may return zero as the length for files denoting system-dependent * entities such as devices or pipes, in which case we must fall back on comparing the bytes * directly. */ long len1 = file1.length(); long len2 = file2.length(); if (len1 != 0 && len2 != 0 && len1 != len2) { return false; } return asByteSource(file1).contentEquals(asByteSource(file2)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equal File: android/guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-732" ]
CVE-2020-8908
LOW
2.1
google/guava
equal
android/guava/src/com/google/common/io/Files.java
fec0dbc4634006a6162cfd4d0d09c962073ddf40
0
Analyze the following code function for security vulnerabilities
public void setCheckForXmlRootElement(boolean checkForXmlRootElement) { this.checkForXmlRootElement = checkForXmlRootElement; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCheckForXmlRootElement File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
setCheckForXmlRootElement
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
public String displayDocument() throws XWikiException { return this.doc.displayDocument(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayDocument 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
displayDocument
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
@Override public boolean refContentProvider(IBinder connection, int stable, int unstable) { return mCpHelper.refContentProvider(connection, stable, unstable); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: refContentProvider File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
refContentProvider
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public void reqService(Service service) throws TransportException { serviceAccept.lock(); try { serviceAccept.clear(); this.nextService = service; sendServiceRequest(service.getName()); serviceAccept.await(timeoutMs, TimeUnit.MILLISECONDS); } finally { serviceAccept.unlock(); this.nextService = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reqService File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
reqService
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
public void exitApplication() { android.os.Process.killProcess(android.os.Process.myPid()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: exitApplication 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
exitApplication
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
Creators collect(JavaType type, Class<?> primaryMixIn) { // 30-Apr-2016, tatu: [databind#1215]: Actually, while true, this does // NOT apply to context since sub-class may have type bindings // TypeResolutionContext typeContext = new TypeResolutionContext.Basic(_typeFactory, _type.getBindings()); List<AnnotatedConstructor> constructors = _findPotentialConstructors(type, primaryMixIn); List<AnnotatedMethod> factories = _findPotentialFactories(type, primaryMixIn); /* And then... let's remove all constructors that are deemed * ignorable after all annotations have been properly collapsed. */ // AnnotationIntrospector is null if annotations not enabled; if so, can skip: if (_intr != null) { if (_defaultConstructor != null) { if (_intr.hasIgnoreMarker(_defaultConstructor)) { _defaultConstructor = null; } } // count down to allow safe removal for (int i = constructors.size(); --i >= 0; ) { if (_intr.hasIgnoreMarker(constructors.get(i))) { constructors.remove(i); } } for (int i = factories.size(); --i >= 0; ) { if (_intr.hasIgnoreMarker(factories.get(i))) { factories.remove(i); } } } return new AnnotatedClass.Creators(_defaultConstructor, constructors, factories); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: collect File: src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
collect
src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public void setNotify(boolean notify) { this.notify = notify; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNotify File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/HipchatNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
setNotify
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/HipchatNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
@Override protected void hangupAndPowerOff() { // hang up all active voice calls if (mPhone.isInCall()) { mPhone.mCT.mRingingCall.hangupIfAlive(); mPhone.mCT.mBackgroundCall.hangupIfAlive(); mPhone.mCT.mForegroundCall.hangupIfAlive(); } mCi.setRadioPower(false, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hangupAndPowerOff File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
hangupAndPowerOff
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
public List<Document> wrapDocs(List<?> docs) { List<Document> result = new ArrayList<Document>(); if (docs != null) { for (java.lang.Object obj : docs) { try { if (obj instanceof XWikiDocument) { XWikiDocument doc = (XWikiDocument) obj; Document wrappedDoc = doc.newDocument(getXWikiContext()); result.add(wrappedDoc); } else if (obj instanceof Document) { result.add((Document) obj); } else if (obj instanceof String) { Document doc = getDocument(obj.toString()); if (doc != null) { result.add(doc); } } } catch (XWikiException ex) { } } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: wrapDocs File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
wrapDocs
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public void redeploy(File warDir, File deployTarDir, WebAppServlet was, String virtualHost) { was = (WebAppServlet) server.unloadServlet(was); if (was == null) return; server.unloadSessions(was.getServletContext()); was.destroy(); // TODO use pre-saved war name if (deployWar(new File(warDir, was.deployDir.getName() + DEPLOY_ARCH_EXT), deployTarDir)) try { was = WebAppServlet.create(was.deployDir, was.deployDir.getName(), server, virtualHost); attachApp(was, virtualHost); server.restoreSessions(was.getServletContext()); markSucceeded(deployTarDir, was.deployDir.getName()); } catch (ServletException sex) { markFailed(deployTarDir, was.deployDir.getName()); server.log("Deployment of a web app " + was.contextName + " failed due " + sex.getRootCause(), sex.getRootCause()); } catch (Throwable t) { if (t instanceof ThreadDeath) throw (ThreadDeath) t; markFailed(deployTarDir, was.deployDir.getName()); server.log("Unexpected problem in deployment of aplication " + was.contextName, t); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: redeploy 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
redeploy
1.x/src/rogatkin/web/WarRoller.java
1bac15c496ec54efe21ad7fab4e17633778582fc
0
Analyze the following code function for security vulnerabilities
public boolean stopServiceToken(ComponentName className, IBinder token, int startId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); ComponentName.writeToParcel(className, data); data.writeStrongBinder(token); data.writeInt(startId); mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); reply.readException(); boolean res = reply.readInt() != 0; data.recycle(); reply.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopServiceToken File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
stopServiceToken
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public static CountingReader readerFor(Object input) throws IOException { return readerFor(input, null, null, CompressionAlgo.NONE.name()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readerFor File: core/src/main/java/apoc/util/FileUtils.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-23532
MEDIUM
6.5
neo4j-contrib/neo4j-apoc-procedures
readerFor
core/src/main/java/apoc/util/FileUtils.java
01e63ed2d187cd2a8aa1d78bf831ef0fdd69b522
0
Analyze the following code function for security vulnerabilities
public void saveUsers(final Collection<User> usersList) throws Exception { update(); m_writeLock.lock(); try { if (!m_allowUnsalted) { for (final User details : usersList) { _assertSaltAcceptable(details); } } // clear out the internal structure and reload it m_users.clear(); for (final User curUser : usersList) { m_users.put(curUser.getUserId(), curUser); } } finally { m_writeLock.unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveUsers File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
saveUsers
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
public static RESTMessage fromDOM(Element element) { RESTMessage resourceMessage = new RESTMessage(); fromDOM(element, resourceMessage); return resourceMessage; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromDOM
base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override protected boolean isFilterStopped(PackageParser.ProviderIntentInfo filter, int userId) { if (!sUserManager.exists(userId)) return true; PackageParser.Package p = filter.provider.owner; if (p != null) { PackageSetting ps = (PackageSetting) p.mExtras; if (ps != null) { // System apps are never considered stopped for purposes of // filtering, because there may be no way for the user to // actually re-launch them. return (ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) == 0 && ps.getStopped(userId); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFilterStopped 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
isFilterStopped
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public void writeLine(final String iContent) throws IOException { writeContent(iContent); out.write(OHttpUtils.EOL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeLine File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java Repository: orientechnologies/orientdb The code follows secure coding practices.
[ "CWE-352" ]
CVE-2015-2912
MEDIUM
6.8
orientechnologies/orientdb
writeLine
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
d5a45e608ba8764fd817c1bdd7cf966564e828e9
0
Analyze the following code function for security vulnerabilities
@Override public CopyOrReadable<Boolean, InputStream, Boolean> dir(String dir) { return new PodOperationsImpl(getContext().withDir(dir)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dir File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java Repository: fabric8io/kubernetes-client The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-20218
MEDIUM
5.8
fabric8io/kubernetes-client
dir
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
325d67cc80b73f049a5d0cea4917c1f2709a8d86
0
Analyze the following code function for security vulnerabilities
@Override public JsonDeserializer<?> createArrayDeserializer(DeserializationContext ctxt, ArrayType type, final BeanDescription beanDesc) throws JsonMappingException { final DeserializationConfig config = ctxt.getConfig(); JavaType elemType = type.getContentType(); // Very first thing: is deserializer hard-coded for elements? JsonDeserializer<Object> contentDeser = elemType.getValueHandler(); // Then optional type info: if type has been resolved, we may already know type deserializer: TypeDeserializer elemTypeDeser = elemType.getTypeHandler(); // but if not, may still be possible to find: if (elemTypeDeser == null) { elemTypeDeser = findTypeDeserializer(config, elemType); } // 23-Nov-2010, tatu: Custom array deserializer? JsonDeserializer<?> deser = _findCustomArrayDeserializer(type, config, beanDesc, elemTypeDeser, contentDeser); if (deser == null) { if (contentDeser == null) { Class<?> raw = elemType.getRawClass(); if (elemType.isPrimitive()) { return PrimitiveArrayDeserializers.forType(raw); } if (raw == String.class) { return StringArrayDeserializer.instance; } } deser = new ObjectArrayDeserializer(type, contentDeser, elemTypeDeser); } // and then new with 2.2: ability to post-process it too (databind#120) if (_factoryConfig.hasDeserializerModifiers()) { for (BeanDeserializerModifier mod : _factoryConfig.deserializerModifiers()) { deser = mod.modifyArrayDeserializer(config, type, beanDesc, deser); } } return deser; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createArrayDeserializer File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
createArrayDeserializer
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public static String htmlAttributeEscape(String text) { StringBuilder buf = new StringBuilder(text.length()+64); for( int i=0; i<text.length(); i++ ) { char ch = text.charAt(i); if(ch=='<') buf.append("&lt;"); else if(ch=='>') buf.append("&gt;"); else if(ch=='&') buf.append("&amp;"); else if(ch=='"') buf.append("&quot;"); else if(ch=='\'') buf.append("&#39;"); else buf.append(ch); } return buf.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: htmlAttributeEscape File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
htmlAttributeEscape
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
@Override public DynamicForm withDirectFieldAccess(boolean directFieldAccess) { if (!directFieldAccess) { // Just do nothing return this; } throw new RuntimeException("Not possible to enable direct field access for dynamic forms."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withDirectFieldAccess 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
withDirectFieldAccess
web/play-java-forms/src/main/java/play/data/DynamicForm.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
private void savePkeyMap(Map<String, byte[]> map) { if (map.isEmpty()) { if (!mKeyStore.delete(PKEY_MAP_KEY)) { Log.w(TAG, "savePkeyMap(): failed to delete pkey map"); } return; } byte[] bytes = Util.toBytes(map); if (!mKeyStore.put(PKEY_MAP_KEY, bytes, KeyStore.UID_SELF, KeyStore.FLAG_ENCRYPTED)) { Log.w(TAG, "savePkeyMap(): failed to write pkey map"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: savePkeyMap File: src/com/android/certinstaller/CertInstaller.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
savePkeyMap
src/com/android/certinstaller/CertInstaller.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
@Override public OnGoingLogicalCondition notBetween(T from, T to) { Condition conditionLocal = new BetweenCondition<T>(new NotSelector(selector), Arrays.asList(selector.generateParameter(from), selector.generateParameter(to))); return getOnGoingLogicalCondition(conditionLocal); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notBetween File: src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java Repository: xjodoin/torpedoquery The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2019-11343
HIGH
7.5
xjodoin/torpedoquery
notBetween
src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
3c20b874fba9cc2a78b9ace10208de1602b56c3f
0
Analyze the following code function for security vulnerabilities
public void systemReady() { getSyncManager(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: systemReady File: services/core/java/com/android/server/content/ContentService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2426
MEDIUM
4.3
android
systemReady
services/core/java/com/android/server/content/ContentService.java
63363af721650e426db5b0bdfb8b2d4fe36abdb0
0
Analyze the following code function for security vulnerabilities
private String installFailureToString(LocalPackageInstallObserver obs) { final int result = obs.result; Field[] fields = PackageManager.class.getFields(); for (Field f: fields) { if (f.getType() == int.class) { int modifiers = f.getModifiers(); // only look at public final static fields. if (((modifiers & Modifier.FINAL) != 0) && ((modifiers & Modifier.PUBLIC) != 0) && ((modifiers & Modifier.STATIC) != 0)) { String fieldName = f.getName(); if (fieldName.startsWith("INSTALL_FAILED_") || fieldName.startsWith("INSTALL_PARSE_FAILED_")) { // get the int value and compare it to result. try { if (result == f.getInt(null)) { StringBuilder sb = new StringBuilder(64); sb.append(fieldName); if (obs.extraPermission != null) { sb.append(" perm="); sb.append(obs.extraPermission); } if (obs.extraPackage != null) { sb.append(" pkg=" + obs.extraPackage); } return sb.toString(); } } catch (IllegalAccessException e) { // this shouldn't happen since we only look for public static fields. } } } } } // couldn't find a matching constant? return the value return Integer.toString(result); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installFailureToString File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
installFailureToString
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
void filterServiceTargets(String packageName, List<ChooserTarget> targets) { if (targets == null) { return; } final PackageManager pm = getPackageManager(); for (int i = targets.size() - 1; i >= 0; i--) { final ChooserTarget target = targets.get(i); final ComponentName targetName = target.getComponentName(); if (packageName != null && packageName.equals(targetName.getPackageName())) { // Anything from the original target's package is fine. continue; } boolean remove; try { final ActivityInfo ai = pm.getActivityInfo(targetName, 0); remove = !ai.exported || ai.permission != null; } catch (NameNotFoundException e) { Log.e(TAG, "Target " + target + " returned by " + packageName + " component not found"); remove = true; } if (remove) { targets.remove(i); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filterServiceTargets File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
filterServiceTargets
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting boolean isSelfOrAncestorWindowAnimatingExit() { WindowState window = this; do { if (window.mAnimatingExit) { return true; } window = window.getParentWindow(); } while (window != null); return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSelfOrAncestorWindowAnimatingExit 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
isSelfOrAncestorWindowAnimatingExit
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override public boolean isParentOf(Context context, Group parentGroup, Group childGroup) throws SQLException { return group2GroupCacheDAO.findByParentAndChild(context, parentGroup, childGroup) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isParentOf File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
isParentOf
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
@Override public NavigationHistory getDirectedNavigationHistory(boolean isForward, int itemLimit) { if (mContentViewCore != null) { return mContentViewCore.getDirectedNavigationHistory(isForward, itemLimit); } else { return new NavigationHistory(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDirectedNavigationHistory File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getDirectedNavigationHistory
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private void notifyFingerprintRunningStateChanged() { for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onFingerprintRunningStateChanged(isFingerprintDetectionRunning()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyFingerprintRunningStateChanged File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
notifyFingerprintRunningStateChanged
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
private void createReader(FileInput fileInput, URI uri) throws IOException { cursor.uri = uri; cursor.lineNumber = 0; InputStream stream = fileInput.getStream(uri); currentReader = createBufferedReader(stream); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createReader File: server/src/main/java/io/crate/execution/engine/collect/files/FileReadingIterator.java Repository: crate The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-24565
MEDIUM
6.5
crate
createReader
server/src/main/java/io/crate/execution/engine/collect/files/FileReadingIterator.java
4e857d675683095945dd524d6ba03e692c70ecd6
0
Analyze the following code function for security vulnerabilities
@Override public String getRootDirectoryUrl() { BlobIdent blobIdent = new BlobIdent(state.blobIdent.revision, null, FileMode.TREE.getBits()); return RequestCycle.get().urlFor(ProjectBlobPage.class, ProjectBlobPage.paramsOf(getProject(), blobIdent)).toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRootDirectoryUrl File: server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-434" ]
CVE-2021-21245
HIGH
7.5
theonedev/onedev
getRootDirectoryUrl
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
0c060153fb97c0288a1917efdb17cc426934dacb
0
Analyze the following code function for security vulnerabilities
public void showNoPGPKeyDialog(boolean plural, DialogInterface.OnClickListener listener) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setIconAttribute(android.R.attr.alertDialogIcon); if (plural) { builder.setTitle(getString(R.string.no_pgp_keys)); builder.setMessage(getText(R.string.contacts_have_no_pgp_keys)); } else { builder.setTitle(getString(R.string.no_pgp_key)); builder.setMessage(getText(R.string.contact_has_no_pgp_key)); } builder.setNegativeButton(getString(R.string.cancel), null); builder.setPositiveButton(getString(R.string.send_unencrypted), listener); builder.create().show(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showNoPGPKeyDialog File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
showNoPGPKeyDialog
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private void updateOCVersion() { UpdateOCVersionOperation update = new UpdateOCVersionOperation(getAccount(), getContext()); RemoteOperationResult result = update.execute(getClient()); if (!result.isSuccess()) { mLastFailedResult = result; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateOCVersion File: src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
updateOCVersion
src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java
27559efb79d45782e000b762860658d49e9c35e9
0
Analyze the following code function for security vulnerabilities
private native void nativePinchBegin( long nativeContentViewCoreImpl, long timeMs, float x, float y);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativePinchBegin 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
nativePinchBegin
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@Override public boolean resetPwd(ResetPwdRequest request, UserDto currentUser) { Optional.ofNullable(currentUser).orElseThrow(() -> new RuntimeException("当前用户为空")); User user = this.getUserById(currentUser.getId()); Optional.ofNullable(user).orElseThrow(() -> new RuntimeException("当前登录用户不存在")); // 非本地创建用户不允许修改密码 if (!"local".equalsIgnoreCase(user.getSource())) { throw new RuntimeException("非云管本地创建的用户无法修改密码"); } if (!MD5Util.md5(request.getOldPassword()).equalsIgnoreCase(user.getPassword())) { throw new RuntimeException("旧密码错误"); } user.setPassword(MD5Util.md5(request.getNewPassword())); user.setUpdateTime(null); this.updateById(user); return true; }
Vulnerability Classification: - CWE: CWE-521 - CVE: CVE-2023-3423 - Severity: HIGH - CVSS Score: 8.8 Description: fix: 用户修改密码增加后端接口校验 Function: resetPwd File: framework/sdk/backend/src/main/java/com/fit2cloud/base/service/impl/BaseUserServiceImpl.java Repository: CloudExplorer-Dev/CloudExplorer-Lite Fixed Code: @Override public boolean resetPwd(ResetPwdRequest request, UserDto currentUser) { Optional.ofNullable(currentUser).orElseThrow(() -> new RuntimeException("当前用户为空")); User user = this.getUserById(currentUser.getId()); Optional.ofNullable(user).orElseThrow(() -> new RuntimeException("当前登录用户不存在")); // 非本地创建用户不允许修改密码 if (!"local".equalsIgnoreCase(user.getSource())) { throw new RuntimeException("非云管本地创建的用户无法修改密码"); } if (StringUtils.equals(request.getOldPassword(), request.getNewPassword())) { throw new RuntimeException("新旧密码相同"); } if (!MD5Util.md5(request.getOldPassword()).equalsIgnoreCase(user.getPassword())) { throw new RuntimeException("旧密码错误"); } if (!request.getNewPassword().matches("^(?!.*\\s)(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\\W_]).{8,30}$")) { throw new RuntimeException("有效密码:8-30位,英文大小写字母+数字+特殊字符"); } user.setPassword(MD5Util.md5(request.getNewPassword())); user.setUpdateTime(null); this.updateById(user); return true; }
[ "CWE-521" ]
CVE-2023-3423
HIGH
8.8
CloudExplorer-Dev/CloudExplorer-Lite
resetPwd
framework/sdk/backend/src/main/java/com/fit2cloud/base/service/impl/BaseUserServiceImpl.java
7d4dab60352079953b7be120afe9bd14983ae3bc
1
Analyze the following code function for security vulnerabilities
@Override public void setUserProvisioningState(int newState, int userId) { if (!mHasFeature) { logMissingFeatureAction("Cannot set provisioning state " + newState + " for user " + userId); return; } Preconditions.checkCallAuthorization( hasCallingOrSelfPermission(MANAGE_PROFILE_AND_DEVICE_OWNERS)); final CallerIdentity caller = getCallerIdentity(); final long id = mInjector.binderClearCallingIdentity(); try { int deviceOwnerUserId = mOwners.getDeviceOwnerUserId(); // NOTE: multiple if statements are nested below so it can log more info on error if (userId != deviceOwnerUserId) { boolean hasProfileOwner = mOwners.hasProfileOwner(userId); if (!hasProfileOwner) { int managedUserId = getManagedUserId(userId); if (managedUserId < 0 && newState != STATE_USER_UNMANAGED) { // No managed device, user or profile, so setting provisioning state makes // no sense. String error = "Not allowed to change provisioning state unless a " + "device or profile owner is set."; Slogf.w(LOG_TAG, "setUserProvisioningState(newState=%d, userId=%d) failed: " + "deviceOwnerId=%d, hasProfileOwner=%b, managedUserId=%d, err=%s", newState, userId, deviceOwnerUserId, hasProfileOwner, managedUserId, error); throw new IllegalStateException(error); } } } synchronized (getLockObject()) { boolean transitionCheckNeeded = true; // Calling identity/permission checks. if (isAdb(caller)) { // ADB shell can only move directly from un-managed to finalized as part of // directly setting profile-owner or device-owner. if (getUserProvisioningState(userId) != DevicePolicyManager.STATE_USER_UNMANAGED || newState != STATE_USER_SETUP_FINALIZED) { throw new IllegalStateException("Not allowed to change provisioning state " + "unless current provisioning state is unmanaged, and new state" + "is finalized."); } transitionCheckNeeded = false; } final DevicePolicyData policyData = getUserData(userId); if (transitionCheckNeeded) { // Optional state transition check for non-ADB case. checkUserProvisioningStateTransition(policyData.mUserProvisioningState, newState); } policyData.mUserProvisioningState = newState; saveSettingsLocked(userId); } } finally { mInjector.binderRestoreCallingIdentity(id); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserProvisioningState File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setUserProvisioningState
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public Collection findByIdOrLegacyId(Context context, String id) throws SQLException { if (StringUtils.isNumeric(id)) { return findByLegacyId(context, Integer.parseInt(id)); } else { return find(context, UUID.fromString(id)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findByIdOrLegacyId File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
findByIdOrLegacyId
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
@Override public boolean onOptionsItemSelected(final MenuItem item) { switch (item.getItemId()) { case R.id.action_settings: startActivity(new Intent(this, SettingsActivity.class)); break; case R.id.action_accounts: startActivity(new Intent(this, ManageAccountActivity.class)); break; case android.R.id.home: finish(); break; case R.id.action_show_qr_code: showQrCode(); break; } return super.onOptionsItemSelected(item); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onOptionsItemSelected 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
onOptionsItemSelected
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private boolean isCa(X509Certificate cert) { try { // TODO: add a test about this byte[] asn1EncodedBytes = cert.getExtensionValue("2.5.29.19"); if (asn1EncodedBytes == null) { return false; } DEROctetString derOctetString = (DEROctetString) new ASN1InputStream(asn1EncodedBytes).readObject(); byte[] octets = derOctetString.getOctets(); ASN1Sequence sequence = (ASN1Sequence) new ASN1InputStream(octets).readObject(); return BasicConstraints.getInstance(sequence).isCA(); } catch (IOException e) { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCa File: src/com/android/certinstaller/CredentialHelper.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
isCa
src/com/android/certinstaller/CredentialHelper.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
@Override public void stopLockTaskModeByToken(IBinder token) { synchronized (this) { final ActivityRecord r = ActivityRecord.forTokenLocked(token); if (r == null) { return; } stopLockTaskModeInternal(r.getTask(), false /* isSystemCaller */); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopLockTaskModeByToken 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
stopLockTaskModeByToken
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public IAppTransitionAnimationSpecsFuture getSpecsFuture() { return mSpecsFuture; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpecsFuture File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
getSpecsFuture
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public void forceStopPackage(String packageName, int userId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(packageName); data.writeInt(userId); mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forceStopPackage File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
forceStopPackage
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public FileAsset fromContentlet(Contentlet con) throws DotStateException { if (con == null) { throw new DotStateException("Contentlet : is null"); } if (con.getStructure().getStructureType() != Structure.STRUCTURE_TYPE_FILEASSET) { throw new DotStateException("Contentlet : " + con.getInode() + " is not a FileAsset"); } FileAsset fa = new FileAsset(); fa.setStructureInode(con.getStructureInode()); try { contAPI.copyProperties((Contentlet) fa, con.getMap()); } catch (Exception e) { throw new DotStateException("File Copy Failed :" + e.getMessage(), e); } fa.setHost(con.getHost()); if(UtilMethods.isSet(con.getFolder())){ try{ Identifier ident = APILocator.getIdentifierAPI().find(con); User systemUser = APILocator.getUserAPI().getSystemUser(); Host host = APILocator.getHostAPI().find(con.getHost(), systemUser , false); Folder folder = APILocator.getFolderAPI().findFolderByPath(ident.getParentPath(), host, systemUser, false); fa.setFolder(folder.getInode()); }catch(Exception e){ try{ User systemUser = APILocator.getUserAPI().getSystemUser(); Host host = APILocator.getHostAPI().find(con.getHost(), systemUser , false); Folder folder = APILocator.getFolderAPI().find(con.getFolder(), systemUser, false); fa.setFolder(folder.getInode()); }catch(Exception e1){ Logger.warn(this, "Unable to convert contentlet to file asset " + con, e1); } } } return fa; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromContentlet File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
fromContentlet
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
0
Analyze the following code function for security vulnerabilities
public Iterator<V> valueIterator(K name) { return new ValueIterator(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: valueIterator File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
valueIterator
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
public void killBackgroundProcesses(final String packageName, int userId) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: killBackgroundProcesses File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
killBackgroundProcesses
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public int getDisplayHeight() { if (this.myView != null) { int h = this.myView.getViewHeight(); displayHeight = h; return h; } return displayHeight; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDisplayHeight 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
getDisplayHeight
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private void encryptCTR(byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) { while (length > 0) { // Increment the IV and encrypt it to get the next keystream block. if (++(iv[15]) == 0) if (++(iv[14]) == 0) if (++(iv[13]) == 0) ++(iv[12]); aes.encrypt(iv, 0, enciv, 0); // XOR the keystream block with the plaintext to create the ciphertext. int temp = length; if (temp > 16) temp = 16; for (int index = 0; index < temp; ++index) ciphertext[ciphertextOffset + index] = (byte)(plaintext[plaintextOffset + index] ^ enciv[index]); // Advance to the next block. plaintextOffset += temp; ciphertextOffset += temp; length -= temp; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: encryptCTR File: src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java Repository: rweather/noise-java The code follows secure coding practices.
[ "CWE-125", "CWE-787" ]
CVE-2020-25021
HIGH
7.5
rweather/noise-java
encryptCTR
src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java
18e86b6f8bea7326934109aa9ffa705ebf4bde90
0
Analyze the following code function for security vulnerabilities
@Override public boolean isInHomeStack(int taskId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(taskId); mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); reply.readException(); boolean isInHomeStack = reply.readInt() > 0; data.recycle(); reply.recycle(); return isInHomeStack; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInHomeStack File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
isInHomeStack
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public void onPlaybackStateChanged(PlaybackStateCompat state) { super.onPlaybackStateChanged(state); if( state == null ) { return; } switch( state.getState() ) { case PlaybackStateCompat.STATE_PLAYING: { mCurrentState = STATE_PLAYING; break; } case PlaybackStateCompat.STATE_PAUSED: { mCurrentState = STATE_PAUSED; break; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPlaybackStateChanged 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
onPlaybackStateChanged
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public Element getElementById(String id) { return doc.getElementById(id); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getElementById 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
getElementById
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
void applyWithNextDraw(Consumer<SurfaceControl.Transaction> consumer) { mSyncSeqId++; mDrawHandlers.add(new DrawHandler(mSyncSeqId, consumer)); requestRedrawForSync(); mWmService.mH.sendNewMessageDelayed(WINDOW_STATE_BLAST_SYNC_TIMEOUT, this, BLAST_TIMEOUT_DURATION); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyWithNextDraw 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
applyWithNextDraw
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public String getDeviceId() { return getDeviceIdForPhone(SubscriptionManager.getPhoneId(getDefaultSubscription())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeviceId File: src/java/com/android/internal/telephony/PhoneSubInfoController.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-0831
MEDIUM
4.3
android
getDeviceId
src/java/com/android/internal/telephony/PhoneSubInfoController.java
79eecef63f3ea99688333c19e22813f54d4a31b1
0
Analyze the following code function for security vulnerabilities
protected boolean isMethodBrowserSupported(String method) { return ("get".equalsIgnoreCase(method) || "post".equalsIgnoreCase(method)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMethodBrowserSupported File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-1904
MEDIUM
4.3
spring-projects/spring-framework
isMethodBrowserSupported
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
741b4b229ae032bd17175b46f98673ce0bd2d485
0
Analyze the following code function for security vulnerabilities
@Override public ParceledListSlice<StatusBarNotification> getAppActiveNotifications(String pkg, int incomingUserId) { checkCallerIsSystemOrSameApp(pkg); int userId = ActivityManager.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), incomingUserId, true, false, "getAppActiveNotifications", pkg); final ArrayList<StatusBarNotification> list = new ArrayList<StatusBarNotification>(mNotificationList.size()); synchronized (mNotificationList) { final int N = mNotificationList.size(); for (int i = 0; i < N; i++) { final StatusBarNotification sbn = mNotificationList.get(i).sbn; if (sbn.getPackageName().equals(pkg) && sbn.getUserId() == userId && (sbn.getNotification().flags & Notification.FLAG_AUTOGROUP_SUMMARY) == 0) { // We could pass back a cloneLight() but clients might get confused and // try to send this thing back to notify() again, which would not work // very well. final StatusBarNotification sbnOut = new StatusBarNotification( sbn.getPackageName(), sbn.getOpPkg(), sbn.getId(), sbn.getTag(), sbn.getUid(), sbn.getInitialPid(), 0, // hide score from apps sbn.getNotification().clone(), sbn.getUser(), sbn.getPostTime()); list.add(sbnOut); } } } return new ParceledListSlice<StatusBarNotification>(list); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppActiveNotifications File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
getAppActiveNotifications
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
private static boolean copyFolder(File source, File target, boolean vacuousSuccess) { if (!source.exists()) return vacuousSuccess; if (source.equals(target)) return false; if (!target.exists() && !target.mkdirs()) return false; try { for (String file : source.list()) { File sourceFile = new File(source, file); File targetFile = new File(target, file); if (sourceFile.isDirectory()) { if (!copyFolder(sourceFile, targetFile, vacuousSuccess)) return false; } else { if (!handleStreamCopy(new FileInputStream(sourceFile), new FileOutputStream(targetFile))) return false; } } return true; } catch (FileNotFoundException e) { e.printStackTrace(); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyFolder File: APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java Repository: Calsign/APDE The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36628
CRITICAL
9.8
Calsign/APDE
copyFolder
APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java
c6d64cbe465348c1bfd211122d89e3117afadecf
0
Analyze the following code function for security vulnerabilities
private LogMaker newLogMaker(int category) { return Helper.newLogMaker(category, mComponentName, mServicePackageName, mPendingUi.sessionId, mCompatMode); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newLogMaker File: services/autofill/java/com/android/server/autofill/ui/SaveUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
newLogMaker
services/autofill/java/com/android/server/autofill/ui/SaveUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
public void stopContainer(String containerId) { KieServerState currentState = context.getStateRepository().load(KieServerEnvironment.getServerId()); Set<String> controllers = currentState.getControllers(); KieServerConfig config = currentState.getConfiguration(); if (controllers != null && !controllers.isEmpty()) { for (String controllerUrl : controllers) { if (controllerUrl != null && !controllerUrl.isEmpty()) { String connectAndSyncUrl = controllerUrl + "/management/servers/" + KieServerEnvironment.getServerId() + "/containers/" + containerId + "/status/stopped"; String userName = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_USER, "kieserver"); String password = loadPassword(config); String token = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_TOKEN); try { makeHttpPostRequestAndCreateCustomResponse(connectAndSyncUrl, "", null, userName, password, token); break; } catch (Exception e) { // let's check all other controllers in case of running in cluster of controllers logger.warn("Exception encountered while syncing with controller at {} error {}", connectAndSyncUrl, e.getCause() == null ? e.getMessage() : e.getCause().getMessage()); logger.debug("Exception encountered while syncing with controller at {} error {}", connectAndSyncUrl, e.getMessage(), e); } } } } }
Vulnerability Classification: - CWE: CWE-260 - CVE: CVE-2016-7043 - Severity: MEDIUM - CVSS Score: 5.0 Description: [RHBMS-4312] Loading pasword from a keystore Function: stopContainer File: kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java Repository: kiegroup/droolsjbpm-integration Fixed Code: public void stopContainer(String containerId) { KieServerState currentState = context.getStateRepository().load(KieServerEnvironment.getServerId()); Set<String> controllers = currentState.getControllers(); KieServerConfig config = currentState.getConfiguration(); if (controllers != null && !controllers.isEmpty()) { for (String controllerUrl : controllers) { if (controllerUrl != null && !controllerUrl.isEmpty()) { String connectAndSyncUrl = controllerUrl + "/management/servers/" + KieServerEnvironment.getServerId() + "/containers/" + containerId + "/status/stopped"; String userName = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_USER, "kieserver"); String password = loadControllerPassword(config); String token = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_TOKEN); try { makeHttpPostRequestAndCreateCustomResponse(connectAndSyncUrl, "", null, userName, password, token); break; } catch (Exception e) { // let's check all other controllers in case of running in cluster of controllers logger.warn("Exception encountered while syncing with controller at {} error {}", connectAndSyncUrl, e.getCause() == null ? e.getMessage() : e.getCause().getMessage()); logger.debug("Exception encountered while syncing with controller at {} error {}", connectAndSyncUrl, e.getMessage(), e); } } } } }
[ "CWE-260" ]
CVE-2016-7043
MEDIUM
5
kiegroup/droolsjbpm-integration
stopContainer
kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java
e916032edd47aa46d15f3a11909b4804ee20a7e8
1
Analyze the following code function for security vulnerabilities
private String generateMnemonicString(boolean withWhitespace) { StringBuilder stringBuilder = new StringBuilder(); for (String string : keyWords) { stringBuilder.append(string); if (withWhitespace) { stringBuilder.append(' '); } } return stringBuilder.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateMnemonicString File: src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-212" ]
CVE-2021-32658
LOW
2.1
nextcloud/android
generateMnemonicString
src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java
355f3c745b464b741b20a3b96597303490c26333
0
Analyze the following code function for security vulnerabilities
private void transferDeviceOwnershipLocked(ComponentName admin, ComponentName target, int userId) { transferActiveAdminUncheckedLocked(target, admin, userId); mOwners.transferDeviceOwnership(target); Slogf.i(LOG_TAG, "Device owner set: " + target + " on user " + userId); mOwners.writeDeviceOwner(); mDeviceAdminServiceController.startServiceForOwner( target.getPackageName(), userId, "transfer-device-owner"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: transferDeviceOwnershipLocked 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
transferDeviceOwnershipLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void setUseWorkflow(boolean useWorkflow) { this.useWorkflow = useWorkflow; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUseWorkflow File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
setUseWorkflow
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
0
Analyze the following code function for security vulnerabilities
void reportActivityLaunchedLocked(boolean timeout, ActivityRecord r, long thisTime, long totalTime) { boolean changed = false; for (int i = mWaitingActivityLaunched.size() - 1; i >= 0; i--) { WaitResult w = mWaitingActivityLaunched.remove(i); if (w.who == null) { changed = true; w.timeout = timeout; if (r != null) { w.who = new ComponentName(r.info.packageName, r.info.name); } w.thisTime = thisTime; w.totalTime = totalTime; } } if (changed) { mService.notifyAll(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportActivityLaunchedLocked File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
reportActivityLaunchedLocked
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public ServerBuilder http1HeaderNaming(Http1HeaderNaming http1HeaderNaming) { requireNonNull(http1HeaderNaming, "http1HeaderNaming"); this.http1HeaderNaming = http1HeaderNaming; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: http1HeaderNaming 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
http1HeaderNaming
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
@Override public void startConfirmDeviceCredentialIntent(Intent intent, Bundle options) { enforceTaskPermission("startConfirmDeviceCredentialIntent"); synchronized (mGlobalLock) { final long ident = Binder.clearCallingIdentity(); try { intent.addFlags(FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); final ActivityOptions activityOptions = options != null ? new ActivityOptions(options) : ActivityOptions.makeBasic(); mContext.startActivityAsUser(intent, activityOptions.toBundle(), UserHandle.CURRENT); } finally { Binder.restoreCallingIdentity(ident); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startConfirmDeviceCredentialIntent File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
startConfirmDeviceCredentialIntent
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private void internalSetReplicatedSubscriptionStatusForNonPartitionedTopic(AsyncResponse asyncResponse, String subName, boolean authoritative, boolean enabled) { try { // Redirect the request to the appropriate broker if this broker is not the owner of the topic validateTopicOwnership(topicName, authoritative); Topic topic = getTopicReference(topicName); if (topic == null) { asyncResponse.resume(new RestException(Status.NOT_FOUND, "Topic not found")); return; } Subscription sub = topic.getSubscription(subName); if (sub == null) { asyncResponse.resume(new RestException(Status.NOT_FOUND, "Subscription not found")); return; } if (topic instanceof PersistentTopic && sub instanceof PersistentSubscription) { if (!((PersistentSubscription) sub).setReplicated(enabled)) { asyncResponse.resume( new RestException(Status.INTERNAL_SERVER_ERROR, "Failed to update cursor properties")); return; } ((PersistentTopic) topic).checkReplicatedSubscriptionControllerState(); log.info("[{}] Changed replicated subscription status to {} - {} {}", clientAppId(), enabled, topicName, subName); asyncResponse.resume(Response.noContent().build()); } else { asyncResponse.resume(new RestException(Status.METHOD_NOT_ALLOWED, "Cannot enable/disable replicated subscriptions on non-persistent topics")); } } catch (Exception e) { resumeAsyncResponseExceptionally(asyncResponse, e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalSetReplicatedSubscriptionStatusForNonPartitionedTopic File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalSetReplicatedSubscriptionStatusForNonPartitionedTopic
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Override public void registerMoveCallback(IPackageMoveObserver callback) { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS, null); mMoveCallbacks.register(callback); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerMoveCallback 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
registerMoveCallback
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public void onSkipToNext() { super.onSkipToNext(); RemoteControlCallback.skipToNext(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSkipToNext File: Ports/Android/src/com/codename1/media/BackgroundAudioService.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
onSkipToNext
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { PageInfoPermissionEntry entry = (PageInfoPermissionEntry) parent.getItemAtPosition(pos); nativeOnPermissionSettingChanged(mNativeWebsiteSettingsPopup, entry.type, entry.value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onItemSelected File: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2015-1261
MEDIUM
5
chromium
onItemSelected
chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
5bf8a2dccf4777c5f065d918d1d9a2bbaa013f9f
0
Analyze the following code function for security vulnerabilities
private void extractPage(final String sourceMeetingId, final String presentationId, final Integer presentationSlide, final String destinationMeetingId) { Boolean uploadFailed = false; ArrayList<String> uploadFailedReasons = new ArrayList<String>(); // Build the source meeting path File sourceMeetingPath = new File(presentationDir + File.separatorChar + sourceMeetingId + File.separatorChar + sourceMeetingId + File.separatorChar + presentationId); // Find the source meeting presentation file final String presentationFilter = presentationId; FilenameFilter pdfFilter = new FilenameFilter() { public boolean accept(File dir, String name) { return name.startsWith(presentationFilter) && name.toLowerCase().endsWith("pdf"); } }; File[] matches = sourceMeetingPath.listFiles(pdfFilter); if (matches != null && matches.length != 1) { // No PDF presentation was found, we look for an image presentation FilenameFilter imgFlter = new FilenameFilter() { public boolean accept(File dir, String name) { return name.startsWith(presentationFilter); } }; matches = sourceMeetingPath.listFiles(imgFlter); } File sourcePresentationFile; if (matches == null || matches.length != 1) { log.warn( "Not matching PDF file with prefix {} found at {}. Using the default blank PDF", sourceMeetingId, sourceMeetingPath); sourcePresentationFile = new File(BLANK_PRESENTATION); } else { sourcePresentationFile = matches[0]; } // Build the target meeting path String filenameExt = FilenameUtils.getExtension(sourcePresentationFile.getName()); String presId = Util.generatePresentationId(presentationId); String newFilename = Util.createNewFilename(presId, filenameExt); File uploadDir = Util.createPresentationDir(destinationMeetingId, presentationDir, presId); String newFilePath = uploadDir.getAbsolutePath() + File.separatorChar + newFilename; File newPresentation = new File(newFilePath); if (sourcePresentationFile.getName().toLowerCase().endsWith("pdf")) { pageExtractor.extractPage(sourcePresentationFile, new File( newFilePath), presentationSlide); } else { try { FileUtils.copyFile(sourcePresentationFile, newPresentation); } catch (IOException e) { log.error("Could not copy presentation {} to {}", sourcePresentationFile.getAbsolutePath(), newPresentation.getAbsolutePath(), e); } } // Hardcode pre-uploaded presentation for breakout room to the default presentation window processUploadedFile("DEFAULT_PRESENTATION_POD", destinationMeetingId, presId, "default-" + presentationSlide.toString() + "." + filenameExt, newPresentation, true, "breakout-authz-token", uploadFailed, uploadFailedReasons); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractPage File: bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43798
MEDIUM
5.4
bigbluebutton
extractPage
bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java
02ba4c6ff8e78a0f4384ad1b7c7367c5a90376e8
0
Analyze the following code function for security vulnerabilities
private int getResIdForFactoryResetProtectionWarningMessage() { final boolean hasFingerprints; if (mFingerprintManager != null && mFingerprintManager.isHardwareDetected()) { hasFingerprints = mFingerprintManager.hasEnrolledFingerprints(mUserId); } else { hasFingerprints = false; } boolean isProfile = UserManager.get(getActivity()).isManagedProfile(mUserId); switch (mLockPatternUtils.getKeyguardStoredPasswordQuality(mUserId)) { case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING: if (hasFingerprints && isProfile) { return R.string .unlock_disable_frp_warning_content_pattern_fingerprint_profile; } else if (hasFingerprints && !isProfile) { return R.string.unlock_disable_frp_warning_content_pattern_fingerprint; } else if (isProfile) { return R.string.unlock_disable_frp_warning_content_pattern_profile; } else { return R.string.unlock_disable_frp_warning_content_pattern; } case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC: case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX: if (hasFingerprints && isProfile) { return R.string.unlock_disable_frp_warning_content_pin_fingerprint_profile; } else if (hasFingerprints && !isProfile) { return R.string.unlock_disable_frp_warning_content_pin_fingerprint; } else if (isProfile) { return R.string.unlock_disable_frp_warning_content_pin_profile; } else { return R.string.unlock_disable_frp_warning_content_pin; } case DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC: case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC: case DevicePolicyManager.PASSWORD_QUALITY_COMPLEX: case DevicePolicyManager.PASSWORD_QUALITY_MANAGED: if (hasFingerprints && isProfile) { return R.string .unlock_disable_frp_warning_content_password_fingerprint_profile; } else if (hasFingerprints && !isProfile) { return R.string.unlock_disable_frp_warning_content_password_fingerprint; } else if (isProfile) { return R.string.unlock_disable_frp_warning_content_password_profile; } else { return R.string.unlock_disable_frp_warning_content_password; } default: if (hasFingerprints && isProfile) { return R.string .unlock_disable_frp_warning_content_unknown_fingerprint_profile; } else if (hasFingerprints && !isProfile) { return R.string.unlock_disable_frp_warning_content_unknown_fingerprint; } else if (isProfile) { return R.string.unlock_disable_frp_warning_content_unknown_profile; } else { return R.string.unlock_disable_frp_warning_content_unknown; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResIdForFactoryResetProtectionWarningMessage 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
getResIdForFactoryResetProtectionWarningMessage
src/com/android/settings/password/ChooseLockGeneric.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
@Override public StaticHandler setAllowRootFileSystemAccess(boolean allowRootFileSystemAccess) { this.allowRootFileSystemAccess = allowRootFileSystemAccess; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAllowRootFileSystemAccess File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-12542
HIGH
7.5
vert-x3/vertx-web
setAllowRootFileSystemAccess
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0