instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public final void compile() throws it.geosolutions.jaiext.jiffle.JiffleException { if (theScript == null) { throw new it.geosolutions.jaiext.jiffle.JiffleException("No script has been set"); } Jiffle.Result<ParseTree> parseResult = parseScript(theScript); if (parseResult.messages.isError()) { reportMessages(parseResult); return; } /* * If image var parameters were provided by the caller we * ignore any in the script. Otherwise, we look for an * images block in the script. */ ParseTree tree = parseResult.result; if (imageParams.isEmpty()) { Jiffle.Result<Map<String, Jiffle.ImageRole>> r = getScriptImageParams( tree); if (r.messages.isError()) { reportMessages(r); return; } if (r.result.isEmpty()) { throw new it.geosolutions.jaiext.jiffle.JiffleException( "No image parameters provided and none found in script"); } setImageParams(r.result); } // run the other preparation and check related workers OptionsBlockWorker optionsWorker = new OptionsBlockWorker(tree); reportMessages(optionsWorker.messages); InitBlockWorker initWorker = new InitBlockWorker(tree); reportMessages(initWorker.messages); VarWorker vw = new VarWorker(tree, imageParams); ExpressionWorker expressionWorker = new ExpressionWorker(tree, vw); reportMessages(expressionWorker.messages); // RuntimeModelWorker worker = new RuntimeModelWorker(tree, optionsWorker.options, expressionWorker.getProperties(), expressionWorker.getScopes()); this.scriptModel = worker.getScriptNode(); this.destinationBands = worker.getDestinationBands(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: compile File: jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java Repository: geosolutions-it/jai-ext The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-24816
HIGH
7.5
geosolutions-it/jai-ext
compile
jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java
cb1d6565d38954676b0a366da4f965fef38da1cb
0
Analyze the following code function for security vulnerabilities
private static List<RollingFileAppender> getFileAppenders(Configuration config) { return config.getAppenders().values().stream().filter(RollingFileAppender.class::isInstance).map(RollingFileAppender.class::cast).toList(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFileAppenders File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-41044
LOW
3.8
Graylog2/graylog2-server
getFileAppenders
graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
02b8792e6f4b829f0c1d87fcbf2d58b73458b938
0
Analyze the following code function for security vulnerabilities
@Override public void onSlashCommandInteraction(SlashCommandInteractionEvent event) { // Only accept commands from guilds if (!event.isFromGuild() && event.getMember() != null) return; event.deferReply(true).queue(); Main.getInstance().getCommandManager().perform(Objects.requireNonNull(event.getMember()), event.getGuild(), null, null, event.getChannel(), event); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSlashCommandInteraction File: src/main/java/de/presti/ree6/events/OtherEvents.java Repository: Ree6-Applications/Ree6 The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-39302
MEDIUM
5.4
Ree6-Applications/Ree6
onSlashCommandInteraction
src/main/java/de/presti/ree6/events/OtherEvents.java
459b5bc24f0ea27e50031f563373926e94b9aa0a
0
Analyze the following code function for security vulnerabilities
public float get() { return mScale; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
get
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
@Override public Route.Definition use(final String path, final Route.Handler handler) { return appendDefinition("*", path, handler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: use File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
use
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private void checkPermissions() { if (isVoiceOnlyCall) { onMicrophoneClick(); } else { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { requestPermissions(PERMISSIONS_CALL, 100); } else { onRequestPermissionsResult(100, PERMISSIONS_CALL, new int[]{1, 1}); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermissions File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
checkPermissions
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
public void engineInit( int opmode, Key key, AlgorithmParameterSpec engineSpec, SecureRandom random) throws InvalidAlgorithmParameterException, InvalidKeyException { // Use default parameters (including cipher key size) if none are specified if (engineSpec == null) { byte[] nonce = null; if (ivLength != 0 && opmode == Cipher.ENCRYPT_MODE) { nonce = new byte[ivLength]; random.nextBytes(nonce); } this.engineSpec = IESUtil.guessParameterSpec(engine.getCipher(), nonce); } else if (engineSpec instanceof IESParameterSpec) { this.engineSpec = (IESParameterSpec)engineSpec; } else { throw new InvalidAlgorithmParameterException("must be passed IES parameters"); } byte[] nonce = this.engineSpec.getNonce(); if (ivLength != 0 && (nonce == null || nonce.length != ivLength)) { throw new InvalidAlgorithmParameterException("NONCE in IES Parameters needs to be " + ivLength + " bytes long"); } // Parse the recipient's key if (opmode == Cipher.ENCRYPT_MODE || opmode == Cipher.WRAP_MODE) { if (key instanceof DHPublicKey) { this.key = DHUtil.generatePublicKeyParameter((PublicKey)key); } else if (key instanceof IESKey) { IESKey ieKey = (IESKey)key; this.key = DHUtil.generatePublicKeyParameter(ieKey.getPublic()); this.otherKeyParameter = DHUtil.generatePrivateKeyParameter(ieKey.getPrivate()); } else { throw new InvalidKeyException("must be passed recipient's public DH key for encryption"); } } else if (opmode == Cipher.DECRYPT_MODE || opmode == Cipher.UNWRAP_MODE) { if (key instanceof DHPrivateKey) { this.key = DHUtil.generatePrivateKeyParameter((PrivateKey)key); } else if (key instanceof IESKey) { IESKey ieKey = (IESKey)key; this.otherKeyParameter = DHUtil.generatePublicKeyParameter(ieKey.getPublic()); this.key = DHUtil.generatePrivateKeyParameter(ieKey.getPrivate()); } else { throw new InvalidKeyException("must be passed recipient's private DH key for decryption"); } } else { throw new InvalidKeyException("must be passed EC key"); } this.random = random; this.state = opmode; buffer.reset(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineInit File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineInit
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
@Pure @Override public @Nullable Timestamp getTimestamp( int i, java.util.@Nullable Calendar cal) throws SQLException { byte[] value = getRawValue(i); if (value == null) { return null; } if (cal == null) { cal = getDefaultCalendar(); } int col = i - 1; int oid = fields[col].getOID(); if (isBinary(i)) { byte [] row = castNonNull(thisRow).get(col); if (oid == Oid.TIMESTAMPTZ || oid == Oid.TIMESTAMP) { boolean hasTimeZone = oid == Oid.TIMESTAMPTZ; TimeZone tz = cal.getTimeZone(); return connection.getTimestampUtils().toTimestampBin(tz, castNonNull(row), hasTimeZone); } else if (oid == Oid.TIME) { // JDBC spec says getTimestamp of Time and Date must be supported Timestamp tsWithMicros = connection.getTimestampUtils().toTimestampBin(cal.getTimeZone(), castNonNull(row), false); // If server sends us a TIME, we ensure java counterpart has date of 1970-01-01 Timestamp tsUnixEpochDate = new Timestamp(castNonNull(getTime(i, cal)).getTime()); tsUnixEpochDate.setNanos(tsWithMicros.getNanos()); return tsUnixEpochDate; } else if (oid == Oid.TIMETZ) { TimeZone tz = cal.getTimeZone(); byte[] timeBytesWithoutTimeZone = Arrays.copyOfRange(castNonNull(row), 0, 8); Timestamp tsWithMicros = connection.getTimestampUtils().toTimestampBin(tz, timeBytesWithoutTimeZone, false); // If server sends us a TIMETZ, we ensure java counterpart has date of 1970-01-01 Timestamp tsUnixEpochDate = new Timestamp(castNonNull(getTime(i, cal)).getTime()); tsUnixEpochDate.setNanos(tsWithMicros.getNanos()); return tsUnixEpochDate; } else if (oid == Oid.DATE) { new Timestamp(castNonNull(getDate(i, cal)).getTime()); } else { throw new PSQLException( GT.tr("Cannot convert the column of type {0} to requested type {1}.", Oid.toString(oid), "timestamp"), PSQLState.DATA_TYPE_MISMATCH); } } // If this is actually a timestamptz, the server-provided timezone will override // the one we pass in, which is the desired behaviour. Otherwise, we'll // interpret the timezone-less value in the provided timezone. String string = castNonNull(getString(i)); if (oid == Oid.TIME || oid == Oid.TIMETZ) { // If server sends us a TIME, we ensure java counterpart has date of 1970-01-01 Timestamp tsWithMicros = connection.getTimestampUtils().toTimestamp(cal, string); Timestamp tsUnixEpochDate = new Timestamp(connection.getTimestampUtils().toTime(cal, string).getTime()); tsUnixEpochDate.setNanos(tsWithMicros.getNanos()); return tsUnixEpochDate; } return connection.getTimestampUtils().toTimestamp(cal, string); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTimestamp 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
getTimestamp
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public final void fatalError(final SAXParseException e) throws SAXException { LOGGER.debug("XML fatal error: {}", e.getLocalizedMessage()); super.fatalError(e); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fatalError File: core/src/main/java/org/mapfish/print/map/style/SLDParserPlugin.java Repository: mapfish/mapfish-print The code follows secure coding practices.
[ "CWE-611" ]
CVE-2020-15232
MEDIUM
6.4
mapfish/mapfish-print
fatalError
core/src/main/java/org/mapfish/print/map/style/SLDParserPlugin.java
e1d0527d13db06b2b62ca7d6afb9e97dacd67a0e
0
Analyze the following code function for security vulnerabilities
@CalledByNative public int getId() { return mId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getId File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getId
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@Override public NodeList getElementsByTagNameNS(String namespaceURI, String localName) { return doc.getElementsByTagNameNS(namespaceURI, localName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getElementsByTagNameNS File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
getElementsByTagNameNS
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
public String getContent() { return content.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContent File: src/main/java/com/openkm/extractor/OpenOfficeTextExtractor.java Repository: openkm/document-management-system The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-33950
HIGH
7.5
openkm/document-management-system
getContent
src/main/java/com/openkm/extractor/OpenOfficeTextExtractor.java
ce1d82329615aea6aa9f2cc6508c1fe7891e34b5
0
Analyze the following code function for security vulnerabilities
@Override public boolean enableNdefPush() throws RemoteException { NfcPermissions.enforceAdminPermissions(mContext); synchronized (NfcService.this) { if (mIsNdefPushEnabled) { return true; } Log.i(TAG, "enabling NDEF Push"); mPrefsEditor.putBoolean(PREF_NDEF_PUSH_ON, true); mPrefsEditor.apply(); mIsNdefPushEnabled = true; setBeamShareActivityState(true); if (isNfcEnabled()) { mP2pLinkManager.enableDisable(true, true); } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enableNdefPush File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
enableNdefPush
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
Map<String, Object> standbyServerDetails() { Map<String, Object> details = new HashMap<>(); details.put("primaryStatusCheckInterval", standbyFileSyncService.primaryStatusCheckInterval()); details.put("lastUpdateTime", new Date(standbyFileSyncService.lastUpdateTime())); details.put("latestReceivedDatabaseWalLocation", databaseStatusProvider.latestReceivedWalLocation()); Map<ConfigFileType, String> currentFileStatus = standbyFileSyncService.getCurrentFileStatus(); for (ConfigFileType configFileType : currentFileStatus.keySet()) { details.put(configFileType.name(), currentFileStatus.get(configFileType)); } details.put("pluginStatus", standbyPluginStatus()); return details; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: standbyServerDetails File: server/src/main/java/com/thoughtworks/go/addon/businesscontinuity/standby/controller/DashBoardController.java Repository: gocd The code follows secure coding practices.
[ "CWE-200" ]
CVE-2021-43287
MEDIUM
5
gocd
standbyServerDetails
server/src/main/java/com/thoughtworks/go/addon/businesscontinuity/standby/controller/DashBoardController.java
41abc210ac4e8cfa184483c9ff1c0cc04fb3511c
0
Analyze the following code function for security vulnerabilities
private void migrate99(File dataDir, Stack<Integer> versions) { Map<String, String> names = new HashMap<>(); Map<String, String> parentIds = new HashMap<>(); for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Projects.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { String id = element.elementText("id").trim(); String name = element.elementText("name").trim(); String parentId; Element parentElement = element.element("parent"); if (parentElement != null) parentId = parentElement.getText().trim(); else parentId = null; names.put(id, name); parentIds.put(id, parentId); } } } for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Projects.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { String id = element.elementText("id").trim(); List<String> pathSegments = new ArrayList<>(); do { pathSegments.add(names.get(id)); id = parentIds.get(id); } while (id != null); Collections.reverse(pathSegments); element.addElement("path").setText(StringUtils.join(pathSegments, "/")); } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate99 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
migrate99
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public XWikiDocumentArchive getDocumentArchive() { // If there is a soft reference, return it. if (this.archive != null) { return this.archive.get(); } // Some APIs are expecting the archive to be null for loading it // (e.g. VersioningStore#loadXWikiDocumentArchive), so it's better to keep it null than to return an // empty archive which would never be populated. return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDocumentArchive 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
getDocumentArchive
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
private static void addSessionFlashes(final HttpServletRequest request, final String... flashes) { final HttpSession session = request.getSession(); for (final String flash : flashes) { final Object flashValue = session.getAttribute(flash); if (flashValue != null) { request.setAttribute(flash, flashValue); session.setAttribute(flash, null); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addSessionFlashes File: xmppserver/src/main/java/org/jivesoftware/admin/servlet/SystemCacheDetailsServlet.java Repository: igniterealtime/Openfire The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-20363
MEDIUM
4.3
igniterealtime/Openfire
addSessionFlashes
xmppserver/src/main/java/org/jivesoftware/admin/servlet/SystemCacheDetailsServlet.java
b6f758241f3fdd57b48c527a695512f33e26eb74
0
Analyze the following code function for security vulnerabilities
private void onAudioManagerDevicesChanged( final MagicAudioManager.AudioDevice currentDevice, final Set<MagicAudioManager.AudioDevice> availableDevices) { Log.d(TAG, "onAudioManagerDevicesChanged: " + availableDevices + ", " + "currentDevice: " + currentDevice); final boolean shouldDisableProximityLock = (currentDevice.equals(MagicAudioManager.AudioDevice.WIRED_HEADSET) || currentDevice.equals(MagicAudioManager.AudioDevice.SPEAKER_PHONE) || currentDevice.equals(MagicAudioManager.AudioDevice.BLUETOOTH)); if (shouldDisableProximityLock) { powerManagerUtils.updatePhoneState(PowerManagerUtils.PhoneState.WITHOUT_PROXIMITY_SENSOR_LOCK); } else { powerManagerUtils.updatePhoneState(PowerManagerUtils.PhoneState.WITH_PROXIMITY_SENSOR_LOCK); } if (audioOutputDialog != null) { audioOutputDialog.updateOutputDeviceList(); } updateAudioOutputButton(currentDevice); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAudioManagerDevicesChanged File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
onAudioManagerDevicesChanged
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
public Object getFirstObject(String fieldname) { try { BaseObject obj = this.getDoc().getFirstObject(fieldname, getXWikiContext()); if (obj == null) { return null; } else { return newObjectApi(obj, getXWikiContext()); } } catch (Exception e) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFirstObject 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
getFirstObject
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
@Override public void onHeadsUpStateChanged(Entry entry, boolean isHeadsUp) { if (!isHeadsUp && mHeadsUpEntriesToRemoveOnSwitch.contains(entry)) { removeNotification(entry.key, mLatestRankingMap); mHeadsUpEntriesToRemoveOnSwitch.remove(entry); if (mHeadsUpEntriesToRemoveOnSwitch.isEmpty()) { mLatestRankingMap = null; } } else { updateNotificationRanking(null); if (isHeadsUp) { mDozeServiceHost.fireNotificationHeadsUp(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onHeadsUpStateChanged File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
onHeadsUpStateChanged
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public void performBootDexOpt() { enforceSystemOrRoot("Only the system can request dexopt be performed"); // Before everything else, see whether we need to fstrim. try { IMountService ms = PackageHelper.getMountService(); if (ms != null) { final boolean isUpgrade = isUpgrade(); boolean doTrim = isUpgrade; if (doTrim) { Slog.w(TAG, "Running disk maintenance immediately due to system update"); } else { final long interval = android.provider.Settings.Global.getLong( mContext.getContentResolver(), android.provider.Settings.Global.FSTRIM_MANDATORY_INTERVAL, DEFAULT_MANDATORY_FSTRIM_INTERVAL); if (interval > 0) { final long timeSinceLast = System.currentTimeMillis() - ms.lastMaintenance(); if (timeSinceLast > interval) { doTrim = true; Slog.w(TAG, "No disk maintenance in " + timeSinceLast + "; running immediately"); } } } if (doTrim) { if (!isFirstBoot()) { try { ActivityManagerNative.getDefault().showBootMessage( mContext.getResources().getString( R.string.android_upgrading_fstrim), true); } catch (RemoteException e) { } } ms.runMaintenance(); } } else { Slog.e(TAG, "Mount service unavailable!"); } } catch (RemoteException e) { // Can't happen; MountService is local } final ArraySet<PackageParser.Package> pkgs; synchronized (mPackages) { pkgs = mPackageDexOptimizer.clearDeferredDexOptPackages(); } if (pkgs != null) { // Sort apps by importance for dexopt ordering. Important apps are given more priority // in case the device runs out of space. ArrayList<PackageParser.Package> sortedPkgs = new ArrayList<PackageParser.Package>(); // Give priority to core apps. for (Iterator<PackageParser.Package> it = pkgs.iterator(); it.hasNext();) { PackageParser.Package pkg = it.next(); if (pkg.coreApp) { if (DEBUG_DEXOPT) { Log.i(TAG, "Adding core app " + sortedPkgs.size() + ": " + pkg.packageName); } sortedPkgs.add(pkg); it.remove(); } } // Give priority to system apps that listen for pre boot complete. Intent intent = new Intent(Intent.ACTION_PRE_BOOT_COMPLETED); ArraySet<String> pkgNames = getPackageNamesForIntent(intent); for (Iterator<PackageParser.Package> it = pkgs.iterator(); it.hasNext();) { PackageParser.Package pkg = it.next(); if (pkgNames.contains(pkg.packageName)) { if (DEBUG_DEXOPT) { Log.i(TAG, "Adding pre boot system app " + sortedPkgs.size() + ": " + pkg.packageName); } sortedPkgs.add(pkg); it.remove(); } } // Filter out packages that aren't recently used. filterRecentlyUsedApps(pkgs); // Add all remaining apps. for (PackageParser.Package pkg : pkgs) { if (DEBUG_DEXOPT) { Log.i(TAG, "Adding app " + sortedPkgs.size() + ": " + pkg.packageName); } sortedPkgs.add(pkg); } // If we want to be lazy, filter everything that wasn't recently used. if (mLazyDexOpt) { filterRecentlyUsedApps(sortedPkgs); } int i = 0; int total = sortedPkgs.size(); File dataDir = Environment.getDataDirectory(); long lowThreshold = StorageManager.from(mContext).getStorageLowBytes(dataDir); if (lowThreshold == 0) { throw new IllegalStateException("Invalid low memory threshold"); } for (PackageParser.Package pkg : sortedPkgs) { long usableSpace = dataDir.getUsableSpace(); if (usableSpace < lowThreshold) { Log.w(TAG, "Not running dexopt on remaining apps due to low memory: " + usableSpace); break; } performBootDexOpt(pkg, ++i, total); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: performBootDexOpt 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
performBootDexOpt
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public void run(TaskMonitor monitor) { boolean ok = false; try { unjarArchive(monitor); ok = true; } catch (Exception e) { Msg.showError(this, null, null, null, e); message = message + " failed."; } message = "\"" + projectLocator.toString() + "\" from \"" + jarFile.getAbsolutePath() + "\""; if (monitor.isCancelled()) { message += " was cancelled by user."; // put everything back the way it was... plugin.cleanupRestoredProject(projectLocator); } else { message += ((ok) ? " succeeded." : " failed."); final boolean success = ok; Runnable r = () -> restoreCompleted(success); try { SwingUtilities.invokeAndWait(r); } catch (InterruptedException e1) { } catch (InvocationTargetException e1) { } } Msg.info(this, "Restore Archive: " + message); }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2019-13623 - Severity: MEDIUM - CVSS Score: 6.8 Description: GT-3001 (#789) fix RestoreTask to safely extract files from zip. Abstracted guts of GFileSystemExtractAllTask, reused in RestoreTask. Fixed NPE in RestoreTask if restore was canceled. Function: run File: Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/archive/RestoreTask.java Repository: NationalSecurityAgency/ghidra Fixed Code: @Override public void run(TaskMonitor monitor) throws CancelledException { FileSystemService fsService = FileSystemService.getInstance(); String locInfo = "\"" + projectLocator.toString() + "\" from \"" + projectArchiveFile.getAbsolutePath() + "\""; if (projectFile.exists() || projectDir.exists()) { Msg.showError(this, null, "Restore Archive Error", "Project already exists at: " + projectDir); return; } FSRL archiveFSRL = fsService.getLocalFSRL(projectArchiveFile); try (GFileSystem fs = fsService.openFileSystemContainer(archiveFSRL, monitor)) { verifyArchive(fs, monitor); startExtract(fs, null, monitor); verifyRestoredProject(); openRestoredProject(); Msg.info(this, "Restore Archive: " + locInfo + " succeeded."); } catch (CancelledException ce) { plugin.cleanupRestoredProject(projectLocator); Msg.info(this, "Restore Archive: " + locInfo + " was cancelled by user."); } catch (Throwable e) { plugin.cleanupRestoredProject(projectLocator); String eMsg = (e.getMessage() != null) ? ":\n\n" + e.getMessage() : ""; Msg.showError(this, null, "Restore Archive Failed", "An error occurred when restoring the project archive\n " + projectArchiveFile + " to \n " + projectDir + eMsg, e); Msg.info(this, "Restore Archive: " + locInfo + " failed."); } }
[ "CWE-22" ]
CVE-2019-13623
MEDIUM
6.8
NationalSecurityAgency/ghidra
run
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/archive/RestoreTask.java
6c0171c9200b4490deb94abf3c92d1b3da59f9bf
1
Analyze the following code function for security vulnerabilities
private native void nativeUpdateTopControlsState(long nativeContentViewCoreImpl, boolean enableHiding, boolean enableShowing, boolean animate);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeUpdateTopControlsState File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
nativeUpdateTopControlsState
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
int doPostInstall(int status, int uid) { if (status == PackageManager.INSTALL_SUCCEEDED) { cleanUp(move.fromUuid); } else { cleanUp(move.toUuid); } return status; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doPostInstall 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
doPostInstall
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public String removeAttribute(String name) { return attributes.remove(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeAttribute File: base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
removeAttribute
base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
protected void onProviderChanged(int appWidgetId, AppWidgetProviderInfo appWidget) { AppWidgetHostView v; // Convert complex to dp -- we are getting the AppWidgetProviderInfo from the // AppWidgetService, which doesn't have our context, hence we need to do the // conversion here. appWidget.minWidth = TypedValue.complexToDimensionPixelSize(appWidget.minWidth, mDisplayMetrics); appWidget.minHeight = TypedValue.complexToDimensionPixelSize(appWidget.minHeight, mDisplayMetrics); appWidget.minResizeWidth = TypedValue.complexToDimensionPixelSize(appWidget.minResizeWidth, mDisplayMetrics); appWidget.minResizeHeight = TypedValue.complexToDimensionPixelSize(appWidget.minResizeHeight, mDisplayMetrics); synchronized (mViews) { v = mViews.get(appWidgetId); } if (v != null) { v.resetAppWidget(appWidget); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onProviderChanged File: core/java/android/appwidget/AppWidgetHost.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
onProviderChanged
core/java/android/appwidget/AppWidgetHost.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
public void setContextPath(String contextPath) { Assert.hasText(contextPath, "'contextPath' must not be null"); this.contextPath = contextPath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setContextPath File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
setContextPath
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
@Override public ServerBuilder annotatedService(Object service, Object... exceptionHandlersAndConverters) { virtualHostTemplate.annotatedService(service, exceptionHandlersAndConverters); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: annotatedService File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
annotatedService
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
@Override public SysRoleIndex getDynamicIndexByUserRole(String username,String version) { List<String> roles = sysUserRoleMapper.getRoleByUserName(username); String componentUrl = RoleIndexConfigEnum.getIndexByRoles(roles); SysRoleIndex roleIndex = new SysRoleIndex(componentUrl); //只有 X-Version=v3 的时候,才读取sys_role_index表获取角色首页配置 if (oConvertUtils.isNotEmpty(version) && roles!=null && roles.size()>0) { LambdaQueryWrapper<SysRoleIndex> routeIndexQuery = new LambdaQueryWrapper(); //用户所有角色 routeIndexQuery.in(SysRoleIndex::getRoleCode, roles); //角色首页状态0:未开启 1:开启 routeIndexQuery.eq(SysRoleIndex::getStatus, CommonConstant.STATUS_1); //优先级正序排序 routeIndexQuery.orderByAsc(SysRoleIndex::getPriority); List<SysRoleIndex> list = sysRoleIndexMapper.selectList(routeIndexQuery); if (null != list && list.size() > 0) { roleIndex = list.get(0); } } //如果componentUrl为空,则返回空 if(oConvertUtils.isEmpty(roleIndex.getComponent())){ return null; } return roleIndex; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDynamicIndexByUserRole File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45208
MEDIUM
4.3
jeecgboot/jeecg-boot
getDynamicIndexByUserRole
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
51e2227bfe54f5d67b09411ee9a336750164e73d
0
Analyze the following code function for security vulnerabilities
private Config buildConfig(final Config source, final Config args, final List<Config> modules) { // normalize tmpdir Config system = ConfigFactory.systemProperties(); Config tmpdir = source.hasPath("java.io.tmpdir") ? source : system; // system properties system = system // file encoding got corrupted sometimes, override it. .withValue("file.encoding", fromAnyRef(System.getProperty("file.encoding"))) .withValue("java.io.tmpdir", fromAnyRef(Paths.get(tmpdir.getString("java.io.tmpdir")).normalize().toString())); // set module config Config moduleStack = ConfigFactory.empty(); for (Config module : ImmutableList.copyOf(modules).reverse()) { moduleStack = moduleStack.withFallback(module); } String env = Arrays.asList(system, args, source).stream() .filter(it -> it.hasPath("application.env")) .findFirst() .map(c -> c.getString("application.env")) .orElse("dev"); String cpath = Arrays.asList(system, args, source).stream() .filter(it -> it.hasPath("application.path")) .findFirst() .map(c -> c.getString("application.path")) .orElse("/"); Config envconf = envConf(source, env); // application.[env].conf -> application.conf Config conf = envconf.withFallback(source); return system .withFallback(args) .withFallback(conf) .withFallback(moduleStack) .withFallback(MediaType.types) .withFallback(defaultConfig(conf, Route.normalize(cpath))) .resolve(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildConfig File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
buildConfig
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public Builder removeResponseFilter(ResponseFilter responseFilter) { responseFilters.remove(responseFilter); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeResponseFilter File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
removeResponseFilter
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
@GetMapping("related-list") public JSON relatedList(@IdParam(name = "mainid") ID mainid, HttpServletRequest request) { final ID user = getRequestUser(request); String related = getParameterNotNull(request, "related"); String q = getParameter(request, "q"); String sql = buildBaseSql(mainid, related, q, false, user); Entity relatedEntity = MetadataHelper.getEntity(related.split("\\.")[0]); String sort = getParameter(request, "sort", "modifiedOn:desc"); // 名称字段排序 if ("NAME".equalsIgnoreCase(sort)) { sort = relatedEntity.getNameField().getName() + ":asc"; } sql += " order by " + sort.replace(":", " "); int pn = NumberUtils.toInt(getParameter(request, "pageNo"), 1); int ps = NumberUtils.toInt(getParameter(request, "pageSize"), 200); Object[][] array = QueryHelper.createQuery(sql, relatedEntity).setLimit(ps, pn * ps - ps).array(); List<Object> res = new ArrayList<>(); for (Object[] o : array) { Object nameValue = o[1]; nameValue = FieldValueHelper.wrapFieldValue(nameValue, relatedEntity.getNameField(), true); if (nameValue == null || StringUtils.isEmpty(nameValue.toString())) { nameValue = FieldValueHelper.NO_LABEL_PREFIX + o[0].toString().toUpperCase(); } int approvalState = o.length > 3 ? ObjectUtils.toInt(o[3]) : 0; boolean canUpdate = approvalState != ApprovalState.APPROVED.getState() && approvalState != ApprovalState.PROCESSING.getState() && Application.getPrivilegesManager().allowUpdate(user, (ID) o[0]); res.add(new Object[] { o[0], nameValue, I18nUtils.formatDate((Date) o[2]), approvalState, canUpdate }); } return JSONUtils.toJSONObject( new String[] { "total", "data" }, new Object[] { 0, res }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: relatedList File: src/main/java/com/rebuild/web/general/RelatedListController.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
relatedList
src/main/java/com/rebuild/web/general/RelatedListController.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
private void loadLanguageFile() { // we load langCode var passed into URL if present // else, we use default configuration var if (language == null) { String lang = ""; if (params.get("langCode") != null) lang = this.params.get("langCode"); else lang = getConfig("culture"); BufferedReader br = null; InputStreamReader isr = null; String text; StringBuffer contents = new StringBuffer(); try { isr = new InputStreamReader(new FileInputStream(this.fileRoot + ROOT_PATH + "scripts/languages/" + lang + ".js"), "UTF-8"); br = new BufferedReader(isr); while ((text = br.readLine()) != null) contents.append(text); language = JSONObject.parseObject(contents.toString()); } catch (Exception e) { this.error("Fatal error: Language file not found."); } finally { try { if (br != null) br.close(); } catch (Exception e2) { } try { if (isr != null) isr.close(); } catch (Exception e2) { } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadLanguageFile File: src/main/java/com/jflyfox/modules/filemanager/FileManager.java Repository: jflyfox/jfinal_cms The code follows secure coding practices.
[ "CWE-74" ]
CVE-2021-37262
MEDIUM
5
jflyfox/jfinal_cms
loadLanguageFile
src/main/java/com/jflyfox/modules/filemanager/FileManager.java
e7fd0fe9362464c4d2bd308318eecc89a847b116
0
Analyze the following code function for security vulnerabilities
protected void initQuotedText(CharSequence quotedText, boolean shouldQuoteText) { mQuotedTextView.setQuotedTextFromHtml(quotedText, shouldQuoteText); mShowQuotedText = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initQuotedText File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
initQuotedText
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(value = MANAGE_DEVICE_POLICY_CAMERA, conditional = true) public boolean getCameraDisabled(@Nullable ComponentName admin) { return getCameraDisabled(admin, myUserId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCameraDisabled 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
getCameraDisabled
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public boolean installExistingPackage(@NonNull ComponentName admin, String packageName) { throwIfParentInstance("installExistingPackage"); if (mService != null) { try { return mService.installExistingPackage(admin, mContext.getPackageName(), packageName); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installExistingPackage 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
installExistingPackage
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void stopBlockSuppression() { try { Log.startSession("TSI.sBS"); enforceModifyPermission(); if (Binder.getCallingUid() != Process.SHELL_UID && Binder.getCallingUid() != Process.ROOT_UID) { throw new SecurityException("Shell-only API."); } synchronized (mLock) { long token = Binder.clearCallingIdentity(); try { BlockedNumberContract.SystemContract.endBlockSuppression(mContext); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopBlockSuppression 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
stopBlockSuppression
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
private void moveDoUserRestrictionsToCopeParent(ActiveAdmin doAdmin, ActiveAdmin parentAdmin) { if (doAdmin.userRestrictions == null) { return; } for (final String restriction : doAdmin.userRestrictions.keySet()) { if (UserRestrictionsUtils.canProfileOwnerOfOrganizationOwnedDeviceChange(restriction)) { parentAdmin.ensureUserRestrictions().putBoolean( restriction, doAdmin.userRestrictions.getBoolean(restriction)); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveDoUserRestrictionsToCopeParent File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
moveDoUserRestrictionsToCopeParent
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@GuardedBy("mProcLock") private void updateAppProcessCpuTimeLPr(final long uptimeSince, final boolean doCpuKills, final long checkDur, final int cpuLimit, final ProcessRecord app) { synchronized (mAppProfiler.mProfilerLock) { final ProcessProfileRecord profile = app.mProfile; final long curCpuTime = profile.mCurCpuTime.get(); final long lastCpuTime = profile.mLastCpuTime.get(); if (lastCpuTime > 0) { final long cpuTimeUsed = curCpuTime - lastCpuTime; if (checkExcessivePowerUsageLPr(uptimeSince, doCpuKills, cpuTimeUsed, app.processName, app.toShortString(), cpuLimit, app)) { mHandler.post(() -> { synchronized (ActivityManagerService.this) { app.killLocked("excessive cpu " + cpuTimeUsed + " during " + uptimeSince + " dur=" + checkDur + " limit=" + cpuLimit, ApplicationExitInfo.REASON_EXCESSIVE_RESOURCE_USAGE, ApplicationExitInfo.SUBREASON_EXCESSIVE_CPU, true); } }); profile.reportExcessiveCpu(); } } profile.mLastCpuTime.set(curCpuTime); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateAppProcessCpuTimeLPr 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
updateAppProcessCpuTimeLPr
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@ApiOperation(value = "批量删除", notes = "批量删除") @PostMapping("/batchRemove") @ResponseBody @RequiresPermissions("novel:friendLink:batchRemove") public R remove(@RequestParam("ids[]") Integer[] ids) { friendLinkService.batchRemove(ids); redisTemplate.delete(CacheKey.INDEX_LINK_KEY); return R.ok(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: remove File: novel-admin/src/main/java/com/java2nb/novel/controller/FriendLinkController.java Repository: 201206030/novel-plus The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-7171
LOW
3.3
201206030/novel-plus
remove
novel-admin/src/main/java/com/java2nb/novel/controller/FriendLinkController.java
d6093d8182362422370d7eaf6c53afde9ee45215
0
Analyze the following code function for security vulnerabilities
private void onDisconnected(Throwable reason) { Log.e(TAG, "onDisconnected: " + reason); reason.printStackTrace(); // iterate through to the deepest exception while (reason.getCause() != null && !(reason.getCause().getClass().getSimpleName().equals("GaiException"))) reason = reason.getCause(); onDisconnected(reason.getLocalizedMessage()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDisconnected File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
onDisconnected
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
private void updateSnackBar(final Conversation conversation) { final Account account = conversation.getAccount(); final XmppConnection connection = account.getXmppConnection(); final int mode = conversation.getMode(); final Contact contact = mode == Conversation.MODE_SINGLE ? conversation.getContact() : null; if (conversation.getStatus() == Conversation.STATUS_ARCHIVED) { return; } if (account.getStatus() == Account.State.DISABLED) { showSnackbar(R.string.this_account_is_disabled, R.string.enable, this.mEnableAccountListener); } else if (conversation.isBlocked()) { showSnackbar(R.string.contact_blocked, R.string.unblock, this.mUnblockClickListener); } else if (contact != null && !contact.showInRoster() && contact.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) { showSnackbar(R.string.contact_added_you, R.string.add_back, this.mAddBackClickListener, this.mLongPressBlockListener); } else if (contact != null && contact.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) { showSnackbar(R.string.contact_asks_for_presence_subscription, R.string.allow, this.mAllowPresenceSubscription, this.mLongPressBlockListener); } else if (mode == Conversation.MODE_MULTI && !conversation.getMucOptions().online() && account.getStatus() == Account.State.ONLINE) { switch (conversation.getMucOptions().getError()) { case NICK_IN_USE: showSnackbar(R.string.nick_in_use, R.string.edit, clickToMuc); break; case NO_RESPONSE: showSnackbar(R.string.joining_conference, 0, null); break; case SERVER_NOT_FOUND: if (conversation.receivedMessagesCount() > 0) { showSnackbar(R.string.remote_server_not_found, R.string.try_again, joinMuc); } else { showSnackbar(R.string.remote_server_not_found, R.string.leave, leaveMuc); } break; case REMOTE_SERVER_TIMEOUT: if (conversation.receivedMessagesCount() > 0) { showSnackbar(R.string.remote_server_timeout, R.string.try_again, joinMuc); } else { showSnackbar(R.string.remote_server_timeout, R.string.leave, leaveMuc); } break; case PASSWORD_REQUIRED: showSnackbar(R.string.conference_requires_password, R.string.enter_password, enterPassword); break; case BANNED: showSnackbar(R.string.conference_banned, R.string.leave, leaveMuc); break; case MEMBERS_ONLY: showSnackbar(R.string.conference_members_only, R.string.leave, leaveMuc); break; case RESOURCE_CONSTRAINT: showSnackbar(R.string.conference_resource_constraint, R.string.try_again, joinMuc); break; case KICKED: showSnackbar(R.string.conference_kicked, R.string.join, joinMuc); break; case UNKNOWN: showSnackbar(R.string.conference_unknown_error, R.string.try_again, joinMuc); break; case INVALID_NICK: showSnackbar(R.string.invalid_muc_nick, R.string.edit, clickToMuc); case SHUTDOWN: showSnackbar(R.string.conference_shutdown, R.string.try_again, joinMuc); break; case DESTROYED: showSnackbar(R.string.conference_destroyed, R.string.leave, leaveMuc); break; default: hideSnackbar(); break; } } else if (account.hasPendingPgpIntent(conversation)) { showSnackbar(R.string.openpgp_messages_found, R.string.decrypt, clickToDecryptListener); } else if (connection != null && connection.getFeatures().blocking() && conversation.countMessages() != 0 && !conversation.isBlocked() && conversation.isWithStranger()) { showSnackbar(R.string.received_message_from_stranger, R.string.block, mBlockClickListener); } else { hideSnackbar(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSnackBar File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
updateSnackBar
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public boolean isTerminating() { return terminating; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTerminating File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
isTerminating
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public int getStorageEntrySize(String name) { return (int)new File(getContext().getFilesDir(), name).length(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStorageEntrySize 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
getStorageEntrySize
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private void loadAppearance(Element appearElt, CircuitData circData, String context) { Map<Location, Instance> pins = new HashMap<Location, Instance>(); for (Component comp : circData.knownComponents.values()) { if (comp.getFactory() == Pin.FACTORY) { Instance instance = Instance.getInstanceFor(comp); pins.put(comp.getLocation(), instance); } } List<AbstractCanvasObject> shapes = new ArrayList<AbstractCanvasObject>(); for (Element sub : XmlIterator.forChildElements(appearElt)) { try { AbstractCanvasObject m = AppearanceSvgReader.createShape( sub, pins); if (m == null) { addError( Strings.get("fileAppearanceNotFound", sub.getTagName()), context + "." + sub.getTagName()); } else { shapes.add(m); } } catch (RuntimeException e) { addError(Strings.get("fileAppearanceError", sub.getTagName()), context + "." + sub.getTagName()); } } if (!shapes.isEmpty()) { if (circData.appearance == null) { circData.appearance = shapes; } else { circData.appearance.addAll(shapes); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadAppearance File: src/com/cburch/logisim/file/XmlReader.java Repository: logisim-evolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000889
MEDIUM
6.8
logisim-evolution
loadAppearance
src/com/cburch/logisim/file/XmlReader.java
90aee8f8ceef463884cc400af4f6d1f109fb0972
0
Analyze the following code function for security vulnerabilities
@Override public void sendAccessibilityEventUnchecked(AccessibilityEvent event) { if (mDisableTextAccessibilityEvents) { if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED || event.getEventType() == AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED) { return; } } super.sendAccessibilityEventUnchecked(event); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendAccessibilityEventUnchecked File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
sendAccessibilityEventUnchecked
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
protected String getBaseURL() { return this.testUtils.rest().getBaseURL(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBaseURL File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-352" ]
CVE-2023-37277
CRITICAL
9.6
xwiki/xwiki-platform
getBaseURL
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java
4c175405faa0e62437df397811c7526dfc0fbae7
0
Analyze the following code function for security vulnerabilities
public static File createDateDir(String parent) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy" + File.separator + "MM" + File.separator + "dd"); File dateDir = new File(parent, sdf.format(new Date())); if (!dateDir.exists()) { dateDir.mkdirs(); } return dateDir; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createDateDir File: src/main/java/com/openkm/util/FileUtils.java Repository: openkm/document-management-system The code follows secure coding practices.
[ "CWE-377" ]
CVE-2022-3969
MEDIUM
5.5
openkm/document-management-system
createDateDir
src/main/java/com/openkm/util/FileUtils.java
c069e4d73ab8864345c25119d8459495f45453e1
0
Analyze the following code function for security vulnerabilities
@Override protected void doRun() throws Exception { trimLabels(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doRun File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
doRun
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private String getEncryptionStatusName(int encryptionStatus) { switch (encryptionStatus) { case DevicePolicyManager.ENCRYPTION_STATUS_INACTIVE: return "inactive"; case DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE_DEFAULT_KEY: return "block default key"; case DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE: return "block"; case DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE_PER_USER: return "per-user"; case DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED: return "unsupported"; case DevicePolicyManager.ENCRYPTION_STATUS_ACTIVATING: return "activating"; default: return "unknown"; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEncryptionStatusName File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
getEncryptionStatusName
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void onRtlPropertiesChanged(int layoutDirection) { super.onRtlPropertiesChanged(layoutDirection); updateResources(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onRtlPropertiesChanged File: packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3886
HIGH
7.2
android
onRtlPropertiesChanged
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
6ca6cd5a50311d58a1b7bf8fbef3f9aa29eadcd5
0
Analyze the following code function for security vulnerabilities
public static Location getLocation(String id, FormEntryContext context) { Location location = null; if (id != null) { id = id.trim(); // handle "SystemDefault" setting if(id.equals(HtmlFormEntryConstants.SYSTEM_DEFAULT)) { location= Context.getLocationService().getDefaultLocation(); if (location != null) { return location; } } // handle GlobalProperty:property.name if (id.startsWith("GlobalProperty:")) { String gpName = id.substring("GlobalProperty:".length()); String gpValue = Context.getAdministrationService().getGlobalProperty(gpName); if (StringUtils.isNotEmpty(gpValue)) { return getLocation(gpValue, context); } } // handle UserProperty:propName if (id.startsWith("UserProperty:")) { String upName = id.substring("UserProperty:".length()); String upValue = Context.getAuthenticatedUser().getUserProperty(upName); if (StringUtils.isNotEmpty(upValue)) { return getLocation(upValue, context); } } // handle SessionAttribute:attributeName if (id.startsWith("SessionAttribute:")) { if (context.getHttpSession() == null) { // if we don't have access to a session, e.g. when validating a form, we can't do anything return null; } String saName = id.substring("SessionAttribute:".length()); Object saValue = context.getHttpSession().getAttribute(saName); if (saValue == null) { return null; } else if (saValue instanceof Location) { return (Location) saValue; } else if (saValue instanceof String) { return getLocation((String) saValue, context); } else { return getLocation(saValue.toString(), context); } } // see if this is parseable int; if so, try looking up by id try { //handle integer: id int locationId = Integer.parseInt(id); location = Context.getLocationService().getLocation(locationId); if (location != null) { return location; } } catch (Exception ex) { //do nothing } // handle uuid id: "a3e1302b-74bf-11df-9768-17cfc9833272" if id matches a uuid format if (isValidUuidFormat(id)) { location = Context.getLocationService().getLocationByUuid(id); if (location != null) { return location; } } //get by mapping "source:code" location = getMetadataByMapping(Location.class, id); if(location != null){ return location; } // if it's neither a uuid or id, try location name location = Context.getLocationService().getLocation(id); if (location != null) { return location; } // try the "101 - Cange" case if (id.contains(" ")) { String[] values = id.split(" "); try { int locationId = Integer.parseInt(values[0]); location = Context.getLocationService().getLocation(locationId); if (location != null) { return location; } } catch (Exception ex) { //do nothing } } } // no match found, so return null return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocation File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java Repository: openmrs/openmrs-module-htmlformentry The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-16521
HIGH
7.5
openmrs/openmrs-module-htmlformentry
getLocation
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
9dcd304688e65c31cac5532fe501b9816ed975ae
0
Analyze the following code function for security vulnerabilities
public void setOperationResult(String operationResult) { this.operationResult = operationResult; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOperationResult File: base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setOperationResult
base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private void migrate4(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Accounts.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { Element avatarUploadDateElement = element.element("avatarUploadDate"); if (avatarUploadDateElement != null) avatarUploadDateElement.detach(); } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate4 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
migrate4
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
BroadcastQueue broadcastQueueForIntent(Intent intent) { if (isOnFgOffloadQueue(intent.getFlags())) { if (DEBUG_BROADCAST_BACKGROUND) { Slog.i(TAG_BROADCAST, "Broadcast intent " + intent + " on foreground offload queue"); } return mFgOffloadBroadcastQueue; } if (isOnBgOffloadQueue(intent.getFlags())) { if (DEBUG_BROADCAST_BACKGROUND) { Slog.i(TAG_BROADCAST, "Broadcast intent " + intent + " on background offload queue"); } return mBgOffloadBroadcastQueue; } final boolean isFg = (intent.getFlags() & Intent.FLAG_RECEIVER_FOREGROUND) != 0; if (DEBUG_BROADCAST_BACKGROUND) Slog.i(TAG_BROADCAST, "Broadcast intent " + intent + " on " + (isFg ? "foreground" : "background") + " queue"); return (isFg) ? mFgBroadcastQueue : mBgBroadcastQueue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastQueueForIntent 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
broadcastQueueForIntent
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public void initializeKey(byte[] key, int offset) { // Set the encryption key. keySpec = new SecretKeySpec(key, offset, 32, "AES"); // Generate the hashing key by encrypting a block of zeroes. Arrays.fill(iv, (byte)0); Arrays.fill(hashKey, (byte)0); try { cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(iv)); } catch (InvalidKeyException e) { // Shouldn't happen. throw new IllegalStateException(e); } catch (InvalidAlgorithmParameterException e) { // Shouldn't happen. throw new IllegalStateException(e); } try { int result = cipher.update(hashKey, 0, 16, hashKey, 0); cipher.doFinal(hashKey, result); } catch (ShortBufferException e) { // Shouldn't happen. throw new IllegalStateException(e); } catch (IllegalBlockSizeException e) { // Shouldn't happen. throw new IllegalStateException(e); } catch (BadPaddingException e) { // Shouldn't happen. throw new IllegalStateException(e); } ghash.reset(hashKey, 0); // Reset the nonce. n = 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeKey File: src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java Repository: rweather/noise-java The code follows secure coding practices.
[ "CWE-125", "CWE-787" ]
CVE-2020-25021
HIGH
7.5
rweather/noise-java
initializeKey
src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java
18e86b6f8bea7326934109aa9ffa705ebf4bde90
0
Analyze the following code function for security vulnerabilities
@Override public int hashCode() { return Objects.hash(profileDescription, profileId, profileName, profileURL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hashCode File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileDataInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
hashCode
base/common/src/main/java/com/netscape/certsrv/profile/ProfileDataInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private void applyTextViewStyle(@NonNull View rootView) { final List<TextView> textViews = new ArrayList<>(); final Predicate<View> predicate = (view) -> { if (view instanceof TextView) { // Collects TextViews textViews.add((TextView) view); } return false; }; // Traverses all TextViews, enables movement method if the TextView contains URLSpan rootView.findViewByPredicate(predicate); final int size = textViews.size(); for (int i = 0; i < size; i++) { applyMovementMethodIfNeed(textViews.get(i)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyTextViewStyle File: services/autofill/java/com/android/server/autofill/ui/SaveUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
applyTextViewStyle
services/autofill/java/com/android/server/autofill/ui/SaveUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
public void setBean(Object bean) { _bean = bean; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBean File: src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42004
HIGH
7.5
FasterXML/jackson-databind
setBean
src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java
063183589218fec19a9293ed2f17ec53ea80ba88
0
Analyze the following code function for security vulnerabilities
@Nullable ActiveAdmin getActiveAdminOrCheckPermissionForCallerLocked( @Nullable ComponentName who, int reqPolicy, boolean parent, @Nullable String permission) throws SecurityException { return getActiveAdminOrCheckPermissionsForCallerLocked( who, reqPolicy, parent, permission == null ? Set.of() : Set.of(permission)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActiveAdminOrCheckPermissionForCallerLocked 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
getActiveAdminOrCheckPermissionForCallerLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public int getStatus() { return status; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStatus File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdDownloadZip.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
getStatus
src/main/java/org/olat/core/commons/modules/bc/commands/CmdDownloadZip.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(value = MANAGE_DEVICE_POLICY_ACCOUNT_MANAGEMENT, conditional = true) public void setAccountManagementDisabled(@Nullable ComponentName admin, String accountType, boolean disabled) { if (mService != null) { try { mService.setAccountManagementDisabled(admin, mContext.getPackageName(), accountType, disabled, mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAccountManagementDisabled 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
setAccountManagementDisabled
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public synchronized void updateDouble(String columnName, double x) throws SQLException { updateDouble(findColumn(columnName), x); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateDouble 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
updateDouble
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public void setRealm(String realm) { setFieldValue(REALM_KEY, realm, ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRealm File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
setRealm
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
private String keyFromMapObject(Object key) { if (key instanceof String) { return (String) key; } return "" + key; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: keyFromMapObject File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java Repository: orientechnologies/orientdb The code follows secure coding practices.
[ "CWE-352" ]
CVE-2015-2912
MEDIUM
6.8
orientechnologies/orientdb
keyFromMapObject
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
d5a45e608ba8764fd817c1bdd7cf966564e828e9
0
Analyze the following code function for security vulnerabilities
private Set getProfileIdsLocked(int userId) { Set userIds = new HashSet<Integer>(); final List<UserInfo> profiles = getUserManagerLocked().getProfiles( userId, false /* enabledOnly */); for (UserInfo user : profiles) { userIds.add(Integer.valueOf(user.id)); } return userIds; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProfileIdsLocked 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
getProfileIdsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public String protocol() { return protocol; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: protocol 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
protocol
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") void finishInstrumentationLocked(ProcessRecord app, int resultCode, Bundle results) { if (app.instr == null) { Slog.w(TAG, "finishInstrumentation called on non-instrumented: " + app); return; } if (!app.instr.mFinished) { if (app.instr.mWatcher != null) { Bundle finalResults = app.instr.mCurResults; if (finalResults != null) { if (app.instr.mCurResults != null && results != null) { finalResults.putAll(results); } } else { finalResults = results; } mInstrumentationReporter.reportFinished(app.instr.mWatcher, app.instr.mClass, resultCode, finalResults); } // Can't call out of the system process with a lock held, so post a message. if (app.instr.mUiAutomationConnection != null) { mHandler.obtainMessage(SHUTDOWN_UI_AUTOMATION_CONNECTION_MSG, app.instr.mUiAutomationConnection).sendToTarget(); } app.instr.mFinished = true; } app.instr.removeProcess(app); app.instr = null; forceStopPackageLocked(app.info.packageName, -1, false, false, true, true, false, app.userId, "finished inst"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishInstrumentationLocked 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
finishInstrumentationLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public <T> T deserialize(Response response, GenericType<T> returnType) throws ApiException { if (response == null || returnType == null) { return null; } if ("byte[]".equals(returnType.toString())) { // Handle binary response (byte array). return (T) response.readEntity(byte[].class); } else if (returnType.getRawType() == File.class) { // Handle file downloading. T file = (T) downloadFileFromResponse(response); return file; } String contentType = null; List<Object> contentTypes = response.getHeaders().get("Content-Type"); if (contentTypes != null && !contentTypes.isEmpty()) contentType = String.valueOf(contentTypes.get(0)); // read the entity stream multiple times response.bufferEntity(); return response.readEntity(returnType); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deserialize File: samples/client/petstore/java/resteasy/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
deserialize
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void runSQLFile(String sqlFile, boolean stopOnError, Handler<AsyncResult<List<String>>> replyHandler){ if(sqlFile == null){ log.error("sqlFile value is null"); replyHandler.handle(Future.failedFuture("sqlFile value is null")); return; } try { StringBuilder singleStatement = new StringBuilder(); String[] allLines = sqlFile.split("(\r\n|\r|\n)"); List<String> execStatements = new ArrayList<>(); boolean inFunction = false; boolean inCopy = false; for (int i = 0; i < allLines.length; i++) { if(allLines[i].toUpperCase().matches("^\\s*(CREATE USER|CREATE ROLE).*") && AES.getSecretKey() != null) { final Pattern pattern = Pattern.compile("PASSWORD\\s*'(.+?)'\\s*", Pattern.CASE_INSENSITIVE); final Matcher matcher = pattern.matcher(allLines[i]); if(matcher.find()){ /** password argument indicated in the create user / role statement */ String newPassword = createPassword(matcher.group(1)); allLines[i] = matcher.replaceFirst(" PASSWORD '" + newPassword +"' "); } } if(allLines[i].trim().startsWith("\ufeff--") || allLines[i].trim().length() == 0 || allLines[i].trim().startsWith("--")){ //this is an sql comment, skip continue; } else if(allLines[i].toUpperCase().matches("^\\s*(COPY ).*?FROM.*?STDIN.*") && !inFunction){ singleStatement.append(allLines[i]); inCopy = true; } else if (inCopy && (allLines[i].trim().equals("\\."))){ inCopy = false; execStatements.add( singleStatement.toString() ); singleStatement = new StringBuilder(); } else if(allLines[i].toUpperCase().matches("^\\s*(CREATE OR REPLACE FUNCTION|CREATE FUNCTION).*")){ singleStatement.append(allLines[i]+"\n"); inFunction = true; } else if (inFunction && allLines[i].trim().toUpperCase().matches(".*\\s*LANGUAGE .*")){ singleStatement.append(SPACE + allLines[i]); if(!allLines[i].trim().endsWith(SEMI_COLON)){ int j=0; if(i+1<allLines.length){ for (j = i+1; j < allLines.length; j++) { if(allLines[j].trim().toUpperCase().trim().matches(CLOSE_FUNCTION_POSTGRES)){ singleStatement.append(SPACE + allLines[j]); } else{ break; } } } i = j; } inFunction = false; execStatements.add( singleStatement.toString() ); singleStatement = new StringBuilder(); } else if(allLines[i].trim().endsWith(SEMI_COLON) && !inFunction && !inCopy){ execStatements.add( singleStatement.append(SPACE + allLines[i]).toString() ); singleStatement = new StringBuilder(); } else { if(inCopy) { singleStatement.append("\n"); } else{ singleStatement.append(SPACE); } singleStatement.append(allLines[i]); } } String lastStatement = singleStatement.toString(); if (! lastStatement.trim().isEmpty()) { execStatements.add(lastStatement); } execute(execStatements.toArray(new String[]{}), stopOnError, replyHandler); } catch (Exception e) { log.error(e.getMessage(), e); replyHandler.handle(Future.failedFuture(e)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runSQLFile File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
runSQLFile
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Test public void deleteByPojoX(TestContext context) throws FieldException { deleteByPojo(context, xPojo); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteByPojoX 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
deleteByPojoX
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Test public void testGETAttachmentVersions() throws Exception { final int NUMBER_OF_VERSIONS = 4; String attachmentName = String.format("%s.txt", UUID.randomUUID().toString()); Map<String, String> versionToContentMap = new HashMap<String, String>(); /* Create NUMBER_OF_ATTACHMENTS attachments */ for (int i = 0; i < NUMBER_OF_VERSIONS; i++) { String attachmentURI = buildURIForThisPage(AttachmentResource.class, attachmentName); String content = String.format("CONTENT %d", i); PutMethod putMethod = executePut(attachmentURI, content, MediaType.TEXT_PLAIN, TestUtils.SUPER_ADMIN_CREDENTIALS.getUserName(), TestUtils.SUPER_ADMIN_CREDENTIALS.getPassword()); if (i == 0) { Assert.assertEquals(getHttpMethodInfo(putMethod), HttpStatus.SC_CREATED, putMethod.getStatusCode()); } else { Assert.assertEquals(getHttpMethodInfo(putMethod), HttpStatus.SC_ACCEPTED, putMethod.getStatusCode()); } Attachment attachment = (Attachment) this.unmarshaller.unmarshal(putMethod.getResponseBodyAsStream()); versionToContentMap.put(attachment.getVersion(), content); } String attachmentsUri = buildURIForThisPage(AttachmentHistoryResource.class, attachmentName); GetMethod getMethod = executeGet(attachmentsUri); Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode()); Attachments attachments = (Attachments) this.unmarshaller.unmarshal(getMethod.getResponseBodyAsStream()); Assert.assertEquals(NUMBER_OF_VERSIONS, attachments.getAttachments().size()); for (Attachment attachment : attachments.getAttachments()) { getMethod = executeGet(getFirstLinkByRelation(attachment, Relations.ATTACHMENT_DATA).getHref()); Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode()); Assert.assertEquals(versionToContentMap.get(attachment.getVersion()), getMethod.getResponseBodyAsString()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testGETAttachmentVersions File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-352" ]
CVE-2023-37277
CRITICAL
9.6
xwiki/xwiki-platform
testGETAttachmentVersions
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java
4c175405faa0e62437df397811c7526dfc0fbae7
0
Analyze the following code function for security vulnerabilities
public abstract File getBaseDirectory();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBaseDirectory File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
getBaseDirectory
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
public String displayPrettyName(String fieldname, boolean showMandatory, boolean before) { if (this.currentObj == null) { return this.doc.displayPrettyName(fieldname, showMandatory, before, getXWikiContext()); } else { return this.doc.displayPrettyName(fieldname, showMandatory, before, this.currentObj.getBaseObject(), getXWikiContext()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayPrettyName 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
displayPrettyName
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
private void showErrorToast(String message) { Toast t = Toast.makeText(this, message, Toast.LENGTH_LONG); t.setText(message); t.setGravity(Gravity.CENTER_HORIZONTAL, 0, getResources().getDimensionPixelSize(R.dimen.attachment_toast_yoffset)); t.show(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showErrorToast File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
showErrorToast
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private static String getDateCreated(long timeInMillis) { Date date = new Date(timeInMillis); DateFormat df = new SimpleDateFormat("yyyy-MM-dd-E"); return df.format(date); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDateCreated File: cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Search.java Repository: ballerina-platform/ballerina-lang The code follows secure coding practices.
[ "CWE-306" ]
CVE-2021-32700
MEDIUM
5.8
ballerina-platform/ballerina-lang
getDateCreated
cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Search.java
4609ffee1744ecd16aac09303b1783bf0a525816
0
Analyze the following code function for security vulnerabilities
boolean supportsFreeform() { return supportsFreeformInDisplayArea(getDisplayArea()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: supportsFreeform 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
supportsFreeform
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private static void mapQueryCachesConfigXmlGenerator(XmlGenerator gen, MapConfig mapConfig) { List<QueryCacheConfig> queryCacheConfigs = mapConfig.getQueryCacheConfigs(); if (queryCacheConfigs != null && !queryCacheConfigs.isEmpty()) { gen.open("query-caches"); for (QueryCacheConfig queryCacheConfig : queryCacheConfigs) { gen.open("query-cache", "name", queryCacheConfig.getName()); gen.node("include-value", queryCacheConfig.isIncludeValue()); gen.node("in-memory-format", queryCacheConfig.getInMemoryFormat()); gen.node("populate", queryCacheConfig.isPopulate()); gen.node("coalesce", queryCacheConfig.isCoalesce()); gen.node("delay-seconds", queryCacheConfig.getDelaySeconds()); gen.node("batch-size", queryCacheConfig.getBatchSize()); gen.node("buffer-size", queryCacheConfig.getBufferSize()); evictionConfigXmlGenerator(gen, queryCacheConfig.getEvictionConfig()); mapIndexConfigXmlGenerator(gen, queryCacheConfig.getIndexConfigs()); mapQueryCachePredicateConfigXmlGenerator(gen, queryCacheConfig); entryListenerConfigXmlGenerator(gen, queryCacheConfig.getEntryListenerConfigs()); gen.close(); } gen.close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mapQueryCachesConfigXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
mapQueryCachesConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public void onLoadStarted() { for (TabObserver observer : mObservers) observer.onLoadStarted(Tab.this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLoadStarted File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
onLoadStarted
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public String toString() { return text; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: src/edu/stanford/nlp/util/XMLUtils.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-0239
HIGH
7.5
stanfordnlp/CoreNLP
toString
src/edu/stanford/nlp/util/XMLUtils.java
1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd
0
Analyze the following code function for security vulnerabilities
private static String replaceTimeWithFormat(String query, String regExp, String timeFormat) { List<RegExMatch> matches = RegEX.find(query, regExp); String originalDate; String luceneDate; StringBuilder newQuery; int begin; if ((matches != null) && (0 < matches.size())) { newQuery = new StringBuilder(query.length() * 2); begin = 0; for (RegExMatch regExMatch : matches) { originalDate = regExMatch.getMatch(); luceneDate = toLuceneTimeWithFormat(originalDate, timeFormat); newQuery.append(query.substring(begin, regExMatch.getBegin()) + luceneDate); begin = regExMatch.getEnd(); } return newQuery.append(query.substring(begin)).toString(); } return query; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replaceTimeWithFormat File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
replaceTimeWithFormat
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
@Deprecated public void loadAttachmentContent(XWikiAttachment attachment, XWikiContext context) throws XWikiException { String database = context.getWikiId(); try { // We might need to switch database to // get the translated content if (getDatabase() != null) { context.setWikiId(getDatabase()); } attachment.loadAttachmentContent(context); } finally { if (database != null) { context.setWikiId(database); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadAttachmentContent File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
loadAttachmentContent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private void writeBinary(byte[] buf, int offset, int length) throws TException { writeVarint32(length); trans_.write(buf, offset, length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeBinary File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
writeBinary
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
@Override public Bundle getUserRestrictionsGlobally(String callerPackage) { if (!mHasFeature) { return null; } final CallerIdentity caller = getCallerIdentity(callerPackage); if (!isPolicyEngineForFinanceFlagEnabled()) { throw new IllegalStateException("Feature flag is not enabled."); } EnforcingAdmin admin = getEnforcingAdminForCaller(/*who=*/ null, caller.getPackageName()); return getUserRestrictionsFromPolicyEngine(admin, UserHandle.USER_ALL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserRestrictionsGlobally 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
getUserRestrictionsGlobally
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
protected String getItemGroupAndItemMetaConditionalOrderItems(String crfVersionIds) { return " where cv.crf_version_id in (" + crfVersionIds + ") and cv.crf_version_id = ifm.crf_version_id" + " and ifm.item_id = item.item_id and ifm.response_set_id = rs.response_set_id" + " and ifm.item_id = igm.item_id and cv.crf_version_id = igm.crf_version_id and igm.item_group_id = ig.item_group_id" + " and orderInForm.crf_version_id = cv.crf_version_id and orderInForm.item_id = ifm.item_id" + " order by cv.crf_id, cv.crf_version_id desc, ig.item_group_id, item.item_id, rs.response_set_id"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getItemGroupAndItemMetaConditionalOrderItems File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getItemGroupAndItemMetaConditionalOrderItems
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public String selectHeaderAccept(String[] accepts) { if (accepts.length == 0) { return null; } for (String accept : accepts) { if (isJsonMime(accept)) { return accept; } } return StringUtil.join(accepts, ","); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectHeaderAccept File: samples/openapi3/client/extensions/x-auth-id-alias/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
selectHeaderAccept
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public boolean hasPropertyBasedCreator() { return _creators[C_PROPS] != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasPropertyBasedCreator File: src/main/java/com/fasterxml/jackson/databind/deser/impl/CreatorCollector.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
hasPropertyBasedCreator
src/main/java/com/fasterxml/jackson/databind/deser/impl/CreatorCollector.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("resource") public static String quote(String string) { StringWriter sw = new StringWriter(); synchronized (sw.getBuffer()) { try { return quote(string, sw).toString(); } catch (IOException ignored) { // will never happen - we are writing to a string writer return ""; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: quote 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
quote
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
public ComputerSet getComputer() { return new ComputerSet(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getComputer File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getComputer
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private void onGetServerInfoFinish(RemoteOperationResult result) { /// update activity state mWaitingForOpId = Long.MAX_VALUE; if (result.isSuccess()) { /// SUCCESS means: // 1. connection succeeded, and we know if it's SSL or not // 2. server is installed // 3. we got the server version // 4. we got the authentication method required by the server mServerInfo = (GetServerInfoOperation.ServerInfo) (result.getData().get(0)); // show outdated warning if (getResources().getBoolean(R.bool.show_outdated_server_warning) && MainApp.OUTDATED_SERVER_VERSION.isSameMajorVersion(mServerInfo.mVersion) && !mServerInfo.hasExtendedSupport) { DisplayUtils.showServerOutdatedSnackbar(this, Snackbar.LENGTH_INDEFINITE); } if (webViewUser != null && !webViewUser.isEmpty() && webViewPassword != null && !webViewPassword.isEmpty()) { checkBasicAuthorization(webViewUser, webViewPassword); } else { new Thread(() -> { OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(Uri.parse(mServerInfo.mBaseUrl), this, true); RemoteOperationResult remoteOperationResult = new GetCapabilitiesRemoteOperation().execute(client); if (remoteOperationResult.isSuccess() && remoteOperationResult.getData() != null && remoteOperationResult.getData().size() > 0) { OCCapability capability = (OCCapability) remoteOperationResult.getData().get(0); try { primaryColor = Color.parseColor(capability.getServerColor()); } catch (Exception e) { // falls back to primary color } } }).start(); setContentView(R.layout.account_setup_webview); mLoginWebView = findViewById(R.id.login_webview); initWebViewLogin(mServerInfo.mBaseUrl + WEB_LOGIN, false); } } else { updateServerStatusIconAndText(result); showServerStatus(); } // very special case (TODO: move to a common place for all the remote operations) if (result.getCode() == ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED) { showUntrustedCertDialog(result); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onGetServerInfoFinish File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-248" ]
CVE-2021-32694
MEDIUM
4.3
nextcloud/android
onGetServerInfoFinish
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
9343bdd85d70625a90e0c952897957a102c2421b
0
Analyze the following code function for security vulnerabilities
public List<News> newsFromAuthor(String author){ Query query = em.createQuery("SELECT n FROM News n INNER JOIN n.authors a WHERE a.name LIKE :author ORDER BY date DESC"); query.setParameter("author", author); @SuppressWarnings("unchecked") List<News> news = query.getResultList(); return news; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newsFromAuthor File: Cnn-EJB/ejbModule/ejbs/NewsBean.java Repository: rfsimoes/IS_Projecto2 The code follows secure coding practices.
[ "CWE-89" ]
CVE-2014-125038
MEDIUM
5.2
rfsimoes/IS_Projecto2
newsFromAuthor
Cnn-EJB/ejbModule/ejbs/NewsBean.java
aa128b2c9c9fdcbbf5ecd82c1e92103573017fe0
0
Analyze the following code function for security vulnerabilities
public DaoConfig addSupportedSubscriptionType(Subscription.SubscriptionChannelType theSubscriptionChannelType) { myModelConfig.addSupportedSubscriptionType(theSubscriptionChannelType); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addSupportedSubscriptionType 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
addSupportedSubscriptionType
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
public static void dumpByteArray(byte[][] x) { if (hasNullPointer(x)) { throw new NullPointerException("x has null pointers"); } for (int i = 0; i < x.length; i++) { System.out.println(Hex.toHexString(x[i])); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpByteArray File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
dumpByteArray
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
public Client getHttpClient() { return httpClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHttpClient 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
getHttpClient
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 static void fullInfo(HttpServletRequest request, boolean staticHtml) { boolean staticBlog = ZrLogUtil.isStaticBlogPlugin(request); // 模板地址 String suffix = ""; if (staticBlog || staticHtml) { suffix = ".html"; } request.setAttribute("staticBlog", staticBlog); request.setAttribute("suffix", suffix); BaseDataInitVO baseDataInitVO = BeanUtil.cloneObject(request.getAttribute("init")); request.setAttribute("init", baseDataInitVO); Map webSite = baseDataInitVO.getWebSite(); String baseUrl = setBaseUrl(request, staticBlog, webSite); //过期 request.setAttribute("webs", webSite); String title = webSite.get("title") + " - " + webSite.get("second_title"); if (request.getAttribute("log") != null) { title = ((Log) request.getAttribute("log")).get("title") + " - " + title; } request.setAttribute("title", title); Object data = null; if (request.getAttribute("data") != null) { data = request.getAttribute("data"); } else if (request.getAttribute("log") != null) { data = request.getAttribute("log"); } staticHtml(data, request, suffix, Constants.getBooleanByFromWebSite("article_thumbnail_status")); PagerVO pager = (PagerVO) request.getAttribute("pager"); if (pager != null && !pager.getPageList().isEmpty()) { List<PagerVO.PageEntry> pageList = pager.getPageList(); for (PagerVO.PageEntry pageMap : pageList) { pageMap.setUrl(baseUrl + pageMap.getUrl() + suffix); } pager.setPageStartUrl(baseUrl + pager.getPageStartUrl() + suffix); pager.setPageEndUrl(baseUrl + pager.getPageEndUrl() + suffix); } fillTags(suffix, baseUrl, baseDataInitVO.getTags()); fillType(suffix, baseUrl, baseDataInitVO.getTypes()); fullNavBar(request, suffix, baseDataInitVO); baseDataInitVO.setArchiveList(getConvertedArchives(suffix, baseUrl, baseDataInitVO.getArchives())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fullInfo File: web/src/main/java/com/zrlog/web/interceptor/TemplateHelper.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21316
MEDIUM
4.3
94fzb/zrlog
fullInfo
web/src/main/java/com/zrlog/web/interceptor/TemplateHelper.java
b921c1ae03b8290f438657803eee05226755c941
0
Analyze the following code function for security vulnerabilities
public QName get(String name) { QName answer = null; if (name != null) { answer = noNamespaceCache.get(name); } else { name = ""; } if (answer == null) { answer = createQName(name); answer.setDocumentFactory(documentFactory); noNamespaceCache.put(name, answer); } return answer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: src/main/java/org/dom4j/tree/QNameCache.java Repository: dom4j The code follows secure coding practices.
[ "CWE-91" ]
CVE-2018-1000632
MEDIUM
5
dom4j
get
src/main/java/org/dom4j/tree/QNameCache.java
e598eb43d418744c4dbf62f647dd2381c9ce9387
0
Analyze the following code function for security vulnerabilities
private static void parseDynamicAttributes(Element root, Map<String, Attribute> dynamicAttributes, Map<String, Attribute> commonAttributes) throws PolicyException { for (Element ele : getByTagName(root, "attribute")) { String name = getAttributeValue(ele, "name"); Attribute toAdd = commonAttributes.get(name.toLowerCase()); if (toAdd != null) { String attrName = name.toLowerCase().substring(0, name.length() - 1); dynamicAttributes.put(attrName, toAdd); } else { throw new PolicyException("Dynamic attribute '" + name + "' was not defined in <common-attributes>"); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseDynamicAttributes File: src/main/java/org/owasp/validator/html/Policy.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-14735
MEDIUM
4.3
nahsra/antisamy
parseDynamicAttributes
src/main/java/org/owasp/validator/html/Policy.java
82da009e733a989a57190cd6aa1b6824724f6d36
0
Analyze the following code function for security vulnerabilities
public boolean isDeviceAccessibilityScriptInjectionEnabled() { try { // On JellyBean and higher, native accessibility is the default so script // injection is only allowed if enabled via a flag. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && !CommandLine.getInstance().hasSwitch( ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION)) { return false; } if (!mContentSettings.getJavaScriptEnabled()) { return false; } int result = getContext().checkCallingOrSelfPermission( android.Manifest.permission.INTERNET); if (result != PackageManager.PERMISSION_GRANTED) { return false; } Field field = Settings.Secure.class.getField("ACCESSIBILITY_SCRIPT_INJECTION"); field.setAccessible(true); String accessibilityScriptInjection = (String) field.get(null); ContentResolver contentResolver = getContext().getContentResolver(); if (mAccessibilityScriptInjectionObserver == null) { ContentObserver contentObserver = new ContentObserver(new Handler()) { @Override public void onChange(boolean selfChange, Uri uri) { setAccessibilityState(mAccessibilityManager.isEnabled()); } }; contentResolver.registerContentObserver( Settings.Secure.getUriFor(accessibilityScriptInjection), false, contentObserver); mAccessibilityScriptInjectionObserver = contentObserver; } return Settings.Secure.getInt(contentResolver, accessibilityScriptInjection, 0) == 1; } catch (NoSuchFieldException e) { // Do nothing, default to false. } catch (IllegalAccessException e) { // Do nothing, default to false. } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDeviceAccessibilityScriptInjectionEnabled File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
isDeviceAccessibilityScriptInjectionEnabled
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
protected void validate(Document document) throws SAXException, IOException { DOMSource docSource = new DOMSource(document); validator.validate(docSource); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validate File: ext/java/nokogiri/XmlSchema.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-611" ]
CVE-2020-26247
MEDIUM
4
sparklemotion/nokogiri
validate
ext/java/nokogiri/XmlSchema.java
9c87439d9afa14a365ff13e73adc809cb2c3d97b
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(value = MANAGE_DEVICE_POLICY_CERTIFICATES, conditional = true) public boolean installKeyPair(@Nullable ComponentName admin, @NonNull PrivateKey privKey, @NonNull Certificate[] certs, @NonNull String alias, int flags) { throwIfParentInstance("installKeyPair"); boolean requestAccess = (flags & INSTALLKEY_REQUEST_CREDENTIALS_ACCESS) == INSTALLKEY_REQUEST_CREDENTIALS_ACCESS; boolean isUserSelectable = (flags & INSTALLKEY_SET_USER_SELECTABLE) == INSTALLKEY_SET_USER_SELECTABLE; try { final byte[] pemCert = Credentials.convertToPem(certs[0]); byte[] pemChain = null; if (certs.length > 1) { pemChain = Credentials.convertToPem(Arrays.copyOfRange(certs, 1, certs.length)); } final byte[] pkcs8Key = KeyFactory.getInstance(privKey.getAlgorithm()) .getKeySpec(privKey, PKCS8EncodedKeySpec.class).getEncoded(); return mService.installKeyPair(admin, mContext.getPackageName(), pkcs8Key, pemCert, pemChain, alias, requestAccess, isUserSelectable); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } catch (NoSuchAlgorithmException | InvalidKeySpecException e) { Log.w(TAG, "Failed to obtain private key material", e); } catch (CertificateException | IOException e) { Log.w(TAG, "Could not pem-encode certificate", e); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installKeyPair 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
installKeyPair
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0