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
private void migrate53(File dataDir, Stack<Integer> versions) { String anonymousGroupName = null; Map<String, String> groupIds = new HashMap<>(); List<Triple<String, String, String>> authorizations = new ArrayList<>(); for (File file: dataDir.listFiles()) { try { String content = FileUtils.readFileToString(file, StandardCharsets.UTF_8); content = StringUtils.replace(content, "io.onedev.server.model.support.issue.fieldspec.", "io.onedev.server.model.support.issue.field.spec."); content = StringUtils.replace(content, "io.onedev.server.model.support.issue.fieldsupply.", "io.onedev.server.model.support.issue.field.supply."); content = StringUtils.replace(content, "org.server.plugin.report.checkstyle.", "io.onedev.server.plugin.report.checkstyle."); content = StringUtils.replace(content, "org.server.plugin.report.clover.", "io.onedev.server.plugin.report.clover."); FileUtils.writeStringToFile(file, content, StandardCharsets.UTF_8); if (file.getName().startsWith("Settings.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { if (element.elementTextTrim("key").equals("SECURITY")) { Element valueElement = element.element("value"); if (valueElement != null) { Element anonymousGroupElement = valueElement.element("anonymousGroup"); if (anonymousGroupElement != null) { if (valueElement.elementTextTrim("enableAnonymousAccess").equals("true")) anonymousGroupName = anonymousGroupElement.getText().trim(); anonymousGroupElement.detach(); } } } } dom.writeToFile(file, false); } else if (file.getName().startsWith("Groups.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) groupIds.put(element.elementText("name").trim(), element.elementText("id").trim()); } else if (file.getName().startsWith("GroupAuthorizations.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { String groupId = element.elementText("group").trim(); String projectId = element.elementText("project").trim(); String roleId = element.elementText("role").trim(); authorizations.add(Triple.of(groupId, projectId, roleId)); } } } catch (IOException e) { throw new RuntimeException(e); } } Map<String, String> defaultRoles = new HashMap<>(); if (anonymousGroupName != null) { String anonymousGroupId = groupIds.get(anonymousGroupName); for (Triple<String, String, String> authorization: authorizations) { if (authorization.getLeft().equals(anonymousGroupId)) defaultRoles.put(authorization.getMiddle(), authorization.getRight()); } } for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Projects.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { String defaultRoleId = defaultRoles.get(element.elementText("id").trim()); if (defaultRoleId != null) element.addElement("defaultRole").setText(defaultRoleId); } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate53 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate53
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public BaseClass getUserClass(XWikiContext context) throws XWikiException { return getMandatoryClass(context, new DocumentReference(context.getWikiId(), SYSTEM_SPACE, "XWikiUsers")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserClass File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getUserClass
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public void onLowMemory() { super.onLowMemory(); AndroidNativeUtil.onLowMemory(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLowMemory File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
onLowMemory
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public BufferedBlockCipher getCipher() { return cipher; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCipher File: core/src/main/java/org/bouncycastle/crypto/engines/IESEngine.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
getCipher
core/src/main/java/org/bouncycastle/crypto/engines/IESEngine.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
private AuthorityInfo getAuthorityLocked(EndPoint info, String tag) { if (info.target_service) { SparseArray<AuthorityInfo> aInfo = mServices.get(info.service); AuthorityInfo authority = null; if (aInfo != null) { authority = aInfo.get(info.userId); } if (authority == null) { if (tag != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, tag + " No authority info found for " + info.service + " for" + " user " + info.userId); } } return null; } return authority; } else if (info.target_provider){ AccountAndUser au = new AccountAndUser(info.account, info.userId); AccountInfo accountInfo = mAccounts.get(au); if (accountInfo == null) { if (tag != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, tag + ": unknown account " + au); } } return null; } AuthorityInfo authority = accountInfo.authorities.get(info.provider); if (authority == null) { if (tag != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, tag + ": unknown provider " + info.provider); } } return null; } return authority; } else { Log.e(TAG, tag + " Authority : " + info + ", invalid target"); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthorityLocked File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
getAuthorityLocked
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
@Override public void updatePersistentConfiguration(Configuration values) { enforceCallingPermission(CHANGE_CONFIGURATION, "updatePersistentConfiguration()"); enforceWriteSettingsPermission("updatePersistentConfiguration()"); if (values == null) { throw new NullPointerException("Configuration must not be null"); } int userId = UserHandle.getCallingUserId(); synchronized(this) { updatePersistentConfigurationLocked(values, userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updatePersistentConfiguration 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
updatePersistentConfiguration
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public IBinder getUriPermissionOwnerForActivity(IBinder activityToken) { enforceNotIsolatedCaller("getUriPermissionOwnerForActivity"); synchronized(this) { ActivityRecord r = ActivityRecord.isInStackLocked(activityToken); if (r == null) { throw new IllegalArgumentException("Activity does not exist; token=" + activityToken); } return r.getUriPermissionsLocked().getExternalTokenLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUriPermissionOwnerForActivity 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
getUriPermissionOwnerForActivity
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Deprecated public void setApplicationRestrictionsManagingPackage(@NonNull ComponentName admin, @Nullable String packageName) throws NameNotFoundException { throwIfParentInstance("setApplicationRestrictionsManagingPackage"); if (mService != null) { try { if (!mService.setApplicationRestrictionsManagingPackage(admin, packageName)) { throw new NameNotFoundException(packageName); } } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setApplicationRestrictionsManagingPackage File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setApplicationRestrictionsManagingPackage
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void handshake() throws WebSocketException { try { // Perform handshake with the proxy server. mProxyHandshaker.perform(); } catch (IOException e) { // Handshake with the proxy server failed. String message = String.format( "Handshake with the proxy server (%s) failed: %s", mAddress, e.getMessage()); // Raise an exception with PROXY_HANDSHAKE_ERROR. throw new WebSocketException(WebSocketError.PROXY_HANDSHAKE_ERROR, message, e); } if (mSSLSocketFactory == null) { // SSL handshake with the WebSocket endpoint is not needed. return; } try { // Overlay the existing socket. mSocket = mSSLSocketFactory.createSocket(mSocket, mHost, mPort, true); } catch (IOException e) { // Failed to overlay an existing socket. String message = "Failed to overlay an existing socket: " + e.getMessage(); // Raise an exception with SOCKET_OVERLAY_ERROR. throw new WebSocketException(WebSocketError.SOCKET_OVERLAY_ERROR, message, e); } try { // Start the SSL handshake manually. As for the reason, see // http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/samples/sockets/client/SSLSocketClient.java ((SSLSocket)mSocket).startHandshake(); } catch (IOException e) { // SSL handshake with the WebSocket endpoint failed. String message = String.format( "SSL handshake with the WebSocket endpoint (%s) failed: %s", mAddress, e.getMessage()); // Raise an exception with SSL_HANDSHAKE_ERROR. throw new WebSocketException(WebSocketError.SSL_HANDSHAKE_ERROR, message, e); } }
Vulnerability Classification: - CWE: CWE-295 - CVE: CVE-2017-1000209 - Severity: MEDIUM - CVSS Score: 4.3 Description: Verify that certificate is valid for server hostname Without this change, the WebSocket library will accept a trusted certificate issued for domain A when connecting to domain B. This could be exploited for Man-in-the-middle attacks. The underlying issue is that Java considers hostname verification to be a part of HTTPS and as such, will not perform it by default. This change adds the default HostnameVerifier used by Android, which in recent versions is derived from OkHttp. Minor changes were made to make it build for Java 1.6. Tested with and without a proxy configured. Function: handshake File: src/main/java/com/neovisionaries/ws/client/SocketConnector.java Repository: TakahikoKawasaki/nv-websocket-client Fixed Code: private void handshake() throws WebSocketException { try { // Perform handshake with the proxy server. mProxyHandshaker.perform(); } catch (IOException e) { // Handshake with the proxy server failed. String message = String.format( "Handshake with the proxy server (%s) failed: %s", mAddress, e.getMessage()); // Raise an exception with PROXY_HANDSHAKE_ERROR. throw new WebSocketException(WebSocketError.PROXY_HANDSHAKE_ERROR, message, e); } if (mSSLSocketFactory == null) { // SSL handshake with the WebSocket endpoint is not needed. return; } try { // Overlay the existing socket. mSocket = mSSLSocketFactory.createSocket(mSocket, mHost, mPort, true); } catch (IOException e) { // Failed to overlay an existing socket. String message = "Failed to overlay an existing socket: " + e.getMessage(); // Raise an exception with SOCKET_OVERLAY_ERROR. throw new WebSocketException(WebSocketError.SOCKET_OVERLAY_ERROR, message, e); } try { // Start the SSL handshake manually. As for the reason, see // http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/samples/sockets/client/SSLSocketClient.java ((SSLSocket)mSocket).startHandshake(); if (mSocket instanceof SSLSocket) { // Verify that the proxied hostname matches the certificate here since // this is not automatically done by the SSLSocket. OkHostnameVerifier hostnameVerifier = OkHostnameVerifier.INSTANCE; SSLSession sslSession = ((SSLSocket) mSocket).getSession(); if (!hostnameVerifier.verify(mProxyHandshaker.getProxiedHostname(), sslSession)) { throw new SSLPeerUnverifiedException("Proxied hostname " + mProxyHandshaker.getProxiedHostname() + " does not match certificate (" + sslSession.getPeerPrincipal() + ")"); } } } catch (IOException e) { // SSL handshake with the WebSocket endpoint failed. String message = String.format( "SSL handshake with the WebSocket endpoint (%s) failed: %s", mAddress, e.getMessage()); // Raise an exception with SSL_HANDSHAKE_ERROR. throw new WebSocketException(WebSocketError.SSL_HANDSHAKE_ERROR, message, e); } }
[ "CWE-295" ]
CVE-2017-1000209
MEDIUM
4.3
TakahikoKawasaki/nv-websocket-client
handshake
src/main/java/com/neovisionaries/ws/client/SocketConnector.java
feb9c8302757fd279f4cfc99cbcdfb6ee709402d
1
Analyze the following code function for security vulnerabilities
public String getCharacterEncoding() { String enc = getCurrentEncoding(); return (enc == null ? "ISO-8859-1" : enc); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCharacterEncoding File: src/java/winstone/WinstoneResponse.java Repository: jenkinsci/winstone The code follows secure coding practices.
[ "CWE-79" ]
CVE-2011-4344
LOW
2.6
jenkinsci/winstone
getCharacterEncoding
src/java/winstone/WinstoneResponse.java
410ed3001d51c689cf59085b7417466caa2ded7b
0
Analyze the following code function for security vulnerabilities
public boolean isStoreRequestId() { return myStoreRequestId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isStoreRequestId File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
isStoreRequestId
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
protected Array makeArray(int oid, byte[] value) throws SQLException { return new PgArray(connection, oid, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeArray 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
makeArray
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public void stop(String packageName, int pid, int uid) { try { final String reason = TAG + ":stop"; mService.tempAllowlistTargetPkgIfPossible(getUid(), getPackageName(), pid, uid, packageName, reason); mCb.onStop(packageName, pid, uid); } catch (RemoteException e) { Log.e(TAG, "Remote failure in stop.", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stop File: services/core/java/com/android/server/media/MediaSessionRecord.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21280
MEDIUM
5.5
android
stop
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
private void installApexPackages(List<InstallRequest> requests) { if (requests.isEmpty()) { return; } if (requests.size() != 1) { throw new IllegalStateException( "Only a non-staged install of a single APEX is supported"); } InstallRequest request = requests.get(0); try { // Should directory scanning logic be moved to ApexManager for better test coverage? final File dir = request.mArgs.mOriginInfo.mResolvedFile; final File[] apexes = dir.listFiles(); if (apexes == null) { throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, dir.getAbsolutePath() + " is not a directory"); } if (apexes.length != 1) { throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, "Expected exactly one .apex file under " + dir.getAbsolutePath() + " got: " + apexes.length); } try (PackageParser2 packageParser = mPm.mInjector.getScanningPackageParser()) { mApexManager.installPackage(apexes[0], packageParser); } } catch (PackageManagerException e) { request.mInstallResult.setError("APEX installation failed", e); } PackageManagerService.invalidatePackageInfoCache(); mPm.notifyInstallObserver(request.mInstallResult, request.mArgs.mObserver); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installApexPackages File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
installApexPackages
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
public void addBadge(Badge b) { String badge = b.toString(); if (StringUtils.isBlank(badges)) { badges = ","; } badges = badges.concat(badge).concat(","); addRep(b.getReward()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addBadge File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
addBadge
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public String getAsString() { return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAsString File: src/main/java/org/projectforge/web/core/JsonBuilder.java Repository: micromata/projectforge-webapp The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-7250
LOW
3.5
micromata/projectforge-webapp
getAsString
src/main/java/org/projectforge/web/core/JsonBuilder.java
5a6a25366491443b76e528a04a9e4ba26f08a83c
0
Analyze the following code function for security vulnerabilities
public Renderer<?> getRenderer() { return (Renderer<?>) getState().renderer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRenderer File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getRenderer
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override public void onPerform(CommandEvent commandEvent) { if (!commandEvent.getGuild().getSelfMember().hasPermission(Permission.MANAGE_WEBHOOKS)) { Main.getInstance().getCommandManager().sendMessage("I need the permission `Manage Webhooks` to use this command!", commandEvent.getChannel(), commandEvent.getInteractionHook()); } if (commandEvent.isSlashCommand()) { Main.getInstance().getCommandManager().sendMessage("This Command doesn't support slash commands yet.", commandEvent.getChannel(), commandEvent.getInteractionHook()); return; } if(commandEvent.getArguments().length == 1) { if(commandEvent.getArguments()[0].equalsIgnoreCase("list")) { StringBuilder end = new StringBuilder("```\n"); for(String users : Main.getInstance().getSqlConnector().getSqlWorker().getAllSubreddits(commandEvent.getGuild().getId())) { end.append(users).append("\n"); } end.append("```"); Main.getInstance().getCommandManager().sendMessage(end.toString(), 10, commandEvent.getChannel(), commandEvent.getInteractionHook()); } else { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier list/add/remove", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } } else if(commandEvent.getArguments().length == 3) { if (commandEvent.getMessage().getMentions().getChannels(TextChannel.class).isEmpty()) { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier add/remove Subreddit #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); return; } String name = commandEvent.getArguments()[1]; if (commandEvent.getArguments()[0].equalsIgnoreCase("add")) { commandEvent.getMessage().getMentions().getChannels(TextChannel.class).get(0).createWebhook("Ree6-RedditNotifier-" + name).queue(w -> Main.getInstance().getSqlConnector().getSqlWorker().addRedditWebhook(commandEvent.getGuild().getId(), w.getId(), w.getToken(), name)); Main.getInstance().getCommandManager().sendMessage("A Reddit Notifier has been created for the Subreddit " + name + "!", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); if (!Main.getInstance().getNotifier().isSubredditRegistered(name)) { Main.getInstance().getNotifier().registerSubreddit(name); } } else if (commandEvent.getArguments()[0].equalsIgnoreCase("remove")) { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier remove Subreddit", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } else { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier add Subreddit #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } } else if(commandEvent.getArguments().length == 2) { String name = commandEvent.getArguments()[1]; if(commandEvent.getArguments()[0].equalsIgnoreCase("remove")) { Main.getInstance().getSqlConnector().getSqlWorker().removeRedditWebhook(commandEvent.getGuild().getId(), name); Main.getInstance().getCommandManager().sendMessage("A Reddit Notifier has been removed from the Subreddit " + name + "!", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); if (Main.getInstance().getNotifier().isSubredditRegistered(name)) { Main.getInstance().getNotifier().unregisterSubreddit(name); } } else if (commandEvent.getArguments()[0].equalsIgnoreCase("add")) { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier add Subreddit #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } else { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier remove Subreddit", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } } else { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier list/add/remove", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } Main.getInstance().getCommandManager().deleteMessage(commandEvent.getMessage(), commandEvent.getInteractionHook()); }
Vulnerability Classification: - CWE: CWE-863 - CVE: CVE-2022-39302 - Severity: MEDIUM - CVSS Score: 5.4 Description: Removed News-Channel. Fixed Cross-Server Channel Exploit. Fixed Temporal-Voice setup. Function: onPerform File: src/main/java/de/presti/ree6/commands/impl/community/RedditNotifier.java Repository: Ree6-Applications/Ree6 Fixed Code: @Override public void onPerform(CommandEvent commandEvent) { if (!commandEvent.getGuild().getSelfMember().hasPermission(Permission.MANAGE_WEBHOOKS)) { Main.getInstance().getCommandManager().sendMessage("I need the permission `Manage Webhooks` to use this command!", commandEvent.getChannel(), commandEvent.getInteractionHook()); } if (commandEvent.isSlashCommand()) { Main.getInstance().getCommandManager().sendMessage("This Command doesn't support slash commands yet.", commandEvent.getChannel(), commandEvent.getInteractionHook()); return; } if(commandEvent.getArguments().length == 1) { if(commandEvent.getArguments()[0].equalsIgnoreCase("list")) { StringBuilder end = new StringBuilder("```\n"); for(String users : Main.getInstance().getSqlConnector().getSqlWorker().getAllSubreddits(commandEvent.getGuild().getId())) { end.append(users).append("\n"); } end.append("```"); Main.getInstance().getCommandManager().sendMessage(end.toString(), 10, commandEvent.getChannel(), commandEvent.getInteractionHook()); } else { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier list/add/remove", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } } else if(commandEvent.getArguments().length == 3) { if (commandEvent.getMessage().getMentions().getChannels(TextChannel.class).isEmpty() || !commandEvent.getMessage().getMentions().getChannels(TextChannel.class).get(0).getGuild().getId().equals(commandEvent.getGuild().getId())) { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier add/remove Subreddit #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); return; } String name = commandEvent.getArguments()[1]; if (commandEvent.getArguments()[0].equalsIgnoreCase("add")) { commandEvent.getMessage().getMentions().getChannels(TextChannel.class).get(0).createWebhook("Ree6-RedditNotifier-" + name).queue(w -> Main.getInstance().getSqlConnector().getSqlWorker().addRedditWebhook(commandEvent.getGuild().getId(), w.getId(), w.getToken(), name)); Main.getInstance().getCommandManager().sendMessage("A Reddit Notifier has been created for the Subreddit " + name + "!", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); if (!Main.getInstance().getNotifier().isSubredditRegistered(name)) { Main.getInstance().getNotifier().registerSubreddit(name); } } else if (commandEvent.getArguments()[0].equalsIgnoreCase("remove")) { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier remove Subreddit", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } else { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier add Subreddit #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } } else if(commandEvent.getArguments().length == 2) { String name = commandEvent.getArguments()[1]; if(commandEvent.getArguments()[0].equalsIgnoreCase("remove")) { Main.getInstance().getSqlConnector().getSqlWorker().removeRedditWebhook(commandEvent.getGuild().getId(), name); Main.getInstance().getCommandManager().sendMessage("A Reddit Notifier has been removed from the Subreddit " + name + "!", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); if (Main.getInstance().getNotifier().isSubredditRegistered(name)) { Main.getInstance().getNotifier().unregisterSubreddit(name); } } else if (commandEvent.getArguments()[0].equalsIgnoreCase("add")) { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier add Subreddit #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } else { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier remove Subreddit", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } } else { Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "redditnotifier list/add/remove", 5, commandEvent.getChannel(), commandEvent.getInteractionHook()); } Main.getInstance().getCommandManager().deleteMessage(commandEvent.getMessage(), commandEvent.getInteractionHook()); }
[ "CWE-863" ]
CVE-2022-39302
MEDIUM
5.4
Ree6-Applications/Ree6
onPerform
src/main/java/de/presti/ree6/commands/impl/community/RedditNotifier.java
459b5bc24f0ea27e50031f563373926e94b9aa0a
1
Analyze the following code function for security vulnerabilities
static byte[] hexStringToBytes(String s) { if (s == null || s.length() == 0) return null; int len = s.length(); if (len % 2 != 0) { s = '0' + s; len++; } byte[] data = new byte[len / 2]; for (int i = 0; i < len; i += 2) { data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16)); } return data; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hexStringToBytes File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
hexStringToBytes
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
public String selectHeaderContentType(String[] contentTypes) { if (contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { if (isJsonMime(contentType)) { return contentType; } } return contentTypes[0]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectHeaderContentType File: samples/client/petstore/java/jersey2-java8/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
selectHeaderContentType
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public ExtensionRegistry.ExtensionInfo findExtensionByName( ExtensionRegistry registry, String name) { return registry.findImmutableExtensionByName(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findExtensionByName File: java/core/src/main/java/com/google/protobuf/MessageReflection.java Repository: protocolbuffers/protobuf The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-3509
HIGH
7.5
protocolbuffers/protobuf
findExtensionByName
java/core/src/main/java/com/google/protobuf/MessageReflection.java
a3888f53317a8018e7a439bac4abeb8f3425d5e9
0
Analyze the following code function for security vulnerabilities
private void restorePosition(int originalOffset, int originalColumnNumber, int originalCharacterOffset) { this.offset = originalOffset; this.columnNumber_ = originalColumnNumber; this.characterOffset_ = originalCharacterOffset; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: restorePosition File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
restorePosition
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
public void addInput(ProfileInput input) { ProfileInput curInput = getInput(input.getName()); if (curInput != null) { inputs.remove(curInput); } inputs.add(input); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addInput File: base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
addInput
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
protected String _idFrom(Object value, Class<?> cls, TypeFactory typeFactory) { // Need to ensure that "enum subtypes" work too if (ClassUtil.isEnumType(cls)) { if (!cls.isEnum()) { // means that it's sub-class of base enum, so: cls = cls.getSuperclass(); } } String str = cls.getName(); if (str.startsWith(JAVA_UTIL_PKG)) { // 25-Jan-2009, tatu: There are some internal classes that we cannot access as is. // We need better mechanism; for now this has to do... // Enum sets and maps are problematic since we MUST know type of // contained enums, to be able to deserialize. // In addition, EnumSet is not a concrete type either if (value instanceof EnumSet<?>) { // Regular- and JumboEnumSet... Class<?> enumClass = ClassUtil.findEnumType((EnumSet<?>) value); // not optimal: but EnumSet is not a customizable type so this is sort of ok str = typeFactory.constructCollectionType(EnumSet.class, enumClass).toCanonical(); } else if (value instanceof EnumMap<?,?>) { Class<?> enumClass = ClassUtil.findEnumType((EnumMap<?,?>) value); Class<?> valueClass = Object.class; // not optimal: but EnumMap is not a customizable type so this is sort of ok str = typeFactory.constructMapType(EnumMap.class, enumClass, valueClass).toCanonical(); } // 10-Jan-2018, tatu: Up until 2.9.4 we used to have other conversions for `Collections.xxx()` // and `Arrays.asList(...)`; but it was changed to be handled on receiving end instead } else if (str.indexOf('$') >= 0) { /* Other special handling may be needed for inner classes, * The best way to handle would be to find 'hidden' constructor; pass parent * value etc (which is actually done for non-anonymous static classes!), * but that is just not possible due to various things. So, we will instead * try to generalize type into something we will be more likely to be able * construct. */ Class<?> outer = ClassUtil.getOuterClass(cls); if (outer != null) { // one more check: let's actually not worry if the declared static type is // non-static as well; if so, deserializer does have a chance at figuring it all out. Class<?> staticType = _baseType.getRawClass(); if (ClassUtil.getOuterClass(staticType) == null) { // Is this always correct? Seems like it should be... cls = _baseType.getRawClass(); str = cls.getName(); } } } return str; }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2019-16942 - Severity: HIGH - CVSS Score: 7.5 Description: More clean up after #2478 Function: _idFrom File: src/main/java/com/fasterxml/jackson/databind/jsontype/impl/ClassNameIdResolver.java Repository: FasterXML/jackson-databind Fixed Code: protected String _idFrom(Object value, Class<?> cls, TypeFactory typeFactory) { // Need to ensure that "enum subtypes" work too if (ClassUtil.isEnumType(cls)) { // 29-Sep-2019, tatu: `Class.isEnum()` only returns true for main declaration, // but NOT from sub-class thereof (extending individual values). This // is why additional resolution is needed: we want class that contains // enumeration instances. if (!cls.isEnum()) { // and this parent would then have `Enum.class` as its parent: cls = cls.getSuperclass(); } } String str = cls.getName(); if (str.startsWith(JAVA_UTIL_PKG)) { // 25-Jan-2009, tatu: There are some internal classes that we cannot access as is. // We need better mechanism; for now this has to do... // Enum sets and maps are problematic since we MUST know type of // contained enums, to be able to deserialize. // In addition, EnumSet is not a concrete type either if (value instanceof EnumSet<?>) { // Regular- and JumboEnumSet... Class<?> enumClass = ClassUtil.findEnumType((EnumSet<?>) value); // not optimal: but EnumSet is not a customizable type so this is sort of ok str = typeFactory.constructCollectionType(EnumSet.class, enumClass).toCanonical(); } else if (value instanceof EnumMap<?,?>) { Class<?> enumClass = ClassUtil.findEnumType((EnumMap<?,?>) value); Class<?> valueClass = Object.class; // not optimal: but EnumMap is not a customizable type so this is sort of ok str = typeFactory.constructMapType(EnumMap.class, enumClass, valueClass).toCanonical(); } // 10-Jan-2018, tatu: Up until 2.9.4 we used to have other conversions for `Collections.xxx()` // and `Arrays.asList(...)`; but it was changed to be handled on receiving end instead } else if (str.indexOf('$') >= 0) { /* Other special handling may be needed for inner classes, * The best way to handle would be to find 'hidden' constructor; pass parent * value etc (which is actually done for non-anonymous static classes!), * but that is just not possible due to various things. So, we will instead * try to generalize type into something we will be more likely to be able * construct. */ Class<?> outer = ClassUtil.getOuterClass(cls); if (outer != null) { // one more check: let's actually not worry if the declared static type is // non-static as well; if so, deserializer does have a chance at figuring it all out. Class<?> staticType = _baseType.getRawClass(); if (ClassUtil.getOuterClass(staticType) == null) { // Is this always correct? Seems like it should be... cls = _baseType.getRawClass(); str = cls.getName(); } } } return str; }
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
_idFrom
src/main/java/com/fasterxml/jackson/databind/jsontype/impl/ClassNameIdResolver.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
1
Analyze the following code function for security vulnerabilities
@Override protected void setUp() throws Exception { Context appContext = getInstrumentation().getTargetContext().getApplicationContext(); mBrowserContext = new AwBrowserContext(new InMemorySharedPreferences(), appContext); super.setUp(); if (needsBrowserProcessStarted()) { startBrowserProcess(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUp File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5155
MEDIUM
4.3
chromium
setUp
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
0
Analyze the following code function for security vulnerabilities
public TransactionSynchronizationManager txSynchronizationManager() { return transactionSynchronizationManager; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: txSynchronizationManager File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
txSynchronizationManager
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
private void sendPackageAddedForUser(String packageName, PackageSetting pkgSetting, int userId) { Bundle extras = new Bundle(1); extras.putInt(Intent.EXTRA_UID, UserHandle.getUid(userId, pkgSetting.appId)); sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED, packageName, extras, null, null, new int[] {userId}); try { IActivityManager am = ActivityManagerNative.getDefault(); final boolean isSystem = isSystemApp(pkgSetting) || isUpdatedSystemApp(pkgSetting); if (isSystem && am.isUserRunning(userId, false)) { // The just-installed/enabled app is bundled on the system, so presumed // to be able to run automatically without needing an explicit launch. // Send it a BOOT_COMPLETED if it would ordinarily have gotten one. Intent bcIntent = new Intent(Intent.ACTION_BOOT_COMPLETED) .addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES) .setPackage(packageName); am.broadcastIntent(null, bcIntent, null, null, 0, null, null, null, android.app.AppOpsManager.OP_NONE, null, false, false, userId); } } catch (RemoteException e) { // shouldn't happen Slog.w(TAG, "Unable to bootstrap installed package", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendPackageAddedForUser 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
sendPackageAddedForUser
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public JSONObject put(String key, Collection<?> value) throws JSONException { return this.put(key, new JSONArray(value)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
put
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
@Override public void cancelMissedCallsNotification(String callingPackage) { try { Log.startSession("TSI.cMCN", Log.getPackageAbbreviation(callingPackage)); synchronized (mLock) { enforcePermissionOrPrivilegedDialer(MODIFY_PHONE_STATE, callingPackage); UserHandle userHandle = Binder.getCallingUserHandle(); long token = Binder.clearCallingIdentity(); try { mCallsManager.getMissedCallNotifier().clearMissedCalls(userHandle); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelMissedCallsNotification File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
cancelMissedCallsNotification
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
public String[] getExcludedRegionsNormalized() { return (excludedRegions == null || excludedRegions.trim().equals("")) ? null : excludedRegions.split("[\\r\\n]+"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExcludedRegionsNormalized 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
getExcludedRegionsNormalized
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
@Deprecated protected void showVariables( final String uri, final HttpServletResponse response, final String namespace, final boolean includeDoc, final DisplayType displayType, final String... vars ) throws IOException { showVariables(uri, response, namespace, null, includeDoc, displayType, vars); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showVariables File: varexport/src/main/java/com/indeed/util/varexport/servlet/ViewExportedVariablesServlet.java Repository: indeedeng/util The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36634
MEDIUM
5.4
indeedeng/util
showVariables
varexport/src/main/java/com/indeed/util/varexport/servlet/ViewExportedVariablesServlet.java
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
0
Analyze the following code function for security vulnerabilities
public IntentBuilder setRequestGatekeeperPasswordHandle( boolean requestGatekeeperPasswordHandle) { mIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_REQUEST_GK_PW_HANDLE, requestGatekeeperPasswordHandle); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRequestGatekeeperPasswordHandle File: src/com/android/settings/password/ChooseLockPassword.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
setRequestGatekeeperPasswordHandle
src/com/android/settings/password/ChooseLockPassword.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
@Test public void testMethodBaseWithMaliciousRequest() throws WebdavException { assertNotNull(methodBase.parseContent(request, response)); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-20000 - Severity: MEDIUM - CVSS Score: 5.0 Description: format: follow the repo code style, and welcome mvnvm props to manage maven versions Function: testMethodBaseWithMaliciousRequest File: src/test/java/org/bedework/webdav/servlet/common/TestSecureXmlTypes.java Repository: Bedework/bw-webdav Fixed Code: @Test public void testMethodBaseWithMaliciousRequest() throws WebdavException { assertNotNull(methodBase.parseContent(request, response)); }
[ "CWE-611" ]
CVE-2018-20000
MEDIUM
5
Bedework/bw-webdav
testMethodBaseWithMaliciousRequest
src/test/java/org/bedework/webdav/servlet/common/TestSecureXmlTypes.java
0ce2007b3515a23b5f287ef521300bcb1f748edc
1
Analyze the following code function for security vulnerabilities
@Override public int checkPermission(@NonNull String packageName, @NonNull String permissionName, int userId, @NonNull TriFunction<String, String, Integer, Integer> superImpl) { if (mDelegatedPackageName.equals(packageName) && isDelegatedPermission(permissionName)) { final long identity = Binder.clearCallingIdentity(); try { return superImpl.apply("com.android.shell", permissionName, userId); } finally { Binder.restoreCallingIdentity(identity); } } return superImpl.apply(packageName, permissionName, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermission File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
checkPermission
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
public void saveWithProgrammingRights(String comment, boolean minorEdit) throws XWikiException { if (hasProgrammingRights()) { // The rights check above is generic, but the current method is a save operation, thus it should not be // performed if the document's wiki is in read only mode. XWikiContext context = getXWikiContext(); String currentWikiId = context.getWikiId(); try { // Make sure we check the current document's wiki and not the current context's wiki. context.setWikiId(getWiki()); if (!context.getWiki().isReadOnly()) { saveDocument(comment, minorEdit, false); } else { java.lang.Object[] args = { getDefaultEntityReferenceSerializer().serialize(getDocumentReference()), getWiki() }; throw new XWikiException(XWikiException.MODULE_XWIKI_ACCESS, XWikiException.ERROR_XWIKI_ACCESS_DENIED, "Access denied in edit mode on document [{0}]. The wiki [{1}] is in read only mode.", null, args); } } finally { // Restore the context wiki. context.setWikiId(currentWikiId); } } else { java.lang.Object[] args = { this.getFullName() }; throw new XWikiException(XWikiException.MODULE_XWIKI_ACCESS, XWikiException.ERROR_XWIKI_ACCESS_DENIED, "Access denied with no programming rights document {0}", null, args); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveWithProgrammingRights 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
saveWithProgrammingRights
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
public Enum[] getEnumConstants() { return (Enum[])clazz.getEnumConstants(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEnumConstants File: core/src/main/java/hudson/model/Descriptor.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getEnumConstants
core/src/main/java/hudson/model/Descriptor.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public BrowserLiveReload getLiveReload() { return liveReload; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLiveReload File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
getLiveReload
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0
Analyze the following code function for security vulnerabilities
private void enforceFeature(String feature) { PackageManager pm = mContext.getPackageManager(); if (!pm.hasSystemFeature(feature)) { throw new UnsupportedOperationException( "System does not support feature " + feature); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceFeature File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
enforceFeature
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
@Override protected void dumpFilter(PrintWriter out, String prefix, PackageParser.ServiceIntentInfo filter) { out.print(prefix); out.print( Integer.toHexString(System.identityHashCode(filter.service))); out.print(' '); filter.service.printComponentShortName(out); out.print(" filter "); out.println(Integer.toHexString(System.identityHashCode(filter))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpFilter 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
dumpFilter
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
ActiveAdmin getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked() { ensureLocked(); ActiveAdmin admin = getDeviceOwnerAdminLocked(); if (admin == null) { admin = getProfileOwnerOfOrganizationOwnedDeviceLocked(); } return admin; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked 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
getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public JsonDeserializer<?> createReferenceDeserializer(DeserializationContext ctxt, ReferenceType type, BeanDescription beanDesc) throws JsonMappingException { JavaType contentType = type.getContentType(); // Very first thing: is deserializer hard-coded for elements? JsonDeserializer<Object> contentDeser = contentType.getValueHandler(); final DeserializationConfig config = ctxt.getConfig(); // Then optional type info: if type has been resolved, we may already know type deserializer: TypeDeserializer contentTypeDeser = contentType.getTypeHandler(); if (contentTypeDeser == null) { // or if not, may be able to find: contentTypeDeser = findTypeDeserializer(config, contentType); } JsonDeserializer<?> deser = _findCustomReferenceDeserializer(type, config, beanDesc, contentTypeDeser, contentDeser); if (deser == null) { // Just one referential type as of JDK 1.7 / Java 7: AtomicReference (Java 8 adds Optional) if (type.isTypeOrSubTypeOf(AtomicReference.class)) { Class<?> rawType = type.getRawClass(); ValueInstantiator inst; if (rawType == AtomicReference.class) { inst = null; } else { /* 23-Oct-2016, tatu: Note that subtypes are probably not supportable * without either forcing merging (to avoid having to create instance) * or something else... */ inst = findValueInstantiator(ctxt, beanDesc); } return new AtomicReferenceDeserializer(type, inst, contentTypeDeser, contentDeser); } } if (deser != null) { // and then post-process if (_factoryConfig.hasDeserializerModifiers()) { for (BeanDeserializerModifier mod : _factoryConfig.deserializerModifiers()) { deser = mod.modifyReferenceDeserializer(config, type, beanDesc, deser); } } } return deser; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createReferenceDeserializer 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
createReferenceDeserializer
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(value = MANAGE_DEVICE_POLICY_WIFI, conditional = true) public void setConfiguredNetworksLockdownState( @Nullable ComponentName admin, boolean lockdown) { throwIfParentInstance("setConfiguredNetworksLockdownState"); if (mService != null) { try { mService.setConfiguredNetworksLockdownState( admin, mContext.getPackageName(), lockdown); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setConfiguredNetworksLockdownState File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setConfiguredNetworksLockdownState
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private VaadinSession createAndRegisterSession(VaadinRequest request) { assert ((ReentrantLock) getSessionLock(request.getWrappedSession())) .isHeldByCurrentThread() : "Session has not been locked by this thread"; VaadinSession session = createVaadinSession(request); VaadinSession.setCurrent(session); storeSession(session, request.getWrappedSession()); // Initial WebBrowser data comes from the request session.setBrowser(new WebBrowser(request)); session.setConfiguration(getDeploymentConfiguration()); // Initial locale comes from the request if (getInstantiator().getI18NProvider() != null) { setLocale(request, session); } onVaadinSessionStarted(request, session); return session; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createAndRegisterSession File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
createAndRegisterSession
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
public static HttpRequest patch(final String destination) { return new HttpRequest() .method(HttpMethod.PATCH) .set(destination); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: patch File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
patch
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
@Nullable protected String getText(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); StandardEvaluationContext context = new StandardEvaluationContext(root); context.addPropertyAccessor(new MapAccessor()); return message.getValue(context, String.class); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-46166 - Severity: CRITICAL - CVSS Score: 9.8 Description: feat: improve notifiers Function: getText File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/TelegramNotifier.java Repository: codecentric/spring-boot-admin Fixed Code: @Nullable protected String getText(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); SimpleEvaluationContext context = SimpleEvaluationContext .forPropertyAccessors(DataBindingPropertyAccessor.forReadOnlyAccess(), new MapAccessor()) .withRootObject(root).build(); return message.getValue(context, String.class); }
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getText
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/TelegramNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
1
Analyze the following code function for security vulnerabilities
public String getCertificateFile() { return prop.getProperty(TS_CERTIFICATE_FILE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCertificateFile File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getCertificateFile
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
@Override public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element element = toDOM(document); document.appendChild(element); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: toXML File: base/common/src/main/java/com/netscape/certsrv/key/KeyRequestInfo.java Repository: dogtagpki/pki Fixed Code: @Override public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element element = toDOM(document); document.appendChild(element); TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
toXML
base/common/src/main/java/com/netscape/certsrv/key/KeyRequestInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
public NotificationChannelGroup getGroup(String pkg, int uid, String groupId) { if (groupId == null) { return null; } try { return sINM.getNotificationChannelGroupForPackage(groupId, pkg, uid); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getGroup File: src/com/android/settings/notification/NotificationBackend.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
getGroup
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
private static String[] splitInitialLine(AppendableCharSequence sb) { int aStart; int aEnd; int bStart; int bEnd; int cStart; int cEnd; aStart = findNonWhitespace(sb, 0); aEnd = findWhitespace(sb, aStart); bStart = findNonWhitespace(sb, aEnd); bEnd = findWhitespace(sb, bStart); cStart = findNonWhitespace(sb, bEnd); cEnd = findEndOfString(sb); return new String[] { sb.subStringUnsafe(aStart, aEnd), sb.subStringUnsafe(bStart, bEnd), cStart < cEnd? sb.subStringUnsafe(cStart, cEnd) : "" }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: splitInitialLine File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java Repository: netty The code follows secure coding practices.
[ "CWE-444" ]
CVE-2019-16869
MEDIUM
5
netty
splitInitialLine
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
39cafcb05c99f2aa9fce7e6597664c9ed6a63a95
0
Analyze the following code function for security vulnerabilities
@DELETE @Path("{userCriteria}/roles/{roleName}") public Response deleteRole(@Context final SecurityContext securityContext, @PathParam("userCriteria") final String userCriteria, @PathParam("roleName") final String roleName) { writeLock(); try { if (!hasEditRights(securityContext)) { throw getException(Status.BAD_REQUEST, "User {} does not have write access to users!", securityContext.getUserPrincipal().getName()); } if (! Authentication.isValidRole(roleName)) { throw getException(Status.BAD_REQUEST, "Invalid role {}!", roleName); } final OnmsUser user = getOnmsUser(userCriteria); boolean modified = false; if (user.getRoles().contains(roleName)) { user.getRoles().remove(roleName); modified = true; } if (modified) { LOG.debug("deleteRole: user {} updated", user); try { m_userManager.save(user); } catch (final Throwable t) { throw getException(Status.INTERNAL_SERVER_ERROR, t); } return Response.noContent().build(); } return Response.notModified().build(); } finally { writeUnlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteRole File: opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/UserRestService.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-0872
HIGH
8
OpenNMS/opennms
deleteRole
opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/UserRestService.java
34ab169a74b2bc489ab06d0dbf33fee1ed94c93c
0
Analyze the following code function for security vulnerabilities
public void gotoPage(String space, String page, String action, Object... queryParameters) { gotoPage(space, page, action, toQueryString(queryParameters)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gotoPage 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
gotoPage
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
@Override public void setIgnorePermissions(final boolean ignorePermissions) { this.ignorePermissions = ignorePermissions; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIgnorePermissions File: src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java Repository: codehaus-plexus/plexus-archiver The code follows secure coding practices.
[ "CWE-22", "CWE-61" ]
CVE-2023-37460
CRITICAL
9.8
codehaus-plexus/plexus-archiver
setIgnorePermissions
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
54759839fbdf85caf8442076f001d5fd64e0dcb2
0
Analyze the following code function for security vulnerabilities
protected String getCarrierAppPackageName() { UiccCard card = UiccController.getInstance().getUiccCard(mPhone.getPhoneId()); if (card == null) { return null; } List<String> carrierPackages = card.getCarrierPackageNamesForIntent( mContext.getPackageManager(), new Intent(CarrierMessagingService.SERVICE_INTERFACE)); return (carrierPackages != null && carrierPackages.size() == 1) ? carrierPackages.get(0) : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCarrierAppPackageName File: src/java/com/android/internal/telephony/SMSDispatcher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3858
HIGH
9.3
android
getCarrierAppPackageName
src/java/com/android/internal/telephony/SMSDispatcher.java
df31d37d285dde9911b699837c351aed2320b586
0
Analyze the following code function for security vulnerabilities
@Deprecated public boolean getAutoTimeRequired() { throwIfParentInstance("getAutoTimeRequired"); if (mService != null) { try { return mService.getAutoTimeRequired(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAutoTimeRequired File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getAutoTimeRequired
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
static XmlSchema createSchemaInstance(ThreadContext context, RubyClass klazz, Source source) { Ruby runtime = context.getRuntime(); XmlRelaxng xmlRelaxng = (XmlRelaxng) NokogiriService.XML_RELAXNG_ALLOCATOR.allocate(runtime, klazz); xmlRelaxng.setInstanceVariable("@errors", runtime.newEmptyArray()); try { Schema schema = xmlRelaxng.getSchema(source, context); xmlRelaxng.setVerifier(schema.newVerifier()); return xmlRelaxng; } catch (VerifierConfigurationException ex) { throw context.getRuntime().newRuntimeError("Could not parse document: " + ex.getMessage()); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2020-26247 - Severity: MEDIUM - CVSS Score: 4.0 Description: feat: XML::Schema and RelaxNG creation accept optional ParseOptions I'm trying out a new pattern, which is that the parsed object carries around the ParseOptions it was created with, which should make some testing a bit easier. I'm also not implementing the "config block" pattern in use for Documents, because I think the UX is weird and I'm hoping to change everything to use kwargs in a 2.0 release, anyway. Function: createSchemaInstance File: ext/java/nokogiri/XmlRelaxng.java Repository: sparklemotion/nokogiri Fixed Code: static XmlSchema createSchemaInstance(ThreadContext context, RubyClass klazz, Source source, IRubyObject parseOptions) { Ruby runtime = context.getRuntime(); XmlRelaxng xmlRelaxng = (XmlRelaxng) NokogiriService.XML_RELAXNG_ALLOCATOR.allocate(runtime, klazz); if (parseOptions == null) { parseOptions = defaultParseOptions(context.getRuntime()); } xmlRelaxng.setInstanceVariable("@errors", runtime.newEmptyArray()); xmlRelaxng.setInstanceVariable("@parse_options", parseOptions); try { Schema schema = xmlRelaxng.getSchema(source, context); xmlRelaxng.setVerifier(schema.newVerifier()); return xmlRelaxng; } catch (VerifierConfigurationException ex) { throw context.getRuntime().newRuntimeError("Could not parse document: " + ex.getMessage()); } }
[ "CWE-611" ]
CVE-2020-26247
MEDIUM
4
sparklemotion/nokogiri
createSchemaInstance
ext/java/nokogiri/XmlRelaxng.java
9c87439d9afa14a365ff13e73adc809cb2c3d97b
1
Analyze the following code function for security vulnerabilities
private void addWarning(Issue msg, Object... parameters) { mWarnings.add(new IssueWithParams(msg, parameters)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addWarning File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
addWarning
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
protected String pageInbox(Map<String, Object> data) { String html = ""; try { UserviewMenu menu = null; if ("current".equals(getPropertyString("inbox"))) { menu = new InboxMenu(); } else if ("all".equals(getPropertyString("inbox"))) { menu = new UniversalInboxMenu(); } if (menu != null) { userview.setProperty("pageNotFoundMenu", menu); Map<String, Object> props = new HashMap<String, Object>(); props.put("id", INBOX); props.put("customId", INBOX); props.put("menuId", INBOX); props.put("label", ""); if ("current".equals(getPropertyString("inbox"))) { props.put(InboxMenu.PROPERTY_FILTER, InboxMenu.PROPERTY_FILTER_ALL); } menu.setRequestParameters(userview.getParams()); menu.setProperties(props); menu.setUserview(userview); menu.setUrl(data.get("base_link") + INBOX); menu.setKey(userview.getParamString("key")); html += UserviewUtil.getUserviewMenuHtml(menu); } } catch (Exception e) { html += handleContentError(e, data); } return html; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pageInbox File: wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java Repository: jogetworkflow/jw-community The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4560
MEDIUM
6.1
jogetworkflow/jw-community
pageInbox
wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
0
Analyze the following code function for security vulnerabilities
@Pure public @Nullable Clob getClob(int i) throws SQLException { byte[] value = getRawValue(i); if (value == null) { return null; } return makeClob(getLong(i)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClob 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
getClob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public void setProcessLimit(int max) { enforceCallingPermission(android.Manifest.permission.SET_PROCESS_LIMIT, "setProcessLimit()"); synchronized (this) { mConstants.setOverrideMaxCachedProcesses(max); trimApplicationsLocked(true, OomAdjuster.OOM_ADJ_REASON_PROCESS_END); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProcessLimit 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
setProcessLimit
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public Map<String, MapSession> findByIndexNameAndIndexValue(String indexName, String indexValue) { if (!PRINCIPAL_NAME_INDEX_NAME.equals(indexName)) { return Collections.emptyMap(); } return cache.getNativeCache().values().stream() .map(cacheValue -> (MapSession) cacheValue) .filter(session -> indexValue.equals(principalNameResolver.resolvePrincipal(session))) .collect(Collectors.toMap(MapSession::getId, Function.identity())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findByIndexNameAndIndexValue File: spring/spring5/spring5-common/src/main/java/org/infinispan/spring/common/session/AbstractInfinispanSessionRepository.java Repository: infinispan The code follows secure coding practices.
[ "CWE-384" ]
CVE-2019-10158
HIGH
7.5
infinispan
findByIndexNameAndIndexValue
spring/spring5/spring5-common/src/main/java/org/infinispan/spring/common/session/AbstractInfinispanSessionRepository.java
f3efef8de7fec4108dd5ab725cea6ae09f14815d
0
Analyze the following code function for security vulnerabilities
private boolean apnTypesMatch(String[] apnTypesArray1, String apnTypes2) { if (ArrayUtils.isEmpty(apnTypesArray1)) { return false; } if (hasAllApns(apnTypesArray1) || TextUtils.isEmpty(apnTypes2)) { return true; } final List apnTypesList1 = Arrays.asList(apnTypesArray1); final String[] apnTypesArray2 = apnTypes2.split(","); for (String apn : apnTypesArray2) { if (apnTypesList1.contains(apn.trim())) { Log.d(TAG, "apnTypesMatch: true because match found for " + apn.trim()); return true; } } Log.d(TAG, "apnTypesMatch: false"); return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: apnTypesMatch File: src/com/android/settings/network/apn/ApnEditor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40125
HIGH
7.8
android
apnTypesMatch
src/com/android/settings/network/apn/ApnEditor.java
63d464c3fa5c7b9900448fef3844790756e557eb
0
Analyze the following code function for security vulnerabilities
public void processShutdownSignal(ShutdownSignalException signal, boolean ignoreClosed, boolean notifyRpc) { try { synchronized (_channelMutex) { if (!setShutdownCauseIfOpen(signal)) { if (!ignoreClosed) throw new AlreadyClosedException(getCloseReason()); } _channelMutex.notifyAll(); } } finally { if (notifyRpc) notifyOutstandingRpc(signal); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processShutdownSignal File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
processShutdownSignal
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@Override public void finishAndRemoveTask() { checkCaller(); synchronized (ActivityManagerService.this) { long origId = Binder.clearCallingIdentity(); try { if (!removeTaskByIdLocked(mTaskId, false)) { throw new IllegalArgumentException("Unable to find task ID " + mTaskId); } } finally { Binder.restoreCallingIdentity(origId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishAndRemoveTask File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
finishAndRemoveTask
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
protected void handlePortableFactories(Node node, BeanDefinitionBuilder serializationConfigBuilder) { ManagedMap<Integer, BeanReference> factories = new ManagedMap<Integer, BeanReference>(); ManagedMap<Integer, String> classNames = new ManagedMap<Integer, String>(); for (Node child : childElements(node)) { String name = cleanNodeName(child); if ("portable-factory".equals(name)) { NamedNodeMap attributes = child.getAttributes(); Node implRef = attributes.getNamedItem("implementation"); Node classNode = attributes.getNamedItem("class-name"); Node fidNode = attributes.getNamedItem("factory-id"); if (implRef != null) { factories.put(parseInt(getTextContent(fidNode)), new RuntimeBeanReference(getTextContent(implRef))); } if (classNode != null) { classNames.put(parseInt(getTextContent(fidNode)), getTextContent(classNode)); } } } serializationConfigBuilder.addPropertyValue("portableFactoryClasses", classNames); serializationConfigBuilder.addPropertyValue("portableFactories", factories); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handlePortableFactories File: hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
handlePortableFactories
hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private HttpSession getHttpSession() { Session session = this.container.getSession(); if (session instanceof ServletSession) { HttpSession httpSession = ((ServletSession) session).getHttpSession(); this.logger.debug("Session: {}", httpSession.getId()); return httpSession; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHttpSession File: oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java Repository: xwiki-contrib/oidc The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39387
HIGH
7.5
xwiki-contrib/oidc
getHttpSession
oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
0247af1417925b9734ab106ad7cd934ee870ac89
0
Analyze the following code function for security vulnerabilities
boolean enterPictureInPictureMode(@NonNull ActivityRecord r, PictureInPictureParams params) { // If the activity is already in picture in picture mode, then just return early if (r.inPinnedWindowingMode()) { return true; } // Activity supports picture-in-picture, now check that we can enter PiP at this // point, if it is if (!r.checkEnterPictureInPictureState("enterPictureInPictureMode", false /* beforeStopping */)) { return false; } final Runnable enterPipRunnable = () -> { synchronized (mGlobalLock) { if (r.getParent() == null) { Slog.e(TAG, "Skip enterPictureInPictureMode, destroyed " + r); return; } r.setPictureInPictureParams(params); mRootWindowContainer.moveActivityToPinnedRootTask(r, null /* launchIntoPipHostActivity */, "enterPictureInPictureMode"); final Task task = r.getTask(); // Continue the pausing process after entering pip. if (task.getPausingActivity() == r) { task.schedulePauseActivity(r, false /* userLeaving */, false /* pauseImmediately */, "auto-pip"); } } }; if (r.isKeyguardLocked()) { // If the keyguard is showing or occluded, then try and dismiss it before // entering picture-in-picture (this will prompt the user to authenticate if the // device is currently locked). mActivityClientController.dismissKeyguard(r.token, new KeyguardDismissCallback() { @Override public void onDismissSucceeded() { mH.post(enterPipRunnable); } }, null /* message */); } else { // Enter picture in picture immediately otherwise enterPipRunnable.run(); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enterPictureInPictureMode 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
enterPictureInPictureMode
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public HttpRequest queryRemove(final String name) { query.remove(name); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryRemove File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
queryRemove
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
void initAppOpsState() { if (mAppOp == OP_NONE || !mAppOpVisibility) { return; } // If the app op was MODE_DEFAULT we would have checked the permission // and add the window only if the permission was granted. Therefore, if // the mode is MODE_DEFAULT we want the op to succeed as the window is // shown. final int mode = mWmService.mAppOps.startOpNoThrow(mAppOp, getOwningUid(), getOwningPackage(), true /* startIfModeDefault */, null /* featureId */, "init-default-visibility"); if (mode != MODE_ALLOWED && mode != MODE_DEFAULT) { setAppOpVisibilityLw(false); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initAppOpsState 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
initAppOpsState
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override public String[] getValueNames() { Map<String, Object> values = this.values; if (values == null || values.isEmpty()) { return EmptyArrays.EMPTY_STRINGS; } return values.keySet().toArray(new String[values.size()]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValueNames File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
getValueNames
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
public boolean isArtifactsDeleted() { return isArtifactsDeleted; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isArtifactsDeleted File: common/src/main/java/com/thoughtworks/go/domain/DirectoryEntries.java Repository: gocd The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-43288
LOW
3.5
gocd
isArtifactsDeleted
common/src/main/java/com/thoughtworks/go/domain/DirectoryEntries.java
f5c1d2aa9ab302a97898a6e4b16218e64fe8e9e4
0
Analyze the following code function for security vulnerabilities
@Override public Media createBackgroundMedia(final String uri) throws IOException { int mediaId = nextMediaId++; backgroundMediaCount++; Intent serviceIntent = new Intent(getContext(), AudioService.class); serviceIntent.putExtra("mediaLink", uri); serviceIntent.putExtra("mediaId", mediaId); if (background == null) { ServiceConnection mConnection = new ServiceConnection() { public void onServiceDisconnected(ComponentName name) { background = null; backgroundMediaServiceConnection = null; } public void onServiceConnected(ComponentName name, IBinder service) { AudioService.LocalBinder mLocalBinder = (AudioService.LocalBinder) service; AudioService svc = (AudioService)mLocalBinder.getService(); background = svc; } }; backgroundMediaServiceConnection = mConnection; boolean boundSuccess = getContext().bindService(serviceIntent, mConnection, getContext().BIND_AUTO_CREATE); if (!boundSuccess) { throw new RuntimeException("Failed to bind background media service for uri "+uri); } ContextCompat.startForegroundService(getContext(), serviceIntent); while (background == null) { Display.getInstance().invokeAndBlock(new Runnable() { @Override public void run() { Util.sleep(200); } }); } } else { ContextCompat.startForegroundService(getContext(), serviceIntent); } while (background.getMedia(mediaId) == null) { Display.getInstance().invokeAndBlock(new Runnable() { public void run() { Util.sleep(200); } }); } Media ret = new MediaProxy(background.getMedia(mediaId)) { @Override public void cleanup() { super.cleanup(); if (--backgroundMediaCount <= 0) { if (backgroundMediaServiceConnection != null) { try { getContext().unbindService(backgroundMediaServiceConnection); } catch (IllegalArgumentException ex) { // This is thrown sometimes if the service has already been unbound } } } } }; return ret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createBackgroundMedia 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
createBackgroundMedia
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
void inspectTaskModelResumeAvailableOnDB(List<ConnectionModel> connectionOnDBList) { // check resume available final long offset; final int connectionCount = model.getConnectionCount(); final String tempFilePath = model.getTempFilePath(); final String targetFilePath = model.getTargetFilePath(); final boolean isMultiConnection = connectionCount > 1; if (isNeedForceDiscardRange) { offset = 0; } else if (isMultiConnection && !supportSeek) { // can't support seek for multi-connection is fatal problem, so discard resume. offset = 0; } else { final boolean resumeAvailable = FileDownloadUtils .isBreakpointAvailable(model.getId(), model); if (resumeAvailable) { if (!supportSeek) { offset = new File(tempFilePath).length(); } else { if (isMultiConnection) { // when it is multi connections, the offset would be 0, // because it only store on the connection table. if (connectionCount != connectionOnDBList.size()) { // dirty data offset = 0; } else { offset = ConnectionModel.getTotalOffset(connectionOnDBList); } } else { offset = model.getSoFar(); } } } else { offset = 0; } } model.setSoFar(offset); isResumeAvailableOnDB = offset > 0; if (!isResumeAvailableOnDB) { database.removeConnections(model.getId()); FileDownloadUtils.deleteTaskFiles(targetFilePath, tempFilePath); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: inspectTaskModelResumeAvailableOnDB File: library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
inspectTaskModelResumeAvailableOnDB
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "4.3M2") public void setDefaultLanguage(String defaultLanguage) { setDefaultLocale(LocaleUtils.toLocale(defaultLanguage, Locale.ROOT)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDefaultLanguage File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
setDefaultLanguage
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
public void startRequest() { connection.resetChannel(); state = new AjpRequestParseState(); read = 0; if(parseTimeoutUpdater != null) { parseTimeoutUpdater.connectionIdle(); } connection.setCurrentExchange(null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startRequest File: core/src/main/java/io/undertow/server/protocol/ajp/AjpReadListener.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-252" ]
CVE-2022-1319
HIGH
7.5
undertow-io/undertow
startRequest
core/src/main/java/io/undertow/server/protocol/ajp/AjpReadListener.java
1443a1a2bbb8e32e56788109d8285db250d55c8b
0
Analyze the following code function for security vulnerabilities
public KeyguardViewController registerCentralSurfaces(CentralSurfaces centralSurfaces, NotificationPanelViewController panelView, @Nullable PanelExpansionStateManager panelExpansionStateManager, BiometricUnlockController biometricUnlockController, View notificationContainer, KeyguardBypassController bypassController) { mCentralSurfaces = centralSurfaces; mKeyguardViewControllerLazy.get().registerCentralSurfaces( centralSurfaces, panelView, panelExpansionStateManager, biometricUnlockController, notificationContainer, bypassController); return mKeyguardViewControllerLazy.get(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerCentralSurfaces File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
registerCentralSurfaces
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
void getTransformationMatrix(float[] float9, Matrix outMatrix) { float9[Matrix.MSCALE_X] = mGlobalScale; float9[Matrix.MSKEW_Y] = 0; float9[Matrix.MSKEW_X] = 0; float9[Matrix.MSCALE_Y] = mGlobalScale; transformSurfaceInsetsPosition(mTmpPoint, mAttrs.surfaceInsets); int x = mSurfacePosition.x + mTmpPoint.x; int y = mSurfacePosition.y + mTmpPoint.y; // If changed, also adjust transformFrameToSurfacePosition final WindowContainer parent = getParent(); if (isChildWindow()) { final WindowState parentWindow = getParentWindow(); x += parentWindow.mWindowFrames.mFrame.left - parentWindow.mAttrs.surfaceInsets.left; y += parentWindow.mWindowFrames.mFrame.top - parentWindow.mAttrs.surfaceInsets.top; } else if (parent != null) { final Rect parentBounds = parent.getBounds(); x += parentBounds.left; y += parentBounds.top; } float9[Matrix.MTRANS_X] = x; float9[Matrix.MTRANS_Y] = y; float9[Matrix.MPERSP_0] = 0; float9[Matrix.MPERSP_1] = 0; float9[Matrix.MPERSP_2] = 1; outMatrix.setValues(float9); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTransformationMatrix 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
getTransformationMatrix
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
WindowState findMainWindow() { return findMainWindow(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findMainWindow File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
findMainWindow
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public static boolean validate(WifiConfiguration config, long supportedFeatureSet, boolean isAdd) { if (!validateSsid(config.SSID, isAdd)) { return false; } if (!validateBssid(config.BSSID)) { return false; } if (!validateBitSets(config)) { return false; } if (!validateKeyMgmt(config.allowedKeyManagement)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_WEP) && config.wepKeys != null && !validateWepKeys(config.wepKeys, config.wepTxKeyIndex, isAdd)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_PSK) && !validatePassword(config.preSharedKey, isAdd, false)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_SAE) && !validatePassword(config.preSharedKey, isAdd, true)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_DPP) && (supportedFeatureSet & WifiManager.WIFI_FEATURE_DPP_AKM) == 0) { Log.e(TAG, "DPP AKM is not supported"); return false; } if (!validateEnterpriseConfig(config, isAdd)) { return false; } // b/153435438: Added to deal with badly formed WifiConfiguration from apps. if (config.preSharedKey != null && !config.needsPreSharedKey()) { Log.e(TAG, "preSharedKey set with an invalid KeyMgmt, resetting KeyMgmt to WPA_PSK"); config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK); } if (!validateIpConfiguration(config.getIpConfiguration())) { return false; } // TBD: Validate some enterprise params as well in the future here. return true; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21252 - Severity: MEDIUM - CVSS Score: 5.5 Description: Add pre-share key check for wapi Bug: 275339978 Test: atest com.androi.server.wifi (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c4142aedf5a09294cd4f2b184a1564b1c4e203ba) Merged-In: Id37e395f4f4f05b7901b718e3ea84c56b95cdfe7 Change-Id: Id37e395f4f4f05b7901b718e3ea84c56b95cdfe7 Function: validate File: service/java/com/android/server/wifi/WifiConfigurationUtil.java Repository: android Fixed Code: public static boolean validate(WifiConfiguration config, long supportedFeatureSet, boolean isAdd) { if (!validateSsid(config.SSID, isAdd)) { return false; } if (!validateBssid(config.BSSID)) { return false; } if (!validateBitSets(config)) { return false; } if (!validateKeyMgmt(config.allowedKeyManagement)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_WEP) && config.wepKeys != null && !validateWepKeys(config.wepKeys, config.wepTxKeyIndex, isAdd)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_PSK) && !validatePassword(config.preSharedKey, isAdd, false)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_SAE) && !validatePassword(config.preSharedKey, isAdd, true)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_WAPI_PSK) && !validatePassword(config.preSharedKey, isAdd, false)) { return false; } if (config.isSecurityType(WifiConfiguration.SECURITY_TYPE_DPP) && (supportedFeatureSet & WifiManager.WIFI_FEATURE_DPP_AKM) == 0) { Log.e(TAG, "DPP AKM is not supported"); return false; } if (!validateEnterpriseConfig(config, isAdd)) { return false; } // b/153435438: Added to deal with badly formed WifiConfiguration from apps. if (config.preSharedKey != null && !config.needsPreSharedKey()) { Log.e(TAG, "preSharedKey set with an invalid KeyMgmt, resetting KeyMgmt to WPA_PSK"); config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK); } if (!validateIpConfiguration(config.getIpConfiguration())) { return false; } // TBD: Validate some enterprise params as well in the future here. return true; }
[ "CWE-Other" ]
CVE-2023-21252
MEDIUM
5.5
android
validate
service/java/com/android/server/wifi/WifiConfigurationUtil.java
044ab0684153c4effb9f4fda47df43ccdc77bda8
1
Analyze the following code function for security vulnerabilities
public long getSectionEditingDepth() { return this.xwiki.getSectionEditingDepth(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSectionEditingDepth 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
getSectionEditingDepth
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
@Override public void init(FilterConfig filterConfig) { // nothing to init }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: core-war/src/main/java/org/silverpeas/web/token/SessionSynchronizerTokenValidator.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
init
core-war/src/main/java/org/silverpeas/web/token/SessionSynchronizerTokenValidator.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
public String escapeString(String str) { try { return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); } catch (UnsupportedEncodingException e) { return str; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: escapeString File: samples/client/petstore/java/okhttp-gson/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
escapeString
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void migrateLegacySettingsForUserIfNeededLocked(int userId) { // Every user has secure settings and if no file we need to migrate. final int secureKey = makeKey(SETTINGS_TYPE_SECURE, userId); File secureFile = getSettingsFile(secureKey); if (SettingsState.stateFileExists(secureFile)) { return; } DatabaseHelper dbHelper = new DatabaseHelper(getContext(), userId); SQLiteDatabase database = dbHelper.getWritableDatabase(); migrateLegacySettingsForUserLocked(dbHelper, database, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrateLegacySettingsForUserIfNeededLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
migrateLegacySettingsForUserIfNeededLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
@Override public void onPhoneAccountChanged(String callId, PhoneAccountHandle pHandle, Session.Info sessionInfo) throws RemoteException { // Check that the Calling Package matches PhoneAccountHandle's Component Package if (pHandle != null) { mAppOpsManager.checkPackage(Binder.getCallingUid(), pHandle.getComponentName().getPackageName()); } Log.startSession(sessionInfo, "CSW.oPAC", mPackageAbbreviation); long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { Call call = mCallIdMapper.getCall(callId); if (call != null) { call.setTargetPhoneAccount(pHandle); } } } catch (Throwable t) { Log.e(ConnectionServiceWrapper.this, t, ""); throw t; } finally { Binder.restoreCallingIdentity(token); Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPhoneAccountChanged File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
onPhoneAccountChanged
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Test public void detectsJoinAliasesCorrectly() { Set<String> aliases = getOuterJoinAliases("select p from Person p left outer join x.foo b2_$ar where …"); assertThat(aliases, hasSize(1)); assertThat(aliases, hasItems("b2_$ar")); aliases = getOuterJoinAliases("select p from Person p left join x.foo b2_$ar where …"); assertThat(aliases, hasSize(1)); assertThat(aliases, hasItems("b2_$ar")); aliases = getOuterJoinAliases( "select p from Person p left outer join x.foo as b2_$ar, left join x.bar as foo where …"); assertThat(aliases, hasSize(2)); assertThat(aliases, hasItems("b2_$ar", "foo")); aliases = getOuterJoinAliases( "select p from Person p left join x.foo as b2_$ar, left outer join x.bar foo where …"); assertThat(aliases, hasSize(2)); assertThat(aliases, hasItems("b2_$ar", "foo")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: detectsJoinAliasesCorrectly File: src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java Repository: spring-projects/spring-data-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-6652
MEDIUM
6.8
spring-projects/spring-data-jpa
detectsJoinAliasesCorrectly
src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
b8e7fe
0
Analyze the following code function for security vulnerabilities
public PRIndirectReference getPageOrigRef(int pageNum) { try { --pageNum; if (pageNum < 0 || pageNum >= size()) return null; if (refsn != null) return (PRIndirectReference)refsn.get(pageNum); else { int n = refsp.get(pageNum); if (n == 0) { PRIndirectReference ref = getSinglePage(pageNum); if (reader.lastXrefPartial == -1) lastPageRead = -1; else lastPageRead = pageNum; reader.lastXrefPartial = -1; refsp.put(pageNum, ref.getNumber()); if (keepPages) lastPageRead = -1; return ref; } else { if (lastPageRead != pageNum) lastPageRead = -1; if (keepPages) lastPageRead = -1; return new PRIndirectReference(reader, n); } } } catch (Exception e) { throw new ExceptionConverter(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPageOrigRef File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
getPageOrigRef
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public void createConnection(final Call call, final CreateConnectionResponse response) { Log.i(this, "createConnection(%s) via %s.", call, getComponentName()); BindCallback callback = new BindCallback() { @Override public void onSuccess() { String callId = mCallIdMapper.getCallId(call); if (callId == null) { Log.w(ConnectionServiceWrapper.this, "Call not present" + " in call id mapper, maybe it was aborted before the bind" + " completed successfully?"); response.handleCreateConnectionFailure( new DisconnectCause(DisconnectCause.CANCELED)); return; } mPendingResponses.put(callId, response); GatewayInfo gatewayInfo = call.getGatewayInfo(); Bundle extras = call.getIntentExtras(); if (gatewayInfo != null && gatewayInfo.getGatewayProviderPackageName() != null && gatewayInfo.getOriginalAddress() != null) { extras = (Bundle) extras.clone(); extras.putString( TelecomManager.GATEWAY_PROVIDER_PACKAGE, gatewayInfo.getGatewayProviderPackageName()); extras.putParcelable( TelecomManager.GATEWAY_ORIGINAL_ADDRESS, gatewayInfo.getOriginalAddress()); } if (call.isIncoming() && mCallsManager.getEmergencyCallHelper() .getLastEmergencyCallTimeMillis() > 0) { // Add the last emergency call time to the connection request for incoming calls if (extras == call.getIntentExtras()) { extras = (Bundle) extras.clone(); } extras.putLong(android.telecom.Call.EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS, mCallsManager.getEmergencyCallHelper().getLastEmergencyCallTimeMillis()); } // Call is incoming and added because we're handing over from another; tell CS // that its expected to handover. if (call.isIncoming() && call.getHandoverSourceCall() != null) { extras.putBoolean(TelecomManager.EXTRA_IS_HANDOVER, true); extras.putParcelable(TelecomManager.EXTRA_HANDOVER_FROM_PHONE_ACCOUNT, call.getHandoverSourceCall().getTargetPhoneAccount()); } Log.addEvent(call, LogUtils.Events.START_CONNECTION, Log.piiHandle(call.getHandle()) + " via:" + getComponentName().getPackageName()); if (call.isEmergencyCall()) { extras.putParcelable(Connection.EXTRA_LAST_KNOWN_CELL_IDENTITY, getLastKnownCellIdentity()); } ConnectionRequest connectionRequest = new ConnectionRequest.Builder() .setAccountHandle(call.getTargetPhoneAccount()) .setAddress(call.getHandle()) .setExtras(extras) .setVideoState(call.getVideoState()) .setTelecomCallId(callId) // For self-managed incoming calls, if there is another ongoing call Telecom // is responsible for showing a UI to ask the user if they'd like to answer // this new incoming call. .setShouldShowIncomingCallUi( !mCallsManager.shouldShowSystemIncomingCallUi(call)) .setRttPipeFromInCall(call.getInCallToCsRttPipeForCs()) .setRttPipeToInCall(call.getCsToInCallRttPipeForCs()) .build(); try { mServiceInterface.createConnection( call.getConnectionManagerPhoneAccount(), callId, connectionRequest, call.shouldAttachToExistingConnection(), call.isUnknown(), Log.getExternalSession(TELECOM_ABBREVIATION)); } catch (RemoteException e) { Log.e(this, e, "Failure to createConnection -- %s", getComponentName()); mPendingResponses.remove(callId).handleCreateConnectionFailure( new DisconnectCause(DisconnectCause.ERROR, e.toString())); } } @Override public void onFailure() { Log.e(this, new Exception(), "Failure to call %s", getComponentName()); response.handleCreateConnectionFailure(new DisconnectCause(DisconnectCause.ERROR)); } }; mBinder.bind(callback, call); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createConnection File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
createConnection
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
protected void disableCertificateValidation(ClientBuilder clientBuilder) throws KeyManagementException, NoSuchAlgorithmException { TrustManager[] trustAllCerts = new X509TrustManager[] { new X509TrustManager() { @Override public X509Certificate[] getAcceptedIssuers() { return null; } @Override public void checkClientTrusted(X509Certificate[] certs, String authType) { } @Override public void checkServerTrusted(X509Certificate[] certs, String authType) { } } }; SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(null, trustAllCerts, new SecureRandom()); clientBuilder.sslContext(sslContext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disableCertificateValidation File: samples/client/petstore/java/jersey2-java8/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
disableCertificateValidation
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public StaticHandler setIndexPage(String indexPage) { Objects.requireNonNull(indexPage); if (!indexPage.startsWith("/")) { indexPage = "/" + indexPage; } this.indexPage = indexPage; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIndexPage 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
setIndexPage
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
private void setGlobalUserRestrictionInternal( EnforcingAdmin admin, String key, boolean enabled) { PolicyDefinition<Boolean> policyDefinition = PolicyDefinition.getPolicyDefinitionForUserRestriction(key); if (enabled) { mDevicePolicyEngine.setGlobalPolicy( PolicyDefinition.getPolicyDefinitionForUserRestriction(key), admin, new BooleanPolicyValue(true)); } else { mDevicePolicyEngine.removeGlobalPolicy( policyDefinition, admin); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setGlobalUserRestrictionInternal 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
setGlobalUserRestrictionInternal
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private static File makeTempCacheCopy(File file) throws IOException { File cacheDir = new File(getContext().getCacheDir(), "intent_files"); // Create the storage directory if it does not exist if (!cacheDir.exists()) { if (!cacheDir.mkdirs()) { Log.d(Display.getInstance().getProperty("AppName", "CodenameOne"), "failed to create directory"); return null; } } File copy = new File(cacheDir, "tmp-"+System.currentTimeMillis()+file.getName()); copy(file, copy); return copy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeTempCacheCopy 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
makeTempCacheCopy
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private boolean readDigit() throws IOException { if (!isDigit()) { return false; } read(); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readDigit File: src/main/org/hjson/JsonParser.java Repository: hjson/hjson-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34620
HIGH
7.5
hjson/hjson-java
readDigit
src/main/org/hjson/JsonParser.java
91bef056d56bf968451887421c89a44af1d692ff
0
Analyze the following code function for security vulnerabilities
public void performIdleMaintenance() throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: performIdleMaintenance File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
performIdleMaintenance
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Test public void getByIdFailure(TestContext context) { createFoo(context).getByIdAsString( "nonexistingTable", randomUuid(), context.asyncAssertFailure()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getByIdFailure File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
getByIdFailure
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
void makeFinishingLocked() { if (finishing) { return; } finishing = true; // Transfer the launch cookie to the next running activity above this in the same task. if (mLaunchCookie != null && mState != RESUMED && task != null && !task.mInRemoveTask && !task.isClearingToReuseTask()) { final ActivityRecord nextCookieTarget = task.getActivity( // Intend to only associate the same app by checking uid. r -> r.mLaunchCookie == null && !r.finishing && r.isUid(getUid()), this, false /* includeBoundary */, false /* traverseTopToBottom */); if (nextCookieTarget != null) { nextCookieTarget.mLaunchCookie = mLaunchCookie; mLaunchCookie = null; } } final TaskFragment taskFragment = getTaskFragment(); if (taskFragment != null) { final Task task = taskFragment.getTask(); if (task != null && task.isClearingToReuseTask() && taskFragment.getTopNonFinishingActivity() == null) { taskFragment.mClearedTaskForReuse = true; } taskFragment.sendTaskFragmentInfoChanged(); } if (stopped) { abortAndClearOptionsAnimation(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeFinishingLocked File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
makeFinishingLocked
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public FileSelector[] getFileSelectors() { return fileSelectors; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFileSelectors File: src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java Repository: codehaus-plexus/plexus-archiver The code follows secure coding practices.
[ "CWE-22", "CWE-61" ]
CVE-2023-37460
CRITICAL
9.8
codehaus-plexus/plexus-archiver
getFileSelectors
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
54759839fbdf85caf8442076f001d5fd64e0dcb2
0
Analyze the following code function for security vulnerabilities
public String getBasePath() { return basePath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBasePath 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
getBasePath
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 int countByUuid_C(String uuid, long companyId) { FinderPath finderPath = FINDER_PATH_COUNT_BY_UUID_C; Object[] finderArgs = new Object[] { uuid, companyId }; Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler query = new StringBundler(3); query.append(_SQL_COUNT_KBTEMPLATE_WHERE); boolean bindUuid = false; if (uuid == null) { query.append(_FINDER_COLUMN_UUID_C_UUID_1); } else if (uuid.equals(StringPool.BLANK)) { query.append(_FINDER_COLUMN_UUID_C_UUID_3); } else { bindUuid = true; query.append(_FINDER_COLUMN_UUID_C_UUID_2); } query.append(_FINDER_COLUMN_UUID_C_COMPANYID_2); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); if (bindUuid) { qPos.add(uuid); } qPos.add(companyId); count = (Long)q.uniqueResult(); finderCache.putResult(finderPath, finderArgs, count); } catch (Exception e) { finderCache.removeResult(finderPath, finderArgs); throw processException(e); } finally { closeSession(session); } } return count.intValue(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: countByUuid_C File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
countByUuid_C
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
0
Analyze the following code function for security vulnerabilities
@Override public MediaPackage addCatalog(URI uri, MediaPackageElementFlavor flavor, MediaPackage mediaPackage) throws IOException, IngestException { Job job = null; try { job = serviceRegistry.createJob(JOB_TYPE, INGEST_CATALOG_FROM_URI, Arrays.asList(uri.toString(), flavor.toString(), MediaPackageParser.getAsXml(mediaPackage)), null, false, ingestFileJobLoad); job.setStatus(Status.RUNNING); job = serviceRegistry.updateJob(job); String elementId = UUID.randomUUID().toString(); logger.info("Start adding catalog {} from URL {} on mediapackage {}", elementId, uri, mediaPackage); URI newUrl = addContentToRepo(mediaPackage, elementId, uri); if (MediaPackageElements.SERIES.equals(flavor)) { updateSeries(uri); } MediaPackage mp = addContentToMediaPackage(mediaPackage, elementId, newUrl, MediaPackageElement.Type.Catalog, flavor); job.setStatus(Job.Status.FINISHED); logger.info("Successful added catalog {} on mediapackage {} at URL {}", elementId, mediaPackage, newUrl); return mp; } catch (ServiceRegistryException e) { throw new IngestException(e); } catch (NotFoundException e) { throw new IngestException("Unable to update ingest job", e); } finally { finallyUpdateJob(job); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addCatalog File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-29237
MEDIUM
5.5
opencast
addCatalog
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
public abstract void init();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: src/main/java/org/projectforge/web/dialog/ModalDialog.java Repository: micromata/projectforge-webapp The code follows secure coding practices.
[ "CWE-352" ]
CVE-2013-7251
MEDIUM
6.8
micromata/projectforge-webapp
init
src/main/java/org/projectforge/web/dialog/ModalDialog.java
422de35e3c3141e418a73bfb39b430d5fd74077e
0
Analyze the following code function for security vulnerabilities
@Override public Principal getPrincipal(HttpRequest httpRequest) { X509Certificate[] certs = (X509Certificate[]) httpRequest.getAttribute(CERTIFICATES_ATTR); if (certs == null || certs.length < 1) { if (log.isDebugEnabled()) { log.debug("no certificate was present to authenticate the client"); } return null; } // certs is an array of certificates presented by the client // with the first one in the array being the certificate of the client // itself. X509Certificate identityCert = certs[0]; return createPrincipal(parseUuid(identityCert)); }
Vulnerability Classification: - CWE: CWE-639 - CVE: CVE-2021-4142 - Severity: MEDIUM - CVSS Score: 5.5 Description: Disallow authN with SCA certificate Function: getPrincipal File: server/src/main/java/org/candlepin/auth/SSLAuth.java Repository: candlepin Fixed Code: @Override public Principal getPrincipal(HttpRequest httpRequest) { X509Certificate[] certs = (X509Certificate[]) httpRequest.getAttribute(CERTIFICATES_ATTR); if (certs == null || certs.length < 1) { if (log.isDebugEnabled()) { log.debug("no certificate was present to authenticate the client"); } return null; } // certs is an array of certificates presented by the client // with the first one in the array being the certificate of the client // itself. X509Certificate identityCert = certs[0]; this.checkForInvalidCertificateType(identityCert); return createPrincipal(parseUuid(identityCert)); }
[ "CWE-639" ]
CVE-2021-4142
MEDIUM
5.5
candlepin
getPrincipal
server/src/main/java/org/candlepin/auth/SSLAuth.java
87bb26761cb0d563d2eb697331ebd0dd85a67e5f
1