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 static boolean hasUnsafe() {
return UNSAFE_UNAVAILABILITY_CAUSE == null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasUnsafe
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
hasUnsafe
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
private void installNewPackageLI(PackageParser.Package pkg, int parseFlags, int scanFlags,
UserHandle user, String installerPackageName, String volumeUuid,
PackageInstalledInfo res) {
// Remember this for later, in case we need to rollback this install
String pkgName = pkg.packageName;
if (DEBUG_INSTALL) Slog.d(TAG, "installNewPackageLI: " + pkg);
final boolean dataDirExists = Environment
.getDataUserPackageDirectory(volumeUuid, UserHandle.USER_OWNER, pkgName).exists();
synchronized(mPackages) {
if (mSettings.mRenamedPackages.containsKey(pkgName)) {
// A package with the same name is already installed, though
// it has been renamed to an older name. The package we
// are trying to install should be installed as an update to
// the existing one, but that has not been requested, so bail.
res.setError(INSTALL_FAILED_ALREADY_EXISTS, "Attempt to re-install " + pkgName
+ " without first uninstalling package running as "
+ mSettings.mRenamedPackages.get(pkgName));
return;
}
if (mPackages.containsKey(pkgName)) {
// Don't allow installation over an existing package with the same name.
res.setError(INSTALL_FAILED_ALREADY_EXISTS, "Attempt to re-install " + pkgName
+ " without first uninstalling.");
return;
}
}
try {
PackageParser.Package newPackage = scanPackageLI(pkg, parseFlags, scanFlags,
System.currentTimeMillis(), user);
updateSettingsLI(newPackage, installerPackageName, volumeUuid, null, null, res, user);
// delete the partially installed application. the data directory will have to be
// restored if it was already existing
if (res.returnCode != PackageManager.INSTALL_SUCCEEDED) {
// remove package from internal structures. Note that we want deletePackageX to
// delete the package data and cache directories that it created in
// scanPackageLocked, unless those directories existed before we even tried to
// install.
deletePackageLI(pkgName, UserHandle.ALL, false, null, null,
dataDirExists ? PackageManager.DELETE_KEEP_DATA : 0,
res.removedInfo, true);
}
} catch (PackageManagerException e) {
res.setError("Package couldn't be installed in " + pkg.codePath, e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: installNewPackageLI
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
|
installNewPackageLI
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
private void migrate47(File dataDir, Stack<Integer> versions) {
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("Builds.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
Element refNameElement = element.element("refName");
if (refNameElement == null)
element.addElement("refName").setText("unknown");
}
dom.writeToFile(file, false);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate47
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
|
migrate47
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean unzipNonStrict(InputStream in, VFSContainer targetDir, Identity identity, boolean versioning) {
try(net.sf.jazzlib.ZipInputStream oZip = new net.sf.jazzlib.ZipInputStream(in)) {
VFSRepositoryService vfsRepositoryService = CoreSpringFactory.getImpl(VFSRepositoryService.class);
// unzip files
net.sf.jazzlib.ZipEntry oEntr = oZip.getNextEntry();
VFSLeaf lastLeaf = null;
while (oEntr != null) {
if (oEntr.getName() != null && !oEntr.getName().startsWith(DIR_NAME__MACOSX)) {
if (oEntr.isDirectory()) {
// skip MacOSX specific metadata directory
// create directories
getAllSubdirs(targetDir, oEntr.getName(), identity, true);
} else {
// create file
VFSContainer createIn = targetDir;
String name = oEntr.getName();
// check if entry has directories which did not show up as
// directories above
int dirSepIndex = name.lastIndexOf('/');
if (dirSepIndex == -1) {
// try it windows style, backslash is also valid format
dirSepIndex = name.lastIndexOf('\\');
}
if (dirSepIndex > 0) {
// create subdirs
createIn = getAllSubdirs(targetDir, name.substring(0, dirSepIndex), identity, true);
if (createIn == null) {
log.debug("Error creating directory structure for zip entry: {}", oEntr.getName());
return false;
}
name = name.substring(dirSepIndex + 1);
}
if(name != null && name.startsWith("._oo_meta_")) {
if(lastLeaf != null && name.endsWith(lastLeaf.getName())) {
unzipMetadata(oZip, lastLeaf);
}
} else if(versioning) {
VFSLeaf newEntry = (VFSLeaf)createIn.resolve(name);
if(newEntry == null) {
newEntry = createIn.createChildLeaf(name);
if (!copyShielded(oZip, newEntry)) {
return false;
}
} else if (newEntry.canVersion() == VFSConstants.YES) {
vfsRepositoryService.addVersion(newEntry, identity, "", oZip);
}
lastLeaf = newEntry;
unzipMetadata(identity, newEntry);
} else {
VFSLeaf newEntry = createIn.createChildLeaf(name);
if (newEntry != null) {
if (!copyShielded(oZip, newEntry)) {
return false;
}
lastLeaf = newEntry;
unzipMetadata(identity, newEntry);
}
}
}
}
oZip.closeEntry();
oEntr = oZip.getNextEntry();
}
} catch (IOException e) {
return false;
}
return true;
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2021-39180
- Severity: HIGH
- CVSS Score: 9.0
Description: OO-5549: check parent by unzip
Function: unzipNonStrict
File: src/main/java/org/olat/core/util/ZipUtil.java
Repository: OpenOLAT
Fixed Code:
private static boolean unzipNonStrict(InputStream in, VFSContainer targetDir, Identity identity, boolean versioning) {
try(net.sf.jazzlib.ZipInputStream oZip = new net.sf.jazzlib.ZipInputStream(in)) {
VFSRepositoryService vfsRepositoryService = CoreSpringFactory.getImpl(VFSRepositoryService.class);
// unzip files
net.sf.jazzlib.ZipEntry oEntr = oZip.getNextEntry();//TODO zip
VFSLeaf lastLeaf = null;
while (oEntr != null) {
if (oEntr.getName() != null && !oEntr.getName().startsWith(DIR_NAME__MACOSX)) {
if (oEntr.isDirectory()) {
// skip MacOSX specific metadata directory
// create directories
getAllSubdirs(targetDir, oEntr.getName(), identity, true);
} else {
// create file
VFSContainer createIn = targetDir;
String name = oEntr.getName();
// check if entry has directories which did not show up as
// directories above
int dirSepIndex = name.lastIndexOf('/');
if (dirSepIndex == -1) {
// try it windows style, backslash is also valid format
dirSepIndex = name.lastIndexOf('\\');
}
if (dirSepIndex > 0) {
// create subdirs
createIn = getAllSubdirs(targetDir, name.substring(0, dirSepIndex), identity, true);
if (createIn == null) {
log.debug("Error creating directory structure for zip entry: {}", oEntr.getName());
return false;
}
name = name.substring(dirSepIndex + 1);
}
if(name != null && name.startsWith("._oo_meta_")) {
if(lastLeaf != null && name.endsWith(lastLeaf.getName())) {
unzipMetadata(oZip, lastLeaf);
}
} else if(versioning) {
VFSLeaf newEntry = (VFSLeaf)createIn.resolve(name);
if(newEntry == null) {
newEntry = createIn.createChildLeaf(name);
if (!copyShielded(oZip, newEntry)) {
return false;
}
} else if (newEntry.canVersion() == VFSConstants.YES) {
vfsRepositoryService.addVersion(newEntry, identity, "", oZip);
}
lastLeaf = newEntry;
unzipMetadata(identity, newEntry);
} else {
VFSLeaf newEntry = createIn.createChildLeaf(name);
if (newEntry != null) {
if (!copyShielded(oZip, newEntry)) {
return false;
}
lastLeaf = newEntry;
unzipMetadata(identity, newEntry);
}
}
}
}
oZip.closeEntry();
oEntr = oZip.getNextEntry();
}
} catch (IOException e) {
return false;
}
return true;
}
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
unzipNonStrict
|
src/main/java/org/olat/core/util/ZipUtil.java
|
5668a41ab3f1753102a89757be013487544279d5
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public int delete(Uri uri, String selection, String[] selectionArgs)
{
int uriType = URI_MATCHER.match(uri);
SQLiteDatabase db = databaseManager.getWriteDb();
int rowsDeleted = 0;
switch (uriType)
{
case SEARCHES:
rowsDeleted = db.delete(HistorySearchSchema.TABLENAME, selection, selectionArgs);
break;
case SEARCH_ID:
String id = uri.getLastPathSegment();
if (TextUtils.isEmpty(selection))
{
rowsDeleted = db.delete(HistorySearchSchema.TABLENAME, HistorySearchSchema.COLUMN_ID + "=" + id,
null);
}
else
{
rowsDeleted = db.delete(HistorySearchSchema.TABLENAME, HistorySearchSchema.COLUMN_ID + "=" + id
+ " and " + selection, selectionArgs);
}
break;
default:
throw new IllegalArgumentException("Unknown URI: " + uri);
}
getContext().getContentResolver().notifyChange(uri, null);
return rowsDeleted;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: delete
File: alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/providers/search/HistorySearchProvider.java
Repository: Alfresco/alfresco-android-app
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15566
|
HIGH
| 7.5
|
Alfresco/alfresco-android-app
|
delete
|
alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/providers/search/HistorySearchProvider.java
|
32faa4355f82783326d16b0252e81e1231e12c9c
| 0
|
Analyze the following code function for security vulnerabilities
|
@ParameterizedTest
@MethodSource("testsParameters")
@Order(2)
void registerExistingUser(boolean useLiveValidation, boolean isModal, TestUtils testUtils) throws Exception
{
AbstractRegistrationPage registrationPage = setUp(testUtils, useLiveValidation, isModal);
// Uses the empty string instead of the null value to empty the form fields (the null value just keep the value filled from the previously run test).
registrationPage.fillRegisterForm("", "", "Admin", "password", "password", "");
// Can't use validateAndRegister here because user existence is not checked by LiveValidation.
assertFalse(tryToRegister(testUtils, registrationPage, isModal));
assertTrue(registrationPage.validationFailureMessagesInclude("User already exists."));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerExistingUser
File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2024-21650
|
CRITICAL
| 9.8
|
xwiki/xwiki-platform
|
registerExistingUser
|
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java
|
b290bfd573c6f7db6cc15a88dd4111d9fcad0d31
| 0
|
Analyze the following code function for security vulnerabilities
|
public HttpRequest open() {
if (httpConnectionProvider == null) {
return open(HttpConnectionProvider.get());
}
return open(httpConnectionProvider);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: open
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
|
open
|
src/main/java/jodd/http/HttpRequest.java
|
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
| 0
|
Analyze the following code function for security vulnerabilities
|
public <T> void get(String table, Class<T> clazz, String[] fields, CQLWrapper filter,
boolean returnCount, boolean setId,
Handler<AsyncResult<Results<T>>> replyHandler) {
get(table, clazz, fields, filter, returnCount, setId, null, replyHandler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: get
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
|
get
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public static AbstractSession getSession(IoSession ioSession)
throws MissingAttachedSessionException {
return getSession(ioSession, false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSession
File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
Repository: apache/mina-sshd
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
apache/mina-sshd
|
getSession
|
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
|
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
| 0
|
Analyze the following code function for security vulnerabilities
|
private void writeHuffmanEncodableValue(ByteBuffer target, HttpString headerName, String val) {
if (hpackHeaderFunction.shouldUseHuffman(headerName, val)) {
if (!HPackHuffman.encode(target, val, false)) {
writeValueString(target, val);
}
} else {
writeValueString(target, val);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeHuffmanEncodableValue
File: core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-214"
] |
CVE-2021-3859
|
HIGH
| 7.5
|
undertow-io/undertow
|
writeHuffmanEncodableValue
|
core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java
|
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
| 0
|
Analyze the following code function for security vulnerabilities
|
@LargeTest
@Test
public void testSingleOutgoingCallLocalDisconnect() throws Exception {
IdPair ids = startAndMakeActiveOutgoingCall("650-555-1212",
mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
mInCallServiceFixtureX.mInCallAdapter.disconnectCall(ids.mCallId);
assertEquals(Call.STATE_DISCONNECTING,
mInCallServiceFixtureX.getCall(ids.mCallId).getState());
assertEquals(Call.STATE_DISCONNECTING,
mInCallServiceFixtureY.getCall(ids.mCallId).getState());
when(mClockProxy.currentTimeMillis()).thenReturn(TEST_DISCONNECT_TIME);
when(mClockProxy.elapsedRealtime()).thenReturn(TEST_DISCONNECT_ELAPSED_TIME);
mConnectionServiceFixtureA.sendSetDisconnected(ids.mConnectionId, DisconnectCause.LOCAL);
assertEquals(Call.STATE_DISCONNECTED,
mInCallServiceFixtureX.getCall(ids.mCallId).getState());
assertEquals(Call.STATE_DISCONNECTED,
mInCallServiceFixtureY.getCall(ids.mCallId).getState());
assertEquals(TEST_CONNECT_TIME,
mInCallServiceFixtureX.getCall(ids.mCallId).getConnectTimeMillis());
assertEquals(TEST_CONNECT_TIME,
mInCallServiceFixtureY.getCall(ids.mCallId).getConnectTimeMillis());
assertEquals(TEST_CREATE_TIME,
mInCallServiceFixtureX.getCall(ids.mCallId).getCreationTimeMillis());
assertEquals(TEST_CREATE_TIME,
mInCallServiceFixtureY.getCall(ids.mCallId).getCreationTimeMillis());
verifyNoBlockChecks();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testSingleOutgoingCallLocalDisconnect
File: tests/src/com/android/server/telecom/tests/BasicCallTests.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
testSingleOutgoingCallLocalDisconnect
|
tests/src/com/android/server/telecom/tests/BasicCallTests.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Set<String> getRoles(PrincipalCollection principals) {
return getRoles(principals.getPrimaryPrincipal());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRoles
File: dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java
Repository: ManyDesigns/Portofino
The code follows secure coding practices.
|
[
"CWE-347"
] |
CVE-2021-29451
|
MEDIUM
| 6.4
|
ManyDesigns/Portofino
|
getRoles
|
dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java
|
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setSuggestedQuery(
OmniboxResultItem suggestionItem, boolean showDescriptionIfPresent,
boolean isUrlQuery, boolean isUrlHighlighted) {
String userQuery = suggestionItem.getMatchedQuery();
String suggestedQuery = null;
List<MatchClassification> classifications;
OmniboxSuggestion suggestion = suggestionItem.getSuggestion();
if (showDescriptionIfPresent && !TextUtils.isEmpty(suggestion.getUrl())
&& !TextUtils.isEmpty(suggestion.getDescription())) {
suggestedQuery = suggestion.getDescription();
classifications = suggestion.getDescriptionClassifications();
} else {
suggestedQuery = suggestion.getDisplayText();
classifications = suggestion.getDisplayTextClassifications();
}
if (suggestedQuery == null) {
assert false : "Invalid suggestion sent with no displayable text";
suggestedQuery = "";
classifications = new ArrayList<MatchClassification>();
classifications.add(new MatchClassification(0, MatchClassificationStyle.NONE));
}
if (mSuggestion.getType() == OmniboxSuggestionType.SEARCH_SUGGEST_TAIL) {
String fillIntoEdit = mSuggestion.getFillIntoEdit();
// Data sanity checks.
if (fillIntoEdit.startsWith(userQuery)
&& fillIntoEdit.endsWith(suggestedQuery)
&& fillIntoEdit.length() < userQuery.length() + suggestedQuery.length()) {
final String ellipsisPrefix = "\u2026 ";
suggestedQuery = ellipsisPrefix + suggestedQuery;
// Offset the match classifications by the length of the ellipsis prefix to ensure
// the highlighting remains correct.
for (int i = 0; i < classifications.size(); i++) {
classifications.set(i, new MatchClassification(
classifications.get(i).offset + ellipsisPrefix.length(),
classifications.get(i).style));
}
classifications.add(0, new MatchClassification(0, MatchClassificationStyle.NONE));
if (DeviceFormFactor.isTablet(getContext())) {
TextPaint tp = mContentsView.mTextLine1.getPaint();
mContentsView.mRequiredWidth =
tp.measureText(fillIntoEdit, 0, fillIntoEdit.length());
mContentsView.mMatchContentsWidth =
tp.measureText(suggestedQuery, 0, suggestedQuery.length());
// Update the max text widths values in SuggestionList. These will be passed to
// the contents view on layout.
mSuggestionDelegate.onTextWidthsUpdated(
mContentsView.mRequiredWidth, mContentsView.mMatchContentsWidth);
}
}
}
Spannable str = SpannableString.valueOf(suggestedQuery);
if (!isUrlHighlighted) applyHighlightToMatchRegions(str, classifications);
mContentsView.mTextLine1.setText(str, BufferType.SPANNABLE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSuggestedQuery
File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5163
|
MEDIUM
| 4.3
|
chromium
|
setSuggestedQuery
|
chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
|
3bd33fee094e863e5496ac24714c558bd58d28ef
| 0
|
Analyze the following code function for security vulnerabilities
|
public void clearUserTemporarilyDisabledList() {
mUserTemporarilyDisabledList.clear();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearUserTemporarilyDisabledList
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
clearUserTemporarilyDisabledList
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean hasMacRandomizationSettingsChanged(WifiConfiguration existingConfig,
WifiConfiguration newConfig) {
if (existingConfig == null) {
return newConfig.macRandomizationSetting != WifiConfiguration.RANDOMIZATION_AUTO;
}
return newConfig.macRandomizationSetting != existingConfig.macRandomizationSetting;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasMacRandomizationSettingsChanged
File: service/java/com/android/server/wifi/WifiConfigurationUtil.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21252
|
MEDIUM
| 5.5
|
android
|
hasMacRandomizationSettingsChanged
|
service/java/com/android/server/wifi/WifiConfigurationUtil.java
|
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Map<String, Object> toJson() {
Map json = super.toJson();
json.put("files", subDirectory.toJson());
return json;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toJson
File: common/src/main/java/com/thoughtworks/go/domain/FolderDirectoryEntry.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2021-43288
|
LOW
| 3.5
|
gocd
|
toJson
|
common/src/main/java/com/thoughtworks/go/domain/FolderDirectoryEntry.java
|
f5c1d2aa9ab302a97898a6e4b16218e64fe8e9e4
| 0
|
Analyze the following code function for security vulnerabilities
|
static JsonValue tryParseNumber(StringBuilder value, boolean stopAtNext) throws IOException {
int idx=0, len=value.length();
if (idx<len && value.charAt(idx)=='-') idx++;
if (idx>=len) return null;
char first=value.charAt(idx++);
if (!isDigit(first)) return null;
if (first=='0' && idx<len && isDigit(value.charAt(idx)))
return null; // leading zero is not allowed
while (idx<len && isDigit(value.charAt(idx))) idx++;
// frac
if (idx<len && value.charAt(idx)=='.') {
idx++;
if (idx>=len || !isDigit(value.charAt(idx++))) return null;
while (idx<len && isDigit(value.charAt(idx))) idx++;
}
// exp
if (idx<len && Character.toLowerCase(value.charAt(idx))=='e') {
idx++;
if (idx<len && (value.charAt(idx)=='+' || value.charAt(idx)=='-')) idx++;
if (idx>=len || !isDigit(value.charAt(idx++))) return null;
while (idx<len && isDigit(value.charAt(idx))) idx++;
}
int last=idx;
while (idx<len && isWhiteSpace(value.charAt(idx))) idx++;
boolean foundStop=false;
if (idx<len && stopAtNext) {
// end scan if we find a control character like ,}] or a comment
char ch=value.charAt(idx);
if (ch==',' || ch=='}' || ch==']' || ch=='#' || ch=='/' && (len>idx+1 && (value.charAt(idx+1)=='/' || value.charAt(idx+1)=='*')))
foundStop=true;
}
if (idx<len && !foundStop) return null;
return new JsonNumber(Double.parseDouble(value.substring(0, last)));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: tryParseNumber
File: src/main/org/hjson/HjsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34620
|
HIGH
| 7.5
|
hjson/hjson-java
|
tryParseNumber
|
src/main/org/hjson/HjsonParser.java
|
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "2.2M2")
public void setStringListValue(String className, String fieldName, List value)
{
setStringListValue(
getXClassEntityReferenceResolver().resolve(className, EntityType.DOCUMENT, getDocumentReference()),
fieldName, value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setStringListValue
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
|
setStringListValue
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean validateImsManifest(Document doc) {
try {
//do not throw exception already here, as it might be only a generic zip file
if (doc == null) return false;
String adluri = null;
String seqencingUri = null;
String simpleSeqencingUri = null;
// get all organization elements. need to set namespace
Element rootElement = doc.getRootElement();
String nsuri = rootElement.getNamespace().getURI();
// look for the adl cp namespace that differs a scorm package from a normal cp package
Namespace nsADL = rootElement.getNamespaceForPrefix("adlcp");
if (nsADL != null ) adluri = nsADL.getURI();
Namespace nsADLSeq = rootElement.getNamespaceForPrefix("adlseq");
if (nsADLSeq != null ) seqencingUri = nsADLSeq.getURI();
Namespace nsADLSS = rootElement.getNamespaceForPrefix("imsss");
if (nsADLSS != null ) simpleSeqencingUri = nsADLSS.getURI();
// we can only support scorm 1.2 so far.
if (adluri != null && !((adluri.indexOf("adlcp_rootv1p2") != -1) || (adluri.indexOf("adlcp_rootv1p3") != -1))){
//we dont have have scorm 1.2 or 1.3 namespace so it can't be a scorm package
return false;
}
Map<String, String> nsuris = new HashMap<>(5);
nsuris.put("ns", nsuri);
//nsuris.put("adluri", adluri);
//we might have a scorm 2004 which we do not yet support
if (seqencingUri != null) nsuris.put("adlseq", seqencingUri);
if (simpleSeqencingUri != null) nsuris.put("imsss", simpleSeqencingUri);
// Check for organization element. Must provide at least one... title gets extracted from either
// the (optional) <title> element or the mandatory identifier attribute.
// This makes sure, at least a root node gets created in CPManifestTreeModel.
XPath meta = rootElement.createXPath("//ns:organization");
meta.setNamespaceURIs(nsuris);
Element orgaEl = (Element) meta.selectSingleNode(rootElement);
if (orgaEl == null) {
return false;
}
// Check for at least one <item> element referencing a <resource> of adlcp:scormtype="sco" or "asset",
// which will serve as an entry point.
XPath resourcesXPath = rootElement.createXPath("//ns:resources");
resourcesXPath.setNamespaceURIs(nsuris);
Element elResources = (Element)resourcesXPath.selectSingleNode(rootElement);
if (elResources == null) {
return false;
}
XPath itemsXPath = rootElement.createXPath("//ns:item");
itemsXPath.setNamespaceURIs(nsuris);
List<Node> items = itemsXPath.selectNodes(rootElement);
if (items.isEmpty()) {
return false; // no <item> element.
}
// check for scorm 2004 simple sequencing stuff which we do not yet support
if (seqencingUri != null) {
XPath seqencingXPath = rootElement.createXPath("//ns:imsss");
List<Node> sequences = seqencingXPath.selectNodes(rootElement);
if (!sequences.isEmpty()) {
return false; // seqencing elements found -> scorm 2004
}
}
Set<String> set = new HashSet<>();
for (Iterator<Node> iter = items.iterator(); iter.hasNext();) {
Element item = (Element) iter.next();
String identifier = item.attributeValue("identifier");
//check if identifiers are unique, reject if not so
if (!set.add(identifier)) {
return false;
}
}
for (Iterator<Node> iter = items.iterator(); iter.hasNext();) {
Element item = (Element) iter.next();
String identifierref = item.attributeValue("identifierref");
if (identifierref == null) continue;
XPath resourceXPath = rootElement.createXPath("//ns:resource[@identifier='" + identifierref + "']");
resourceXPath.setNamespaceURIs(nsuris);
Element elResource = (Element)resourceXPath.selectSingleNode(elResources);
if (elResource == null) {
return false;
}
//check for scorm attribute
Attribute scormAttr = elResource.attribute("scormtype");
//some packages have attribute written like "scormType"
Attribute scormAttrUpper = elResource.attribute("scormType");
if (scormAttr == null && scormAttrUpper == null) {
return false;
}
String attr = "";
if (scormAttr != null) attr = scormAttr.getStringValue();
if (scormAttrUpper != null) attr = scormAttrUpper.getStringValue();
if (attr == null) {
return false;
}
if (elResource.attributeValue("href") != null && (attr.equalsIgnoreCase("sco") || attr.equalsIgnoreCase("asset"))) {
return true; // success.
}
}
return false;
} catch (Exception e) {
log.warn("Not a valid SCORM package", e);
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateImsManifest
File: src/main/java/org/olat/fileresource/types/ScormCPFileResource.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
validateImsManifest
|
src/main/java/org/olat/fileresource/types/ScormCPFileResource.java
|
699490be8e931af0ef1f135c55384db1f4232637
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String[] getNames(Object object) {
if (object == null) {
return null;
}
Class<?> klass = object.getClass();
Field[] fields = klass.getFields();
int length = fields.length;
if (length == 0) {
return null;
}
String[] names = new String[length];
for (int i = 0; i < length; i += 1) {
names[i] = fields[i].getName();
}
return names;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNames
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
|
getNames
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected List<Delta> getDeltas(Revision rev)
{
List<Delta> list = new ArrayList<Delta>();
for (int i = 0; i < rev.size(); i++) {
list.add(rev.getDelta(i));
}
return list;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDeltas
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
|
getDeltas
|
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 readStructure(Element design, DesignContext context) {
if (design.children().isEmpty()) {
return;
}
if (design.children().size() > 1
|| !design.child(0).tagName().equals("table")) {
throw new DesignException(
"Grid needs to have a table element as its only child");
}
Element table = design.child(0);
Elements colgroups = table.getElementsByTag("colgroup");
if (colgroups.size() != 1) {
throw new DesignException(
"Table element in declarative Grid needs to have a"
+ " colgroup defining the columns used in Grid");
}
List<DeclarativeValueProvider<T>> providers = new ArrayList<>();
for (Element col : colgroups.get(0).getElementsByTag("col")) {
String id = DesignAttributeHandler.readAttribute("column-id",
col.attributes(), null, String.class);
// If there is a property with a matching name available,
// map to that
Optional<PropertyDefinition<T, ?>> property = propertySet
.getProperties().filter(p -> p.getName().equals(id))
.findFirst();
Column<T, ?> column;
if (property.isPresent()) {
column = addColumn(id);
} else {
DeclarativeValueProvider<T> provider = new DeclarativeValueProvider<>();
column = createColumn(provider, ValueProvider.identity(),
new HtmlRenderer());
addColumn(getGeneratedIdentifier(), column);
if (id != null) {
column.setId(id);
}
providers.add(provider);
}
column.readDesign(col, context);
}
for (Element child : table.children()) {
if (child.tagName().equals("thead")) {
getHeader().readDesign(child, context);
} else if (child.tagName().equals("tbody")) {
readData(child, providers);
} else if (child.tagName().equals("tfoot")) {
getFooter().readDesign(child, context);
}
}
// Sync default header captions to column captions
if (getDefaultHeaderRow() != null) {
for (Column<T, ?> c : getColumns()) {
HeaderCell headerCell = getDefaultHeaderRow().getCell(c);
if (headerCell.getCellType() == GridStaticCellType.TEXT) {
c.setCaption(headerCell.getText());
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readStructure
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
readStructure
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
public void delete() {
safeDelete(certificate);
safeDelete(privateKey);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: delete
File: handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-378",
"CWE-379"
] |
CVE-2021-21290
|
LOW
| 1.9
|
netty
|
delete
|
handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java
|
c735357bf29d07856ad171c6611a2e1a0e0000ec
| 0
|
Analyze the following code function for security vulnerabilities
|
int getRequestedOrientation() {
return mOrientation;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequestedOrientation
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
|
getRequestedOrientation
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public int length() {
return this.map.size();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: length
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
|
length
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
private final void performLayoutAndPlaceSurfacesLockedLoop() {
if (mInLayout) {
if (DEBUG) {
throw new RuntimeException("Recursive call!");
}
Slog.w(TAG, "performLayoutAndPlaceSurfacesLocked called while in layout. Callers="
+ Debug.getCallers(3));
return;
}
if (mWaitingForConfig) {
// Our configuration has changed (most likely rotation), but we
// don't yet have the complete configuration to report to
// applications. Don't do any window layout until we have it.
return;
}
if (!mDisplayReady) {
// Not yet initialized, nothing to do.
return;
}
Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "wmLayout");
mInLayout = true;
boolean recoveringMemory = false;
if (!mForceRemoves.isEmpty()) {
recoveringMemory = true;
// Wait a little bit for things to settle down, and off we go.
while (!mForceRemoves.isEmpty()) {
WindowState ws = mForceRemoves.remove(0);
Slog.i(TAG, "Force removing: " + ws);
removeWindowInnerLocked(ws);
}
Slog.w(TAG, "Due to memory failure, waiting a bit for next layout");
Object tmp = new Object();
synchronized (tmp) {
try {
tmp.wait(250);
} catch (InterruptedException e) {
}
}
}
try {
performLayoutAndPlaceSurfacesLockedInner(recoveringMemory);
mInLayout = false;
if (needsLayout()) {
if (++mLayoutRepeatCount < 6) {
requestTraversalLocked();
} else {
Slog.e(TAG, "Performed 6 layouts in a row. Skipping");
mLayoutRepeatCount = 0;
}
} else {
mLayoutRepeatCount = 0;
}
if (mWindowsChanged && !mWindowChangeListeners.isEmpty()) {
mH.removeMessages(H.REPORT_WINDOWS_CHANGE);
mH.sendEmptyMessage(H.REPORT_WINDOWS_CHANGE);
}
} catch (RuntimeException e) {
mInLayout = false;
Slog.wtf(TAG, "Unhandled exception while laying out windows", e);
}
Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: performLayoutAndPlaceSurfacesLockedLoop
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
performLayoutAndPlaceSurfacesLockedLoop
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
public ArrayList<Responsavel> buscarResponsavel(String email, String nome, String telefone, String endereco) throws Exception{
if ((email == null) && (nome == null) && (telefone == null) && (endereco == null))
throw new Exception("Preencha pelo menos um dos campos para realizar a busca");
String cmd = "";
cmd += "select * from ACI_Responsavel where ";
if (email != null) {
cmd += "email like '%"+email+"%'";
if ((nome != null) || (telefone != null) || (endereco != null))
cmd += " and ";
}
if (nome != null) {
cmd += "nome like '%"+nome+"%'";
if ((telefone != null) || (endereco != null))
cmd += " and ";
}
if (telefone != null) {
cmd += "telefone like '%"+telefone+"%'";
if (endereco != null)
cmd += " and ";
}
if (endereco != null)
cmd += "endereco like '%"+endereco+"%'";
ResultSet result = this.bancoConec.execConsulta(cmd);
if (result.first()) {
String rEmail, rNome, rTelefone, rEndereco;
ArrayList<Responsavel> aResp = new ArrayList<Responsavel>();
rEmail = result.getString("email");
rNome = result.getString("nome");
rTelefone = result.getString("telefone");
rEndereco = result.getString("endereco");
Responsavel r = new Responsavel(rEmail,rNome,rTelefone,rEndereco);
aResp.add(r);
while (result.next()) {
rEmail = result.getString("email");
rNome = result.getString("nome");
rTelefone = result.getString("telefone");
rEndereco = result.getString("endereco");
Responsavel resp = new Responsavel(rEmail,rNome,rTelefone,rEndereco);
aResp.add(resp);
}
return aResp;
} else {
throw new Exception("Nenhum resultado");
}
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2015-10037
- Severity: MEDIUM
- CVSS Score: 5.2
Description: Prooteçao contra SQL Injection
Function: buscarResponsavel
File: Escola Eclipse/Escola/src/banco_de_dados/dao/Responsaveis.java
Repository: marinaguimaraes/ACI_Escola
Fixed Code:
public ArrayList<Responsavel> buscarResponsavel(String email, String nome, String telefone, String endereco) throws Exception{
if ((email == null) && (nome == null) && (telefone == null) && (endereco == null))
throw new Exception("Preencha pelo menos um dos campos para realizar a busca");
String cmd = "";
cmd += "select * from ACI_Responsavel where ";
if (email != null) {
cmd += "email like '%"+email.replace("'", "")+"%'";
if ((nome != null) || (telefone != null) || (endereco != null))
cmd += " and ";
}
if (nome != null) {
cmd += "nome like '%"+nome.replace("'", "")+"%'";
if ((telefone != null) || (endereco != null))
cmd += " and ";
}
if (telefone != null) {
cmd += "telefone like '%"+telefone.replace("'", "")+"%'";
if (endereco != null)
cmd += " and ";
}
if (endereco != null)
cmd += "endereco like '%"+endereco.replace("'", "")+"%'";
ResultSet result = this.bancoConec.execConsulta(cmd);
if (result.first()) {
String rEmail, rNome, rTelefone, rEndereco;
ArrayList<Responsavel> aResp = new ArrayList<Responsavel>();
rEmail = result.getString("email");
rNome = result.getString("nome");
rTelefone = result.getString("telefone");
rEndereco = result.getString("endereco");
Responsavel r = new Responsavel(rEmail,rNome,rTelefone,rEndereco);
aResp.add(r);
while (result.next()) {
rEmail = result.getString("email");
rNome = result.getString("nome");
rTelefone = result.getString("telefone");
rEndereco = result.getString("endereco");
Responsavel resp = new Responsavel(rEmail,rNome,rTelefone,rEndereco);
aResp.add(resp);
}
return aResp;
} else {
throw new Exception("Nenhum resultado");
}
}
|
[
"CWE-89"
] |
CVE-2015-10037
|
MEDIUM
| 5.2
|
marinaguimaraes/ACI_Escola
|
buscarResponsavel
|
Escola Eclipse/Escola/src/banco_de_dados/dao/Responsaveis.java
|
34eed1f7b9295d1424912f79989d8aba5de41e9f
| 1
|
Analyze the following code function for security vulnerabilities
|
public String getNavbarLink2URL() {
return CONF.navbarCustomLink2Url();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNavbarLink2URL
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
getNavbarLink2URL
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
void addInputMethodWindowToListLocked(WindowState win) {
int pos = findDesiredInputMethodWindowIndexLocked(true);
if (pos >= 0) {
win.mTargetAppToken = mInputMethodTarget.mAppToken;
if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(
TAG, "Adding input method window " + win + " at " + pos);
// TODO(multidisplay): IMEs are only supported on the default display.
getDefaultWindowListLocked().add(pos, win);
mWindowsChanged = true;
moveInputMethodDialogsLocked(pos+1);
return;
}
win.mTargetAppToken = null;
addWindowToListInOrderLocked(win, true);
moveInputMethodDialogsLocked(pos);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addInputMethodWindowToListLocked
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
addInputMethodWindowToListLocked
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean canShowErrorDialogs() {
return mShowDialogs && !mSleeping && !mShuttingDown;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canShowErrorDialogs
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
canShowErrorDialogs
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setMetricsCollector(MetricsCollector metricsCollector) {
this.metricsCollector = metricsCollector;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMetricsCollector
File: src/main/java/com/rabbitmq/client/ConnectionFactory.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
setMetricsCollector
|
src/main/java/com/rabbitmq/client/ConnectionFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void validateAppTokens(int stackId, List<TaskGroup> tasks) {
synchronized (mWindowMap) {
int t = tasks.size() - 1;
if (t < 0) {
Slog.w(TAG, "validateAppTokens: empty task list");
return;
}
TaskGroup task = tasks.get(0);
int taskId = task.taskId;
Task targetTask = mTaskIdToTask.get(taskId);
DisplayContent displayContent = targetTask.getDisplayContent();
if (displayContent == null) {
Slog.w(TAG, "validateAppTokens: no Display for taskId=" + taskId);
return;
}
final ArrayList<Task> localTasks = mStackIdToStack.get(stackId).getTasks();
int taskNdx;
for (taskNdx = localTasks.size() - 1; taskNdx >= 0 && t >= 0; --taskNdx, --t) {
AppTokenList localTokens = localTasks.get(taskNdx).mAppTokens;
task = tasks.get(t);
List<IApplicationToken> tokens = task.tokens;
DisplayContent lastDisplayContent = displayContent;
displayContent = mTaskIdToTask.get(taskId).getDisplayContent();
if (displayContent != lastDisplayContent) {
Slog.w(TAG, "validateAppTokens: displayContent changed in TaskGroup list!");
return;
}
int tokenNdx;
int v;
for (tokenNdx = localTokens.size() - 1, v = task.tokens.size() - 1;
tokenNdx >= 0 && v >= 0; ) {
final AppWindowToken atoken = localTokens.get(tokenNdx);
if (atoken.removed) {
--tokenNdx;
continue;
}
if (tokens.get(v) != atoken.token) {
break;
}
--tokenNdx;
v--;
}
if (tokenNdx >= 0 || v >= 0) {
break;
}
}
if (taskNdx >= 0 || t >= 0) {
Slog.w(TAG, "validateAppTokens: Mismatch! ActivityManager=" + tasks);
Slog.w(TAG, "validateAppTokens: Mismatch! WindowManager=" + localTasks);
Slog.w(TAG, "validateAppTokens: Mismatch! Callers=" + Debug.getCallers(4));
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateAppTokens
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
validateAppTokens
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isCssMimeType(String mimetype)
{
return "text/css".equalsIgnoreCase(mimetype);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCssMimeType
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SkinAction.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-36092
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
isCssMimeType
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SkinAction.java
|
71a6d0bb6f8ab718fcfaae0e9b8c16c2d69cd4bb
| 0
|
Analyze the following code function for security vulnerabilities
|
public static <T> List<String> getNamespacesForClass(final Class<T> clazz) {
final List<String> namespaces = new ArrayList<>();
final XmlSeeAlso seeAlso = clazz.getAnnotation(XmlSeeAlso.class);
if (seeAlso != null) {
for (final Class<?> c : seeAlso.value()) {
namespaces.addAll(getNamespacesForClass(c));
}
}
return namespaces;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNamespacesForClass
File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2023-0871
|
MEDIUM
| 6.1
|
OpenNMS/opennms
|
getNamespacesForClass
|
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
|
3c17231714e3d55809efc580a05734ed530f9ad4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
if (MenuDoubleTabUtil.shouldIgnoreTap()) {
return false;
} else if (conversation == null) {
return super.onOptionsItemSelected(item);
}
switch (item.getItemId()) {
case R.id.encryption_choice_axolotl:
case R.id.encryption_choice_pgp:
case R.id.encryption_choice_none:
handleEncryptionSelection(item);
break;
case R.id.attach_choose_picture:
case R.id.attach_take_picture:
case R.id.attach_record_video:
case R.id.attach_choose_file:
case R.id.attach_record_voice:
case R.id.attach_location:
handleAttachmentSelection(item);
break;
case R.id.action_archive:
activity.xmppConnectionService.archiveConversation(conversation);
break;
case R.id.action_contact_details:
activity.switchToContactDetails(conversation.getContact());
break;
case R.id.action_muc_details:
Intent intent = new Intent(getActivity(), ConferenceDetailsActivity.class);
intent.setAction(ConferenceDetailsActivity.ACTION_VIEW_MUC);
intent.putExtra("uuid", conversation.getUuid());
startActivity(intent);
break;
case R.id.action_invite:
startActivityForResult(ChooseContactActivity.create(activity, conversation), REQUEST_INVITE_TO_CONVERSATION);
break;
case R.id.action_clear_history:
clearHistoryDialog(conversation);
break;
case R.id.action_mute:
muteConversationDialog(conversation);
break;
case R.id.action_unmute:
unmuteConversation(conversation);
break;
case R.id.action_block:
case R.id.action_unblock:
final Activity activity = getActivity();
if (activity instanceof XmppActivity) {
BlockContactDialog.show((XmppActivity) activity, conversation);
}
break;
default:
break;
}
return super.onOptionsItemSelected(item);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onOptionsItemSelected
File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
onOptionsItemSelected
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getTranslatedContent(String locale, XWikiContext context) throws XWikiException
{
XWikiDocument tdoc = getTranslatedDocument(locale, context);
return tdoc.getContent();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTranslatedContent
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
|
getTranslatedContent
|
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
|
@Override
public void onHandleAppCrash(WindowProcessController wpc) {
synchronized (mGlobalLock) {
mRootWindowContainer.handleAppCrash(wpc);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onHandleAppCrash
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
onHandleAppCrash
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@CalledByNative
public Context getContext() {
return mContext;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContext
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
|
getContext
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getServiceProperty(String key, String defaultValue, Context context) {
if (Display.isInitialized()) {
return Display.getInstance().getProperty(key, defaultValue);
}
String val = getServiceProperties(context).get(key);
return val == null ? defaultValue : val;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServiceProperty
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
|
getServiceProperty
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean sendPendingBroadcastsLocked(ProcessRecord app) {
boolean didSomething = false;
final BroadcastRecord br = mPendingBroadcast;
if (br != null && br.curApp.pid == app.pid) {
try {
mPendingBroadcast = null;
processCurBroadcastLocked(br, app);
didSomething = true;
} catch (Exception e) {
Slog.w(TAG, "Exception in new application when starting receiver "
+ br.curComponent.flattenToShortString(), e);
logBroadcastReceiverDiscardLocked(br);
finishReceiverLocked(br, br.resultCode, br.resultData,
br.resultExtras, br.resultAbort, false);
scheduleBroadcastsLocked();
// We need to reset the state if we failed to start the receiver.
br.state = BroadcastRecord.IDLE;
throw new RuntimeException(e.getMessage());
}
}
return didSomething;
}
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2016-3912
- Severity: HIGH
- CVSS Score: 9.3
Description: DO NOT MERGE: Clean up when recycling a pid with a pending launch
Fix for accidental launch of a broadcast receiver in an
incorrect app instance.
Bug: 30202481
Change-Id: I8ec8f19c633f3aec8da084dab5fd5b312443336f
(cherry picked from commit 55eacb944122ddc0a3bb693b36fe0f07b0fe18c9)
Function: sendPendingBroadcastsLocked
File: services/core/java/com/android/server/am/BroadcastQueue.java
Repository: android
Fixed Code:
public boolean sendPendingBroadcastsLocked(ProcessRecord app) {
boolean didSomething = false;
final BroadcastRecord br = mPendingBroadcast;
if (br != null && br.curApp.pid == app.pid) {
if (br.curApp != app) {
Slog.e(TAG, "App mismatch when sending pending broadcast to "
+ app.processName + ", intended target is " + br.curApp.processName);
return false;
}
try {
mPendingBroadcast = null;
processCurBroadcastLocked(br, app);
didSomething = true;
} catch (Exception e) {
Slog.w(TAG, "Exception in new application when starting receiver "
+ br.curComponent.flattenToShortString(), e);
logBroadcastReceiverDiscardLocked(br);
finishReceiverLocked(br, br.resultCode, br.resultData,
br.resultExtras, br.resultAbort, false);
scheduleBroadcastsLocked();
// We need to reset the state if we failed to start the receiver.
br.state = BroadcastRecord.IDLE;
throw new RuntimeException(e.getMessage());
}
}
return didSomething;
}
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
sendPendingBroadcastsLocked
|
services/core/java/com/android/server/am/BroadcastQueue.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 1
|
Analyze the following code function for security vulnerabilities
|
private boolean removeTaskByIdLocked(int taskId, boolean killProcess,
boolean removeFromRecents) {
final TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(
taskId, !RESTORE_FROM_RECENTS, INVALID_STACK_ID);
if (tr != null) {
tr.removeTaskActivitiesLocked();
cleanUpRemovedTaskLocked(tr, killProcess, removeFromRecents);
if (tr.isPersistable) {
notifyTaskPersisterLocked(null, true);
}
return true;
}
Slog.w(TAG, "Request to remove task ignored for non-existent task " + taskId);
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeTaskByIdLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
removeTaskByIdLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setWindowManager(WindowManagerService wm) {
synchronized (mGlobalLock) {
mWindowManager = wm;
mRootWindowContainer = wm.mRoot;
mWindowOrganizerController.setWindowManager(wm);
mTempConfig.setToDefaults();
mTempConfig.setLocales(LocaleList.getDefault());
mConfigurationSeq = mTempConfig.seq = 1;
mRootWindowContainer.onConfigurationChanged(mTempConfig);
mLockTaskController.setWindowManager(wm);
mTaskSupervisor.setWindowManager(wm);
mRootWindowContainer.setWindowManager(wm);
if (mBackNavigationController != null) {
mBackNavigationController.setTaskSnapshotController(wm.mTaskSnapshotController);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setWindowManager
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
setWindowManager
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onConnectChoiceSet(@NonNull List<WifiConfiguration> networks,
String choiceKey, int rssi) {
onUserConnectChoiceSet(networks, choiceKey, rssi);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onConnectChoiceSet
File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
onConnectChoiceSet
|
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private ArrayMap<String, IBinder> getCommonServicesLocked(boolean isolated) {
// Isolated processes won't get this optimization, so that we don't
// violate the rules about which services they have access to.
if (isolated) {
if (mIsolatedAppBindArgs == null) {
mIsolatedAppBindArgs = new ArrayMap<>(1);
addServiceToMap(mIsolatedAppBindArgs, "package");
addServiceToMap(mIsolatedAppBindArgs, "permissionmgr");
}
return mIsolatedAppBindArgs;
}
if (mAppBindArgs == null) {
mAppBindArgs = new ArrayMap<>();
// Add common services.
// IMPORTANT: Before adding services here, make sure ephemeral apps can access them too.
// Enable the check in ApplicationThread.bindApplication() to make sure.
addServiceToMap(mAppBindArgs, "package");
addServiceToMap(mAppBindArgs, "permissionmgr");
addServiceToMap(mAppBindArgs, Context.WINDOW_SERVICE);
addServiceToMap(mAppBindArgs, Context.ALARM_SERVICE);
addServiceToMap(mAppBindArgs, Context.DISPLAY_SERVICE);
addServiceToMap(mAppBindArgs, Context.NETWORKMANAGEMENT_SERVICE);
addServiceToMap(mAppBindArgs, Context.CONNECTIVITY_SERVICE);
addServiceToMap(mAppBindArgs, Context.ACCESSIBILITY_SERVICE);
addServiceToMap(mAppBindArgs, Context.INPUT_METHOD_SERVICE);
addServiceToMap(mAppBindArgs, Context.INPUT_SERVICE);
addServiceToMap(mAppBindArgs, "graphicsstats");
addServiceToMap(mAppBindArgs, Context.APP_OPS_SERVICE);
addServiceToMap(mAppBindArgs, "content");
addServiceToMap(mAppBindArgs, Context.JOB_SCHEDULER_SERVICE);
addServiceToMap(mAppBindArgs, Context.NOTIFICATION_SERVICE);
addServiceToMap(mAppBindArgs, Context.VIBRATOR_SERVICE);
addServiceToMap(mAppBindArgs, Context.ACCOUNT_SERVICE);
addServiceToMap(mAppBindArgs, Context.POWER_SERVICE);
addServiceToMap(mAppBindArgs, Context.USER_SERVICE);
addServiceToMap(mAppBindArgs, "mount");
addServiceToMap(mAppBindArgs, Context.PLATFORM_COMPAT_SERVICE);
}
return mAppBindArgs;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCommonServicesLocked
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
|
getCommonServicesLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public Collection<Object> getSelectedRows() {
return getSelectionModel().getSelectedRows();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSelectedRows
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
getSelectedRows
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
private TOC createTOC() throws PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationException {
TOC toc = new TOC();
synchronized (toc) {
if (viewManager != null) {
toc.generate(viewManager.getTopStructElement(), viewManager.isListAllVolumesInTOC(), viewManager.getMimeType(), tocCurrentPage);
// The TOC object will correct values that are too high, so update the local value, if necessary
if (toc.getCurrentPage() != this.tocCurrentPage) {
this.tocCurrentPage = toc.getCurrentPage();
}
}
}
return toc;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createTOC
File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29014
|
MEDIUM
| 6.1
|
intranda/goobi-viewer-core
|
createTOC
|
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
|
c29efe60e745a94d03debc17681c4950f3917455
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isListening() {
return listening;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isListening
File: src/main/java/io/vertx/ext/stomp/impl/StompServerImpl.java
Repository: vert-x3/vertx-stomp
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2023-32081
|
MEDIUM
| 6.5
|
vert-x3/vertx-stomp
|
isListening
|
src/main/java/io/vertx/ext/stomp/impl/StompServerImpl.java
|
0de4bc5a44ddb57e74d92c445f16456fa03f265b
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_SUPPORT_MESSAGE, conditional = true)
public CharSequence getShortSupportMessage(@Nullable ComponentName admin) {
throwIfParentInstance("getShortSupportMessage");
if (mService != null) {
try {
return mService.getShortSupportMessage(admin, mContext.getPackageName());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getShortSupportMessage
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
|
getShortSupportMessage
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String[] getSSLCertificates(Object connection, String url) throws IOException {
if (connection instanceof HttpsURLConnection) {
HttpsURLConnection conn = (HttpsURLConnection)connection;
try {
conn.connect();
java.security.cert.Certificate[] certs = conn.getServerCertificates();
String[] out = new String[certs.length * 2];
int i=0;
for (java.security.cert.Certificate cert : certs) {
{
MessageDigest md = MessageDigest.getInstance("SHA-256");
md.update(cert.getEncoded());
out[i++] = "SHA-256:" + dumpHex(md.digest());
}
{
MessageDigest md = MessageDigest.getInstance("SHA1");
md.update(cert.getEncoded());
out[i++] = "SHA1:" + dumpHex(md.digest());
}
}
return out;
} catch (Exception ex) {
ex.printStackTrace();
}
}
return new String[0];
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSSLCertificates
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
|
getSSLCertificates
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public void noteCaptivePortalDetected(int networkId) {
WifiConfiguration config = getInternalConfiguredNetwork(networkId);
if (config != null) {
config.getNetworkSelectionStatus().setHasNeverDetectedCaptivePortal(false);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: noteCaptivePortalDetected
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
noteCaptivePortalDetected
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getDatabasePath(String databaseName) {
if (databaseName.startsWith("file://")) {
return databaseName;
}
File db = new File(getContext().getApplicationInfo().dataDir + "/databases/" + databaseName);
return db.getAbsolutePath();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDatabasePath
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
|
getDatabasePath
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public XWikiDocument clone()
{
return cloneInternal(getDocumentReference(), true, false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clone
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
|
clone
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAssistDataAllowedOnCurrentActivity
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
isAssistDataAllowedOnCurrentActivity
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Stream<PropertyDefinition<T, ?>> getProperties() {
// No columns configured by default
return Stream.empty();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProperties
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
getProperties
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
void checkUserAutohide(View v, MotionEvent event) {
if ((mSystemUiVisibility & STATUS_OR_NAV_TRANSIENT) != 0 // a transient bar is revealed
&& event.getAction() == MotionEvent.ACTION_OUTSIDE // touch outside the source bar
&& event.getX() == 0 && event.getY() == 0 // a touch outside both bars
&& !mRemoteInputController.isRemoteInputActive()) { // not due to typing in IME
userAutohide();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkUserAutohide
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
|
checkUserAutohide
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<ShortcutInfo> removeNonKeyFields(@Nullable List<ShortcutInfo> shortcutInfos) {
if (CollectionUtils.isEmpty(shortcutInfos)) {
return shortcutInfos;
}
final int size = shortcutInfos.size();
List<ShortcutInfo> keyFieldOnlyShortcuts = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
final ShortcutInfo si = shortcutInfos.get(i);
if (si.hasKeyFieldsOnly()) {
keyFieldOnlyShortcuts.add(si);
} else {
keyFieldOnlyShortcuts.add(si.clone(ShortcutInfo.CLONE_REMOVE_NON_KEY_INFO));
}
}
return keyFieldOnlyShortcuts;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeNonKeyFields
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40079
|
HIGH
| 7.8
|
android
|
removeNonKeyFields
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void readDesign(Element trElement,
DesignContext designContext) {
super.readDesign(trElement, designContext);
boolean defaultRow = DesignAttributeHandler.readAttribute("default",
trElement.attributes(), false, boolean.class);
if (defaultRow) {
section.grid.setDefaultHeaderRow(this);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readDesign
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
readDesign
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
protected abstract boolean requestCanCreateSession(VaadinRequest request);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestCanCreateSession
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
|
requestCanCreateSession
|
server/src/main/java/com/vaadin/server/VaadinService.java
|
d852126ab6f0c43f937239305bd0e9594834fe34
| 0
|
Analyze the following code function for security vulnerabilities
|
private void attemptNetworkLinking(WifiConfiguration config) {
// Only link WPA_PSK config.
if (!config.isSecurityType(WifiConfiguration.SECURITY_TYPE_PSK)) {
return;
}
ScanDetailCache scanDetailCache = getScanDetailCacheForNetwork(config.networkId);
// Ignore configurations with large number of BSSIDs.
if (scanDetailCache != null
&& scanDetailCache.size() > LINK_CONFIGURATION_MAX_SCAN_CACHE_ENTRIES) {
return;
}
for (WifiConfiguration linkConfig : getInternalConfiguredNetworks()) {
if (linkConfig.getProfileKey().equals(config.getProfileKey())) {
continue;
}
if (linkConfig.ephemeral) {
continue;
}
if (!linkConfig.getNetworkSelectionStatus().isNetworkEnabled()) {
continue;
}
// Network Selector will be allowed to dynamically jump from a linked configuration
// to another, hence only link configurations that have WPA_PSK security type.
if (!linkConfig.isSecurityType(WifiConfiguration.SECURITY_TYPE_PSK)) {
continue;
}
ScanDetailCache linkScanDetailCache =
getScanDetailCacheForNetwork(linkConfig.networkId);
// Ignore configurations with large number of BSSIDs.
if (linkScanDetailCache != null
&& linkScanDetailCache.size() > LINK_CONFIGURATION_MAX_SCAN_CACHE_ENTRIES) {
continue;
}
// Check if the networks should be linked/unlinked.
if (shouldNetworksBeLinked(
config, linkConfig, scanDetailCache, linkScanDetailCache)) {
linkNetworks(config, linkConfig);
} else {
unlinkNetworks(config, linkConfig);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: attemptNetworkLinking
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
attemptNetworkLinking
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public String[] getRequestingPackages() throws RemoteException {
final ParceledListSlice list = AppGlobals.getPackageManager()
.getPackagesHoldingPermissions(PERM, 0 /*flags*/,
ActivityManager.getCurrentUser());
final List<PackageInfo> pkgs = list.getList();
if (pkgs == null || pkgs.isEmpty()) return new String[0];
final int N = pkgs.size();
final String[] rt = new String[N];
for (int i = 0; i < N; i++) {
rt[i] = pkgs.get(i).packageName;
}
return rt;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequestingPackages
File: services/core/java/com/android/server/notification/NotificationManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3884
|
MEDIUM
| 4.3
|
android
|
getRequestingPackages
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getDeletedChannelCount(String pkg, int uid) {
try {
return sINM.getDeletedChannelCount(pkg, uid);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
return 0;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDeletedChannelCount
File: src/com/android/settings/notification/NotificationBackend.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35667
|
HIGH
| 7.8
|
android
|
getDeletedChannelCount
|
src/com/android/settings/notification/NotificationBackend.java
|
d8355ac47e068ad20c6a7b1602e72f0585ec0085
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isSpecialPackageKey(String packageName) {
return (AccountManager.PACKAGE_NAME_KEY_LEGACY_VISIBLE.equals(packageName)
|| AccountManager.PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE.equals(packageName));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSpecialPackageKey
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
isSpecialPackageKey
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setupIme() {
this.binding.textinput.refreshIme();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setupIme
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
|
setupIme
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
private CompletableFuture<Object> processFuturePutOperations(MethodInvocationContext<Object, Object> context, CacheOperation cacheOperation, CompletableFuture<Object> returnFuture) {
List<AnnotationValue<CachePut>> putOperations = cacheOperation.putOperations;
if (putOperations != null) {
for (AnnotationValue<CachePut> putOperation : putOperations) {
String[] cacheNames = cacheOperation.getCachePutNames(putOperation);
if (ArrayUtils.isNotEmpty(cacheNames)) {
boolean isAsync = putOperation.get(MEMBER_ASYNC, Boolean.class, false);
if (!isAsync) {
CompletableFuture<Object> newFuture = new CompletableFuture<>();
returnFuture.whenComplete((result, throwable) -> {
if (throwable == null) {
try {
CacheKeyGenerator keyGenerator = cacheOperation.getCachePutKeyGenerator(putOperation);
Object[] parameterValues = resolveParams(context, putOperation.get(MEMBER_PARAMETERS, String[].class, StringUtils.EMPTY_STRING_ARRAY));
Object key = keyGenerator.generateKey(context, parameterValues);
CompletableFuture<Void> putOperationFuture = buildPutFutures(cacheNames, result, key);
putOperationFuture.whenComplete((aVoid, error) -> {
if (error != null) {
SyncCache cache = cacheManager.getCache(cacheNames[0]);
if (errorHandler.handlePutError(cache, key, result, asRuntimeException(error))) {
newFuture.completeExceptionally(error);
} else {
newFuture.complete(result);
}
} else {
newFuture.complete(result);
}
});
} catch (Exception e) {
newFuture.completeExceptionally(e);
}
} else {
newFuture.completeExceptionally(throwable);
}
});
returnFuture = newFuture;
} else {
returnFuture.whenCompleteAsync((result, throwable) -> {
if (throwable == null) {
putResultAsync(context, cacheOperation, putOperation, cacheNames, result);
}
}, ioExecutor);
}
}
}
}
return returnFuture;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processFuturePutOperations
File: runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
Repository: micronaut-projects/micronaut-core
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
processFuturePutOperations
|
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setIssuedOnTo(String issuedOnTo) {
this.issuedOnTo = issuedOnTo;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setIssuedOnTo
File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setIssuedOnTo
|
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void disableLocalCaches() {
sDpmCaches.disableAllForCurrentProcess();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: disableLocalCaches
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
|
disableLocalCaches
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public HttpRequest trustAllCerts(final boolean trust) {
trustAllCertificates = trust;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: trustAllCerts
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
|
trustAllCerts
|
src/main/java/jodd/http/HttpRequest.java
|
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private void sendMultipartSms(SmsTracker tracker) {
ArrayList<String> parts;
ArrayList<PendingIntent> sentIntents;
ArrayList<PendingIntent> deliveryIntents;
HashMap<String, Object> map = tracker.mData;
String destinationAddress = (String) map.get("destination");
String scAddress = (String) map.get("scaddress");
parts = (ArrayList<String>) map.get("parts");
sentIntents = (ArrayList<PendingIntent>) map.get("sentIntents");
deliveryIntents = (ArrayList<PendingIntent>) map.get("deliveryIntents");
// check if in service
int ss = mPhone.getServiceState().getState();
// if sms over IMS is not supported on data and voice is not available...
if (!isIms() && ss != ServiceState.STATE_IN_SERVICE) {
for (int i = 0, count = parts.size(); i < count; i++) {
PendingIntent sentIntent = null;
if (sentIntents != null && sentIntents.size() > i) {
sentIntent = sentIntents.get(i);
}
handleNotInService(ss, sentIntent);
}
return;
}
sendMultipartText(destinationAddress, scAddress, parts, sentIntents, deliveryIntents,
null/*messageUri*/, null/*callingPkg*/);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendMultipartSms
File: src/java/com/android/internal/telephony/SMSDispatcher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3858
|
HIGH
| 9.3
|
android
|
sendMultipartSms
|
src/java/com/android/internal/telephony/SMSDispatcher.java
|
df31d37d285dde9911b699837c351aed2320b586
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String encodedXMLStringAsUTF8(String xmlString)
{
if (xmlString == null) {
return "";
}
int length = xmlString.length();
char character;
StringBuilder result = new StringBuilder();
for (int i = 0; i < length; i++) {
character = xmlString.charAt(i);
switch (character) {
case '&':
result.append("&");
break;
case '"':
result.append(""");
break;
case '<':
result.append("<");
break;
case '>':
result.append(">");
break;
case '\n':
result.append("\n");
break;
case '\r':
result.append("\r");
break;
case '\t':
result.append("\t");
break;
default:
if (character < 0x20) {
} else if (character > 0x7F) {
result.append("&#x");
result.append(Integer.toHexString(character).toUpperCase());
result.append(";");
} else {
result.append(character);
}
break;
}
}
return result.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: encodedXMLStringAsUTF8
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
|
encodedXMLStringAsUTF8
|
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 Intent getIntentForUnlockMethod(int quality) {
Intent intent = null;
if (quality >= DevicePolicyManager.PASSWORD_QUALITY_MANAGED) {
intent = getLockManagedPasswordIntent(mUserPassword);
} else if (quality >= DevicePolicyManager.PASSWORD_QUALITY_NUMERIC) {
int minLength = mDPM.getPasswordMinimumLength(null, mUserId);
if (minLength < MIN_PASSWORD_LENGTH) {
minLength = MIN_PASSWORD_LENGTH;
}
final int maxLength = mDPM.getPasswordMaximumLength(quality);
intent = getLockPasswordIntent(quality, minLength, maxLength);
} else if (quality == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) {
intent = getLockPatternIntent();
}
if (intent != null) {
intent.putExtra(EXTRA_HIDE_DRAWER, mHideDrawer);
}
return intent;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIntentForUnlockMethod
File: src/com/android/settings/password/ChooseLockGeneric.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2018-9501
|
HIGH
| 7.2
|
android
|
getIntentForUnlockMethod
|
src/com/android/settings/password/ChooseLockGeneric.java
|
5e43341b8c7eddce88f79c9a5068362927c05b54
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getURLToDeleteSpace(EntityReference space)
{
return getURL(space, "WebHome", "deletespace", "confirm=1&async=false&affectChidlren=on");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getURLToDeleteSpace
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getURLToDeleteSpace
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
return File.class.isAssignableFrom(type);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isWriteable
File: independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/providers/serialisers/FileBodyHandler.java
Repository: quarkusio/quarkus
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-0481
|
LOW
| 3.3
|
quarkusio/quarkus
|
isWriteable
|
independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/providers/serialisers/FileBodyHandler.java
|
95d5904f7cf18c8165b97d8ca03b203d7f69c17e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void save(String table, Object entity, boolean returnId, Handler<AsyncResult<String>> replyHandler) {
client.getConnection(conn -> save(conn, table, /* id */ null, entity,
returnId, /* upsert */ false, /* convertEntity */ true, closeAndHandleResult(conn, replyHandler)));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: save
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
|
save
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public char getCharAndRemove(K name, char defaultValue) {
Character v = getCharAndRemove(name);
return v != null ? v : defaultValue;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCharAndRemove
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-436",
"CWE-113"
] |
CVE-2022-41915
|
MEDIUM
| 6.5
|
netty
|
getCharAndRemove
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getColumnOID(int field) {
return fields[field - 1].getOID();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getColumnOID
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
|
getColumnOID
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
private void processForRemoteInput(Notification n) {
if (!ENABLE_REMOTE_INPUT) return;
if (n.extras != null && n.extras.containsKey("android.wearable.EXTENSIONS") &&
(n.actions == null || n.actions.length == 0)) {
Notification.Action viableAction = null;
Notification.WearableExtender we = new Notification.WearableExtender(n);
List<Notification.Action> actions = we.getActions();
final int numActions = actions.size();
for (int i = 0; i < numActions; i++) {
Notification.Action action = actions.get(i);
if (action == null) {
continue;
}
RemoteInput[] remoteInputs = action.getRemoteInputs();
if (remoteInputs == null) {
continue;
}
for (RemoteInput ri : remoteInputs) {
if (ri.getAllowFreeFormInput()) {
viableAction = action;
break;
}
}
if (viableAction != null) {
break;
}
}
if (viableAction != null) {
Notification.Builder rebuilder = Notification.Builder.recoverBuilder(mContext, n);
rebuilder.setActions(viableAction);
rebuilder.build(); // will rewrite n
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processForRemoteInput
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
|
processForRemoteInput
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<Act> histoicFlowList(String procInsId, String startAct, String endAct){
List<Act> actList = Lists.newArrayList();
List<HistoricActivityInstance> list = historyService.createHistoricActivityInstanceQuery().processInstanceId(procInsId)
.orderByHistoricActivityInstanceStartTime().asc().orderByHistoricActivityInstanceEndTime().asc().list();
boolean start = false;
Map<String, Integer> actMap = Maps.newHashMap();
for (int i=0; i<list.size(); i++){
HistoricActivityInstance histIns = list.get(i);
// 过滤开始节点前的节点
if (StringUtils.isNotBlank(startAct) && startAct.equals(histIns.getActivityId())){
start = true;
}
if (StringUtils.isNotBlank(startAct) && !start){
continue;
}
// 只显示开始节点和结束节点,并且执行人不为空的任务
if (StringUtils.isNotBlank(histIns.getAssignee())
|| "startEvent".equals(histIns.getActivityType())
|| "endEvent".equals(histIns.getActivityType())){
// 给节点增加一个序号
Integer actNum = actMap.get(histIns.getActivityId());
if (actNum == null){
actMap.put(histIns.getActivityId(), actMap.size());
}
Act e = new Act();
e.setHistIns(histIns);
// 获取流程发起人名称
if ("startEvent".equals(histIns.getActivityType())){
List<HistoricProcessInstance> il = historyService.createHistoricProcessInstanceQuery().processInstanceId(procInsId).orderByProcessInstanceStartTime().asc().list();
// List<HistoricIdentityLink> il = historyService.getHistoricIdentityLinksForProcessInstance(procInsId);
if (il.size() > 0){
if (StringUtils.isNotBlank(il.get(0).getStartUserId())){
User user = UserUtils.getByLoginName(il.get(0).getStartUserId());
if (user != null){
e.setAssignee(histIns.getAssignee());
e.setAssigneeName(user.getName());
}
}
}
}
// 获取任务执行人名称
if (StringUtils.isNotEmpty(histIns.getAssignee())){
User user = UserUtils.getByLoginName(histIns.getAssignee());
if (user != null){
e.setAssignee(histIns.getAssignee());
e.setAssigneeName(user.getName());
}
}
// 获取意见评论内容
if (StringUtils.isNotBlank(histIns.getTaskId())){
List<Comment> commentList = taskService.getTaskComments(histIns.getTaskId());
if (commentList.size()>0){
e.setComment(commentList.get(0).getFullMessage());
}
}
actList.add(e);
}
// 过滤结束节点后的节点
if (StringUtils.isNotBlank(endAct) && endAct.equals(histIns.getActivityId())){
boolean bl = false;
Integer actNum = actMap.get(histIns.getActivityId());
// 该活动节点,后续节点是否在结束节点之前,在后续节点中是否存在
for (int j=i+1; j<list.size(); j++){
HistoricActivityInstance hi = list.get(j);
Integer actNumA = actMap.get(hi.getActivityId());
if ((actNumA != null && actNumA < actNum) || StringUtils.equals(hi.getActivityId(), histIns.getActivityId())){
bl = true;
}
}
if (!bl){
break;
}
}
}
return actList;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: histoicFlowList
File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
Repository: thinkgem/jeesite
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-34601
|
CRITICAL
| 9.8
|
thinkgem/jeesite
|
histoicFlowList
|
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
|
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
| 0
|
Analyze the following code function for security vulnerabilities
|
public Column setEditorField(Field<?> editor) {
grid.setEditorField(getPropertyId(), editor);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setEditorField
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
setEditorField
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void writeAjaxErrorResponse(int httpStatusCode, String message, XWikiContext context)
{
try {
context.getResponse().setContentType("text/plain");
context.getResponse().setStatus(httpStatusCode);
context.getResponse().setCharacterEncoding(context.getWiki().getEncoding());
context.getResponse().getWriter().print(message);
} catch (IOException e) {
LOGGER.error("Failed to send error response to AJAX save and continue request.", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeAjaxErrorResponse
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2022-23617
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
writeAjaxErrorResponse
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
|
b35ef0edd4f2ff2c974cbeef6b80fcf9b5a44554
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
public String getBodyHtml() {
return spannedBodyToHtml(mBodyView.getText(), false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBodyHtml
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
|
getBodyHtml
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public boolean supports(Class c) {
return c.equals(AppointmentType.class);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: supports
File: api/src/main/java/org/openmrs/module/appointmentscheduling/validator/AppointmentTypeValidator.java
Repository: openmrs/openmrs-module-appointmentscheduling
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-36635
|
MEDIUM
| 5.4
|
openmrs/openmrs-module-appointmentscheduling
|
supports
|
api/src/main/java/org/openmrs/module/appointmentscheduling/validator/AppointmentTypeValidator.java
|
34213c3f6ea22df427573076fb62744694f601d8
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ByteBuffer reallocateDirectNoCleaner(ByteBuffer buffer, int capacity) {
assert USE_DIRECT_BUFFER_NO_CLEANER;
int len = capacity - buffer.capacity();
incrementMemoryCounter(len);
try {
return PlatformDependent0.reallocateDirectNoCleaner(buffer, capacity);
} catch (Throwable e) {
decrementMemoryCounter(len);
throwException(e);
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reallocateDirectNoCleaner
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
reallocateDirectNoCleaner
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getInitialDisplayDensity(int displayId) {
synchronized (mWindowMap) {
final DisplayContent displayContent = getDisplayContentLocked(displayId);
if (displayContent != null && displayContent.hasAccess(Binder.getCallingUid())) {
synchronized(displayContent.mDisplaySizeLock) {
return displayContent.mInitialDisplayDensity;
}
}
}
return -1;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInitialDisplayDensity
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
getInitialDisplayDensity
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setIsTargetServiceActive(ComponentName cname, int userId, boolean active) {
setSyncableStateForEndPoint(new EndPoint(cname, userId), active ? 1 : 0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setIsTargetServiceActive
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
setIsTargetServiceActive
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
public Principal getPrincipal() {
if (userPrincipal != null) {
return userPrincipal;
} else if (userTokenId != null) {
userPrincipal = new NTPrincipal(userTokenId);
return userPrincipal;
} else {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPrincipal
File: openam-authentication/openam-auth-nt/src/main/java/com/sun/identity/authentication/modules/nt/NT.java
Repository: OpenIdentityPlatform/OpenAM
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-34298
|
MEDIUM
| 5
|
OpenIdentityPlatform/OpenAM
|
getPrincipal
|
openam-authentication/openam-auth-nt/src/main/java/com/sun/identity/authentication/modules/nt/NT.java
|
3b242fbd6bdc1e2fa2f07842213a6301a0a0b468
| 0
|
Analyze the following code function for security vulnerabilities
|
protected CompletableFuture<Map<BacklogQuota.BacklogQuotaType, BacklogQuota>> internalGetBacklogQuota(
boolean applied) {
return getTopicPoliciesAsyncWithRetry(topicName)
.thenApply(op -> {
Map<BacklogQuota.BacklogQuotaType, BacklogQuota> quotaMap = op
.map(TopicPolicies::getBackLogQuotaMap)
.map(map -> {
HashMap<BacklogQuota.BacklogQuotaType, BacklogQuota> hashMap = Maps.newHashMap();
map.forEach((key, value) -> hashMap.put(BacklogQuota.BacklogQuotaType.valueOf(key), value));
return hashMap;
}).orElse(Maps.newHashMap());
if (applied && quotaMap.isEmpty()) {
quotaMap = getNamespacePolicies(namespaceName).backlog_quota_map;
if (quotaMap.isEmpty()) {
String namespace = namespaceName.toString();
for (BacklogQuota.BacklogQuotaType backlogQuotaType : BacklogQuota.BacklogQuotaType.values()) {
quotaMap.put(
backlogQuotaType,
namespaceBacklogQuota(namespace,
AdminResource.path(POLICIES, namespace), backlogQuotaType)
);
}
}
}
return quotaMap;
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalGetBacklogQuota
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalGetBacklogQuota
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
private void addSignerCertificate(X509Certificate cert) {
mSignerCerts.add(cert);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addSignerCertificate
File: src/main/java/com/android/apksig/ApkVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
addSignerCertificate
|
src/main/java/com/android/apksig/ApkVerifier.java
|
039f815895f62c9f8af23df66622b66246f3f61e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setPackageScreenCompatMode(String packageName, int mode) {
enforceCallingPermission(android.Manifest.permission.SET_SCREEN_COMPATIBILITY,
"setPackageScreenCompatMode");
synchronized (this) {
mCompatModePackages.setPackageScreenCompatModeLocked(packageName, mode);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPackageScreenCompatMode
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
|
setPackageScreenCompatMode
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void writeFloat(float flt) throws TException {
fixedIntToBytes(Float.floatToIntBits(flt), buffer, 0);
trans_.write(buffer, 0, 4);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeFloat
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
|
writeFloat
|
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
|
08c2d412adb214c40bb03be7587057b25d053030
| 0
|
Analyze the following code function for security vulnerabilities
|
private String endCapture() {
int end=current==-1 ? index : index-1;
String captured;
if (captureBuffer.length()>0) {
captureBuffer.append(buffer, captureStart, end-captureStart);
captured=captureBuffer.toString();
captureBuffer.setLength(0);
} else {
captured=new String(buffer, captureStart, end-captureStart);
}
captureStart=-1;
return captured;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: endCapture
File: src/main/org/hjson/JsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34620
|
HIGH
| 7.5
|
hjson/hjson-java
|
endCapture
|
src/main/org/hjson/JsonParser.java
|
91bef056d56bf968451887421c89a44af1d692ff
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
public String getAttributeValue(int index) {
final int id = nativeGetAttributeStringValue(mParseState, index);
if (id == ERROR_NULL_DOCUMENT) {
throw new NullPointerException("Null document");
}
if (DEBUG) System.out.println("getAttributeValue of " + index + " = " + id);
if (id >= 0) return getSequenceString(mStrings.getSequence(id));
// May be some other type... check and try to convert if so.
final int t = nativeGetAttributeDataType(mParseState, index);
if (t == ERROR_NULL_DOCUMENT) {
throw new NullPointerException("Null document");
}
if (t == TypedValue.TYPE_NULL) {
throw new IndexOutOfBoundsException(String.valueOf(index));
}
final int v = nativeGetAttributeData(mParseState, index);
if (v == ERROR_NULL_DOCUMENT) {
throw new NullPointerException("Null document");
}
return TypedValue.coerceToString(t, v);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAttributeValue
File: core/java/android/content/res/XmlBlock.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
getAttributeValue
|
core/java/android/content/res/XmlBlock.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
if (skipFilter((HttpServletRequest) request)) {
chain.doFilter(request, response);
} else {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
String servletPath = httpRequest.getServletPath();
// for all /images and /initfilter/scripts files, write the path
// (the "/initfilter" part is needed so that the openmrs_static_context-servlet.xml file doesn't
// get instantiated early, before the locale messages are all set up)
if (servletPath.startsWith("/images") || servletPath.startsWith("/initfilter/scripts")) {
servletPath = servletPath.replaceFirst("/initfilter", "/WEB-INF/view"); // strip out the /initfilter part
// writes the actual image file path to the response
File file = new File(filterConfig.getServletContext().getRealPath(servletPath));
if (httpRequest.getPathInfo() != null) {
file = new File(file, httpRequest.getPathInfo());
}
InputStream imageFileInputStream = null;
try {
imageFileInputStream = new FileInputStream(file);
OpenmrsUtil.copyFile(imageFileInputStream, httpResponse.getOutputStream());
}
catch (FileNotFoundException e) {
log.error("Unable to find file: " + file.getAbsolutePath());
}
finally {
if (imageFileInputStream != null) {
try {
imageFileInputStream.close();
}
catch (IOException io) {
log.warn("Couldn't close imageFileInputStream: " + io);
}
}
}
} else if (servletPath.startsWith("/scripts")) {
log.error(
"Calling /scripts during the initializationfilter pages will cause the openmrs_static_context-servlet.xml to initialize too early and cause errors after startup. Use '/initfilter"
+ servletPath + "' instead.");
}
// for anything but /initialsetup
else if (!httpRequest.getServletPath().equals("/" + WebConstants.SETUP_PAGE_URL)
&& !httpRequest.getServletPath().equals("/" + AUTO_RUN_OPENMRS)) {
// send the user to the setup page
httpResponse.sendRedirect("/" + WebConstants.WEBAPP_NAME + "/" + WebConstants.SETUP_PAGE_URL);
} else {
if ("GET".equals(httpRequest.getMethod())) {
doGet(httpRequest, httpResponse);
} else if ("POST".equals(httpRequest.getMethod())) {
// only clear errors before POSTS so that redirects can show errors too.
errors.clear();
msgs.clear();
doPost(httpRequest, httpResponse);
}
}
// Don't continue down the filter chain otherwise Spring complains
// that it hasn't been set up yet.
// The jsp and servlet filter are also on this chain, so writing to
// the response directly here is the only option
}
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2022-23612
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Fix bug
Function: doFilter
File: web/src/main/java/org/openmrs/web/filter/StartupFilter.java
Repository: openmrs/openmrs-core
Fixed Code:
@Override
public final void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
if (skipFilter((HttpServletRequest) request)) {
chain.doFilter(request, response);
} else {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
String servletPath = httpRequest.getServletPath();
// for all /images and /initfilter/scripts files, write the path
// (the "/initfilter" part is needed so that the openmrs_static_context-servlet.xml file doesn't
// get instantiated early, before the locale messages are all set up)
if (servletPath.startsWith("/images") || servletPath.startsWith("/initfilter/scripts")) {
// strip out the /initfilter part
servletPath = servletPath.replaceFirst("/initfilter", "/WEB-INF/view");
// writes the actual image file path to the response
Path filePath = Paths.get(filterConfig.getServletContext().getRealPath(servletPath)).normalize();
Path fullFilePath = filePath;
if (httpRequest.getPathInfo() != null) {
fullFilePath = fullFilePath.resolve(httpRequest.getPathInfo());
if (!(fullFilePath.normalize().startsWith(filePath))) {
log.warn("Detected attempted directory traversal in request for {}", httpRequest.getPathInfo());
return;
}
}
try (InputStream imageFileInputStream = new FileInputStream(fullFilePath.normalize().toFile())) {
OpenmrsUtil.copyFile(imageFileInputStream, httpResponse.getOutputStream());
}
catch (FileNotFoundException e) {
log.error("Unable to find file: {}", filePath, e);
}
catch (IOException e) {
log.warn("An error occurred while handling file {}", filePath, e);
}
} else if (servletPath.startsWith("/scripts")) {
log.error(
"Calling /scripts during the initializationfilter pages will cause the openmrs_static_context-servlet.xml to initialize too early and cause errors after startup. Use '/initfilter"
+ servletPath + "' instead.");
}
// for anything but /initialsetup
else if (!httpRequest.getServletPath().equals("/" + WebConstants.SETUP_PAGE_URL)
&& !httpRequest.getServletPath().equals("/" + AUTO_RUN_OPENMRS)) {
// send the user to the setup page
httpResponse.sendRedirect("/" + WebConstants.WEBAPP_NAME + "/" + WebConstants.SETUP_PAGE_URL);
} else {
if ("GET".equals(httpRequest.getMethod())) {
doGet(httpRequest, httpResponse);
} else if ("POST".equals(httpRequest.getMethod())) {
// only clear errors before POSTS so that redirects can show errors too.
errors.clear();
msgs.clear();
doPost(httpRequest, httpResponse);
}
}
// Don't continue down the filter chain otherwise Spring complains
// that it hasn't been set up yet.
// The jsp and servlet filter are also on this chain, so writing to
// the response directly here is the only option
}
}
|
[
"CWE-22"
] |
CVE-2022-23612
|
MEDIUM
| 5
|
openmrs/openmrs-core
|
doFilter
|
web/src/main/java/org/openmrs/web/filter/StartupFilter.java
|
db8454bf19a092a78d53ee4dba2af628b730a6e7
| 1
|
Analyze the following code function for security vulnerabilities
|
public Set<String> getMaskedFields() {
return Collections.unmodifiableSet(maskedFields);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMaskedFields
File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
Repository: opensearch-project/security
The code follows secure coding practices.
|
[
"CWE-612",
"CWE-863"
] |
CVE-2022-41918
|
MEDIUM
| 6.3
|
opensearch-project/security
|
getMaskedFields
|
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
|
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
| 0
|
Analyze the following code function for security vulnerabilities
|
private void applyOptionsAnimation(ActivityOptions pendingOptions, Intent intent) {
final int animationType = pendingOptions.getAnimationType();
final DisplayContent displayContent = getDisplayContent();
AnimationOptions options = null;
IRemoteCallback startCallback = null;
IRemoteCallback finishCallback = null;
switch (animationType) {
case ANIM_CUSTOM:
displayContent.mAppTransition.overridePendingAppTransition(
pendingOptions.getPackageName(),
pendingOptions.getCustomEnterResId(),
pendingOptions.getCustomExitResId(),
pendingOptions.getCustomBackgroundColor(),
pendingOptions.getAnimationStartedListener(),
pendingOptions.getAnimationFinishedListener(),
pendingOptions.getOverrideTaskTransition());
options = AnimationOptions.makeCustomAnimOptions(pendingOptions.getPackageName(),
pendingOptions.getCustomEnterResId(), pendingOptions.getCustomExitResId(),
pendingOptions.getCustomBackgroundColor(),
pendingOptions.getOverrideTaskTransition());
startCallback = pendingOptions.getAnimationStartedListener();
finishCallback = pendingOptions.getAnimationFinishedListener();
break;
case ANIM_CLIP_REVEAL:
displayContent.mAppTransition.overridePendingAppTransitionClipReveal(
pendingOptions.getStartX(), pendingOptions.getStartY(),
pendingOptions.getWidth(), pendingOptions.getHeight());
options = AnimationOptions.makeClipRevealAnimOptions(
pendingOptions.getStartX(), pendingOptions.getStartY(),
pendingOptions.getWidth(), pendingOptions.getHeight());
if (intent.getSourceBounds() == null) {
intent.setSourceBounds(new Rect(pendingOptions.getStartX(),
pendingOptions.getStartY(),
pendingOptions.getStartX() + pendingOptions.getWidth(),
pendingOptions.getStartY() + pendingOptions.getHeight()));
}
break;
case ANIM_SCALE_UP:
displayContent.mAppTransition.overridePendingAppTransitionScaleUp(
pendingOptions.getStartX(), pendingOptions.getStartY(),
pendingOptions.getWidth(), pendingOptions.getHeight());
options = AnimationOptions.makeScaleUpAnimOptions(
pendingOptions.getStartX(), pendingOptions.getStartY(),
pendingOptions.getWidth(), pendingOptions.getHeight());
if (intent.getSourceBounds() == null) {
intent.setSourceBounds(new Rect(pendingOptions.getStartX(),
pendingOptions.getStartY(),
pendingOptions.getStartX() + pendingOptions.getWidth(),
pendingOptions.getStartY() + pendingOptions.getHeight()));
}
break;
case ANIM_THUMBNAIL_SCALE_UP:
case ANIM_THUMBNAIL_SCALE_DOWN:
final boolean scaleUp = (animationType == ANIM_THUMBNAIL_SCALE_UP);
final HardwareBuffer buffer = pendingOptions.getThumbnail();
displayContent.mAppTransition.overridePendingAppTransitionThumb(buffer,
pendingOptions.getStartX(), pendingOptions.getStartY(),
pendingOptions.getAnimationStartedListener(),
scaleUp);
options = AnimationOptions.makeThumbnailAnimOptions(buffer,
pendingOptions.getStartX(), pendingOptions.getStartY(), scaleUp);
startCallback = pendingOptions.getAnimationStartedListener();
if (intent.getSourceBounds() == null && buffer != null) {
intent.setSourceBounds(new Rect(pendingOptions.getStartX(),
pendingOptions.getStartY(),
pendingOptions.getStartX() + buffer.getWidth(),
pendingOptions.getStartY() + buffer.getHeight()));
}
break;
case ANIM_THUMBNAIL_ASPECT_SCALE_UP:
case ANIM_THUMBNAIL_ASPECT_SCALE_DOWN:
final AppTransitionAnimationSpec[] specs = pendingOptions.getAnimSpecs();
final IAppTransitionAnimationSpecsFuture specsFuture =
pendingOptions.getSpecsFuture();
if (specsFuture != null) {
displayContent.mAppTransition.overridePendingAppTransitionMultiThumbFuture(
specsFuture, pendingOptions.getAnimationStartedListener(),
animationType == ANIM_THUMBNAIL_ASPECT_SCALE_UP);
} else if (animationType == ANIM_THUMBNAIL_ASPECT_SCALE_DOWN
&& specs != null) {
displayContent.mAppTransition.overridePendingAppTransitionMultiThumb(
specs, pendingOptions.getAnimationStartedListener(),
pendingOptions.getAnimationFinishedListener(), false);
} else {
displayContent.mAppTransition.overridePendingAppTransitionAspectScaledThumb(
pendingOptions.getThumbnail(),
pendingOptions.getStartX(), pendingOptions.getStartY(),
pendingOptions.getWidth(), pendingOptions.getHeight(),
pendingOptions.getAnimationStartedListener(),
(animationType == ANIM_THUMBNAIL_ASPECT_SCALE_UP));
if (intent.getSourceBounds() == null) {
intent.setSourceBounds(new Rect(pendingOptions.getStartX(),
pendingOptions.getStartY(),
pendingOptions.getStartX() + pendingOptions.getWidth(),
pendingOptions.getStartY() + pendingOptions.getHeight()));
}
}
break;
case ANIM_OPEN_CROSS_PROFILE_APPS:
displayContent.mAppTransition
.overridePendingAppTransitionStartCrossProfileApps();
options = AnimationOptions.makeCrossProfileAnimOptions();
break;
case ANIM_NONE:
case ANIM_UNDEFINED:
break;
default:
Slog.e(TAG_WM, "applyOptionsLocked: Unknown animationType=" + animationType);
break;
}
if (options != null) {
mTransitionController.setOverrideAnimation(options, startCallback, finishCallback);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: applyOptionsAnimation
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
|
applyOptionsAnimation
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
private static byte[] retrieveData(InputStream input) throws IOException {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
final byte[] buffer = new byte[1024];
int read;
while ((read = input.read(buffer)) > 0) {
out.write(buffer, 0, read);
}
out.close();
return out.toByteArray();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: retrieveData
File: src/net/sourceforge/plantuml/security/SURL.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
retrieveData
|
src/net/sourceforge/plantuml/security/SURL.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getDisplayName() {
return Messages.Hudson_Computer_DisplayName();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDisplayName
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
|
getDisplayName
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ServletOutputStream getOutputStream() throws IOException {
return servletOutputStream;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOutputStream
File: h2/src/test/org/h2/test/server/TestWeb.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
getOutputStream
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isProfileOwnerInCallingUser(String packageName) {
final ComponentName profileOwnerInCallingUser =
getProfileOwnerAsUser(UserHandle.getCallingUserId());
return profileOwnerInCallingUser != null
&& packageName.equals(profileOwnerInCallingUser.getPackageName());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isProfileOwnerInCallingUser
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
|
isProfileOwnerInCallingUser
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean inLockoutMode() {
return mFailedAttempts >= MAX_FAILED_ATTEMPTS;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: inLockoutMode
File: services/core/java/com/android/server/fingerprint/FingerprintService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
inLockoutMode
|
services/core/java/com/android/server/fingerprint/FingerprintService.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void initClickListeners() {
binding.pictureInPictureButton.setOnClickListener(l -> enterPipMode());
binding.audioOutputButton.setOnClickListener(v -> {
audioOutputDialog = new AudioOutputDialog(this);
audioOutputDialog.show();
});
binding.microphoneButton.setOnClickListener(l -> onMicrophoneClick());
binding.microphoneButton.setOnLongClickListener(l -> {
if (!microphoneOn) {
callControlHandler.removeCallbacksAndMessages(null);
callInfosHandler.removeCallbacksAndMessages(null);
cameraSwitchHandler.removeCallbacksAndMessages(null);
isPTTActive = true;
binding.callControls.setVisibility(View.VISIBLE);
if (!isVoiceOnlyCall) {
binding.switchSelfVideoButton.setVisibility(View.VISIBLE);
}
}
onMicrophoneClick();
return true;
});
binding.cameraButton.setOnClickListener(l -> onCameraClick());
binding.hangupButton.setOnClickListener(l -> {
setCallState(CallStatus.LEAVING);
hangup(true);
});
binding.switchSelfVideoButton.setOnClickListener(l -> switchCamera());
binding.gridview.setOnItemClickListener((parent, view, position, id) -> animateCallControls(true, 0));
binding.callStates.callStateRelativeLayout.setOnClickListener(l -> {
if (currentCallStatus.equals(CallStatus.CALLING_TIMEOUT)) {
setCallState(CallStatus.RECONNECTING);
hangupNetworkCalls(false);
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initClickListeners
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
|
initClickListeners
|
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
|
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.