instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
public final HeaderEntry<K, V> before() {
return before;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: before
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-436",
"CWE-113"
] |
CVE-2022-41915
|
MEDIUM
| 6.5
|
netty
|
before
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isAssociatedCompanionApp(int userId, int uid) {
final Set<Integer> allUids = mCompanionAppUidsMap.get(userId);
if (allUids == null) {
return false;
}
return allUids.contains(uid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAssociatedCompanionApp
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
isAssociatedCompanionApp
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void setOCItemDataDNs(OdmClinicalDataBean data, String idataIds, HashMap<Integer, String> idataOidPoses) {
this.setOCItemDataDNsTypesExpected();
HashMap<String, ArrayList<ChildNoteBean>> pDNs = new HashMap<String, ArrayList<ChildNoteBean>>();
// HashMap<String, ArrayList<DiscrepancyNoteBean>> sDNs = new HashMap<String, ArrayList<DiscrepancyNoteBean>>();
logger.debug("Begin to execute GetOCItemDataDNsSql");
logger.debug("getOCItemDataDNsSql= " + this.getOCItemDataDNsSql(idataIds));
ArrayList rows = select(this.getOCItemDataDNsSql(idataIds));
Iterator iter = rows.iterator();
while (iter.hasNext()) {
HashMap row = (HashMap) iter.next();
Integer idataId = (Integer) row.get("item_data_id");
Integer pdnId = (Integer) row.get("parent_dn_id");
Integer dnId = (Integer) row.get("dn_id");
String description = (String) row.get("description");
String detailedNote = (String) row.get("detailed_notes");
Integer ownerId = (Integer) row.get("owner_id");
Date dateCreated = (Date) row.get("date_created");
String status = (String) row.get("status");
String noteType = (String) row.get("name");
if (pdnId != null && pdnId > 0) {
String key = idataId + "-" + pdnId;
ChildNoteBean cn = new ChildNoteBean();
cn.setDateCreated(dateCreated);
cn.setDescription(description);
cn.setDetailedNote(detailedNote);
cn.setStatus(status);
cn.setOid("CDN_" + dnId);
ElementRefBean userRef = new ElementRefBean();
userRef.setElementDefOID("USR_" + ownerId);
cn.setUserRef(userRef);
ArrayList<ChildNoteBean> cns = pDNs.containsKey(key) ? pDNs.get(key) : new ArrayList<ChildNoteBean>();
cns.add(cn);
pDNs.put(key, cns);
} else {
DiscrepancyNoteBean dn = new DiscrepancyNoteBean();
String k = idataId + "-" + dnId;
if (pDNs != null && pDNs.containsKey(k)) {
dn.setChildNotes(pDNs.get(k));
dn.setNumberOfChildNotes(dn.getChildNotes().size());
}
dn.setDateUpdated(dateCreated);
dn.setNoteType(noteType);
dn.setStatus(status);
dn.setOid("DN_" + dnId);
ElementRefBean userRef = new ElementRefBean();
userRef.setElementDefOID("USR_" + ownerId);
if (idataOidPoses.containsKey(idataId)) {
String[] poses = idataOidPoses.get(idataId).split("---");
int p0 = Integer.parseInt(poses[0]);
int p1 = Integer.parseInt(poses[1]);
int p2 = Integer.parseInt(poses[2]);
int p3 = Integer.parseInt(poses[3]);
int p4 = Integer.parseInt(poses[4]);
String entityID =
data.getExportSubjectData().get(p0).getExportStudyEventData().get(p1).getExportFormData().get(p2).getItemGroupData().get(p3)
.getItemData().get(p4).getItemOID();
data.getExportSubjectData().get(p0).getExportStudyEventData().get(p1).getExportFormData().get(p2).getItemGroupData().get(p3).getItemData()
.get(p4).getDiscrepancyNotes().setEntityID(entityID);
data.getExportSubjectData().get(p0).getExportStudyEventData().get(p1).getExportFormData().get(p2).getItemGroupData().get(p3).getItemData()
.get(p4).getDiscrepancyNotes().getDiscrepancyNotes().add(dn);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOCItemDataDNs
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
|
setOCItemDataDNs
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
Call getForegroundCall() {
return mForegroundCall;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getForegroundCall
File: src/com/android/server/telecom/CallsManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2423
|
MEDIUM
| 6.6
|
android
|
getForegroundCall
|
src/com/android/server/telecom/CallsManager.java
|
a06c9a4aef69ae27b951523cf72bf72412bf48fa
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getExpungeThreadCount() {
return myExpungeThreadCount;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getExpungeThreadCount
File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
Repository: hapifhir/hapi-fhir
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-32053
|
MEDIUM
| 5
|
hapifhir/hapi-fhir
|
getExpungeThreadCount
|
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
|
f2934b229c491235ab0e7782dea86b324521082a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Transactional
public UploadPackageResultDto uploadPackage(MultipartFile pluginPackageFile) {
// 1. save package file to local
String tmpFileName = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());
File localFilePath = new File(SystemUtils.getTempFolderPath() + tmpFileName + "/");
log.info("tmp File Path= {}", localFilePath.getName());
try {
UploadPackageResultDto result = performUploadPackage(pluginPackageFile, localFilePath);
return result;
} finally {
if (localFilePath != null && localFilePath.exists()) {
log.info("try to clean up temporary files:{}", localFilePath.getAbsolutePath());
FileUtils.deleteQuietly(localFilePath);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uploadPackage
File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
Repository: WeBankPartners/wecube-platform
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-45746
|
MEDIUM
| 5
|
WeBankPartners/wecube-platform
|
uploadPackage
|
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
|
1164dae43c505f8a0233cc049b2689d6ca6d0c37
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public XWikiDocument getRevision(DocumentReference reference, String revision) throws XWikiException
{
// Parse the version
String revisionPrefix = null;
if (revision != null) {
int revisionPrefixIndex = revision.indexOf(':');
if (revisionPrefixIndex > 0) {
revisionPrefix = revision.substring(0, revisionPrefixIndex);
}
}
String shortRevision;
if (revisionPrefix != null) {
shortRevision = revision.substring(revisionPrefix.length() + 1);
} else {
shortRevision = revision;
}
// Find the provider
DocumentRevisionProvider provider = this.databaseDocumentRevisionProvider;
if (revisionPrefix != null) {
ComponentManager componentManager = this.componentManagerProvider.get();
if (componentManager.hasComponent(DocumentRevisionProvider.class, revisionPrefix)) {
try {
provider = componentManager.getInstance(DocumentRevisionProvider.class, revisionPrefix);
} catch (ComponentLookupException e) {
throw new XWikiException("Failed to get revision provider for revision [" + revision + "]", e);
}
}
}
// Load the document revision
return provider.getRevision(reference, shortRevision);
}
|
Vulnerability Classification:
- CWE: CWE-668
- CVE: CVE-2023-29208
- Severity: HIGH
- CVSS Score: 7.5
Description: XWIKI-16285: Error when accessing deleted document
Function: getRevision
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/doc/DefaultDocumentRevisionProvider.java
Repository: xwiki/xwiki-platform
Fixed Code:
@Override
public XWikiDocument getRevision(DocumentReference reference, String revision) throws XWikiException
{
Pair<String, String> parsedRevision = parseRevision(revision);
// Load the document revision
return getProvider(parsedRevision.getLeft()).getRevision(reference, parsedRevision.getRight());
}
|
[
"CWE-668"
] |
CVE-2023-29208
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getRevision
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/doc/DefaultDocumentRevisionProvider.java
|
d9e947559077e947315bf700c5703dfc7dd8a8d7
| 1
|
Analyze the following code function for security vulnerabilities
|
private void migrateAllLegacySettingsIfNeededLocked() {
final int key = makeKey(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM);
File globalFile = getSettingsFile(key);
if (SettingsState.stateFileExists(globalFile)) {
return;
}
mSettingsCreationBuildId = Build.ID;
final long identity = Binder.clearCallingIdentity();
try {
List<UserInfo> users = mUserManager.getAliveUsers();
final int userCount = users.size();
for (int i = 0; i < userCount; i++) {
final int userId = users.get(i).id;
DatabaseHelper dbHelper = new DatabaseHelper(getContext(), userId);
SQLiteDatabase database = dbHelper.getWritableDatabase();
migrateLegacySettingsForUserLocked(dbHelper, database, userId);
// Upgrade to the latest version.
UpgradeController upgrader = new UpgradeController(userId);
upgrader.upgradeIfNeededLocked();
// Drop from memory if not a running user.
if (!mUserManager.isUserRunning(new UserHandle(userId))) {
removeUserStateLocked(userId, false);
}
}
} finally {
Binder.restoreCallingIdentity(identity);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrateAllLegacySettingsIfNeededLocked
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
migrateAllLegacySettingsIfNeededLocked
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
private String escapeString(final String string)
{
if (string == null || string.length() == 0) {
return "\"\"";
}
char c = 0;
int i;
final int len = string.length();
final StringBuilder sb = new StringBuilder(len + 4);
String t;
sb.append('"');
for (i = 0; i < len; i += 1) {
c = string.charAt(i);
switch (c) {
case '\\':
case '"':
sb.append('\\');
sb.append(c);
break;
case '/':
// if (b == '<') {
sb.append('\\');
// }
sb.append(c);
break;
case '\b':
sb.append("\\b");
break;
case '\t':
sb.append("\\t");
break;
case '\n':
sb.append("\\n");
break;
case '\f':
sb.append("\\f");
break;
case '\r':
sb.append("\\r");
break;
default:
if (c < ' ') {
t = "000" + Integer.toHexString(c);
sb.append("\\u" + t.substring(t.length() - 4));
} else {
sb.append(c);
}
}
}
sb.append('"');
return sb.toString();
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2013-7250
- Severity: LOW
- CVSS Score: 3.5
Description: Escapes now HTML (JsonBuilder).
Function: escapeString
File: src/main/java/org/projectforge/web/core/JsonBuilder.java
Repository: micromata/projectforge-webapp
Fixed Code:
private String escapeString(final String string)
{
if (string == null || string.length() == 0) {
return "\"\"";
}
char c = 0;
int i;
final int len = string.length();
final StringBuilder sb = new StringBuilder(len + 4);
String t;
sb.append('"');
for (i = 0; i < len; i += 1) {
c = string.charAt(i);
switch (c) {
case '\\':
case '"':
sb.append('\\');
sb.append(c);
break;
case '/':
// if (b == '<') {
sb.append('\\');
// }
sb.append(c);
break;
case '\b':
sb.append("\\b");
break;
case '\t':
sb.append("\\t");
break;
case '\n':
sb.append("\\n");
break;
case '\f':
sb.append("\\f");
break;
case '\r':
sb.append("\\r");
break;
default:
if (c < ' ') {
t = "000" + Integer.toHexString(c);
sb.append("\\u" + t.substring(t.length() - 4));
} else {
if (escapeHtml == true) {
switch (c) {
case '<':
sb.append("<");
break;
case '>':
sb.append(">");
break;
case '&':
sb.append("&");
break;
case '"':
sb.append(""");
break;
case '\'':
sb.append("'");
break;
case '/':
sb.append("/");
break;
default:
sb.append(c);
}
} else {
sb.append(c);
}
}
}
}
sb.append('"');
return sb.toString();
}
|
[
"CWE-79"
] |
CVE-2013-7250
|
LOW
| 3.5
|
micromata/projectforge-webapp
|
escapeString
|
src/main/java/org/projectforge/web/core/JsonBuilder.java
|
5a6a25366491443b76e528a04a9e4ba26f08a83c
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void makePackageIdle(String packageName, int userId) {
if (checkCallingPermission(android.Manifest.permission.FORCE_STOP_PACKAGES)
!= PackageManager.PERMISSION_GRANTED) {
String msg = "Permission Denial: makePackageIdle() from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
+ " requires " + android.Manifest.permission.FORCE_STOP_PACKAGES;
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
final int callingPid = Binder.getCallingPid();
userId = mUserController.handleIncomingUser(callingPid, Binder.getCallingUid(),
userId, true, ALLOW_FULL_ONLY, "makePackageIdle", null);
long callingId = Binder.clearCallingIdentity();
synchronized(this) {
try {
IPackageManager pm = AppGlobals.getPackageManager();
int pkgUid = -1;
try {
pkgUid = pm.getPackageUid(packageName, MATCH_UNINSTALLED_PACKAGES
| MATCH_DEBUG_TRIAGED_MISSING, UserHandle.USER_SYSTEM);
} catch (RemoteException e) {
}
if (pkgUid == -1) {
throw new IllegalArgumentException("Unknown package name " + packageName);
}
if (mLocalPowerManager != null) {
mLocalPowerManager.startUidChanges();
}
final int appId = UserHandle.getAppId(pkgUid);
final int N = mActiveUids.size();
for (int i=N-1; i>=0; i--) {
final UidRecord uidRec = mActiveUids.valueAt(i);
final long bgTime = uidRec.lastBackgroundTime;
if (bgTime > 0 && !uidRec.idle) {
if (UserHandle.getAppId(uidRec.uid) == appId) {
if (userId == UserHandle.USER_ALL ||
userId == UserHandle.getUserId(uidRec.uid)) {
EventLogTags.writeAmUidIdle(uidRec.uid);
uidRec.idle = true;
uidRec.setIdle = true;
Slog.w(TAG, "Idling uid " + UserHandle.formatUid(uidRec.uid)
+ " from package " + packageName + " user " + userId);
doStopUidLocked(uidRec.uid, uidRec);
}
}
}
}
} finally {
if (mLocalPowerManager != null) {
mLocalPowerManager.finishUidChanges();
}
Binder.restoreCallingIdentity(callingId);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makePackageIdle
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
|
makePackageIdle
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setFocusedStack(int stackId) {
enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "setFocusedStack()");
if (DEBUG_FOCUS) Slog.d(TAG_FOCUS, "setFocusedStack: stackId=" + stackId);
final long callingId = Binder.clearCallingIdentity();
try {
synchronized (this) {
final ActivityStack stack = mStackSupervisor.getStack(stackId);
if (stack == null) {
Slog.w(TAG, "setFocusedStack: No stack with id=" + stackId);
return;
}
final ActivityRecord r = stack.topRunningActivityLocked();
if (mStackSupervisor.moveFocusableActivityStackToFrontLocked(r, "setFocusedStack")) {
mStackSupervisor.resumeFocusedStackTopActivityLocked();
}
}
} finally {
Binder.restoreCallingIdentity(callingId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setFocusedStack
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
|
setFocusedStack
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("checkstyle:npathcomplexity")
protected BeanDefinition getEvictionConfig(Node node) {
Node size = node.getAttributes().getNamedItem("size");
Node maxSizePolicy = node.getAttributes().getNamedItem("max-size-policy");
Node evictionPolicy = node.getAttributes().getNamedItem("eviction-policy");
Node comparatorClassName = node.getAttributes().getNamedItem("comparator-class-name");
Node comparatorBean = node.getAttributes().getNamedItem("comparator-bean");
if (comparatorClassName != null && comparatorBean != null) {
throw new InvalidConfigurationException("Only one of the `comparator-class-name` and `comparator-bean`"
+ " attributes can be configured inside eviction configuration!");
}
BeanDefinitionBuilder evictionConfigBuilder = createBeanBuilder(EvictionConfig.class);
Integer sizeValue = EvictionConfig.DEFAULT_MAX_ENTRY_COUNT;
EvictionConfig.MaxSizePolicy maxSizePolicyValue = EvictionConfig.DEFAULT_MAX_SIZE_POLICY;
EvictionPolicy evictionPolicyValue = EvictionConfig.DEFAULT_EVICTION_POLICY;
String comparatorClassNameValue = null;
String comparatorBeanValue = null;
if (size != null) {
sizeValue = parseInt(getTextContent(size));
}
if (maxSizePolicy != null) {
maxSizePolicyValue = EvictionConfig.MaxSizePolicy.valueOf(
upperCaseInternal(getTextContent(maxSizePolicy)));
}
if (evictionPolicy != null) {
evictionPolicyValue = EvictionPolicy.valueOf(
upperCaseInternal(getTextContent(evictionPolicy)));
}
if (comparatorClassName != null) {
comparatorClassNameValue = getTextContent(comparatorClassName);
}
if (comparatorBean != null) {
comparatorBeanValue = getTextContent(comparatorBean);
}
try {
checkEvictionConfig(evictionPolicyValue, comparatorClassNameValue, comparatorBean, false);
} catch (IllegalArgumentException e) {
throw new InvalidConfigurationException(e.getMessage());
}
evictionConfigBuilder.addPropertyValue("size", sizeValue);
evictionConfigBuilder.addPropertyValue("maximumSizePolicy", maxSizePolicyValue);
evictionConfigBuilder.addPropertyValue("evictionPolicy", evictionPolicyValue);
if (comparatorClassNameValue != null) {
evictionConfigBuilder.addPropertyValue("comparatorClassName", comparatorClassNameValue);
}
if (comparatorBean != null) {
evictionConfigBuilder.addPropertyReference("comparator", comparatorBeanValue);
}
return evictionConfigBuilder.getBeanDefinition();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEvictionConfig
File: hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
getEvictionConfig
|
hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected PackageParser.ProviderIntentInfo[] newArray(int size) {
return new PackageParser.ProviderIntentInfo[size];
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newArray
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
|
newArray
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public Number optNumber(String key) {
return this.optNumber(key, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: optNumber
File: src/main/java/org/json/JSONObject.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-5072
|
HIGH
| 7.5
|
stleary/JSON-java
|
optNumber
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void close(final AjaxRequestTarget target)
{
target.appendJavaScript("$('#" + getMainContainerMarkupId() + "').modal('hide');");
}
|
Vulnerability Classification:
- CWE: CWE-352
- CVE: CVE-2013-7251
- Severity: MEDIUM
- CVSS Score: 6.8
Description: CSRF protection.
Function: close
File: src/main/java/org/projectforge/web/dialog/ModalDialog.java
Repository: micromata/projectforge-webapp
Fixed Code:
public void close(final AjaxRequestTarget target)
{
csrfTokenHandler.onSubmit();
target.appendJavaScript("$('#" + getMainContainerMarkupId() + "').modal('hide');");
}
|
[
"CWE-352"
] |
CVE-2013-7251
|
MEDIUM
| 6.8
|
micromata/projectforge-webapp
|
close
|
src/main/java/org/projectforge/web/dialog/ModalDialog.java
|
422de35e3c3141e418a73bfb39b430d5fd74077e
| 1
|
Analyze the following code function for security vulnerabilities
|
private String getBareJID(String from) {
String[] res = from.split("/", 2);
return res[0].toLowerCase();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBareJID
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
|
getBareJID
|
src/org/yaxim/androidclient/service/SmackableImp.java
|
65a38dc77545d9568732189e86089390f0ceaf9f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getUidProcessState(int uid, String callingPackage) {
if (!hasUsageStatsPermission(callingPackage)) {
enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS,
"getUidProcessState");
}
// In case the caller is requesting processState of an app in a different user,
// then verify the caller has INTERACT_ACROSS_USERS_FULL permission
mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
UserHandle.getUserId(uid), false /* allowAll */, ALLOW_FULL_ONLY,
"getUidProcessState", callingPackage); // Ignore return value
synchronized (mProcLock) {
if (mPendingStartActivityUids.isPendingTopUid(uid)) {
return PROCESS_STATE_TOP;
}
return mProcessList.getUidProcStateLOSP(uid);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUidProcessState
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
getUidProcessState
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
protected JavaType _typeFromId(String id, DatabindContext ctxt) throws IOException
{
// 24-Apr-2019, tatu: [databind#2195] validate as well as resolve:
JavaType t = ctxt.resolveAndValidateSubType(_baseType, id, _subTypeValidator);
if (t == null) {
if (ctxt instanceof DeserializationContext) {
// First: we may have problem handlers that can deal with it?
return ((DeserializationContext) ctxt).handleUnknownTypeId(_baseType, id, this, "no such class found");
}
// ... meaning that we really should never get here.
}
return t;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _typeFromId
File: src/main/java/com/fasterxml/jackson/databind/jsontype/impl/ClassNameIdResolver.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
_typeFromId
|
src/main/java/com/fasterxml/jackson/databind/jsontype/impl/ClassNameIdResolver.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) {
enforceNotIsolatedCaller("moveActivityTaskToBack");
synchronized(this) {
final long origId = Binder.clearCallingIdentity();
try {
int taskId = ActivityRecord.getTaskForActivityLocked(token, !nonRoot);
final TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId);
if (task != null) {
if (mStackSupervisor.isLockedTask(task)) {
mStackSupervisor.showLockTaskToast();
return false;
}
return ActivityRecord.getStackLocked(token).moveTaskToBackLocked(taskId);
}
} finally {
Binder.restoreCallingIdentity(origId);
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: moveActivityTaskToBack
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
moveActivityTaskToBack
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void execute(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws Exception
{
XWikiContext context = null;
try {
// Initialize the XWiki Context which is the main object used to pass information across
// classes/methods. It's also wrapping the request, response, and all container objects
// in general.
context = initializeXWikiContext(servletRequest, servletResponse);
// From this line forward all information can be found in the XWiki Context.
execute(context);
} finally {
if (context != null) {
cleanupComponents();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: execute
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2022-23617
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
execute
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
|
b35ef0edd4f2ff2c974cbeef6b80fcf9b5a44554
| 0
|
Analyze the following code function for security vulnerabilities
|
@POST
@Produces(MediaType.TEXT_XML)
@Path("addCatalog")
@RestQuery(name = "addCatalogURL", description = "Add a metadata catalog to a given media package using an URL", restParameters = {
@RestParameter(description = "The location of the catalog", isRequired = true, name = "url", type = RestParameter.Type.STRING),
@RestParameter(description = "The kind of catalog", isRequired = true, name = "flavor", type = RestParameter.Type.STRING),
@RestParameter(description = "The media package as XML", isRequired = true, name = "mediaPackage", type = RestParameter.Type.TEXT) }, reponses = {
@RestResponse(description = "Returns augmented media package", responseCode = HttpServletResponse.SC_OK),
@RestResponse(description = "Media package not valid", responseCode = HttpServletResponse.SC_BAD_REQUEST),
@RestResponse(description = "", responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR) }, returnDescription = "")
public Response addMediaPackageCatalog(@FormParam("url") String url, @FormParam("flavor") String flavor,
@FormParam("mediaPackage") String mpx) {
logger.trace("add catalog with url: {} flavor: {} mediaPackage: {}", url, flavor, mpx);
try {
MediaPackage mp = factory.newMediaPackageBuilder().loadFromXml(mpx);
if (MediaPackageSupport.sanityCheck(mp).isSome())
return Response.serverError().status(Status.BAD_REQUEST).build();
MediaPackage resultingMediaPackage = ingestService.addCatalog(new URI(url),
MediaPackageElementFlavor.parseFlavor(flavor), mp);
return Response.ok(resultingMediaPackage).build();
} catch (Exception e) {
logger.warn(e.getMessage(), e);
return Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addMediaPackageCatalog
File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2020-5230
|
MEDIUM
| 5
|
opencast
|
addMediaPackageCatalog
|
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java
|
bbb473f34ab95497d6c432c81285efb0c739f317
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isFastMode() {
return fastmode;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isFastMode
File: worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java
Repository: IntellectualSites/FastAsyncWorldEdit
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-35925
|
MEDIUM
| 5.5
|
IntellectualSites/FastAsyncWorldEdit
|
isFastMode
|
worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java
|
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
| 0
|
Analyze the following code function for security vulnerabilities
|
public CopyBuildTask inFile(Getter<File> in) {
inputType = FILE;
inputFile = in;
orGetterChangeNoticer(in);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: inFile
File: APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java
Repository: Calsign/APDE
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-36628
|
CRITICAL
| 9.8
|
Calsign/APDE
|
inFile
|
APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java
|
c6d64cbe465348c1bfd211122d89e3117afadecf
| 0
|
Analyze the following code function for security vulnerabilities
|
public ResourceRetriever getResourceRetriever() {
return resourceRetriever;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getResourceRetriever
File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
Repository: pac4j
The code follows secure coding practices.
|
[
"CWE-347"
] |
CVE-2021-44878
|
MEDIUM
| 5
|
pac4j
|
getResourceRetriever
|
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
|
22b82ffd702a132d9f09da60362fc6264fc281ae
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public List<BaseObject> updateObjectsFromRequest(String className, String pref, XWikiContext context)
throws XWikiException
{
return updateXObjectsFromRequest(
getXClassEntityReferenceResolver().resolve(className, EntityType.DOCUMENT, getDocumentReference()), pref,
context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateObjectsFromRequest
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
|
updateObjectsFromRequest
|
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 setProcessForeground(IBinder token, int pid, boolean isForeground) {
enforceCallingPermission(android.Manifest.permission.SET_PROCESS_LIMIT,
"setProcessForeground()");
synchronized(this) {
boolean changed = false;
synchronized (mPidsSelfLocked) {
ProcessRecord pr = mPidsSelfLocked.get(pid);
if (pr == null && isForeground) {
Slog.w(TAG, "setProcessForeground called on unknown pid: " + pid);
return;
}
ForegroundToken oldToken = mForegroundProcesses.get(pid);
if (oldToken != null) {
oldToken.token.unlinkToDeath(oldToken, 0);
mForegroundProcesses.remove(pid);
if (pr != null) {
pr.forcingToForeground = null;
}
changed = true;
}
if (isForeground && token != null) {
ForegroundToken newToken = new ForegroundToken() {
@Override
public void binderDied() {
foregroundTokenDied(this);
}
};
newToken.pid = pid;
newToken.token = token;
try {
token.linkToDeath(newToken, 0);
mForegroundProcesses.put(pid, newToken);
pr.forcingToForeground = token;
changed = true;
} catch (RemoteException e) {
// If the process died while doing this, we will later
// do the cleanup with the process death link.
}
}
}
if (changed) {
updateOomAdjLocked();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setProcessForeground
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
setProcessForeground
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String[] getAlias() {
return new String[0];
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAlias
File: src/main/java/de/presti/ree6/commands/impl/mod/Import.java
Repository: Ree6-Applications/Ree6
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-39302
|
MEDIUM
| 5.4
|
Ree6-Applications/Ree6
|
getAlias
|
src/main/java/de/presti/ree6/commands/impl/mod/Import.java
|
459b5bc24f0ea27e50031f563373926e94b9aa0a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void writeBoolean(XmlSerializer xml, Bundle restrictions, String restrictionKey)
throws IOException {
if (restrictions.containsKey(restrictionKey)) {
xml.attribute(null, restrictionKey,
Boolean.toString(restrictions.getBoolean(restrictionKey)));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeBoolean
File: services/core/java/com/android/server/pm/UserManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2457
|
LOW
| 2.1
|
android
|
writeBoolean
|
services/core/java/com/android/server/pm/UserManagerService.java
|
12332e05f632794e18ea8c4ac52c98e82532e5db
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean browserHasNewestVersion(HttpServletRequest request,
long resourceLastModifiedTimestamp) {
assert resourceLastModifiedTimestamp >= -1L;
if (resourceLastModifiedTimestamp == -1L) {
// We do not know when it was modified so the browser cannot have an
// up-to-date version
return false;
}
/*
* The browser can request the resource conditionally using an
* If-Modified-Since header. Check this against the last modification
* time.
*/
try {
// If-Modified-Since represents the timestamp of the version cached
// in the browser
long headerIfModifiedSince = request
.getDateHeader("If-Modified-Since");
if (headerIfModifiedSince >= resourceLastModifiedTimestamp) {
// Browser has this an up-to-date version of the resource
return true;
}
} catch (Exception e) {
// Failed to parse header.
getLogger().trace("Unable to parse If-Modified-Since", e);
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: browserHasNewestVersion
File: flow-server/src/main/java/com/vaadin/flow/server/StaticFileServer.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-36321
|
MEDIUM
| 5
|
vaadin/flow
|
browserHasNewestVersion
|
flow-server/src/main/java/com/vaadin/flow/server/StaticFileServer.java
|
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public void setxWikiClassXML(String xClassXML)
{
setXClassXML(xClassXML);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setxWikiClassXML
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
|
setxWikiClassXML
|
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
|
static void writeTagExtra(TypedXmlSerializer out, String tag, PersistableBundle bundle)
throws IOException, XmlPullParserException {
if (bundle == null) return;
out.startTag(null, tag);
bundle.saveToXml(out);
out.endTag(null, tag);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeTagExtra
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
|
writeTagExtra
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getFileName(String file) {
log.debug("getFileName({})", file);
int idx = file.lastIndexOf(".");
String ret = idx >= 0 ? file.substring(0, idx) : file;
log.debug("getFileName: {}", ret);
return ret;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFileName
File: src/main/java/com/openkm/util/FileUtils.java
Repository: openkm/document-management-system
The code follows secure coding practices.
|
[
"CWE-377"
] |
CVE-2022-3969
|
MEDIUM
| 5.5
|
openkm/document-management-system
|
getFileName
|
src/main/java/com/openkm/util/FileUtils.java
|
c069e4d73ab8864345c25119d8459495f45453e1
| 0
|
Analyze the following code function for security vulnerabilities
|
private native void nativeSetDrawsContent(long nativeContentViewCoreImpl, boolean draws);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeSetDrawsContent
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-1021"
] |
CVE-2015-1241
|
MEDIUM
| 4.3
|
chromium
|
nativeSetDrawsContent
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
List<String> getSeeds() {
ArrayList<String> terms = new ArrayList<String>();
boolean trailingQuote = source.endsWith("\"");
boolean leadingQuote = source.startsWith("\"");
boolean trailingSpace = source.endsWith(" ");
if (trailingQuote || (trailingSpace && !leadingQuote)) {
terms.add("");
} else {
if (leadingQuote) {
int quote = source.lastIndexOf('"');
if (quote == 0) {
terms.add(source.substring(1));
} else {
terms.add("");
}
} else {
int space = source.lastIndexOf(' ');
if (space > -1) {
terms.add(source.substring(space+1));
} else {
terms.add(source);
}
}
}
return terms;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSeeds
File: core/src/main/java/hudson/model/AbstractProject.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
getSeeds
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration,
int[] verticalSizeConfigurations, int[] smallestSizeConfigurations) {
if (DEBUG_CONFIGURATION) Slog.v(TAG, "Report configuration: " + token + " "
+ horizontalSizeConfiguration + " " + verticalSizeConfigurations);
synchronized (this) {
ActivityRecord record = ActivityRecord.isInStackLocked(token);
if (record == null) {
throw new IllegalArgumentException("reportSizeConfigurations: ActivityRecord not "
+ "found for: " + token);
}
record.setSizeConfigurations(horizontalSizeConfiguration,
verticalSizeConfigurations, smallestSizeConfigurations);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reportSizeConfigurations
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
|
reportSizeConfigurations
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean canSetPasswordQualityOnParent(String packageName, final CallerIdentity caller) {
return !mInjector.isChangeEnabled(
PREVENT_SETTING_PASSWORD_QUALITY_ON_PARENT, packageName, caller.getUserId())
|| isProfileOwnerOfOrganizationOwnedDevice(caller);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canSetPasswordQualityOnParent
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
|
canSetPasswordQualityOnParent
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getUrlBeforeEdit() {
return state.urlBeforeEdit;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUrlBeforeEdit
File: server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-434"
] |
CVE-2021-21245
|
HIGH
| 7.5
|
theonedev/onedev
|
getUrlBeforeEdit
|
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
|
0c060153fb97c0288a1917efdb17cc426934dacb
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String find() {
return BASE + UUID;
}
|
Vulnerability Classification:
- CWE: CWE-697
- CVE: CVE-2022-39308
- Severity: MEDIUM
- CVSS Score: 5.9
Description: Access Token APIs (#5797)
* Define a AuthTokenSqlMapDao to store and retrieve token information from DB
* Introduce Auth Token API to manage auth tokens
* Store the hashed token instead of storing the raw value
* Some tests
* Store information of the user who has created the auth token
* Use SHA-256 instead of MD5 for hashing token value
* Change username data type from VARCHAR to VARCHAR_IGNORECASE
* Introduce AuthTokenMother to create authToken in tests
* Fix auth token controller specs
* Remove unused class variable from test
* Introduce auth token index endpoint to fetch all the tokens belonging to me
* Add extra attributes to auth token
* Salt Id
* Salt Value
* Auth Config Id
* Revoked At
* Add support for revoking access tokens
Add a method to validate and fetch access token object provided access token
* Rename controller package and module
* rename service and dao
* Rename auth token package
* Rename rules under url rewrite
* Renamed few more occurences of auth token to acccess tokens
Function: find
File: spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java
Repository: gocd
Fixed Code:
public static String find() {
return BASE + TOKEN_NAME;
}
|
[
"CWE-697"
] |
CVE-2022-39308
|
MEDIUM
| 5.9
|
gocd
|
find
|
spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java
|
236d4baf92e6607f2841c151c855adcc477238b8
| 1
|
Analyze the following code function for security vulnerabilities
|
public long lastModified() {
return internal.lastModified();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: lastModified
File: src/net/sourceforge/plantuml/security/SFile.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
lastModified
|
src/net/sourceforge/plantuml/security/SFile.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onUserStopped(@NonNull TargetUser user) {
mService.mBatteryStatsService.onCleanupUser(user.getUserIdentifier());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUserStopped
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
onUserStopped
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getUserPreference(String prefname, boolean useCookie, XWikiContext context)
{
// First we look in the cookies
if (useCookie) {
String result = Util.normalizeLanguage(getUserPreferenceFromCookie(prefname, context));
if (result != null) {
return result;
}
}
return getUserPreference(prefname, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserPreference
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
getUserPreference
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setEditorEnabled(boolean isEnabled)
throws IllegalStateException {
if (isEditorActive()) {
throw new IllegalStateException(
"Cannot disable the editor while an item ("
+ getEditedItemId() + ") is being edited");
}
if (isEditorEnabled() != isEnabled) {
getState().editorEnabled = isEnabled;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setEditorEnabled
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
setEditorEnabled
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
@UnsupportedAppUsage
public @NonNull ApkAssets[] getApkAssets() {
synchronized (this) {
if (mOpen) {
return mApkAssets;
}
}
return sEmptyApkAssets;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getApkAssets
File: core/java/android/content/res/AssetManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
getApkAssets
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
void removeUserDirectory() {
this.userDirectory = null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeUserDirectory
File: modules/kernel/src/main/java/org/opencastproject/kernel/security/SecurityServiceSpringImpl.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2020-5206
|
MEDIUM
| 6.4
|
opencast
|
removeUserDirectory
|
modules/kernel/src/main/java/org/opencastproject/kernel/security/SecurityServiceSpringImpl.java
|
b157e1fb3b35991ca7bf59f0730329fbe7ce82e8
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean canPlayMoveAnimation() {
// During the transition from pip to fullscreen, the activity windowing mode is set to
// fullscreen at the beginning while the task is kept in pinned mode. Skip the move
// animation in such case since the transition is handled in SysUI.
final boolean hasMovementAnimation = getTask() == null
? getWindowConfiguration().hasMovementAnimations()
: getTask().getWindowConfiguration().hasMovementAnimations();
return mToken.okToAnimate()
&& (mAttrs.privateFlags & PRIVATE_FLAG_NO_MOVE_ANIMATION) == 0
&& !isDragResizing()
&& hasMovementAnimation
&& !mWinAnimator.mLastHidden
&& !mSeamlesslyRotated;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canPlayMoveAnimation
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
|
canPlayMoveAnimation
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
private Map<String, String> getRoleNameMap(Set<String> roleIds) throws org.graylog2.database.NotFoundException {
final Map<String, Role> roleMap = roleService.findIdMap(roleIds);
final Map<String, String> result = new HashMap<>(roleMap.size());
roleMap.forEach((key, value) -> result.put(key, value.getName()));
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRoleNameMap
File: graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-613"
] |
CVE-2023-41041
|
LOW
| 3.1
|
Graylog2/graylog2-server
|
getRoleNameMap
|
graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java
|
bb88f3d0b2b0351669ab32c60b595ab7242a3fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
private void calculateHistoryCount() {
myMemoryCacheService.get(MemoryCacheService.CacheEnum.HISTORY_COUNT, key, supplier);
new TransactionTemplate(myTxManager).executeWithoutResult(t->{
HistoryBuilder historyBuilder = myHistoryBuilderFactory.newHistoryBuilder(mySearchEntity.getResourceType(), mySearchEntity.getResourceId(), mySearchEntity.getLastUpdatedLow(), mySearchEntity.getLastUpdatedHigh());
Long count = historyBuilder.fetchCount(getRequestPartitionId());
mySearchEntity.setTotalCount(count.intValue());
});
}
|
Vulnerability Classification:
- CWE: CWE-400
- CVE: CVE-2021-32053
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Work on history caching
Function: calculateHistoryCount
File: hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
Repository: hapifhir/hapi-fhir
Fixed Code:
private void calculateHistoryCount() {
MemoryCacheService.HistoryCountKey key;
if (mySearchEntity.getResourceId() != null) {
key = MemoryCacheService.HistoryCountKey.forInstance(mySearchEntity.getResourceId());
} else if (mySearchEntity.getResourceType() != null) {
key = MemoryCacheService.HistoryCountKey.forType(mySearchEntity.getResourceType());
} else {
key = MemoryCacheService.HistoryCountKey.forSystem();
}
Function<MemoryCacheService.HistoryCountKey, Integer> supplier = k -> new TransactionTemplate(myTxManager).execute(t -> {
HistoryBuilder historyBuilder = myHistoryBuilderFactory.newHistoryBuilder(mySearchEntity.getResourceType(), mySearchEntity.getResourceId(), mySearchEntity.getLastUpdatedLow(), mySearchEntity.getLastUpdatedHigh());
Long count = historyBuilder.fetchCount(getRequestPartitionId());
return count.intValue();
});
switch (myDaoConfig.getHistoryCountMode()) {
case COUNT_ACCURATE: {
int count = supplier.apply(key);
mySearchEntity.setTotalCount(count);
break;
}
case COUNT_CACHED: {
int count = myMemoryCacheService.get(MemoryCacheService.CacheEnum.HISTORY_COUNT, key, supplier);
mySearchEntity.setTotalCount(count);
break;
}
case COUNT_DISABLED: {
break;
}
}
}
|
[
"CWE-400"
] |
CVE-2021-32053
|
MEDIUM
| 5
|
hapifhir/hapi-fhir
|
calculateHistoryCount
|
hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
|
f2934b229c491235ab0e7782dea86b324521082a
| 1
|
Analyze the following code function for security vulnerabilities
|
private List<UserManager.EnforcingUser> getDevicePolicySources(
List<UserManager.EnforcingUser> sources) {
int sizeBefore = sources.size();
List<UserManager.EnforcingUser> realSources = new ArrayList<>(sizeBefore);
for (int i = 0; i < sizeBefore; i++) {
UserManager.EnforcingUser source = sources.get(i);
int type = source.getUserRestrictionSource();
if (type != UserManager.RESTRICTION_SOURCE_PROFILE_OWNER
&& type != UserManager.RESTRICTION_SOURCE_DEVICE_OWNER) {
// TODO(b/128928355): add unit test
Slogf.d(LOG_TAG, "excluding source of type %s at index %d",
userRestrictionSourceToString(type), i);
continue;
}
realSources.add(source);
}
return realSources;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDevicePolicySources
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
|
getDevicePolicySources
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public HTMLCleanerConfiguration getDefaultConfiguration()
{
HTMLCleanerConfiguration configuration = new DefaultHTMLCleanerConfiguration();
configuration.setFilters(Arrays.asList(
this.controlFilter,
this.bodyFilter,
this.listItemFilter,
this.listFilter,
this.fontFilter,
this.attributeFilter,
this.linkFilter));
return configuration;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-29201
- Severity: CRITICAL
- CVSS Score: 9.0
Description: XCOMMONS-1680: Filter Html attributes in restricted mode based on a whitelist
* Add a SanitizerFilter that checks namespaces and filters elements
based on the HTMLElementSanitizer
Function: getDefaultConfiguration
File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/DefaultHTMLCleaner.java
Repository: xwiki/xwiki-commons
Fixed Code:
@Override
public HTMLCleanerConfiguration getDefaultConfiguration()
{
HTMLCleanerConfiguration configuration = new DefaultHTMLCleanerConfiguration();
configuration.setFilters(Arrays.asList(
this.controlFilter,
this.bodyFilter,
this.listItemFilter,
this.listFilter,
this.fontFilter,
this.attributeFilter,
this.linkFilter,
this.sanitizerFilter));
return configuration;
}
|
[
"CWE-79"
] |
CVE-2023-29201
|
CRITICAL
| 9
|
xwiki/xwiki-commons
|
getDefaultConfiguration
|
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/DefaultHTMLCleaner.java
|
b11eae9d82cb53f32962056b5faa73f3720c6182
| 1
|
Analyze the following code function for security vulnerabilities
|
public float getScale() {
return mRenderCoordinates.getPageScaleFactor();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getScale
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
getScale
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isWhiteSpace() {
return current==' ' || current=='\t' || current=='\n' || current=='\r';
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isWhiteSpace
File: src/main/org/hjson/JsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34620
|
HIGH
| 7.5
|
hjson/hjson-java
|
isWhiteSpace
|
src/main/org/hjson/JsonParser.java
|
91bef056d56bf968451887421c89a44af1d692ff
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN)
public long getPasswordExpiration(@Nullable ComponentName admin) {
if (mService != null) {
try {
return mService.getPasswordExpiration(admin, myUserId(), mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPasswordExpiration
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
|
getPasswordExpiration
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void readPendingOperationsLocked() {
FileInputStream fis = null;
if (!mPendingFile.getBaseFile().exists()) {
if (Log.isLoggable(TAG_FILE, Log.VERBOSE)) {
Log.v(TAG_FILE, "No pending operation file.");
}
return;
}
try {
fis = mPendingFile.openRead();
if (Log.isLoggable(TAG_FILE, Log.VERBOSE)) {
Log.v(TAG_FILE, "Reading " + mPendingFile.getBaseFile());
}
XmlPullParser parser;
parser = Xml.newPullParser();
parser.setInput(fis, null);
int eventType = parser.getEventType();
while (eventType != XmlPullParser.START_TAG &&
eventType != XmlPullParser.END_DOCUMENT) {
eventType = parser.next();
}
if (eventType == XmlPullParser.END_DOCUMENT) return; // Nothing to read.
do {
PendingOperation pop = null;
if (eventType == XmlPullParser.START_TAG) {
try {
String tagName = parser.getName();
if (parser.getDepth() == 1 && "op".equals(tagName)) {
// Verify version.
String versionString =
parser.getAttributeValue(null, XML_ATTR_VERSION);
if (versionString == null ||
Integer.parseInt(versionString) != PENDING_OPERATION_VERSION) {
Log.w(TAG, "Unknown pending operation version " + versionString);
throw new java.io.IOException("Unknown version.");
}
int authorityId = Integer.valueOf(parser.getAttributeValue(
null, XML_ATTR_AUTHORITYID));
boolean expedited = Boolean.valueOf(parser.getAttributeValue(
null, XML_ATTR_EXPEDITED));
int syncSource = Integer.valueOf(parser.getAttributeValue(
null, XML_ATTR_SOURCE));
int reason = Integer.valueOf(parser.getAttributeValue(
null, XML_ATTR_REASON));
AuthorityInfo authority = mAuthorities.get(authorityId);
if (Log.isLoggable(TAG_FILE, Log.VERBOSE)) {
Log.v(TAG_FILE, authorityId + " " + expedited + " " + syncSource + " "
+ reason);
}
if (authority != null) {
pop = new PendingOperation(
authority, reason, syncSource, new Bundle(), expedited);
pop.flatExtras = null; // No longer used.
mPendingOperations.add(pop);
if (Log.isLoggable(TAG_FILE, Log.VERBOSE)) {
Log.v(TAG_FILE, "Adding pending op: "
+ pop.target
+ " src=" + pop.syncSource
+ " reason=" + pop.reason
+ " expedited=" + pop.expedited);
}
} else {
// Skip non-existent authority.
pop = null;
if (Log.isLoggable(TAG_FILE, Log.VERBOSE)) {
Log.v(TAG_FILE, "No authority found for " + authorityId
+ ", skipping");
}
}
} else if (parser.getDepth() == 2 &&
pop != null &&
"extra".equals(tagName)) {
parseExtra(parser, pop.extras);
}
} catch (NumberFormatException e) {
Log.d(TAG, "Invalid data in xml file.", e);
}
}
eventType = parser.next();
} while(eventType != XmlPullParser.END_DOCUMENT);
} catch (java.io.IOException e) {
Log.w(TAG_FILE, "Error reading pending data.", e);
} catch (XmlPullParserException e) {
if (Log.isLoggable(TAG_FILE, Log.VERBOSE)) {
Log.w(TAG_FILE, "Error parsing pending ops xml.", e);
}
} finally {
if (fis != null) {
try {
fis.close();
} catch (java.io.IOException e1) {}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readPendingOperationsLocked
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
readPendingOperationsLocked
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
private void activate(HttpConversationContext conversationContext, final HttpServletRequest request) {
if (lazy && conversationContext instanceof LazyHttpConversationContextImpl) {
LazyHttpConversationContextImpl lazyConversationContext = (LazyHttpConversationContextImpl) conversationContext;
// Activation API should be improved so that it's possible to pass a callback for later execution
lazyConversationContext.activate(lazyInitializationCallback);
} else {
String cid = determineConversationId(request, conversationContext.getParameterName());
conversationContext.activate(cid);
if (cid == null) { // transient conversation
conversationInitializedEvent.fire(request);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: activate
File: impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java
Repository: weld/core
The code follows secure coding practices.
|
[
"CWE-362"
] |
CVE-2014-8122
|
MEDIUM
| 4.3
|
weld/core
|
activate
|
impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java
|
8e413202fa1af08c09c580f444e4fd16874f9c65
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getVersion() {
for (NodeTuple tuple: getValue()) {
ScalarNode keyNode = (ScalarNode) tuple.getKeyNode();
if (keyNode.getValue().equals("version"))
return ((ScalarNode)tuple.getValueNode()).getValue();
}
throw new GeneralException("Unable to find version");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getVersion
File: server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-21249
|
MEDIUM
| 6.5
|
theonedev/onedev
|
getVersion
|
server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java
|
d6fc4212b1ac1e9bbe3ce444e95f9af1e3ab8b66
| 0
|
Analyze the following code function for security vulnerabilities
|
@Editable(order=800, description=""
+ "Specifies name of the attribute inside the user LDAP entry whose value will be taken as user "
+ "email. This field is normally set to <i>mail</i> according to RFC 2798")
@NotEmpty
public String getUserEmailAttribute() {
return userEmailAttribute;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserEmailAttribute
File: server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-90"
] |
CVE-2021-32651
|
MEDIUM
| 4.3
|
theonedev/onedev
|
getUserEmailAttribute
|
server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java
|
4440f0c57e440488d7e653417b2547eaae8ad19c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void runTool(String... args) throws SQLException {
boolean tcpStart = false, pgStart = false, webStart = false;
boolean browserStart = false;
boolean tcpShutdown = false, tcpShutdownForce = false;
String tcpPassword = "";
String tcpShutdownServer = "";
boolean startDefaultServers = true;
for (int i = 0; args != null && i < args.length; i++) {
String arg = args[i];
if (arg == null) {
} else if ("-?".equals(arg) || "-help".equals(arg)) {
showUsage();
return;
} else if (arg.startsWith("-web")) {
if ("-web".equals(arg)) {
startDefaultServers = false;
webStart = true;
} else if ("-webAllowOthers".equals(arg)) {
// no parameters
} else if ("-webExternalNames".equals(arg)) {
i++;
} else if ("-webDaemon".equals(arg)) {
// no parameters
} else if ("-webSSL".equals(arg)) {
// no parameters
} else if ("-webPort".equals(arg)) {
i++;
} else if ("-webAdminPassword".equals(arg)) {
i++;
} else {
showUsageAndThrowUnsupportedOption(arg);
}
} else if ("-browser".equals(arg)) {
startDefaultServers = false;
browserStart = true;
} else if (arg.startsWith("-tcp")) {
if ("-tcp".equals(arg)) {
startDefaultServers = false;
tcpStart = true;
} else if ("-tcpAllowOthers".equals(arg)) {
// no parameters
} else if ("-tcpDaemon".equals(arg)) {
// no parameters
} else if ("-tcpSSL".equals(arg)) {
// no parameters
} else if ("-tcpPort".equals(arg)) {
i++;
} else if ("-tcpPassword".equals(arg)) {
tcpPassword = args[++i];
} else if ("-tcpShutdown".equals(arg)) {
startDefaultServers = false;
tcpShutdown = true;
tcpShutdownServer = args[++i];
} else if ("-tcpShutdownForce".equals(arg)) {
tcpShutdownForce = true;
} else {
showUsageAndThrowUnsupportedOption(arg);
}
} else if (arg.startsWith("-pg")) {
if ("-pg".equals(arg)) {
startDefaultServers = false;
pgStart = true;
} else if ("-pgAllowOthers".equals(arg)) {
// no parameters
} else if ("-pgDaemon".equals(arg)) {
// no parameters
} else if ("-pgPort".equals(arg)) {
i++;
} else {
showUsageAndThrowUnsupportedOption(arg);
}
} else if ("-properties".equals(arg)) {
i++;
} else if ("-trace".equals(arg)) {
// no parameters
} else if ("-ifExists".equals(arg)) {
// no parameters
} else if ("-ifNotExists".equals(arg)) {
// no parameters
} else if ("-baseDir".equals(arg)) {
i++;
} else if ("-key".equals(arg)) {
i += 2;
} else {
showUsageAndThrowUnsupportedOption(arg);
}
}
verifyArgs(args);
if (startDefaultServers) {
tcpStart = true;
pgStart = true;
webStart = true;
browserStart = true;
}
// TODO server: maybe use one single properties file?
if (tcpShutdown) {
out.println("Shutting down TCP Server at " + tcpShutdownServer);
shutdownTcpServer(tcpShutdownServer, tcpPassword,
tcpShutdownForce, false);
}
try {
if (tcpStart) {
tcp = createTcpServer(args);
tcp.start();
out.println(tcp.getStatus());
tcp.setShutdownHandler(this);
}
if (pgStart) {
pg = createPgServer(args);
pg.start();
out.println(pg.getStatus());
}
if (webStart) {
web = createWebServer(args);
web.setShutdownHandler(this);
SQLException result = null;
try {
web.start();
} catch (Exception e) {
result = DbException.toSQLException(e);
}
out.println(web.getStatus());
// start browser in any case (even if the server is already
// running) because some people don't look at the output, but
// are wondering why nothing happens
if (browserStart) {
try {
openBrowser(web.getURL());
} catch (Exception e) {
out.println(e.getMessage());
}
}
if (result != null) {
throw result;
}
} else if (browserStart) {
out.println("The browser can only start if a web server is started (-web)");
}
} catch (SQLException e) {
stopAll();
throw e;
}
}
|
Vulnerability Classification:
- CWE: CWE-312
- CVE: CVE-2022-45868
- Severity: HIGH
- CVSS Score: 7.8
Description: Disallow plain webAdminPassword values to force usage of hashes
Function: runTool
File: h2/src/main/org/h2/tools/Server.java
Repository: h2database
Fixed Code:
@Override
public void runTool(String... args) throws SQLException {
boolean tcpStart = false, pgStart = false, webStart = false;
boolean browserStart = false;
boolean tcpShutdown = false, tcpShutdownForce = false;
String tcpPassword = "";
String tcpShutdownServer = "";
boolean startDefaultServers = true;
for (int i = 0; args != null && i < args.length; i++) {
String arg = args[i];
if (arg == null) {
} else if ("-?".equals(arg) || "-help".equals(arg)) {
showUsage();
return;
} else if (arg.startsWith("-web")) {
if ("-web".equals(arg)) {
startDefaultServers = false;
webStart = true;
} else if ("-webAllowOthers".equals(arg)) {
// no parameters
} else if ("-webExternalNames".equals(arg)) {
i++;
} else if ("-webDaemon".equals(arg)) {
// no parameters
} else if ("-webSSL".equals(arg)) {
// no parameters
} else if ("-webPort".equals(arg)) {
i++;
} else if ("-webAdminPassword".equals(arg)) {
if (fromCommandLine) {
throwUnsupportedOption(arg);
}
i++;
} else {
showUsageAndThrowUnsupportedOption(arg);
}
} else if ("-browser".equals(arg)) {
startDefaultServers = false;
browserStart = true;
} else if (arg.startsWith("-tcp")) {
if ("-tcp".equals(arg)) {
startDefaultServers = false;
tcpStart = true;
} else if ("-tcpAllowOthers".equals(arg)) {
// no parameters
} else if ("-tcpDaemon".equals(arg)) {
// no parameters
} else if ("-tcpSSL".equals(arg)) {
// no parameters
} else if ("-tcpPort".equals(arg)) {
i++;
} else if ("-tcpPassword".equals(arg)) {
tcpPassword = args[++i];
} else if ("-tcpShutdown".equals(arg)) {
startDefaultServers = false;
tcpShutdown = true;
tcpShutdownServer = args[++i];
} else if ("-tcpShutdownForce".equals(arg)) {
tcpShutdownForce = true;
} else {
showUsageAndThrowUnsupportedOption(arg);
}
} else if (arg.startsWith("-pg")) {
if ("-pg".equals(arg)) {
startDefaultServers = false;
pgStart = true;
} else if ("-pgAllowOthers".equals(arg)) {
// no parameters
} else if ("-pgDaemon".equals(arg)) {
// no parameters
} else if ("-pgPort".equals(arg)) {
i++;
} else {
showUsageAndThrowUnsupportedOption(arg);
}
} else if ("-properties".equals(arg)) {
i++;
} else if ("-trace".equals(arg)) {
// no parameters
} else if ("-ifExists".equals(arg)) {
// no parameters
} else if ("-ifNotExists".equals(arg)) {
// no parameters
} else if ("-baseDir".equals(arg)) {
i++;
} else if ("-key".equals(arg)) {
i += 2;
} else {
showUsageAndThrowUnsupportedOption(arg);
}
}
verifyArgs(args);
if (startDefaultServers) {
tcpStart = true;
pgStart = true;
webStart = true;
browserStart = true;
}
// TODO server: maybe use one single properties file?
if (tcpShutdown) {
out.println("Shutting down TCP Server at " + tcpShutdownServer);
shutdownTcpServer(tcpShutdownServer, tcpPassword,
tcpShutdownForce, false);
}
try {
if (tcpStart) {
tcp = createTcpServer(args);
tcp.start();
out.println(tcp.getStatus());
tcp.setShutdownHandler(this);
}
if (pgStart) {
pg = createPgServer(args);
pg.start();
out.println(pg.getStatus());
}
if (webStart) {
web = createWebServer(args);
web.setShutdownHandler(this);
SQLException result = null;
try {
web.start();
} catch (Exception e) {
result = DbException.toSQLException(e);
}
out.println(web.getStatus());
// start browser in any case (even if the server is already
// running) because some people don't look at the output, but
// are wondering why nothing happens
if (browserStart) {
try {
openBrowser(web.getURL());
} catch (Exception e) {
out.println(e.getMessage());
}
}
if (result != null) {
throw result;
}
} else if (browserStart) {
out.println("The browser can only start if a web server is started (-web)");
}
} catch (SQLException e) {
stopAll();
throw e;
}
}
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
runTool
|
h2/src/main/org/h2/tools/Server.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 1
|
Analyze the following code function for security vulnerabilities
|
public void setCertRequestType(String certRequestType) {
this.certRequestType = certRequestType;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCertRequestType
File: base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfo.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setCertRequestType
|
base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfo.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setActivityController(IActivityController controller, boolean imAMonkey) {
if (controller != null) {
Binder.allowBlocking(controller.asBinder());
}
mActivityTaskManager.setActivityController(controller, imAMonkey);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setActivityController
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
setActivityController
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(apiKey);
return this;
}
}
throw new RuntimeException("No API key authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setApiKey
File: samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setApiKey
|
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean hasUsageStatsPermission(String callingPackage) {
final int mode = mAppOpsService.checkOperation(AppOpsManager.OP_GET_USAGE_STATS,
Binder.getCallingUid(), callingPackage);
if (mode == AppOpsManager.MODE_DEFAULT) {
return checkCallingPermission(Manifest.permission.PACKAGE_USAGE_STATS)
== PackageManager.PERMISSION_GRANTED;
}
return mode == AppOpsManager.MODE_ALLOWED;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasUsageStatsPermission
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
hasUsageStatsPermission
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
void reloadHeaderBarLayout(boolean reloadWidget) {
Resources res = mContext.getResources();
mWindowRect = mSystemServicesProxy.getWindowRect();
mStatusBarHeight = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
mNavBarHeight = res.getDimensionPixelSize(com.android.internal.R.dimen.navigation_bar_height);
mNavBarWidth = res.getDimensionPixelSize(com.android.internal.R.dimen.navigation_bar_width);
mConfig = RecentsConfiguration.reinitialize(mContext, mSystemServicesProxy);
mConfig.updateOnConfigurationChange();
if (reloadWidget) {
// Reload the widget id before we get the task stack bounds
reloadSearchBarAppWidget(mContext, mSystemServicesProxy);
}
mConfig.getTaskStackBounds(mWindowRect.width(), mWindowRect.height(), mStatusBarHeight,
(mConfig.hasTransposedNavBar ? mNavBarWidth : 0), mTaskStackBounds);
if (mConfig.isLandscape && mConfig.hasTransposedNavBar) {
mSystemInsets.set(0, mStatusBarHeight, mNavBarWidth, 0);
} else {
mSystemInsets.set(0, mStatusBarHeight, 0, mNavBarHeight);
}
// Inflate the header bar layout so that we can rebind and draw it for the transition
TaskStack stack = new TaskStack();
mDummyStackView = new TaskStackView(mContext, stack);
TaskStackViewLayoutAlgorithm algo = mDummyStackView.getStackAlgorithm();
Rect taskStackBounds = new Rect(mTaskStackBounds);
taskStackBounds.bottom -= mSystemInsets.bottom;
algo.computeRects(mWindowRect.width(), mWindowRect.height(), taskStackBounds);
Rect taskViewSize = algo.getUntransformedTaskViewSize();
int taskBarHeight = res.getDimensionPixelSize(R.dimen.recents_task_bar_height);
mHeaderBar = (TaskViewHeader) mInflater.inflate(R.layout.recents_task_view_header, null,
false);
mHeaderBar.measure(
View.MeasureSpec.makeMeasureSpec(taskViewSize.width(), View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(taskBarHeight, View.MeasureSpec.EXACTLY));
mHeaderBar.layout(0, 0, taskViewSize.width(), taskBarHeight);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reloadHeaderBarLayout
File: packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0813
|
MEDIUM
| 6.6
|
android
|
reloadHeaderBarLayout
|
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
|
16a76dadcc23a13223e9c2216dad1fe5cad7d6e1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void unstableProviderDied(IBinder connection) {
mCpHelper.unstableProviderDied(connection);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unstableProviderDied
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
unstableProviderDied
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onRectangleOnScreenRequested(IBinder token, Rect rectangle) {
synchronized (mWindowMap) {
if (mAccessibilityController != null) {
WindowState window = mWindowMap.get(token);
//TODO (multidisplay): Magnification is supported only for the default display.
if (window != null && window.getDisplayId() == Display.DEFAULT_DISPLAY) {
mAccessibilityController.onRectangleOnScreenRequestedLocked(rectangle);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onRectangleOnScreenRequested
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
onRectangleOnScreenRequested
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
boolean check(ExecutorConfig c1, ExecutorConfig c2) {
if (c1 == c2) {
return true;
}
if (c1 == null || c2 == null) {
return false;
}
int cap1 = c1.getQueueCapacity();
int cap2 = c2.getQueueCapacity();
return nullSafeEqual(c1.getName(), c2.getName())
&& nullSafeEqual(c1.getPoolSize(), c2.getPoolSize())
&& (nullSafeEqual(cap1, cap2) || (Math.min(cap1, cap2) == 0 && Math.max(cap1, cap2) == Integer.MAX_VALUE))
&& nullSafeEqual(c1.getQuorumName(), c2.getQuorumName())
&& nullSafeEqual(c1.isStatisticsEnabled(), c2.isStatisticsEnabled());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: check
File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
check
|
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
private void finishRecipientErrorDialog() {
// after the user dismisses the recipient error
// dialog we want to make sure to refocus the
// recipient to field so they can fix the issue
// easily
if (mTo != null) {
mTo.requestFocus();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishRecipientErrorDialog
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2425
|
MEDIUM
| 4.3
|
android
|
finishRecipientErrorDialog
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void logIncoming(String msg, Object... params) {
// Keep these as debug; the incoming logging is traced on a package level through the
// session logging.
Log.d(this, "CS -> TC[" + Log.getPackageAbbreviation(mComponentName) + "]: "
+ msg, params);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logIncoming
File: src/com/android/server/telecom/ConnectionServiceWrapper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
logIncoming
|
src/com/android/server/telecom/ConnectionServiceWrapper.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getNextPageUrl() throws IndexUnreachableException, DAOException {
return getNextPageUrl(1);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNextPageUrl
File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29014
|
MEDIUM
| 6.1
|
intranda/goobi-viewer-core
|
getNextPageUrl
|
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
|
c29efe60e745a94d03debc17681c4950f3917455
| 0
|
Analyze the following code function for security vulnerabilities
|
public void resetSimPasspointNetwork() {
mProviders.values().stream().forEach(p -> p.setAnonymousIdentity(null));
mWifiConfigManager.saveToStore(true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resetSimPasspointNetwork
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
|
resetSimPasspointNetwork
|
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void removeSpansOfType(SpannableString str, Class<?> cls) {
for (Object span : str.getSpans(0, str.length(), cls)) {
str.removeSpan(span);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeSpansOfType
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2425
|
MEDIUM
| 4.3
|
android
|
removeSpansOfType
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
public Integer getIntegerValue(String key) {
String value = fields.get(key);
if (value == null) { return null; }
try {
return Integer.parseInt(value);
} catch (NumberFormatException e) {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIntegerValue
File: src/main/java/org/olat/restapi/support/MultipartReader.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41242
|
HIGH
| 7.9
|
OpenOLAT
|
getIntegerValue
|
src/main/java/org/olat/restapi/support/MultipartReader.java
|
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
| 0
|
Analyze the following code function for security vulnerabilities
|
public Number getNumber(String key) throws JSONException {
Object object = this.get(key);
try {
if (object instanceof Number) {
return (Number)object;
}
return stringToNumber(object.toString());
} catch (Exception e) {
throw wrongValueFormatException(key, "number", object, e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNumber
File: src/main/java/org/json/JSONObject.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-5072
|
HIGH
| 7.5
|
stleary/JSON-java
|
getNumber
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
public final void setEncoding(final String encoding) {
this.encoding = encoding;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setEncoding
File: cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java
Repository: apereo/java-cas-client
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2014-4172
|
HIGH
| 7.5
|
apereo/java-cas-client
|
setEncoding
|
cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java
|
ae37092100c8eaec610dab6d83e5e05a8ee58814
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequestMapping("save")
@Csrf
public String save(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, String path, String content,
HttpServletRequest request, ModelMap model) {
if (CommonUtils.notEmpty(path)) {
try {
String filepath = siteComponent.getWebFilePath(site.getId(), path);
content = new String(VerificationUtils.base64Decode(content), Constants.DEFAULT_CHARSET);
if (CmsFileUtils.createFile(filepath, content)) {
logOperateService.save(
new LogOperate(site.getId(), admin.getId(), admin.getDeptId(), LogLoginService.CHANNEL_WEB_MANAGER,
"save.web.webfile", RequestUtils.getIpAddress(request), CommonUtils.getDate(), path));
} else {
String historyFilePath = siteComponent.getWebHistoryFilePath(site.getId(), path, true);
CmsFileUtils.updateFile(filepath, historyFilePath, content);
logOperateService.save(
new LogOperate(site.getId(), admin.getId(), admin.getDeptId(), LogLoginService.CHANNEL_WEB_MANAGER,
"update.web.webfile", RequestUtils.getIpAddress(request), CommonUtils.getDate(), path));
}
} catch (IOException e) {
model.addAttribute(CommonConstants.ERROR, e.getMessage());
log.error(e.getMessage(), e);
return CommonConstants.TEMPLATE_ERROR;
}
}
return CommonConstants.TEMPLATE_DONE;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-51252
- Severity: MEDIUM
- CVSS Score: 5.4
Description: https://github.com/sanluan/PublicCMS/issues/79
Function: save
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/cms/CmsWebFileAdminController.java
Repository: sanluan/PublicCMS
Fixed Code:
@RequestMapping("save")
@Csrf
public String save(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, String path, String content,
HttpServletRequest request, ModelMap model) {
if (CommonUtils.notEmpty(path)) {
try {
String suffix = CmsFileUtils.getSuffix(path);
if (ArrayUtils.contains(safeConfigComponent.getSafeSuffix(site), suffix)) {
String filepath = siteComponent.getWebFilePath(site.getId(), path);
content = new String(VerificationUtils.base64Decode(content), Constants.DEFAULT_CHARSET);
if (CmsFileUtils.createFile(filepath, content)) {
logOperateService.save(new LogOperate(site.getId(), admin.getId(), admin.getDeptId(),
LogLoginService.CHANNEL_WEB_MANAGER, "save.web.webfile", RequestUtils.getIpAddress(request),
CommonUtils.getDate(), path));
} else {
String historyFilePath = siteComponent.getWebHistoryFilePath(site.getId(), path, true);
CmsFileUtils.updateFile(filepath, historyFilePath, content);
logOperateService.save(new LogOperate(site.getId(), admin.getId(), admin.getDeptId(),
LogLoginService.CHANNEL_WEB_MANAGER, "update.web.webfile", RequestUtils.getIpAddress(request),
CommonUtils.getDate(), path));
}
} else {
model.addAttribute(CommonConstants.ERROR, LanguagesUtils.getMessage(CommonConstants.applicationContext,
request.getLocale(), "verify.custom.fileType"));
return CommonConstants.TEMPLATE_ERROR;
}
} catch (IOException e) {
model.addAttribute(CommonConstants.ERROR, e.getMessage());
log.error(e.getMessage(), e);
return CommonConstants.TEMPLATE_ERROR;
}
}
return CommonConstants.TEMPLATE_DONE;
}
|
[
"CWE-79"
] |
CVE-2023-51252
|
MEDIUM
| 5.4
|
sanluan/PublicCMS
|
save
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/cms/CmsWebFileAdminController.java
|
2459a3f92c680ae011a369f32306c17df07caaa0
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
protected Column<?, ?> getColumnByInternalId(String internalId) {
return getGrid().getColumnByInternalId(internalId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getColumnByInternalId
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
getColumnByInternalId
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setDeRegisteredTitle(String deRegisteredTitle) {
this.deRegisteredTitle = deRegisteredTitle;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDeRegisteredTitle
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
Repository: codecentric/spring-boot-admin
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2022-46166
|
CRITICAL
| 9.8
|
codecentric/spring-boot-admin
|
setDeRegisteredTitle
|
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
|
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onTextChanged
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
onTextChanged
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getSubscriptionId() {
return mSubscriptionId;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSubscriptionId
File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
getSubscriptionId
|
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final void finishHeavyWeightApp() {
if (checkCallingPermission(android.Manifest.permission.FORCE_STOP_PACKAGES)
!= PackageManager.PERMISSION_GRANTED) {
String msg = "Permission Denial: finishHeavyWeightApp() from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
+ " requires " + android.Manifest.permission.FORCE_STOP_PACKAGES;
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
synchronized(this) {
if (mHeavyWeightProcess == null) {
return;
}
ArrayList<ActivityRecord> activities = new ArrayList<ActivityRecord>(
mHeavyWeightProcess.activities);
for (int i=0; i<activities.size(); i++) {
ActivityRecord r = activities.get(i);
if (!r.finishing) {
r.task.stack.finishActivityLocked(r, Activity.RESULT_CANCELED,
null, "finish-heavy", true);
}
}
mHandler.sendMessage(mHandler.obtainMessage(CANCEL_HEAVY_NOTIFICATION_MSG,
mHeavyWeightProcess.userId, 0));
mHeavyWeightProcess = null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishHeavyWeightApp
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
finishHeavyWeightApp
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void setColorParams() throws Exception {
assertPlotParam("bgcolor", "x000000");
assertPlotParam("bgcolor", "XDEADBE");
assertPlotParam("bgcolor", "%58DEADBE");
assertInvalidPlotParam("bgcolor", "XDEADBEF");
assertInvalidPlotParam("bgcolor", "%5BDEADBE");
assertPlotParam("fgcolor", "x000000");
assertPlotParam("fgcolor", "XDEADBE");
assertPlotParam("fgcolor", "%58DEADBE");
assertInvalidPlotParam("fgcolor", "XDEADBEF");
assertInvalidPlotParam("fgcolor", "%5BDEADBE");
}
|
Vulnerability Classification:
- CWE: CWE-78
- CVE: CVE-2023-25826
- Severity: CRITICAL
- CVSS Score: 9.8
Description: Improved fix for #2261.
Regular expressions wouldn't catch the newlines or possibly other
control characters. Now we'll use the TAG validation code to make
sure the inputs are only plain ASCII printables first.
Fixes CVE-2018-12972, CVE-2020-35476
Function: setColorParams
File: test/tsd/TestGraphHandler.java
Repository: OpenTSDB/opentsdb
Fixed Code:
@Test
public void setColorParams() throws Exception {
assertPlotParam("bgcolor", "x000000");
assertPlotParam("bgcolor", "XDEADBE");
assertPlotParam("bgcolor", "%58DEADBE");
assertInvalidPlotParam("bgcolor", "XDEADBEF");
assertInvalidPlotParam("bgcolor", "%5BDEADBE");
assertInvalidPlotParam("bgcolor", "xBDE%0AAD");
assertPlotParam("fgcolor", "x000000");
assertPlotParam("fgcolor", "XDEADBE");
assertPlotParam("fgcolor", "%58DEADBE");
assertInvalidPlotParam("fgcolor", "XDEADBEF");
assertInvalidPlotParam("fgcolor", "%5BDEADBE");
assertInvalidPlotParam("fgcolor", "xBDE%0AAD");
}
|
[
"CWE-78"
] |
CVE-2023-25826
|
CRITICAL
| 9.8
|
OpenTSDB/opentsdb
|
setColorParams
|
test/tsd/TestGraphHandler.java
|
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
| 1
|
Analyze the following code function for security vulnerabilities
|
public boolean hasEditComment(XWikiContext context)
{
String bl = getXWikiPreference("editcomment", "", context);
if ("1".equals(bl)) {
return true;
}
if ("0".equals(bl)) {
return false;
}
return "1".equals(getConfiguration().getProperty("xwiki.editcomment", "0"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasEditComment
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
hasEditComment
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
public void getByIdAsString(String table, String id, Handler<AsyncResult<String>> replyHandler) {
getById(table, id, string -> string, replyHandler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getByIdAsString
File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
getByIdAsString
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public void sendKeyguardBouncerChanged(boolean showingBouncer) {
if (DEBUG) Log.d(TAG, "sendKeyguardBouncerChanged(" + showingBouncer + ")");
Message message = mHandler.obtainMessage(MSG_KEYGUARD_BOUNCER_CHANGED);
message.arg1 = showingBouncer ? 1 : 0;
message.sendToTarget();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendKeyguardBouncerChanged
File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
sendKeyguardBouncerChanged
|
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<Collection> findDirectMapped(Context context, int actionID) throws SQLException {
return collectionDAO
.findAuthorized(context, context.getCurrentUser(), Arrays.asList(Constants.ADD, Constants.ADMIN));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findDirectMapped
File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41189
|
HIGH
| 9
|
DSpace
|
findDirectMapped
|
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
|
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean publishManifestShortcuts(List<ShortcutInfo> newManifestShortcutList) {
if (ShortcutService.DEBUG || ShortcutService.DEBUG_REBOOT) {
Slog.d(TAG, String.format(
"Package %s: publishing manifest shortcuts", getPackageName()));
}
boolean changed = false;
// Keep the previous IDs.
final ArraySet<String> toDisableList = new ArraySet<>(1);
forEachShortcut(si -> {
if (si.isManifestShortcut()) {
toDisableList.add(si.getId());
}
});
// Publish new ones.
if (newManifestShortcutList != null) {
final int newListSize = newManifestShortcutList.size();
for (int i = 0; i < newListSize; i++) {
changed = true;
final ShortcutInfo newShortcut = newManifestShortcutList.get(i);
final boolean newDisabled = !newShortcut.isEnabled();
final String id = newShortcut.getId();
final ShortcutInfo oldShortcut = findShortcutById(id);
boolean wasPinned = false;
if (oldShortcut != null) {
if (!oldShortcut.isOriginallyFromManifest()) {
Slog.e(TAG, "Shortcut with ID=" + newShortcut.getId()
+ " exists but is not from AndroidManifest.xml, not updating.");
continue;
}
// Take over the pinned flag.
if (oldShortcut.isPinned()) {
wasPinned = true;
newShortcut.addFlags(ShortcutInfo.FLAG_PINNED);
}
}
if (newDisabled && !wasPinned) {
// If the shortcut is disabled, and it was *not* pinned, then this
// just doesn't have to be published.
// Just keep it in toDisableList, so the previous one would be removed.
continue;
}
// Note even if enabled=false, we still need to update all fields, so do it
// regardless.
forceReplaceShortcutInner(newShortcut); // This will clean up the old one too.
if (!newDisabled && !toDisableList.isEmpty()) {
// Still alive, don't remove.
toDisableList.remove(id);
}
}
}
// Disable the previous manifest shortcuts that are no longer in the manifest.
if (!toDisableList.isEmpty()) {
if (ShortcutService.DEBUG) {
Slog.d(TAG, String.format(
"Package %s: disabling %d stale shortcuts", getPackageName(),
toDisableList.size()));
}
for (int i = toDisableList.size() - 1; i >= 0; i--) {
changed = true;
final String id = toDisableList.valueAt(i);
disableWithId(id, /* disable message =*/ null,
/* disable message resid */ 0,
/* overrideImmutable=*/ true, /*ignoreInvisible=*/ false,
ShortcutInfo.DISABLED_REASON_APP_CHANGED);
}
removeOrphans();
}
adjustRanks();
return changed;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: publishManifestShortcuts
File: services/core/java/com/android/server/pm/ShortcutPackage.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40075
|
MEDIUM
| 5.5
|
android
|
publishManifestShortcuts
|
services/core/java/com/android/server/pm/ShortcutPackage.java
|
ae768fbb9975fdab267f525831cb52f485ab0ecc
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String concatSelections(String selection1, String selection2) {
if (TextUtils.isEmpty(selection1)) {
return selection2;
} else if (TextUtils.isEmpty(selection2)) {
return selection1;
} else {
return selection1 + " AND " + selection2;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: concatSelections
File: src/com/android/providers/telephony/MmsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-22"
] |
CVE-2023-21268
|
MEDIUM
| 5.5
|
android
|
concatSelections
|
src/com/android/providers/telephony/MmsProvider.java
|
ca4c9a19635119d95900793e7a41b820cd1d94d9
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("this")
void tempAllowlistUidLocked(int targetUid, long duration, @ReasonCode int reasonCode,
String reason, @TempAllowListType int type, int callingUid) {
synchronized (mProcLock) {
// The temp allowlist type could change according to the reasonCode.
if (mLocalDeviceIdleController != null) {
type = mLocalDeviceIdleController.getTempAllowListType(reasonCode, type);
}
if (type == TEMPORARY_ALLOW_LIST_TYPE_NONE) {
return;
}
mPendingTempAllowlist.put(targetUid,
new PendingTempAllowlist(targetUid, duration, reasonCode, reason, type,
callingUid));
setUidTempAllowlistStateLSP(targetUid, true);
mUiHandler.obtainMessage(PUSH_TEMP_ALLOWLIST_UI_MSG).sendToTarget();
if (type == TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED) {
mFgsStartTempAllowList.add(targetUid, duration,
new FgsTempAllowListItem(duration, reasonCode, reason, callingUid));
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: tempAllowlistUidLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
tempAllowlistUidLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean tryEnableNetwork(int networkId) {
WifiConfiguration config = getInternalConfiguredNetwork(networkId);
if (config == null) {
return false;
}
if (mWifiBlocklistMonitor.shouldEnableNetwork(config)) {
return updateNetworkSelectionStatus(config, NetworkSelectionStatus.DISABLED_NONE);
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: tryEnableNetwork
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
tryEnableNetwork
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getDefaultSubscription() {
return PhoneFactory.getDefaultSubscription();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefaultSubscription
File: src/java/com/android/internal/telephony/PhoneSubInfoController.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-0831
|
MEDIUM
| 4.3
|
android
|
getDefaultSubscription
|
src/java/com/android/internal/telephony/PhoneSubInfoController.java
|
79eecef63f3ea99688333c19e22813f54d4a31b1
| 0
|
Analyze the following code function for security vulnerabilities
|
public Scanner setElementName(String ename) {
fElementName = ename;
fStyle = fElementName.equalsIgnoreCase("STYLE");
fTextarea = fElementName.equalsIgnoreCase("TEXTAREA");
fTitle = fElementName.equalsIgnoreCase("TITLE");
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setElementName
File: src/org/cyberneko/html/HTMLScanner.java
Repository: sparklemotion/nekohtml
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-24839
|
MEDIUM
| 5
|
sparklemotion/nekohtml
|
setElementName
|
src/org/cyberneko/html/HTMLScanner.java
|
a800fce3b079def130ed42a408ff1d09f89e773d
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setScriptableObject(final Object scriptObject) {
scriptObject_ = scriptObject;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setScriptableObject
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
|
setScriptableObject
|
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
|
940dc7fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public Builder withPublicSeed(byte[] val)
{
publicSeed = XMSSUtil.cloneArray(val);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: withPublicSeed
File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-470"
] |
CVE-2018-1000613
|
HIGH
| 7.5
|
bcgit/bc-java
|
withPublicSeed
|
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java
|
4092ede58da51af9a21e4825fbad0d9a3ef5a223
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean hasMaximumRingingCalls() {
return MAXIMUM_RINGING_CALLS <= getNumCallsWithState(CallState.RINGING);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasMaximumRingingCalls
File: src/com/android/server/telecom/CallsManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2423
|
MEDIUM
| 6.6
|
android
|
hasMaximumRingingCalls
|
src/com/android/server/telecom/CallsManager.java
|
a06c9a4aef69ae27b951523cf72bf72412bf48fa
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override // binder call
public void onAcquired(long deviceId, int acquireInfo) {
mHandler.obtainMessage(MSG_ACQUIRED, acquireInfo, 0, deviceId).sendToTarget();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onAcquired
File: core/java/android/hardware/fingerprint/FingerprintManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
onAcquired
|
core/java/android/hardware/fingerprint/FingerprintManager.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public PodOperationsImpl newInstance(OperationContext context) {
return new PodOperationsImpl((PodOperationContext) context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newInstance
File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
Repository: fabric8io/kubernetes-client
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-20218
|
MEDIUM
| 5.8
|
fabric8io/kubernetes-client
|
newInstance
|
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
|
325d67cc80b73f049a5d0cea4917c1f2709a8d86
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isWebSafeImage(String fileName) {
fileName = fileName.toLowerCase();
return fileName.endsWith(".jpg") || fileName.endsWith(".jpeg")
|| fileName.endsWith(".gif") || fileName.endsWith(".png");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isWebSafeImage
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
|
isWebSafeImage
|
server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
|
f864053176c08f59ef2d97fea192ceca46a4d9be
| 0
|
Analyze the following code function for security vulnerabilities
|
private static List<AppInfoVO> convert(List<AppInfoDO> data) {
if (CollectionUtils.isEmpty(data)) {
return Lists.newLinkedList();
}
return data.stream().map(appInfoDO -> {
AppInfoVO appInfoVO = new AppInfoVO();
BeanUtils.copyProperties(appInfoDO, appInfoVO);
return appInfoVO;
}).collect(Collectors.toList());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convert
File: powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/controller/AppInfoController.java
Repository: PowerJob
The code follows secure coding practices.
|
[
"CWE-522"
] |
CVE-2020-28865
|
MEDIUM
| 5
|
PowerJob
|
convert
|
powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/controller/AppInfoController.java
|
464ce2dc0ca3e65fa1dc428239829890c52a413a
| 0
|
Analyze the following code function for security vulnerabilities
|
private int runSetPermissionEnforced() {
final String permission = nextArg();
if (permission == null) {
System.err.println("Error: no permission specified");
showUsage();
return 1;
}
final String enforcedRaw = nextArg();
if (enforcedRaw == null) {
System.err.println("Error: no enforcement specified");
showUsage();
return 1;
}
final boolean enforced = Boolean.parseBoolean(enforcedRaw);
try {
mPm.setPermissionEnforced(permission, enforced);
return 0;
} catch (RemoteException e) {
System.err.println(e.toString());
System.err.println(PM_NOT_RUNNING_ERR);
return 1;
} catch (IllegalArgumentException e) {
System.err.println("Bad argument: " + e.toString());
showUsage();
return 1;
} catch (SecurityException e) {
System.err.println("Operation not allowed: " + e.toString());
return 1;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: runSetPermissionEnforced
File: cmds/pm/src/com/android/commands/pm/Pm.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3833
|
HIGH
| 9.3
|
android
|
runSetPermissionEnforced
|
cmds/pm/src/com/android/commands/pm/Pm.java
|
4e4743a354e26467318b437892a9980eb9b8328a
| 0
|
Analyze the following code function for security vulnerabilities
|
static Expression<Object> toExpressionRecursively(Path<Object> path, PropertyPath property) {
Path<Object> result = path.get(property.getSegment());
return property.hasNext() ? toExpressionRecursively(result, property.next()) : result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toExpressionRecursively
File: src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.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
|
toExpressionRecursively
|
src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
|
b8e7fe
| 0
|
Analyze the following code function for security vulnerabilities
|
public String formatDate(Date date, String format)
{
return this.xwiki.formatDate(date, format, getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: formatDate
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
formatDate
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.