instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
private void migrate66(File dataDir, Stack<Integer> versions) {
Map<String, Element> compareContexts = new HashMap<>();
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("CodeComments.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
Element compareContextElement = element.element("compareContext");
Element leftSideElement = compareContextElement.element("leftSide");
Element compareCommitHashElement = compareContextElement.element("compareCommitHash");
String compareCommitHash = compareCommitHashElement.getTextTrim();
String commitHash = element.element("mark").elementTextTrim("commitHash");
if (Boolean.parseBoolean(leftSideElement.getTextTrim())) {
compareContextElement.addElement("oldCommitHash").setText(compareCommitHash);
compareContextElement.addElement("newCommitHash").setText(commitHash);
} else {
compareContextElement.addElement("newCommitHash").setText(compareCommitHash);
compareContextElement.addElement("oldCommitHash").setText(commitHash);
}
Element requestElement = element.element("request");
if (requestElement != null) {
compareContextElement.addElement("pullRequest").setText(requestElement.getTextTrim());
requestElement.detach();
}
leftSideElement.detach();
compareCommitHashElement.detach();
compareContexts.put(element.elementTextTrim("id"), compareContextElement);
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("PullRequests.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
Element lastCodeCommentActivityDateElement = element.element("lastCodeCommentActivityDate");
if (lastCodeCommentActivityDateElement != null)
lastCodeCommentActivityDateElement.detach();
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("Settings.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
if (element.elementTextTrim("key").equals("MAIL")) {
Element valueElement = element.element("value");
if (valueElement != null) {
String enableStartTLSElement = valueElement.elementTextTrim("enableStartTLS");
Element receiveMailSettingElement = valueElement.element("receiveMailSetting");
if (receiveMailSettingElement != null)
receiveMailSettingElement.addElement("enableSSL").setText(enableStartTLSElement);
}
}
}
dom.writeToFile(file, false);
}
}
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("CodeCommentReplys.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
String elementId = element.elementTextTrim("comment");
element.add(compareContexts.get(elementId).createCopy());
}
dom.writeToFile(file, false);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate66
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
|
migrate66
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
private Mapper buildMapperDynamically(String className, Class[] constructorParamTypes,
Object[] constructorParamValues) {
try {
Class type = Class.forName(className, false, classLoaderReference.getReference());
Constructor constructor = type.getConstructor(constructorParamTypes);
return (Mapper)constructor.newInstance(constructorParamValues);
} catch (Exception e) {
throw new com.thoughtworks.xstream.InitializationException("Could not instantiate mapper : " + className,
e);
} catch (LinkageError e) {
throw new com.thoughtworks.xstream.InitializationException("Could not instantiate mapper : " + className,
e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildMapperDynamically
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
buildMapperDynamically
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
public boolean isRecentlySelectedByTheUser(@NonNull WifiConfiguration currentConfig) {
long currentTimeMillis = mClock.getElapsedSinceBootMillis();
return mWifiConfigManager.getLastSelectedNetwork() == currentConfig.networkId
&& currentTimeMillis - mWifiConfigManager.getLastSelectedTimeStamp()
< LAST_SELECTED_NETWORK_EXPIRATION_AGE_MILLIS;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isRecentlySelectedByTheUser
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
isRecentlySelectedByTheUser
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String getSectionDetails(String CrfVersionOID)
{
return "select section_id, label,title,subtitle,instructions,page_number_label from section section where crf_version_id=?";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSectionDetails
File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24831
|
HIGH
| 7.5
|
OpenClinica
|
getSectionDetails
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
@JsonProperty(FIELD_CACHE_TTL_OVERRIDE)
public abstract Long cacheTTLOverride();
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cacheTTLOverride
File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2023-41045
|
MEDIUM
| 5.3
|
Graylog2/graylog2-server
|
cacheTTLOverride
|
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
|
466af814523cffae9fbc7e77bab7472988f03c3e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String display(String fieldname, String mode, XWikiContext context)
{
return display(fieldname, mode, "", context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: display
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
|
display
|
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 String getTableName(String str) {
String[] arr = str.split("\\s+(?i)where\\s+");
String tableName = arr[0];
//【20230814】解决使用参数tableName=sys_user t&复测,漏洞仍然存在
if (tableName.contains(" ")) {
tableName = tableName.substring(0, tableName.indexOf(" "));
}
if (tableName.contains(".")) {
tableName = tableName.substring(tableName.indexOf(".")+1, tableName.length());
}
//【issues/4393】 sys_user , (sys_user), sys_user%20, %60sys_user%60
String reg = "\\s+|\\(|\\)|`";
return tableName.replaceAll(reg, "");
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2023-38992
- Severity: CRITICAL
- CVSS Score: 9.8
Description: SQL注入 #5173
Function: getTableName
File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/security/DictQueryBlackListHandler.java
Repository: jeecgboot/jeecg-boot
Fixed Code:
private String getTableName(String str) {
String[] arr = str.split("\\s+(?i)where\\s+");
String tableName = arr[0].trim();
//【20230814】解决使用参数tableName=sys_user t&复测,漏洞仍然存在
if (tableName.contains(".")) {
tableName = tableName.substring(tableName.indexOf(".")+1, tableName.length()).trim();
}
if (tableName.contains(" ")) {
tableName = tableName.substring(0, tableName.indexOf(" ")).trim();
}
//【issues/4393】 sys_user , (sys_user), sys_user%20, %60sys_user%60
String reg = "\\s+|\\(|\\)|`";
return tableName.replaceAll(reg, "");
}
|
[
"CWE-89"
] |
CVE-2023-38992
|
CRITICAL
| 9.8
|
jeecgboot/jeecg-boot
|
getTableName
|
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/security/DictQueryBlackListHandler.java
|
d36caf8c696a84edc7e4204c7dc9c4d3f91a9534
| 1
|
Analyze the following code function for security vulnerabilities
|
public void clearMarkdown() {
setModelObject("");
input.setConvertedInput(null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearMarkdown
File: server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-21242
|
HIGH
| 7.5
|
theonedev/onedev
|
clearMarkdown
|
server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
|
f864053176c08f59ef2d97fea192ceca46a4d9be
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isLockTaskFeatureEnabled(int lockTaskFeature) throws RemoteException {
//TODO(b/175285301): Explicitly get the user's identity to check.
int lockTaskFeatures =
getUserData(getCurrentForegroundUserId()).mLockTaskFeatures;
return (lockTaskFeatures & lockTaskFeature) == lockTaskFeature;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isLockTaskFeatureEnabled
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
|
isLockTaskFeatureEnabled
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public Tuple<String, List<Object>> format() {
return format;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: format
File: web/play-java-forms/src/main/java/play/data/Form.java
Repository: playframework
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-31018
|
MEDIUM
| 5
|
playframework
|
format
|
web/play-java-forms/src/main/java/play/data/Form.java
|
15393b736df939e35e275af2347155f296c684f2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void exitFreeformMode(IBinder token) throws RemoteException {
synchronized (this) {
long ident = Binder.clearCallingIdentity();
try {
final ActivityRecord r = ActivityRecord.forTokenLocked(token);
if (r == null) {
throw new IllegalArgumentException(
"exitFreeformMode: No activity record matching token=" + token);
}
final ActivityStack stack = r.getStackLocked(token);
if (stack == null || stack.mStackId != FREEFORM_WORKSPACE_STACK_ID) {
throw new IllegalStateException(
"exitFreeformMode: You can only go fullscreen from freeform.");
}
if (DEBUG_STACK) Slog.d(TAG_STACK, "exitFreeformMode: " + r);
mStackSupervisor.moveTaskToStackLocked(r.task.taskId, FULLSCREEN_WORKSPACE_STACK_ID,
ON_TOP, !FORCE_FOCUS, "exitFreeformMode", ANIMATE);
} finally {
Binder.restoreCallingIdentity(ident);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: exitFreeformMode
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
|
exitFreeformMode
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
public CallStyle setAnswerButtonColorHint(@ColorInt int color) {
mAnswerButtonColor = color;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAnswerButtonColorHint
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
setAnswerButtonColorHint
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public ParsingExceptionCallback getParsingExceptionCallback() {
return parsingExceptionCallback;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getParsingExceptionCallback
File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
Repository: igniterealtime/Smack
The code follows secure coding practices.
|
[
"CWE-362"
] |
CVE-2016-10027
|
MEDIUM
| 4.3
|
igniterealtime/Smack
|
getParsingExceptionCallback
|
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
private String loadStringData(String path, String charset) throws EaterException, UnsupportedEncodingException {
byte[] byteData = null;
if (path.startsWith("http://") || path.startsWith("https://")) {
final SURL url = SURL.create(path);
if (url == null)
throw EaterException.located("load JSON: Invalid URL " + path);
byteData = url.getBytes();
// ::comment when __CORE__
} else {
try {
final SFile file = FileSystem.getInstance().getFile(path);
if (file != null && file.exists() && file.canRead() && !file.isDirectory()) {
final ByteArrayOutputStream out = new ByteArrayOutputStream(1024 * 8);
FileUtils.copyToStream(file, out);
byteData = out.toByteArray();
}
} catch (IOException e) {
Logme.error(e);
throw EaterException.located("load JSON: Cannot read file " + path + ". " + e.getMessage());
}
// ::done
}
if (byteData == null || byteData.length == 0)
return null; // no length, no data (we want the default)
return new String(byteData, charset);
}
|
Vulnerability Classification:
- CWE: CWE-284
- CVE: CVE-2023-3431
- Severity: MEDIUM
- CVSS Score: 5.3
Description: feat: remove legacy ALLOW_INCLUDE use PLANTUML_SECURITY_PROFILE instead
https://github.com/plantuml/plantuml-server/issues/232
Function: loadStringData
File: src/net/sourceforge/plantuml/tim/stdlib/LoadJson.java
Repository: plantuml
Fixed Code:
private String loadStringData(String path, String charset) throws EaterException, UnsupportedEncodingException {
byte[] byteData = null;
if (path.startsWith("http://") || path.startsWith("https://")) {
final SURL url = SURL.create(path);
if (url != null)
byteData = url.getBytes();
// ::comment when __CORE__
} else {
try {
final SFile file = FileSystem.getInstance().getFile(path);
if (file != null && file.exists() && file.canRead() && !file.isDirectory()) {
final ByteArrayOutputStream out = new ByteArrayOutputStream(1024 * 8);
FileUtils.copyToStream(file, out);
byteData = out.toByteArray();
}
} catch (IOException e) {
Logme.error(e);
}
// ::done
}
if (byteData == null || byteData.length == 0)
return null; // no length, no data (we want the default)
return new String(byteData, charset);
}
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
loadStringData
|
src/net/sourceforge/plantuml/tim/stdlib/LoadJson.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 1
|
Analyze the following code function for security vulnerabilities
|
public UserDTO loginLocalMode(String userId, String password) {
UserDTO user = getLoginUser(userId, Collections.singletonList(UserSource.LOCAL.name()));
if (user == null) {
user = getUserDTOByEmail(userId, UserSource.LOCAL.name());
if (user == null) {
throw new RuntimeException(Translator.get("password_is_incorrect"));
}
userId = user.getId();
}
// 密码验证
if (!checkUserPassword(userId, password)) {
throw new RuntimeException(Translator.get("password_is_incorrect"));
}
user.setPassword(null);
return user;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loginLocalMode
File: framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-32699
|
MEDIUM
| 6.5
|
metersphere
|
loginLocalMode
|
framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
|
c59e381d368990214813085a1a4877c5ef865411
| 0
|
Analyze the following code function for security vulnerabilities
|
public static NativeObject jsFunction_updateAuthClient(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
throws ScriptException, APIManagementException, ParseException {
if (args != null && args.length != 0) {
NativeArray accessAllowDomainsArr = (NativeArray) args[4]; // args[4] is not mandatory
String[] accessAllowDomainsArray = new String[(int) accessAllowDomainsArr.getLength()];
for (Object domain : accessAllowDomainsArr.getIds()) {
int index = (Integer) domain;
accessAllowDomainsArray[index] = (String) accessAllowDomainsArr.get(index, null);
}
try {
String validityPeriod = (String) args[5];
String scopes = (String) args[7];
String username = String.valueOf(args[0]);
String tenantDomain = MultitenantUtils.getTenantDomain(username);
int tenantId =
ServiceReferenceHolder.getInstance().getRealmService().getTenantManager()
.getTenantId(tenantDomain);
if (null == validityPeriod || validityPeriod.isEmpty()) { // In case a validity period is unspecified
long defaultValidityPeriod = getApplicationAccessTokenValidityPeriodInSeconds();
if (defaultValidityPeriod < 0) {
validityPeriod = String.valueOf(Long.MAX_VALUE);
} else {
validityPeriod = String.valueOf(defaultValidityPeriod);
}
}
String jsonParams;
if (args.length == 10) {
jsonParams = (String) args[9];
} else {
jsonParams = null;
}
//checking for authorized scopes
Set<Scope> scopeSet = new LinkedHashSet<Scope>();
String authScopeString;
APIConsumer apiConsumer = getAPIConsumer(thisObj);
if (scopes != null && scopes.length() != 0 &&
!scopes.equals(APIConstants.OAUTH2_DEFAULT_SCOPE)) {
scopeSet.addAll(apiConsumer.getScopesByScopeKeys(scopes, tenantId));
}
if (!scopeSet.isEmpty()) {
StringBuilder scopeBuilder = new StringBuilder();
for (Scope scope : scopeSet) {
scopeBuilder.append(scope.getKey()).append(" ");
}
authScopeString = scopeBuilder.toString();
} else {
authScopeString = APIConstants.OAUTH2_DEFAULT_SCOPE;
}
String applicationName = (String) args[1];
String tokenType = (String) args[2];
String callbackUrl = (String) args[3];
String groupingId = (String) args[8];
OAuthApplicationInfo applicationInfo = getAPIConsumer(thisObj).updateAuthClient(
username, applicationName, tokenType, callbackUrl,
accessAllowDomainsArray, validityPeriod, authScopeString, groupingId,
jsonParams);
NativeObject row = new NativeObject();
if (applicationInfo != null) {
row.put(APIConstants.FrontEndParameterNames.CONSUMER_KEY, row, applicationInfo.getClientId());
row.put(APIConstants.FrontEndParameterNames.CONSUMER_SECRET, row, applicationInfo.getClientSecret());
row.put(APIConstants.FrontEndParameterNames.CALLBACK_URL, row, applicationInfo.getCallBackURL());
row.put(APIConstants.FrontEndParameterNames.CLIENT_DETAILS, row, applicationInfo.getJsonString());
}
return row;
} catch (Exception e) {
String msg = "Error while obtaining the application access token for the application:" + args[1];
log.error(msg, e);
throw new ScriptException(msg, e);
}
} else {
handleException("Invalid input parameters.");
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jsFunction_updateAuthClient
File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
Repository: wso2/carbon-apimgt
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2018-20736
|
LOW
| 3.5
|
wso2/carbon-apimgt
|
jsFunction_updateAuthClient
|
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
|
490f2860822f89d745b7c04fa9570bd86bef4236
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String htmlify(final String input) {
return (input == null ? null : input.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: htmlify
File: opennms-web-api/src/main/java/org/opennms/web/api/Util.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-0869
|
MEDIUM
| 6.1
|
OpenNMS/opennms
|
htmlify
|
opennms-web-api/src/main/java/org/opennms/web/api/Util.java
|
66b4ba96a18b9952f25a350bbccc2a7e206238d1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@Deprecated
public List<Group> findAll(Context context, int sortField) throws SQLException {
if (sortField == GroupService.NAME) {
return findAll(context, null);
} else {
throw new UnsupportedOperationException("You can only find all groups sorted by name with this method");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findAll
File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41189
|
HIGH
| 9
|
DSpace
|
findAll
|
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
|
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
| 0
|
Analyze the following code function for security vulnerabilities
|
int getUidState(int uid) {
synchronized (this) {
return getUidStateLocked(uid);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUidState
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
|
getUidState
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Builder builder(ClickHouseNode base) {
Builder b = new Builder();
if (base != null) {
Map<String, String> map = new LinkedHashMap<>(base.options);
map.put(PARAM_CLUSTER, base.getCluster());
map.put(PARAM_REPLICA_NUM, Integer.toString(base.replicaNum));
map.put(PARAM_SHARD_NUM, Integer.toString(base.shardNum));
map.put(PARAM_SHARD_WEIGHT, Integer.toString(base.shardWeight));
map.put(PARAM_WEIGHT, Integer.toString(base.getWeight()));
b.host(base.getHost()).port(base.getProtocol(), base.getPort()).credentials(base.credentials).options(map)
.tags(base.getTags());
}
return b;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: builder
File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
Repository: ClickHouse/clickhouse-java
The code follows secure coding practices.
|
[
"CWE-209"
] |
CVE-2024-23689
|
HIGH
| 8.8
|
ClickHouse/clickhouse-java
|
builder
|
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
|
4f8d9303eb991b39ec7e7e34825241efa082238a
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
public ManagedSubscriptionsPolicy getManagedSubscriptionsPolicy() {
throwIfParentInstance("getManagedSubscriptionsPolicy");
try {
return mService.getManagedSubscriptionsPolicy();
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getManagedSubscriptionsPolicy
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
|
getManagedSubscriptionsPolicy
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isHostInPackageForUid(Host host, int uid, String packageName) {
return host.id.uid == uid && host.id.packageName.equals(packageName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isHostInPackageForUid
File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-1541
|
MEDIUM
| 4.3
|
android
|
isHostInPackageForUid
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
public URI uri() {
return uri;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uri
File: server/src/main/java/io/crate/execution/engine/collect/files/FileReadingIterator.java
Repository: crate
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2024-24565
|
MEDIUM
| 6.5
|
crate
|
uri
|
server/src/main/java/io/crate/execution/engine/collect/files/FileReadingIterator.java
|
4e857d675683095945dd524d6ba03e692c70ecd6
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setUserAgent(String userAgent) {
userAgent = userAgent;
addDefaultHeader("User-Agent", userAgent);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUserAgent
File: samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setUserAgent
|
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
void dispatchMediaKeyWithWakeLockToAudioService(KeyEvent event) {
if (ActivityManagerNative.isSystemReady()) {
MediaSessionLegacyHelper.getHelper(mContext).sendMediaButtonEvent(event, true);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dispatchMediaKeyWithWakeLockToAudioService
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
dispatchMediaKeyWithWakeLockToAudioService
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
protected LocallyAvailableResource entryAt(final String path) {
return new DefaultLocallyAvailableResource(getFile(path), checksumService);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: entryAt
File: subprojects/core/src/main/java/org/gradle/internal/resource/local/DefaultPathKeyFileStore.java
Repository: gradle
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35946
|
MEDIUM
| 5.5
|
gradle
|
entryAt
|
subprojects/core/src/main/java/org/gradle/internal/resource/local/DefaultPathKeyFileStore.java
|
859eae2b2acf751ae7db3c9ffefe275aa5da0d5d
| 0
|
Analyze the following code function for security vulnerabilities
|
static void setUninstallBlockedUnchecked(
String packageName, boolean uninstallBlocked, int userId) {
Binder.withCleanCallingIdentity(() -> {
try {
AppGlobals.getPackageManager().setBlockUninstallForUser(
packageName, uninstallBlocked, userId);
} catch (RemoteException re) {
// Shouldn't happen.
Slogf.e(LOG_TAG, "Failed to setBlockUninstallForUser", re);
}
});
if (uninstallBlocked) {
final PackageManagerInternal pmi = LocalServices.getService(
PackageManagerInternal.class);
pmi.removeNonSystemPackageSuspensions(packageName, userId);
pmi.removeDistractingPackageRestrictions(packageName, userId);
pmi.flushPackageRestrictions(userId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUninstallBlockedUnchecked
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
setUninstallBlockedUnchecked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isOperatorConsideredRoaming(ServiceState s) {
String operatorNumeric = s.getOperatorNumeric();
String[] numericArray = mPhone.getContext().getResources().getStringArray(
com.android.internal.R.array.config_sameNamedOperatorConsideredRoaming);
if (numericArray.length == 0 || operatorNumeric == null) {
return false;
}
for (String numeric : numericArray) {
if (operatorNumeric.startsWith(numeric)) {
return true;
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isOperatorConsideredRoaming
File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3831
|
MEDIUM
| 5
|
android
|
isOperatorConsideredRoaming
|
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
public final String getOwner() {
return owner;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOwner
File: src/net/sourceforge/plantuml/version/LicenseInfo.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
getOwner
|
src/net/sourceforge/plantuml/version/LicenseInfo.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
final void logBroadcastReceiverDiscardLocked(BroadcastRecord r) {
final int logIndex = r.nextReceiver - 1;
if (logIndex >= 0 && logIndex < r.receivers.size()) {
Object curReceiver = r.receivers.get(logIndex);
if (curReceiver instanceof BroadcastFilter) {
BroadcastFilter bf = (BroadcastFilter) curReceiver;
EventLog.writeEvent(EventLogTags.AM_BROADCAST_DISCARD_FILTER,
bf.owningUserId, System.identityHashCode(r),
r.intent.getAction(), logIndex, System.identityHashCode(bf));
} else {
ResolveInfo ri = (ResolveInfo) curReceiver;
EventLog.writeEvent(EventLogTags.AM_BROADCAST_DISCARD_APP,
UserHandle.getUserId(ri.activityInfo.applicationInfo.uid),
System.identityHashCode(r), r.intent.getAction(), logIndex, ri.toString());
}
} else {
if (logIndex < 0) Slog.w(TAG,
"Discarding broadcast before first receiver is invoked: " + r);
EventLog.writeEvent(EventLogTags.AM_BROADCAST_DISCARD_APP,
-1, System.identityHashCode(r),
r.intent.getAction(),
r.nextReceiver,
"NONE");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logBroadcastReceiverDiscardLocked
File: services/core/java/com/android/server/am/BroadcastQueue.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
logBroadcastReceiverDiscardLocked
|
services/core/java/com/android/server/am/BroadcastQueue.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
public void clearWarnings() throws SQLException {
checkClosed();
warnings = null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearWarnings
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
|
clearWarnings
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void attachToDisplay(int displayId) {
synchronized (mService) {
ActivityDisplay activityDisplay = mActivityDisplays.get(displayId);
if (activityDisplay == null) {
return;
}
attachToDisplayLocked(activityDisplay);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: attachToDisplay
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
attachToDisplay
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void verifyUser(Serializable user) {
throw new UnsupportedOperationException();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: verifyUser
File: portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java
Repository: ManyDesigns/Portofino
The code follows secure coding practices.
|
[
"CWE-347"
] |
CVE-2021-29451
|
MEDIUM
| 6.4
|
ManyDesigns/Portofino
|
verifyUser
|
portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java
|
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
boolean hasShortcutHostPermissionInner(@NonNull String packageName, int userId) {
synchronized (mLock) {
throwIfUserLockedL(userId);
final String defaultLauncher = getDefaultLauncher(userId);
if (defaultLauncher != null) {
if (DEBUG) {
Slog.v(TAG, "Detected launcher: " + defaultLauncher + " user: " + userId);
}
return defaultLauncher.equals(packageName);
} else {
return false;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasShortcutHostPermissionInner
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
|
hasShortcutHostPermissionInner
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setAuditHelper(PicketLinkAuditHelper auditHelper) {
this.auditHelper = auditHelper;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAuditHelper
File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
Repository: picketlink/picketlink-bindings
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3158
|
MEDIUM
| 4
|
picketlink/picketlink-bindings
|
setAuditHelper
|
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
|
341a37aefd69e67b6b5f6d775499730d6ccaff0d
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String defaultAccessLoggerName(String hostnamePattern) {
requireNonNull(hostnamePattern, "hostnamePattern");
final HostAndPort hostAndPort = HostAndPort.fromString(hostnamePattern);
hostnamePattern = hostAndPort.getHost();
final String[] elements = hostnamePattern.split("\\.");
final StringBuilder name = new StringBuilder(
DEFAULT_ACCESS_LOGGER_PREFIX.length() + hostnamePattern.length() + 1);
name.append(DEFAULT_ACCESS_LOGGER_PREFIX);
for (int i = elements.length - 1; i >= 0; i--) {
final String element = elements[i];
if (element.isEmpty() || "*".equals(element)) {
continue;
}
name.append('.');
name.append(element);
}
if (hostAndPort.hasPort()) {
name.append(':');
name.append(hostAndPort.getPort());
}
return name.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: defaultAccessLoggerName
File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
line/armeria
|
defaultAccessLoggerName
|
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
|
df7f85824a62e997b910b5d6194a3335841065fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setPasswordMinimumLength(ComponentName who, int length, boolean parent) {
if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumLength")) {
return;
}
Objects.requireNonNull(who, "ComponentName is null");
final int userId = mInjector.userHandleGetCallingUserId();
synchronized (getLockObject()) {
ActiveAdmin ap = getActiveAdminForCallerLocked(
who, DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD, parent);
ensureMinimumQuality(userId, ap, PASSWORD_QUALITY_NUMERIC, "setPasswordMinimumLength");
final PasswordPolicy passwordPolicy = ap.mPasswordPolicy;
if (passwordPolicy.length != length) {
passwordPolicy.length = length;
updatePasswordValidityCheckpointLocked(userId, parent);
saveSettingsLocked(userId);
}
logPasswordQualitySetIfSecurityLogEnabled(who, userId, parent, passwordPolicy);
}
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.SET_PASSWORD_MINIMUM_LENGTH)
.setAdmin(who)
.setInt(length)
.write();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPasswordMinimumLength
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
|
setPasswordMinimumLength
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void toggleSplitScreen() {
toggleSplitScreenMode(-1 /* metricsDockAction */, -1 /* metricsUndockAction */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toggleSplitScreen
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
|
toggleSplitScreen
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getLocalName() {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLocalName
File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
Repository: HtmlUnit/htmlunit
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-2798
|
HIGH
| 7.5
|
HtmlUnit/htmlunit
|
getLocalName
|
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
|
940dc7fd
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean updateDrawnWindowStates(WindowState w) {
w.setDrawnStateEvaluated(true /*evaluated*/);
if (DEBUG_STARTING_WINDOW_VERBOSE && w == mStartingWindow) {
Slog.d(TAG, "updateWindows: starting " + w + " isOnScreen=" + w.isOnScreen()
+ " allDrawn=" + allDrawn + " freezingScreen=" + mFreezingScreen);
}
if (allDrawn && !mFreezingScreen) {
return false;
}
if (mLastTransactionSequence != mWmService.mTransactionSequence) {
mLastTransactionSequence = mWmService.mTransactionSequence;
mNumDrawnWindows = 0;
startingDisplayed = false;
// There is the main base application window, even if it is exiting, wait for it
mNumInterestingWindows = findMainWindow(false /* includeStartingApp */) != null ? 1 : 0;
}
final WindowStateAnimator winAnimator = w.mWinAnimator;
boolean isInterestingAndDrawn = false;
if (!allDrawn && w.mightAffectAllDrawn()) {
if (DEBUG_VISIBILITY || WM_DEBUG_ORIENTATION.isLogToLogcat()) {
final boolean isAnimationSet = isAnimating(TRANSITION | PARENTS,
ANIMATION_TYPE_APP_TRANSITION);
Slog.v(TAG, "Eval win " + w + ": isDrawn=" + w.isDrawn()
+ ", isAnimationSet=" + isAnimationSet);
if (!w.isDrawn()) {
Slog.v(TAG, "Not displayed: s=" + winAnimator.mSurfaceController
+ " pv=" + w.isVisibleByPolicy()
+ " mDrawState=" + winAnimator.drawStateToString()
+ " ph=" + w.isParentWindowHidden() + " th=" + mVisibleRequested
+ " a=" + isAnimationSet);
}
}
if (w != mStartingWindow) {
if (w.isInteresting()) {
// Add non-main window as interesting since the main app has already been added
if (findMainWindow(false /* includeStartingApp */) != w) {
mNumInterestingWindows++;
}
if (w.isDrawn()) {
mNumDrawnWindows++;
if (DEBUG_VISIBILITY || WM_DEBUG_ORIENTATION.isLogToLogcat()) {
Slog.v(TAG, "tokenMayBeDrawn: "
+ this + " w=" + w + " numInteresting=" + mNumInterestingWindows
+ " freezingScreen=" + mFreezingScreen
+ " mAppFreezing=" + w.mAppFreezing);
}
isInterestingAndDrawn = true;
}
}
} else if (w.isDrawn()) {
// The starting window for this container is drawn.
startingDisplayed = true;
}
}
return isInterestingAndDrawn;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateDrawnWindowStates
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
|
updateDrawnWindowStates
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setLocale(Locale locale) {
if (locale == null || locale.equals(Locale.getDefault())) {
return;
}
try {
// If locale is different from current locale this results in a configuration change,
// which will trigger the restarting of the activity.
LocalePicker.updateLocale(locale);
} catch (Exception e) {
// Do not stop provisioning and ignore this error.
Slogf.e(LOG_TAG, "Failed to set the system locale.", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLocale
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
|
setLocale
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public Entity<?> serialize(Object obj, Map<String, Object> formParams, String contentType, boolean isBodyNullable) throws ApiException {
Entity<?> entity;
if (contentType.startsWith("multipart/form-data")) {
MultiPart multiPart = new MultiPart();
for (Entry<String, Object> param: formParams.entrySet()) {
if (param.getValue() instanceof File) {
File file = (File) param.getValue();
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey())
.fileName(file.getName()).size(file.length()).build();
multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
} else {
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build();
multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue())));
}
}
entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE);
} else if (contentType.startsWith("application/x-www-form-urlencoded")) {
Form form = new Form();
for (Entry<String, Object> param: formParams.entrySet()) {
form.param(param.getKey(), parameterToString(param.getValue()));
}
entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
} else {
// We let jersey handle the serialization
if (isBodyNullable) { // payload is nullable
if (obj instanceof String) {
entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType);
} else {
entity = Entity.entity(obj == null ? "null" : obj, contentType);
}
} else {
if (obj instanceof String) {
entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType);
} else {
entity = Entity.entity(obj == null ? "" : obj, contentType);
}
}
}
return entity;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: serialize
File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
serialize
|
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getTempFolderPath() {
return tempFolderPath;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTempFolderPath
File: samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
getTempFolderPath
|
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void generateData(T data, JsonObject jsonObject) {
// Make sure KeyMapper is up to date
getKeyMapper().refresh(data);
// Write the key string for given data object
jsonObject.put(DataCommunicatorConstants.KEY,
getKeyMapper().key(data));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateData
File: server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2021-33609
|
MEDIUM
| 4
|
vaadin/framework
|
generateData
|
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
|
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
| 0
|
Analyze the following code function for security vulnerabilities
|
public ContentProviderHolder getContentProviderExternal(
String name, int userId, IBinder token) {
enforceCallingPermission(android.Manifest.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY,
"Do not have permission in call getContentProviderExternal()");
userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
userId, false, ALLOW_FULL_ONLY, "getContentProvider", null);
return getContentProviderExternalUnchecked(name, token, userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContentProviderExternal
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
|
getContentProviderExternal
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private void migrate63(File dataDir, Stack<Integer> versions) {
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("Settings.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
String key = element.elementTextTrim("key");
if (key.equals("JOB_EXECUTORS")) {
Element valueElement = element.element("value");
if (valueElement != null) {
for (Element executorElement: valueElement.elements()) {
if (executorElement.getName().contains("AutoDiscoveredJobExecutor"))
executorElement.detach();
}
}
}
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("Builds.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
Element errorMessageElement = element.element("errorMessage");
if (errorMessageElement != null)
errorMessageElement.detach();
}
dom.writeToFile(file, false);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate63
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
|
migrate63
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
public Element toDOM(Document document) {
Element requestElement = document.createElement("CertRevokeRequest");
if (reason != null) {
Element reasonElement = document.createElement("Reason");
reasonElement.appendChild(document.createTextNode(reason));
requestElement.appendChild(reasonElement);
}
if (invalidityDate != null) {
Element invalidityDateElement = document.createElement("InvalidityDate");
invalidityDateElement.appendChild(document.createTextNode(Long.toString(invalidityDate.getTime())));
requestElement.appendChild(invalidityDateElement);
}
if (comments != null) {
Element commentsElement = document.createElement("Comments");
commentsElement.appendChild(document.createTextNode(comments));
requestElement.appendChild(commentsElement);
}
if (encoded != null) {
Element encodedElement = document.createElement("Encoded");
encodedElement.appendChild(document.createTextNode(encoded));
requestElement.appendChild(encodedElement);
}
if (nonce != null) {
Element nonceElement = document.createElement("Nonce");
nonceElement.appendChild(document.createTextNode(Long.toString(nonce)));
requestElement.appendChild(nonceElement);
}
return requestElement;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toDOM
File: base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
toDOM
|
base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
protected abstract void readBody(ObjectInput inputStream, ByteArrayInputStream bin) throws IOException, ClassNotFoundException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readBody
File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java
Repository: rabbitmq/rabbitmq-jms-client
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2020-36282
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-jms-client
|
readBody
|
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
|
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handleStatusError(
ChannelHandlerContext ctx,
HttpRequest<?> request,
NettyHttpRequest nettyHttpRequest,
MutableHttpResponse<Object> defaultResponse,
String message) {
Optional<RouteMatch<Object>> statusRoute = router.route(defaultResponse.status());
if (statusRoute.isPresent()) {
RouteMatch<Object> routeMatch = statusRoute.get();
handleRouteMatch(routeMatch, nettyHttpRequest, ctx);
} else {
if (HttpMethod.permitsRequestBody(request.getMethod())) {
JsonError error = newError(request, message);
defaultResponse.body(error);
}
AtomicReference<HttpRequest<?>> requestReference = new AtomicReference<>(request);
Flowable<? extends MutableHttpResponse<?>> responsePublisher = filterPublisher(
requestReference,
Flowable.just(defaultResponse),
ctx.channel().eventLoop(),
false
);
subscribeToResponsePublisher(
ctx,
MediaType.APPLICATION_JSON_TYPE,
requestReference,
responsePublisher
);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleStatusError
File: http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
Repository: micronaut-projects/micronaut-core
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
handleStatusError
|
http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void formOK(UserRequest ureq) {
String name = textElement.getValue();
if(!name.toLowerCase().endsWith(".zip")) {
name += ".zip";
}
VFSLeaf zipFile = currentContainer.createChildLeaf(name);
if (zipFile == null) {
fireEvent(ureq, Event.FAILED_EVENT);
return;
}
List<VFSItem> vfsFiles = new ArrayList<>();
for (String fileName : selection.getFiles()) {
VFSItem item = currentContainer.resolve(fileName);
if (item != null) {
vfsFiles.add(item);
}
}
if (!ZipUtil.zip(vfsFiles, zipFile, new VFSSystemItemFilter(), false)) {
zipFile.delete();
status = FolderCommandStatus.STATUS_FAILED;
fireEvent(ureq, FOLDERCOMMAND_FINISHED);
} else {
vfsRepositoryService.itemSaved(zipFile, ureq.getIdentity());
fireEvent(ureq, new FolderEvent(FolderEvent.ZIP_EVENT, selection.renderAsHtml()));
fireEvent(ureq, FolderCommand.FOLDERCOMMAND_FINISHED);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: formOK
File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41152
|
MEDIUM
| 4
|
OpenOLAT
|
formOK
|
src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java
|
418bb509ffcb0e25ab4390563c6c47f0458583eb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void handleBrokenSinkChannel(Throwable e) {
UndertowLogger.REQUEST_LOGGER.debugf(e, "Closing HTTP2 channel to %s due to broken write side", getPeerAddress());
//the write side is broken, so we can't even send GO_AWAY
//just tear down the TCP connection
IoUtils.safeClose(this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleBrokenSinkChannel
File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-214"
] |
CVE-2021-3859
|
HIGH
| 7.5
|
undertow-io/undertow
|
handleBrokenSinkChannel
|
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
|
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void schemaValidation(Document doc) throws Exception {
ArrayList<StreamSource> schemas = new ArrayList<StreamSource>();
InputStream inputStream = null;
String schemaLocation = doc.getDocumentElement().getAttribute("xsi:schemaLocation");
schemaLocation = schemaLocation.replaceAll("^ +| +$| (?= )", "");
// get every two pair. every pair includes namespace and uri
String[] xsdLocations = schemaLocation.split("(?<!\\G\\S+)\\s");
for (String xsdLocation : xsdLocations) {
if (xsdLocation.isEmpty()) {
continue;
}
String namespace = xsdLocation.split('[' + LINE_SEPARATOR + " ]+")[0];
String uri = xsdLocation.split('[' + LINE_SEPARATOR + " ]+")[1];
// if this is hazelcast namespace but location is different log only warning
if (namespace.equals(xmlns) && !uri.endsWith(hazelcastSchemaLocation)) {
LOGGER.warning("Name of the hazelcast schema location is incorrect, using default");
}
// if this is not hazelcast namespace then try to load from uri
if (!namespace.equals(xmlns)) {
inputStream = loadSchemaFile(uri);
schemas.add(new StreamSource(inputStream));
}
}
// include hazelcast schema
schemas.add(new StreamSource(getClass().getClassLoader().getResourceAsStream(hazelcastSchemaLocation)));
// document to InputStream conversion
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Source xmlSource = new DOMSource(doc);
Result outputTarget = new StreamResult(outputStream);
TransformerFactory.newInstance().newTransformer().transform(xmlSource, outputTarget);
InputStream is = new ByteArrayInputStream(outputStream.toByteArray());
// schema validation
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(schemas.toArray(new Source[schemas.size()]));
Validator validator = schema.newValidator();
try {
SAXSource source = new SAXSource(new InputSource(is));
validator.validate(source);
} catch (Exception e) {
throw new InvalidConfigurationException(e.getMessage(), e);
} finally {
for (StreamSource source : schemas) {
closeResource(source.getInputStream());
}
closeResource(inputStream);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: schemaValidation
File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
schemaValidation
|
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@GetMapping("/login")
public String login() {
User user = getUser();
if (user != null) return redirect("/");
return render("login");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: login
File: src/main/java/co/yiiu/pybbs/controller/front/IndexController.java
Repository: atjiu/pybbs
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-23391
|
MEDIUM
| 4.3
|
atjiu/pybbs
|
login
|
src/main/java/co/yiiu/pybbs/controller/front/IndexController.java
|
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, BlockVector3 pt) {
//FAWE start - allow tree commands to be undone and obey region restrictions
return WorldEditPlugin.getInstance().getBukkitImplAdapter().generateTree(type, editSession, pt, getWorld());
//FAWE end
}
|
Vulnerability Classification:
- CWE: CWE-400
- CVE: CVE-2023-35925
- Severity: MEDIUM
- CVSS Score: 5.5
Description: feat: prevent edits outside +/- 30,000,000 blocks
Function: generateTree
File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
Repository: IntellectualSites/FastAsyncWorldEdit
Fixed Code:
@Override
public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, BlockVector3 pt) {
//FAWE start - allow tree commands to be undone and obey region restrictions
testCoords(pt);
return WorldEditPlugin.getInstance().getBukkitImplAdapter().generateTree(type, editSession, pt, getWorld());
//FAWE end
}
|
[
"CWE-400"
] |
CVE-2023-35925
|
MEDIUM
| 5.5
|
IntellectualSites/FastAsyncWorldEdit
|
generateTree
|
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
|
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
| 1
|
Analyze the following code function for security vulnerabilities
|
private FileItem getFileItem(HttpServletRequest request) throws FileUploadException {
Iterator iterator = getServletFileUpload().parseRequest(request).iterator();
while (iterator.hasNext()) {
FileItem item = (FileItem) iterator.next();
if (!item.isFormField()) {
return item;
}
}
return null;
}
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2014-8114
- Severity: MEDIUM
- CVSS Score: 6.8
Description: BZ(1169544,1169556, 1169557,1169559,1169560): improvements on security related to file access
Function: getFileItem
File: uberfire-server/src/main/java/org/uberfire/server/FileUploadServlet.java
Repository: AppFormer/uberfire
Fixed Code:
private FileItem getFileItem( HttpServletRequest request ) throws FileUploadException {
Iterator iterator = getServletFileUpload().parseRequest( request ).iterator();
while ( iterator.hasNext() ) {
FileItem item = (FileItem) iterator.next();
if ( !item.isFormField() ) {
return item;
}
}
return null;
}
|
[
"CWE-264"
] |
CVE-2014-8114
|
MEDIUM
| 6.8
|
AppFormer/uberfire
|
getFileItem
|
uberfire-server/src/main/java/org/uberfire/server/FileUploadServlet.java
|
21ec50eb15
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void deleteVoterInfo(int id) {
String sql = "delete from voter_table where id=?";
try {
ps = DbUtil.getConnection().prepareStatement(sql);
ps.setInt(1, id);
ps.executeUpdate();
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteVoterInfo
File: src/com/bijay/onlinevotingsystem/dao/VoterDaoImpl.java
Repository: bijaythapaa/OnlineVotingSystem
The code follows secure coding practices.
|
[
"CWE-916"
] |
CVE-2021-21253
|
MEDIUM
| 5
|
bijaythapaa/OnlineVotingSystem
|
deleteVoterInfo
|
src/com/bijay/onlinevotingsystem/dao/VoterDaoImpl.java
|
0181cb0272857696c8eb3e44fcf6cb014ff90f09
| 0
|
Analyze the following code function for security vulnerabilities
|
private native void nativeDestroy(long nativeWebsiteSettingsPopupAndroid);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeDestroy
File: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2015-1261
|
MEDIUM
| 5
|
chromium
|
nativeDestroy
|
chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
|
5bf8a2dccf4777c5f065d918d1d9a2bbaa013f9f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void appendsIgnoreCaseOrderingCorrectly() {
Sort sort = new Sort(new Sort.Order("firstname").ignoreCase());
String query = "select p from Person p order by p.lastname asc";
assertThat(applySorting(query, sort, "p"), endsWith("order by p.lastname asc, lower(p.firstname) asc"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendsIgnoreCaseOrderingCorrectly
File: src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
Repository: spring-projects/spring-data-jpa
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-6652
|
MEDIUM
| 6.8
|
spring-projects/spring-data-jpa
|
appendsIgnoreCaseOrderingCorrectly
|
src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
|
b8e7fe
| 0
|
Analyze the following code function for security vulnerabilities
|
WindowState getParentWindow() {
// NOTE: We are not calling getParent() directly as the WindowState might be a child of a
// WindowContainer that isn't a WindowState.
return (mIsChildWindow) ? ((WindowState) super.getParent()) : null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getParentWindow
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
getParentWindow
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isAuthenticated() {
if (mXMPPConnection != null) {
return (mXMPPConnection.isConnected() && mXMPPConnection
.isAuthenticated());
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAuthenticated
File: src/org/yaxim/androidclient/service/SmackableImp.java
Repository: ge0rg/yaxim
The code follows secure coding practices.
|
[
"CWE-20",
"CWE-346"
] |
CVE-2017-5589
|
MEDIUM
| 4.3
|
ge0rg/yaxim
|
isAuthenticated
|
src/org/yaxim/androidclient/service/SmackableImp.java
|
65a38dc77545d9568732189e86089390f0ceaf9f
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean shouldHideSilentStatusBarIcons(Context context) {
try {
return sINM.shouldHideSilentStatusIcons(context.getPackageName());
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldHideSilentStatusBarIcons
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
|
shouldHideSilentStatusBarIcons
|
src/com/android/settings/notification/NotificationBackend.java
|
d8355ac47e068ad20c6a7b1602e72f0585ec0085
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isEncryptionSupported() {
// Note, this can be implemented as
// return getEncryptionStatus() != DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED;
// But is provided as a separate internal method if there's a faster way to do a
// simple check for supported-or-not.
return getEncryptionStatus() != DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isEncryptionSupported
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
|
isEncryptionSupported
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean updateAccountVisibilityLocked(Account account, String packageName,
int newVisibility, UserAccounts accounts) {
final long accountId = accounts.accountsDb.findDeAccountId(account);
if (accountId < 0) {
return false;
}
final StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
try {
if (!accounts.accountsDb.setAccountVisibility(accountId, packageName,
newVisibility)) {
return false;
}
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
Map<String, Integer> accountVisibility =
getPackagesAndVisibilityForAccountLocked(account, accounts);
accountVisibility.put(packageName, newVisibility);
AccountManager.invalidateLocalAccountsDataCaches();
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateAccountVisibilityLocked
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
|
updateAccountVisibilityLocked
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
@Override
public String getPageName()
{
return this.getName();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPageName
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
|
getPageName
|
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 onStateUpdateFromItem(State state) {
callback.handleUpdate(state);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onStateUpdateFromItem
File: bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java
Repository: openhab/openhab-addons
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2020-5242
|
HIGH
| 9.3
|
openhab/openhab-addons
|
onStateUpdateFromItem
|
bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java
|
4c4cb664f2e2c3866aadf117d22fb54aa8dd0031
| 0
|
Analyze the following code function for security vulnerabilities
|
public BaseObject getXObject()
{
return getXObject(getDocumentReference());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getXObject
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
|
getXObject
|
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 applyManagedSubscriptionsPolicyIfRequired() {
int copeProfileUserId = getOrganizationOwnedProfileUserId();
// This policy is relevant only for COPE devices.
if (copeProfileUserId != UserHandle.USER_NULL) {
unregisterOnSubscriptionsChangedListener();
int policyType = getManagedSubscriptionsPolicy().getPolicyType();
if (policyType == ManagedSubscriptionsPolicy.TYPE_ALL_PERSONAL_SUBSCRIPTIONS) {
clearManagedSubscriptionsPolicy();
} else if (policyType == ManagedSubscriptionsPolicy.TYPE_ALL_MANAGED_SUBSCRIPTIONS) {
// Add listener to assign all current and future subs to managed profile.
registerListenerToAssignSubscriptionsToUser(copeProfileUserId);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: applyManagedSubscriptionsPolicyIfRequired
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
applyManagedSubscriptionsPolicyIfRequired
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void clearQueuedQosMessages() {
removeMessages(WifiMonitor.QOS_POLICY_RESET_EVENT);
removeMessages(WifiMonitor.QOS_POLICY_REQUEST_EVENT);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearQueuedQosMessages
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
clearQueuedQosMessages
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Media createMediaRecorder(MediaRecorderBuilder builder) throws IOException {
return createMediaRecorder(builder.getPath(), builder.getMimeType(), builder.getSamplingRate(), builder.getBitRate(), builder.getAudioChannels(), 0, builder.isRedirectToAudioBuffer());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createMediaRecorder
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
|
createMediaRecorder
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public String selectHeaderContentType(String[] contentTypes) {
if (contentTypes.length == 0) {
return "application/json";
}
for (String contentType : contentTypes) {
if (isJsonMime(contentType)) {
return contentType;
}
}
return contentTypes[0];
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectHeaderContentType
File: samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
selectHeaderContentType
|
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setName(String name) {
this.name = name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setName
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setName
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private GenerationUnitPreprocessResult preProcessModel(AmwTemplateModel model) {
AmwModelPreprocessExceptionHandler exceptionHandler = new AmwModelPreprocessExceptionHandler();
model.setAmwModelPreprocessExceptionHandler(exceptionHandler);
model.preProcess();
GenerationUnitPreprocessResult result = new GenerationUnitPreprocessResult();
result.setErrorMessages(exceptionHandler.getErrorMessages());
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: preProcessModel
File: AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/generator/control/extracted/templates/BaseTemplateProcessor.java
Repository: liimaorg/liima
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2023-26092
|
CRITICAL
| 9.8
|
liimaorg/liima
|
preProcessModel
|
AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/generator/control/extracted/templates/BaseTemplateProcessor.java
|
78ba2e198c615dc8858e56eee3290989f0362686
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String getElement(Element docel, String name)
{
Element el = docel.element(name);
if (el == null) {
return "";
} else {
return el.getText();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getElement
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
|
getElement
|
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
|
protected void showNativePage(NativePage nativePage) {
if (mNativePage == nativePage) return;
NativePage previousNativePage = mNativePage;
mNativePage = nativePage;
pushNativePageStateToNavigationEntry();
for (TabObserver observer : mObservers) observer.onContentChanged(this);
destroyNativePageInternal(previousNativePage);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showNativePage
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
showNativePage
|
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getPublicSharingCondition( String access )
{
return String.join( " or ",
jsonbFunction( EXTRACT_PATH_TEXT, "public" ) + " like " + withQuotes( access ),
jsonbFunction( EXTRACT_PATH_TEXT, "public" ) + " is null" );
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2022-24848
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Merge pull request from GHSA-52vp-f7hj-cj92
Function: getPublicSharingCondition
File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/ProgramOrganisationUnitAssociationsQueryBuilder.java
Repository: dhis2/dhis2-core
Fixed Code:
private String getPublicSharingCondition( String access )
{
return String.join( " or ",
jsonbFunction( EXTRACT_PATH_TEXT, "public" ) + " like " + singleQuote( access ),
jsonbFunction( EXTRACT_PATH_TEXT, "public" ) + " is null" );
}
|
[
"CWE-89"
] |
CVE-2022-24848
|
MEDIUM
| 6.5
|
dhis2/dhis2-core
|
getPublicSharingCondition
|
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/ProgramOrganisationUnitAssociationsQueryBuilder.java
|
3b245d04a58b78f0dc9bae8559f36ee4ca36dfac
| 1
|
Analyze the following code function for security vulnerabilities
|
private void addSharedLibraryLPw(ArraySet<String> usesLibraryFiles, SharedLibraryEntry file,
PackageParser.Package changingLib) {
if (file.path != null) {
usesLibraryFiles.add(file.path);
return;
}
PackageParser.Package p = mPackages.get(file.apk);
if (changingLib != null && changingLib.packageName.equals(file.apk)) {
// If we are doing this while in the middle of updating a library apk,
// then we need to make sure to use that new apk for determining the
// dependencies here. (We haven't yet finished committing the new apk
// to the package manager state.)
if (p == null || p.packageName.equals(changingLib.packageName)) {
p = changingLib;
}
}
if (p != null) {
usesLibraryFiles.addAll(p.getAllCodePaths());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addSharedLibraryLPw
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
|
addSharedLibraryLPw
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean enableAutojoin(String uniqueId, String fqdn, boolean enableAutojoin) {
if (uniqueId == null && fqdn == null) {
return false;
}
if (uniqueId != null) {
// Unique identifier provided
PasspointProvider provider = mProviders.get(uniqueId);
if (provider == null) {
Log.e(TAG, "Config doesn't exist");
return false;
}
if (provider.setAutojoinEnabled(enableAutojoin)) {
mWifiMetrics.logUserActionEvent(enableAutojoin
? UserActionEvent.EVENT_CONFIGURE_AUTO_CONNECT_ON
: UserActionEvent.EVENT_CONFIGURE_AUTO_CONNECT_OFF,
provider.isFromSuggestion(), true);
// Update WifiConfigManager if changed.
updateWifiConfigInWcmIfPresent(provider.getWifiConfig(), provider.getCreatorUid(),
provider.getPackageName(), provider.isFromSuggestion());
}
mWifiConfigManager.saveToStore(true);
return true;
}
ArrayList<PasspointProvider> passpointProviders = new ArrayList<>(mProviders.values());
boolean found = false;
// FQDN provided, loop through all profiles with matching FQDN
for (PasspointProvider provider : passpointProviders) {
if (TextUtils.equals(provider.getConfig().getHomeSp().getFqdn(), fqdn)) {
if (provider.setAutojoinEnabled(enableAutojoin)) {
mWifiMetrics.logUserActionEvent(enableAutojoin
? UserActionEvent.EVENT_CONFIGURE_AUTO_CONNECT_ON
: UserActionEvent.EVENT_CONFIGURE_AUTO_CONNECT_OFF,
provider.isFromSuggestion(), true);
// Update WifiConfigManager if changed.
updateWifiConfigInWcmIfPresent(provider.getWifiConfig(),
provider.getCreatorUid(), provider.getPackageName(),
provider.isFromSuggestion());
}
found = true;
}
}
if (found) {
mWifiConfigManager.saveToStore(true);
}
return found;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enableAutojoin
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
|
enableAutojoin
|
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private void sendMessage(String iface, int what) {
sendMessage(iface, Message.obtain(null, what));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendMessage
File: service/java/com/android/server/wifi/WifiMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
sendMessage
|
service/java/com/android/server/wifi/WifiMonitor.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onPanelLaidOut() {
if (mState == StatusBarState.KEYGUARD) {
// Since the number of notifications is determined based on the height of the view, we
// need to update them.
int maxBefore = getMaxKeyguardNotifications(false /* recompute */);
int maxNotifications = getMaxKeyguardNotifications(true /* recompute */);
if (maxBefore != maxNotifications) {
updateRowStates();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onPanelLaidOut
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
|
onPanelLaidOut
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void securityCheck(String filename) {
Assert.doesNotContain(filename, "..");
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2021-21234
- Severity: MEDIUM
- CVSS Score: 4.0
Description: backport directory traversal vulnerability fix
Function: securityCheck
File: lib/src/main/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpoint.java
Repository: lukashinsch/spring-boot-actuator-logview
Fixed Code:
private void securityCheck(Path base, String filename) {
try {
String canonicalLoggingPath = (filename != null ? new File(base.toFile().toString(), filename) : new File(base.toFile().toString())).getCanonicalPath();
String baseCanonicalPath = new File(loggingPath).getCanonicalPath();
String errorMessage = "File " + base.toString() + "/" + filename + " may not be located outside base path " + loggingPath;
Assert.isTrue(canonicalLoggingPath.startsWith(baseCanonicalPath), errorMessage);
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
|
[
"CWE-22"
] |
CVE-2021-21234
|
MEDIUM
| 4
|
lukashinsch/spring-boot-actuator-logview
|
securityCheck
|
lib/src/main/java/eu/hinsch/spring/boot/actuator/logview/LogViewEndpoint.java
|
760acbb939a8d1f7d1a7dfcd51ca848eea04e772
| 1
|
Analyze the following code function for security vulnerabilities
|
private void setDismissButton(View decor) {
final TextView noButton = decor.findViewById(R.id.autofill_dialog_no);
// set "No thinks" by default
noButton.setText(R.string.autofill_save_no);
noButton.setOnClickListener((v) -> mCallback.onDismissed());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDismissButton
File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-610"
] |
CVE-2023-40133
|
MEDIUM
| 5.5
|
android
|
setDismissButton
|
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
|
08becc8c600f14c5529115cc1a1e0c97cd503f33
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void saveBatchXTrans2(TestContext context) {
log.fatal("started saveBatchXTrans2");
List<Object> list = new LinkedList<>();
list.add(context);
postgresClient = createFoo(context);
postgresClient.startTx(asyncAssertTx(context, trans -> {
postgresClient.saveBatch(trans, FOO, list, context.asyncAssertFailure(save -> {
// postgresClient.endTx(trans, context.asyncAssertSuccess());
}));
}));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveBatchXTrans2
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
saveBatchXTrans2
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String loadFileAsString(File f, Charset encoding) throws IOException {
try (final FileInputStream is = new FileInputStream(f)) {
return BasicFileUtils.toString(is, encoding);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadFileAsString
File: core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices.
|
[
"CWE-345",
"CWE-94",
"CWE-22"
] |
CVE-2019-10182
|
MEDIUM
| 5.8
|
AdoptOpenJDK/IcedTea-Web
|
loadFileAsString
|
core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java
|
2ab070cdac087bd208f64fa8138bb709f8d7680c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void dismissKeyguardLw() {
if (mKeyguardDelegate != null && mKeyguardDelegate.isShowing()) {
if (DEBUG_KEYGUARD) Slog.d(TAG, "PWM.dismissKeyguardLw");
mHandler.post(new Runnable() {
@Override
public void run() {
// ask the keyguard to prompt the user to authenticate if necessary
mKeyguardDelegate.dismiss();
}
});
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dismissKeyguardLw
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
dismissKeyguardLw
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void doStart() {
BayeuxServer bayeux = _oort.getBayeuxServer();
_session.handshake();
ServerChannel setiAllChannel = bayeux.createChannelIfAbsent(SETI_ALL_CHANNEL).getReference();
setiAllChannel.addListener(_initialStateListener);
_session.getChannel(SETI_ALL_CHANNEL).subscribe((channel, message) -> receiveBroadcast(message));
_oort.observeChannel(SETI_ALL_CHANNEL);
String setiChannelName = generateSetiChannel(_setiId);
_session.getChannel(setiChannelName).subscribe((channel, message) -> receiveDirect(message));
_oort.observeChannel(setiChannelName);
_oort.addCometListener(_cometListener);
if (_logger.isDebugEnabled()) {
_logger.debug("{} started", this);
}
}
|
Vulnerability Classification:
- CWE: CWE-863
- CVE: CVE-2022-24721
- Severity: MEDIUM
- CVSS Score: 5.5
Description: Fixes #1146 - Review Oort/Seti channel usage
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Function: doStart
File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
Repository: cometd
Fixed Code:
@Override
protected void doStart() {
BayeuxServer bayeux = _oort.getBayeuxServer();
bayeux.addListener(_allChannelsFilter);
_session.handshake();
protectSetiChannels(bayeux);
ServerChannel setiAllChannel = bayeux.createChannelIfAbsent(SETI_ALL_CHANNEL).getReference();
setiAllChannel.addListener(_initialStateListener);
_session.getChannel(SETI_ALL_CHANNEL).subscribe((channel, message) -> receiveBroadcast(message));
_oort.observeChannel(SETI_ALL_CHANNEL);
String setiChannelName = generateSetiChannel(_setiId);
_session.getChannel(setiChannelName).subscribe((channel, message) -> receiveDirect(message));
_oort.observeChannel(setiChannelName);
_oort.addCometListener(_cometListener);
if (_logger.isDebugEnabled()) {
_logger.debug("{} started", this);
}
}
|
[
"CWE-863"
] |
CVE-2022-24721
|
MEDIUM
| 5.5
|
cometd
|
doStart
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 1
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testSerializationAsString01() throws Exception
{
Instant date = Instant.ofEpochSecond(0L);
String value = MAPPER.writer()
.without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.writeValueAsString(date);
assertEquals("The value is not correct.", '"' + FORMATTER.format(date) + '"', value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testSerializationAsString01
File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
Repository: FasterXML/jackson-modules-java8
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-1000873
|
MEDIUM
| 4.3
|
FasterXML/jackson-modules-java8
|
testSerializationAsString01
|
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
|
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nonnull
public static Color makeContrastColor(@Nonnull final Color color) {
return calculateColorBrightness(color) < 128 ? Color.WHITE : Color.BLACK;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeContrastColor
File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
Repository: raydac/netbeans-mmd-plugin
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000542
|
MEDIUM
| 6.8
|
raydac/netbeans-mmd-plugin
|
makeContrastColor
|
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
|
9fba652bf06e649186b8f9e612d60e9cc15097e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void updateLowBatteryWarning() {
updateNotification();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateLowBatteryWarning
File: packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3854
|
MEDIUM
| 5
|
android
|
updateLowBatteryWarning
|
packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
|
05e0705177d2078fa9f940ce6df723312cfab976
| 0
|
Analyze the following code function for security vulnerabilities
|
public static DomainInfo convertXMLObjectToDomainInfo(XMLObject xmlObject) {
DomainInfo domain = new DomainInfo();
Document doc = xmlObject.getDocument();
Node rootNode = doc.getFirstChild();
Vector<String> values = xmlObject.getValuesFromContainer(rootNode, "Name");
if (!values.isEmpty()) domain.setName(values.firstElement());
for (String type : TYPES) {
NodeList hosts = doc.getElementsByTagName(type);
for (int j=0; j<hosts.getLength(); j++) {
Node hostNode = hosts.item(j);
SecurityDomainHost host = new SecurityDomainHost();
values = xmlObject.getValuesFromContainer(hostNode, "Host");
if (!values.isEmpty()) host.setHostname(values.firstElement());
values = xmlObject.getValuesFromContainer(hostNode, "UnSecurePort");
if (!values.isEmpty()) host.setPort(values.firstElement());
values = xmlObject.getValuesFromContainer(hostNode, "SecurePort");
if (!values.isEmpty()) host.setSecurePort(values.firstElement());
values = xmlObject.getValuesFromContainer(hostNode, "SecureEEClientAuthPort");
if (!values.isEmpty()) host.setSecureEEClientAuthPort(values.firstElement());
values = xmlObject.getValuesFromContainer(hostNode, "SecureAgentPort");
if (!values.isEmpty()) host.setSecureAgentPort(values.firstElement());
values = xmlObject.getValuesFromContainer(hostNode, "SecureAdminPort");
if (!values.isEmpty()) host.setSecureAdminPort(values.firstElement());
values = xmlObject.getValuesFromContainer(hostNode, "Clone");
if (!values.isEmpty()) host.setClone(values.firstElement());
values = xmlObject.getValuesFromContainer(hostNode, "SubsystemName");
if (!values.isEmpty()) host.setSubsystemName(values.firstElement());
values = xmlObject.getValuesFromContainer(hostNode, "DomainManager");
if (!values.isEmpty()) host.setDomainManager(values.firstElement());
String port = host.getSecurePort();
if (port == null) port = host.getSecureEEClientAuthPort();
host.setId(type+" "+host.getHostname()+" "+port);
domain.addHost(type, host);
}
}
return domain;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertXMLObjectToDomainInfo
File: base/server/src/main/java/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
convertXMLObjectToDomainInfo
|
base/server/src/main/java/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isRequestedSessionIdValid() {
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isRequestedSessionIdValid
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
|
isRequestedSessionIdValid
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean useDirectBufferNoCleaner() {
return USE_DIRECT_BUFFER_NO_CLEANER;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: useDirectBufferNoCleaner
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
|
useDirectBufferNoCleaner
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
void resetAppOpsState() {
if (mAppOp != OP_NONE && mAppOpVisibility) {
mWmService.mAppOps.finishOp(mAppOp, getOwningUid(), getOwningPackage(),
null /* featureId */);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resetAppOpsState
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
resetAppOpsState
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isTimeoutSupported() {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isTimeoutSupported
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
|
isTimeoutSupported
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public Element getElement() {
if (this.xmlNode instanceof Element) {
return (Element) this.xmlNode;
} else {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getElement
File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
getElement
|
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
public ClientAuthenticationMethod getTokenEndPointAuthMethod()
{
String authMethod = getProperty(PROP_ENDPOINT_TOKEN_AUTH_METHOD, String.class);
if ("client_secret_post".equalsIgnoreCase(authMethod)) {
return ClientAuthenticationMethod.CLIENT_SECRET_POST;
} else {
return ClientAuthenticationMethod.CLIENT_SECRET_BASIC;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTokenEndPointAuthMethod
File: oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
Repository: xwiki-contrib/oidc
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39387
|
HIGH
| 7.5
|
xwiki-contrib/oidc
|
getTokenEndPointAuthMethod
|
oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
|
0247af1417925b9734ab106ad7cd934ee870ac89
| 0
|
Analyze the following code function for security vulnerabilities
|
private Pattern[] getExcludedRegionsPatterns() {
String[] excluded = getExcludedRegionsNormalized();
if (excluded != null) {
Pattern[] patterns = new Pattern[excluded.length];
int i = 0;
for (String excludedRegion : excluded) {
patterns[i++] = Pattern.compile(excludedRegion);
}
return patterns;
}
return new Pattern[0];
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getExcludedRegionsPatterns
File: src/main/java/hudson/scm/SubversionSCM.java
Repository: jenkinsci/subversion-plugin
The code follows secure coding practices.
|
[
"CWE-255"
] |
CVE-2013-6372
|
LOW
| 2.1
|
jenkinsci/subversion-plugin
|
getExcludedRegionsPatterns
|
src/main/java/hudson/scm/SubversionSCM.java
|
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setLocale(VaadinRequest request, VaadinSession session) {
I18NProvider provider = getInstantiator().getI18NProvider();
List<Locale> providedLocales = provider.getProvidedLocales();
if (providedLocales.size() == 1) {
session.setLocale(providedLocales.get(0));
} else {
Optional<Locale> foundLocale = LocaleUtil
.getExactLocaleMatch(request, providedLocales);
if (!foundLocale.isPresent()) {
foundLocale = LocaleUtil.getLocaleMatchByLanguage(request,
providedLocales);
}
// Set locale by match found in I18N provider, first provided locale
// or else leave as default locale
if (foundLocale.isPresent()) {
session.setLocale(foundLocale.get());
} else if (!providedLocales.isEmpty()) {
session.setLocale(providedLocales.get(0));
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLocale
File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31404
|
LOW
| 1.9
|
vaadin/flow
|
setLocale
|
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
|
621ef1b322737d963bee624b2d2e38cd739903d9
| 0
|
Analyze the following code function for security vulnerabilities
|
default File getTempFileFromInputStream(InputStream inputStream, String prefix, String suffix)
throws IOException {
File tmp = Files.createTempFile(prefix, suffix);
tmp.deleteOnExit();
Files.copy(inputStream, tmp.toPath(), StandardCopyOption.REPLACE_EXISTING);
return tmp;
}
|
Vulnerability Classification:
- CWE: CWE-668
- CVE: CVE-2021-22572
- Severity: LOW
- CVSS Score: 2.1
Description: Actually return a file
Function: getTempFileFromInputStream
File: portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/storage/TemporaryPerJobDataStore.java
Repository: google/data-transfer-project
Fixed Code:
default File getTempFileFromInputStream(InputStream inputStream, String prefix, String suffix)
throws IOException {
File tmp = Files.createTempFile(prefix, suffix).toFile();
tmp.deleteOnExit();
Files.copy(inputStream, tmp.toPath(), StandardCopyOption.REPLACE_EXISTING);
return tmp;
}
|
[
"CWE-668"
] |
CVE-2021-22572
|
LOW
| 2.1
|
google/data-transfer-project
|
getTempFileFromInputStream
|
portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/storage/TemporaryPerJobDataStore.java
|
63583cc337f9c04af498ee6cff76be5f68d2483b
| 1
|
Analyze the following code function for security vulnerabilities
|
@DELETE
@Path("{configClass}")
@ApiOperation(value = "Delete configuration settings from database")
@Timed
@RequiresPermissions(RestPermissions.CLUSTER_CONFIG_ENTRY_DELETE)
@AuditEvent(type = AuditEventTypes.CLUSTER_CONFIGURATION_DELETE)
public void delete(@ApiParam(name = "configClass", value = "The name of the cluster configuration class", required = true)
@PathParam("configClass") @NotBlank String configClass) {
final Class<?> cls = classFromName(configClass);
if (cls == null) {
throw new NotFoundException(createNoClassMsg(configClass));
}
clusterConfigService.remove(cls);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: delete
File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/ClusterConfigResource.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2024-24824
|
HIGH
| 8.8
|
Graylog2/graylog2-server
|
delete
|
graylog2-server/src/main/java/org/graylog2/rest/resources/system/ClusterConfigResource.java
|
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
| 0
|
Analyze the following code function for security vulnerabilities
|
public int read(long[] d)
throws IOException
{
return read(d, 0, d.length);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: read
File: src/main/java/org/xerial/snappy/SnappyInputStream.java
Repository: xerial/snappy-java
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-34455
|
HIGH
| 7.5
|
xerial/snappy-java
|
read
|
src/main/java/org/xerial/snappy/SnappyInputStream.java
|
3bf67857fcf70d9eea56eed4af7c925671e8eaea
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.