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
|
@Override
public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
//便于Wappalyzer读取
response.addHeader("X-ZrLog", BlogBuildInfoUtil.getVersion());
boolean isPluginPath = false;
for (String path : pluginHandlerPaths) {
if (target.startsWith(path)) {
isPluginPath = true;
}
}
if (isPluginPath) {
AdminTokenVO entry = null;
try {
entry = adminTokenService.getAdminTokenVO(request);
if (target.startsWith("/admin/plugins/")) {
try {
adminPermission(target, request, response, entry);
} catch (IOException | InstantiationException e) {
LOGGER.error(e);
}
} else if (target.startsWith("/plugin/") || target.startsWith("/p/")) {
try {
visitorPermission(target, request, response, entry);
} catch (IOException | InstantiationException e) {
LOGGER.error(e);
}
}
} finally {
isHandled[0] = true;
if (entry != null) {
AdminTokenThreadLocal.remove();
}
}
} else {
this.next.handle(target, request, response, isHandled);
}
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2019-16643
- Severity: LOW
- CVSS Score: 3.5
Description: Upgrade jar version & fix #54
Signed-off-by: xiaochun <xchun90@163.com>
Function: handle
File: web/src/main/java/com/zrlog/web/handler/PluginHandler.java
Repository: 94fzb/zrlog
Fixed Code:
@Override
public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
//便于Wappalyzer读取
response.addHeader("X-ZrLog", BlogBuildInfoUtil.getVersion());
boolean isPluginPath = false;
for (String path : pluginHandlerPaths) {
if (target.startsWith(path)) {
isPluginPath = true;
}
}
if (isPluginPath) {
AdminTokenVO entry = null;
try {
entry = adminTokenService.getAdminTokenVO(request);
if (target.startsWith("/admin/plugins/")) {
try {
adminPermission(target, request, response, entry);
} catch (IOException | InstantiationException e) {
LOGGER.error("",e);
}
} else if (target.startsWith("/plugin/") || target.startsWith("/p/")) {
try {
visitorPermission(target, request, response, entry);
} catch (IOException | InstantiationException e) {
LOGGER.error("",e);
}
}
} finally {
isHandled[0] = true;
if (entry != null) {
AdminTokenThreadLocal.remove();
}
}
} else {
this.next.handle(target, request, response, isHandled);
}
}
|
[
"CWE-79"
] |
CVE-2019-16643
|
LOW
| 3.5
|
94fzb/zrlog
|
handle
|
web/src/main/java/com/zrlog/web/handler/PluginHandler.java
|
4a91c83af669e31a22297c14f089d8911d353fa1
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public VerifyCredentialResponse verifyPassword(String password, long challenge, int userId)
throws RemoteException {
return doVerifyPassword(password, true, challenge, userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: verifyPassword
File: services/core/java/com/android/server/LockSettingsService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-255"
] |
CVE-2016-3749
|
MEDIUM
| 4.6
|
android
|
verifyPassword
|
services/core/java/com/android/server/LockSettingsService.java
|
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void listPluginOperations(String projectName, AsyncMethodCallback resultHandler) {
unimplemented(resultHandler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: listPluginOperations
File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
Repository: line/centraldogma
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2021-38388
|
MEDIUM
| 6.5
|
line/centraldogma
|
listPluginOperations
|
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
|
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
| 0
|
Analyze the following code function for security vulnerabilities
|
public Integer getCountSearchResultsUpTo() {
return myCountSearchResultsUpTo;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCountSearchResultsUpTo
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
|
getCountSearchResultsUpTo
|
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
|
@RequirePOST
public void doCancelQueue( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
checkPermission(ABORT);
Jenkins.getInstance().getQueue().cancel(this);
rsp.forwardToPreviousPage(req);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doCancelQueue
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
|
doCancelQueue
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getDefaultSaveRootPath() {
if (!TextUtils.isEmpty(defaultSaveRootPath)) {
return defaultSaveRootPath;
}
if (FileDownloadHelper.getAppContext().getExternalCacheDir() == null) {
return Environment.getDownloadCacheDirectory().getAbsolutePath();
} else {
//noinspection ConstantConditions
return FileDownloadHelper.getAppContext().getExternalCacheDir().getAbsolutePath();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefaultSaveRootPath
File: library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java
Repository: lingochamp/FileDownloader
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-11248
|
HIGH
| 7.5
|
lingochamp/FileDownloader
|
getDefaultSaveRootPath
|
library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java
|
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
| 0
|
Analyze the following code function for security vulnerabilities
|
private static int getChunkSize(String hex) {
hex = hex.trim();
for (int i = 0; i < hex.length(); i ++) {
char c = hex.charAt(i);
if (c == ';' || Character.isWhitespace(c) || Character.isISOControl(c)) {
hex = hex.substring(0, i);
break;
}
}
return Integer.parseInt(hex, 16);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getChunkSize
File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2019-16869
|
MEDIUM
| 5
|
netty
|
getChunkSize
|
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
|
39cafcb05c99f2aa9fce7e6597664c9ed6a63a95
| 0
|
Analyze the following code function for security vulnerabilities
|
public void requestSync(Account account, String authority, Bundle extras) {
ContentResolver.validateSyncExtrasBundle(extras);
int userId = UserHandle.getCallingUserId();
int uId = Binder.getCallingUid();
// This makes it so that future permission checks will be in the context of this
// process rather than the caller's process. We will restore this before returning.
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
syncManager.scheduleSync(account, userId, uId, authority, extras,
0 /* no delay */, 0 /* no delay */,
false /* onlyThoseWithUnkownSyncableState */);
}
} finally {
restoreCallingIdentity(identityToken);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestSync
File: services/core/java/com/android/server/content/ContentService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2426
|
MEDIUM
| 4.3
|
android
|
requestSync
|
services/core/java/com/android/server/content/ContentService.java
|
63363af721650e426db5b0bdfb8b2d4fe36abdb0
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
@Nullable
static String extractTopLevelDir(String[] relativePathSegments, String crossUserRoot) {
if (relativePathSegments == null) return null;
final String topLevelDir = relativePathSegments.length > 0 ? relativePathSegments[0] : null;
if (crossUserRoot != null && crossUserRoot.equals(topLevelDir)) {
return relativePathSegments.length > 1 ? relativePathSegments[1] : null;
}
return topLevelDir;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: extractTopLevelDir
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
extractTopLevelDir
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Analyze the following code function for security vulnerabilities
|
public void addQueryStringEntry(StringBuilder builder, String key, String value)
{
builder.append(escapeURL(key));
if (value != null) {
builder.append('=');
builder.append(escapeURL(value));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addQueryStringEntry
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
addQueryStringEntry
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
public void ensureAccessQueuePurged(VaadinSession session) {
/*
* If no thread is currently holding the lock, pending changes for UIs
* with automatic push would not be processed and pushed until the next
* time there is a request or someone does an explicit push call.
*
* To remedy this, we try to get the lock at this point. If the lock is
* currently held by another thread, we just back out as the queue will
* get purged once it is released. If the lock is held by the current
* thread, we just release it knowing that the queue gets purged once
* the lock is ultimately released. If the lock is not held by any
* thread and we acquire it, we just release it again to purge the queue
* right away.
*/
try {
// tryLock() would be shorter, but it does not guarantee fairness
if (session.getLockInstance().tryLock(0, TimeUnit.SECONDS)) {
// unlock triggers runPendingAccessTasks
session.unlock();
}
} catch (InterruptedException e) {
// Just ignore
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: ensureAccessQueuePurged
File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31404
|
LOW
| 1.9
|
vaadin/flow
|
ensureAccessQueuePurged
|
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
|
621ef1b322737d963bee624b2d2e38cd739903d9
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean getLaunchedFromBubble() {
return mLaunchedFromBubble;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLaunchedFromBubble
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
getLaunchedFromBubble
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<PendingJavaScriptInvocation> dumpPendingJavaScriptInvocations() {
pendingTitleUpdateCanceler = null;
if (pendingJsInvocations.isEmpty()) {
return Collections.emptyList();
}
List<PendingJavaScriptInvocation> currentList = getPendingJavaScriptInvocations()
.peek(PendingJavaScriptInvocation::setSentToBrowser)
.collect(Collectors.toList());
pendingJsInvocations = new ArrayList<>();
return currentList;
}
|
Vulnerability Classification:
- CWE: CWE-200
- CVE: CVE-2023-25499
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Cleanup, and refactoring, in Element, StateNode, UIInternals classes + mvn formatter.
Function: dumpPendingJavaScriptInvocations
File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
Repository: vaadin/flow
Fixed Code:
public List<PendingJavaScriptInvocation> dumpPendingJavaScriptInvocations() {
pendingTitleUpdateCanceler = null;
if (pendingJsInvocations.isEmpty()) {
return Collections.emptyList();
}
List<PendingJavaScriptInvocation> readyToSend = getPendingJavaScriptInvocations()
.filter(invocation -> invocation.getOwner().isVisible())
.peek(PendingJavaScriptInvocation::setSentToBrowser)
.collect(Collectors.toList());
pendingJsInvocations = getPendingJavaScriptInvocations()
.filter(invocation -> !invocation.getOwner().isVisible())
.collect(Collectors.toCollection(ArrayList::new));
return readyToSend;
}
|
[
"CWE-200"
] |
CVE-2023-25499
|
MEDIUM
| 6.5
|
vaadin/flow
|
dumpPendingJavaScriptInvocations
|
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
|
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public Response processAddProducer(ProducerInfo info) throws Exception {
SessionId sessionId = info.getProducerId().getParentId();
ConnectionId connectionId = sessionId.getParentId();
TransportConnectionState cs = lookupConnectionState(connectionId);
if (cs == null) {
throw new IllegalStateException("Cannot add a producer to a connection that had not been registered: "
+ connectionId);
}
SessionState ss = cs.getSessionState(sessionId);
if (ss == null) {
throw new IllegalStateException("Cannot add a producer to a session that had not been registered: "
+ sessionId);
}
// Avoid replaying dup commands
if (!ss.getProducerIds().contains(info.getProducerId())) {
ActiveMQDestination destination = info.getDestination();
if (destination != null && !AdvisorySupport.isAdvisoryTopic(destination)) {
if (getProducerCount(connectionId) >= connector.getMaximumProducersAllowedPerConnection()){
throw new IllegalStateException("Can't add producer on connection " + connectionId + ": at maximum limit: " + connector.getMaximumProducersAllowedPerConnection());
}
}
broker.addProducer(cs.getContext(), info);
try {
ss.addProducer(info);
} catch (IllegalStateException e) {
broker.removeProducer(cs.getContext(), info);
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processAddProducer
File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
Repository: apache/activemq
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-3576
|
MEDIUM
| 5
|
apache/activemq
|
processAddProducer
|
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
|
00921f2
| 0
|
Analyze the following code function for security vulnerabilities
|
public float getTransitionAnimationScaleLocked() {
return mAnimationsDisabled ? 0 : mTransitionAnimationScaleSetting;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTransitionAnimationScaleLocked
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
|
getTransitionAnimationScaleLocked
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public IBinder onBind(Intent intent) {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onBind
File: Ports/Android/src/com/codename1/impl/android/PushNotificationService.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
onBind
|
Ports/Android/src/com/codename1/impl/android/PushNotificationService.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private void dumpCheckin(PrintWriter pw, boolean clear) {
synchronized (mLock) {
try {
final JSONArray users = new JSONArray();
for (int i = 0; i < mUsers.size(); i++) {
users.put(mUsers.valueAt(i).dumpCheckin(clear));
}
final JSONObject result = new JSONObject();
result.put(KEY_SHORTCUT, users);
result.put(KEY_LOW_RAM, injectIsLowRamDevice());
result.put(KEY_ICON_SIZE, mMaxIconDimension);
pw.println(result.toString(1));
} catch (JSONException e) {
Slog.e(TAG, "Unable to write in json", e);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpCheckin
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
|
dumpCheckin
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
private ActiveAdmin getAdminWithMinimumFailedPasswordsForWipeLocked(
int userHandle, boolean parent) {
int count = 0;
ActiveAdmin strictestAdmin = null;
// Return the strictest policy across all participating admins.
List<ActiveAdmin> admins = getActiveAdminsForLockscreenPoliciesLocked(
getProfileParentUserIfRequested(userHandle, parent));
final int N = admins.size();
for (int i = 0; i < N; i++) {
ActiveAdmin admin = admins.get(i);
if (admin.maximumFailedPasswordsForWipe ==
ActiveAdmin.DEF_MAXIMUM_FAILED_PASSWORDS_FOR_WIPE) {
continue; // No max number of failed passwords policy set for this profile.
}
// We always favor the primary profile if several profiles have the same value set.
final int userId = getUserIdToWipeForFailedPasswords(admin);
if (count == 0 ||
count > admin.maximumFailedPasswordsForWipe ||
(count == admin.maximumFailedPasswordsForWipe &&
getUserInfo(userId).isPrimary())) {
count = admin.maximumFailedPasswordsForWipe;
strictestAdmin = admin;
}
}
return strictestAdmin;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAdminWithMinimumFailedPasswordsForWipeLocked
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
|
getAdminWithMinimumFailedPasswordsForWipeLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onUserRemoved(int userId) {
synchronized (ActivityManagerService.this) {
ActivityManagerService.this.onUserStoppedLocked(userId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUserRemoved
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
onUserRemoved
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
public Integer optIntegerObject(String key) {
return this.optIntegerObject(key, 0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: optIntegerObject
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
|
optIntegerObject
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void switchToAccount(Account account) {
switchToAccount(account, false, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: switchToAccount
File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
switchToAccount
|
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isNativePage() {
return mNativePage != null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isNativePage
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
isNativePage
|
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void showNotifyPublic() {
super.showNotify();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showNotifyPublic
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
showNotifyPublic
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public List<BaseObject> addObjectsFromRequest(String className, XWikiContext context) throws XWikiException
{
return addObjectsFromRequest(className, "", context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addObjectsFromRequest
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
|
addObjectsFromRequest
|
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 disableQueue() {
enabledQueue = false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: disableQueue
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
|
disableQueue
|
worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java
|
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
| 0
|
Analyze the following code function for security vulnerabilities
|
public static byte[] fixUTF8(byte[] input) {
byte[] fixed = new byte[input.length];
for (int i = 0; i < input.length; i++) {
if (input[i] == 0x00) {
fixed[i] = 0x20;
} else {
fixed[i] = input[i];
}
}
return fixed;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fixUTF8
File: src/main/java/com/openkm/util/FormatUtil.java
Repository: openkm/document-management-system
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-40317
|
MEDIUM
| 5.4
|
openkm/document-management-system
|
fixUTF8
|
src/main/java/com/openkm/util/FormatUtil.java
|
870d518f7de349c3fa4c7b9883789fdca4590c4e
| 0
|
Analyze the following code function for security vulnerabilities
|
protected EntityReferenceSerializer<String> getLocalSerializer()
{
if (this.localSerializer == null) {
this.localSerializer = Utils.getComponent(EntityReferenceSerializer.TYPE_STRING, "local");
}
return this.localSerializer;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLocalSerializer
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
|
getLocalSerializer
|
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
|
public static <T> T unmarshal(String data, String marshallingFormat, Class<T> unmarshalType) {
if (data == null || data.isEmpty()) {
return null;
}
MarshallingFormat format = getFormat(marshallingFormat);
Marshaller marshaller = null;
switch (format) {
case JAXB: {
marshaller = jaxbMarshaller;
break;
}
case JSON: {
marshaller = jsonMarshaller;
break;
}
default: {
marshaller = jsonMarshaller;
break;
}
}
Object instance = marshaller.unmarshall(data, unmarshalType);
if (instance instanceof Wrapped) {
return (T) ((Wrapped) instance).unwrap();
}
return (T) instance;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unmarshal
File: kie-server-parent/kie-server-controller/kie-server-controller-rest/src/main/java/org/kie/server/controller/rest/ControllerUtils.java
Repository: kiegroup/droolsjbpm-integration
The code follows secure coding practices.
|
[
"CWE-260"
] |
CVE-2016-7043
|
MEDIUM
| 5
|
kiegroup/droolsjbpm-integration
|
unmarshal
|
kie-server-parent/kie-server-controller/kie-server-controller-rest/src/main/java/org/kie/server/controller/rest/ControllerUtils.java
|
e916032edd47aa46d15f3a11909b4804ee20a7e8
| 0
|
Analyze the following code function for security vulnerabilities
|
private @NonNull List<Notification.Action> getNonContextualActions() {
if (mActions == null) return Collections.emptyList();
List<Notification.Action> standardActions = new ArrayList<>();
for (Notification.Action action : mActions) {
if (!action.isContextual()) {
standardActions.add(action);
}
}
return standardActions;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNonContextualActions
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
getNonContextualActions
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void readStructEnd() throws TException {
// consume the last field we read off the wire.
lastFieldId_ = lastField_.pop();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readStructEnd
File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
Repository: facebook/fbthrift
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2019-11938
|
MEDIUM
| 5
|
facebook/fbthrift
|
readStructEnd
|
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
|
08c2d412adb214c40bb03be7587057b25d053030
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String keyToString(int key) {
return "Key[user=" + getUserIdFromKey(key) + ";type="
+ settingTypeToString(getTypeFromKey(key)) + "]";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: keyToString
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3876
|
HIGH
| 7.2
|
android
|
keyToString
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
91fc934bb2e5ea59929bb2f574de6db9b5100745
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final K getKey() {
return key;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getKey
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
|
getKey
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
public int cloneWithNoCheckout(ConsoleOutputStreamConsumer outputStreamConsumer, String url) {
CommandLine gitClone = cloneCommand().
when(!hasRefSpec(), git -> git.withArgs("--branch", branch)).
withArg("--no-checkout").
withArg(new UrlArgument(url)).
withArg(workingDir.getAbsolutePath());
if (!hasRefSpec()) {
return run(gitClone, outputStreamConsumer);
}
final String abbrevBranch = localBranch();
final String fullLocalRef = abbrevBranch.startsWith("refs/") ? abbrevBranch : REFS_HEADS + abbrevBranch;
return runCascade(outputStreamConsumer,
gitClone,
git_C().withArgs("config", "--replace-all", "remote.origin.fetch", "+" + expandRefSpec()),
git_C().withArgs("fetch", "--prune", "--recurse-submodules=no"),
// Enter a detached head state without updating/restoring files in the workspace.
// This covers an edge-case where the destination ref is the same as the default
// branch, which would otherwise cause `git branch -f <local-ref> <remote-ref>` to
// fail when local-ref == current-ref.
git_C().withArgs("update-ref", "--no-deref", "HEAD", "HEAD"),
// Important to create a "real" local branch and not just use `symbolic-ref`
// to update HEAD in order to ensure that GitMaterial#isBranchEqual() passes;
// failing this check will cause the working directory to be obliterated and we
// will re-clone the given repository every time. Yikes!
git_C().withArgs("branch", "-f", abbrevBranch, remoteBranch()),
git_C().withArgs("symbolic-ref", "HEAD", fullLocalRef)
);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cloneWithNoCheckout
File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
cloneWithNoCheckout
|
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@Deprecated
public void removeListener(ItemClickListener listener) {
removeItemClickListener(listener);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeListener
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
|
removeListener
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
void setRequestedVisibilities(InsetsVisibilities visibilities) {
mRequestedVisibilities.set(visibilities);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRequestedVisibilities
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
|
setRequestedVisibilities
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public Job getWikiInitializerJob(String wikiId)
{
return this.initializedWikis.get(wikiId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWikiInitializerJob
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
|
getWikiInitializerJob
|
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 String getAllele() {
return allele;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllele
File: src/main/java/object/Variant.java
Repository: nickzren/alsdb
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-15021
|
MEDIUM
| 5.2
|
nickzren/alsdb
|
getAllele
|
src/main/java/object/Variant.java
|
cbc79a68145e845f951113d184b4de207c341599
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
final String getAndRemove(CharSequence name) {
requireNonNull(name, "name");
final int h = AsciiString.hashCode(name);
return remove0(h, index(h), name);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAndRemove
File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2019-16771
|
MEDIUM
| 5
|
line/armeria
|
getAndRemove
|
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
|
b597f7a865a527a84ee3d6937075cfbb4470ed20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getLockTaskModeState() {
return getLockTaskController().getLockTaskModeState();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLockTaskModeState
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
getLockTaskModeState
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void emailErrorMessage(EPerson eperson, String error)
throws MessagingException
{
log.warn("An error occurred during item import, the user will be notified. " + error);
try
{
Locale supportedLocale = I18nUtil.getEPersonLocale(eperson);
Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "bte_batch_import_error"));
email.addRecipient(eperson.getEmail());
email.addArgument(error);
email.addArgument(ConfigurationManager.getProperty("dspace.url") + "/feedback");
email.send();
}
catch (Exception e)
{
log.warn("error during item import error notification", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: emailErrorMessage
File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31195
|
HIGH
| 7.2
|
DSpace
|
emailErrorMessage
|
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
|
56e76049185bbd87c994128a9d77735ad7af0199
| 0
|
Analyze the following code function for security vulnerabilities
|
public ZentaoConfig getConfig() {
return getConfig(key, ZentaoConfig.class);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getConfig
File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
getConfig
|
test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public @RestrictionLevel int getRestrictionLevel(int uid) {
return mAppRestrictionController.getRestrictionLevel(uid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRestrictionLevel
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
|
getRestrictionLevel
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void handleServiceAccept(String serviceName, Buffer buffer) throws Exception {
if (log.isDebugEnabled()) {
log.debug("handleServiceAccept({}) SSH_MSG_SERVICE_ACCEPT service={}", this, serviceName);
}
KexState state = kexState.get();
if (!validateServiceKexState(state)) {
throw new IllegalStateException(
"Received " + SshConstants.getCommandMessageName(SshConstants.SSH_MSG_SERVICE_REQUEST)
+ " while in KEX state=" + state);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleServiceAccept
File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
Repository: apache/mina-sshd
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
apache/mina-sshd
|
handleServiceAccept
|
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
|
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
| 0
|
Analyze the following code function for security vulnerabilities
|
private void patternInProgress() {
mHeaderText.setText(R.string.lockpattern_recording_inprogress);
if (mDefaultHeaderColorList != null) {
mHeaderText.setTextColor(mDefaultHeaderColorList);
}
mFooterText.setText("");
mNextButton.setEnabled(false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: patternInProgress
File: src/com/android/settings/password/ChooseLockPattern.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
patternInProgress
|
src/com/android/settings/password/ChooseLockPattern.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getXMPPAddress(final User user) throws IOException {
update();
m_readLock.lock();
try {
return _getXMPPAddress(user);
} finally {
m_readLock.unlock();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getXMPPAddress
File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2021-25931
|
MEDIUM
| 6.8
|
OpenNMS/opennms
|
getXMPPAddress
|
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
|
607151ea8f90212a3fb37c977fa57c7d58d26a84
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void inputDispatchingResumed(int pid) {
final ProcessRecord proc;
synchronized (mPidsSelfLocked) {
proc = mPidsSelfLocked.get(pid);
}
if (proc != null) {
mAppErrors.handleDismissAnrDialogs(proc);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: inputDispatchingResumed
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
|
inputDispatchingResumed
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public IBinder getLaunchCookie() {
return mLaunchCookie;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLaunchCookie
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
getLaunchCookie
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Analyze the following code function for security vulnerabilities
|
public static List<Map.Entry<Integer, List<String>>> getExecSqlList(String sqlVersion, String basePath) {
List<Map.Entry<Integer, List<String>>> sqlList = new ArrayList<>();
Integer version = 0;
try {
version = Integer.valueOf(sqlVersion);
} catch (Exception e) {
LOGGER.error(e);
}
for (File f : getSqlFileList(basePath)) {
try {
Integer fileVersion = Integer.valueOf(f.getName().replace(".sql", ""));
if (fileVersion > version) {
LOGGER.info("need update sql " + f);
Map.Entry<Integer, List<String>> entry = new AbstractMap.SimpleEntry<>(fileVersion, Arrays.asList(IOUtil.getStringInputStream(new FileInputStream(f)).split("\n")));
sqlList.add(entry);
}
} catch (FileNotFoundException e) {
LOGGER.error("", e);
}
}
return sqlList;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2019-16643
- Severity: LOW
- CVSS Score: 3.5
Description: Upgrade jar version & fix #54
Signed-off-by: xiaochun <xchun90@163.com>
Function: getExecSqlList
File: common/src/main/java/com/zrlog/util/ZrLogUtil.java
Repository: 94fzb/zrlog
Fixed Code:
public static List<Map.Entry<Integer, List<String>>> getExecSqlList(String sqlVersion, String basePath) {
List<Map.Entry<Integer, List<String>>> sqlList = new ArrayList<>();
Integer version = 0;
try {
version = Integer.valueOf(sqlVersion);
} catch (Exception e) {
LOGGER.error("",e);
}
for (File f : getSqlFileList(basePath)) {
try {
Integer fileVersion = Integer.valueOf(f.getName().replace(".sql", ""));
if (fileVersion > version) {
LOGGER.info("need update sql " + f);
Map.Entry<Integer, List<String>> entry = new AbstractMap.SimpleEntry<>(fileVersion, Arrays.asList(IOUtil.getStringInputStream(new FileInputStream(f)).split("\n")));
sqlList.add(entry);
}
} catch (FileNotFoundException e) {
LOGGER.error("", e);
}
}
return sqlList;
}
|
[
"CWE-79"
] |
CVE-2019-16643
|
LOW
| 3.5
|
94fzb/zrlog
|
getExecSqlList
|
common/src/main/java/com/zrlog/util/ZrLogUtil.java
|
4a91c83af669e31a22297c14f089d8911d353fa1
| 1
|
Analyze the following code function for security vulnerabilities
|
private void generateEntries(Block parentBlock, SyndFeed feed, RssMacroParameters parameters)
throws MacroExecutionException
{
int maxElements = parameters.getCount();
int count = 0;
for (Object item : feed.getEntries()) {
++count;
if (count > maxElements) {
break;
}
SyndEntry entry = (SyndEntry) item;
ResourceReference titleResourceReference = new ResourceReference(entry.getLink(), ResourceType.URL);
Block titleBlock = new LinkBlock(parsePlainText(entry.getTitle()), titleResourceReference, true);
ParagraphBlock paragraphTitleBlock = new ParagraphBlock(Collections.singletonList(titleBlock));
paragraphTitleBlock.setParameter(CLASS_ATTRIBUTE, "rssitemtitle");
parentBlock.addChild(paragraphTitleBlock);
if (parameters.isContent() && entry.getDescription() != null) {
// We are wrapping the feed entry content in a HTML macro, not considering what the declared content
// is, because some feed will declare text while they actually contain HTML.
// See http://stuffthathappens.com/blog/2007/10/29/i-hate-rss/
// A case where doing this might hurt is if a feed declares "text" and has any XML inside it does
// not want to be interpreted as such, but displayed as is instead. But this certainly is too rare
// compared to mis-formed feeds that say text while they want to say HTML.
Block html = new RawBlock(entry.getDescription().getValue(), Syntax.XHTML_1_0);
parentBlock.addChild(new GroupBlock(Arrays.asList(html), Collections.singletonMap(CLASS_ATTRIBUTE,
"rssitemdescription")));
}
}
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-29202
- Severity: CRITICAL
- CVSS Score: 9.0
Description: XWIKI-19671: Filter the feed's content in the RSS macro
Function: generateEntries
File: xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-rss/src/main/java/org/xwiki/rendering/internal/macro/rss/RssMacro.java
Repository: xwiki/xwiki-platform
Fixed Code:
private void generateEntries(Block parentBlock, SyndFeed feed, RssMacroParameters parameters)
throws MacroExecutionException
{
int maxElements = parameters.getCount();
int count = 0;
for (Object item : feed.getEntries()) {
++count;
if (count > maxElements) {
break;
}
SyndEntry entry = (SyndEntry) item;
ResourceReference titleResourceReference = new ResourceReference(entry.getLink(), ResourceType.URL);
Block titleBlock = new LinkBlock(parsePlainText(entry.getTitle()), titleResourceReference, true);
ParagraphBlock paragraphTitleBlock = new ParagraphBlock(Collections.singletonList(titleBlock));
paragraphTitleBlock.setParameter(CLASS_ATTRIBUTE, "rssitemtitle");
parentBlock.addChild(paragraphTitleBlock);
if (parameters.isContent() && entry.getDescription() != null) {
// We are wrapping the feed entry content in a HTML macro, not considering what the declared content
// is, because some feed will declare text while they actually contain HTML.
// See http://stuffthathappens.com/blog/2007/10/29/i-hate-rss/
// A case where doing this might hurt is if a feed declares "text" and has any XML inside it does
// not want to be interpreted as such, but displayed as is instead. But this certainly is too rare
// compared to mis-formed feeds that say text while they want to say HTML.
Block html = new RawBlock(cleanHTML(entry.getDescription().getValue()), Syntax.HTML_5_0);
parentBlock.addChild(new GroupBlock(Arrays.asList(html), Collections.singletonMap(CLASS_ATTRIBUTE,
"rssitemdescription")));
}
}
}
|
[
"CWE-79"
] |
CVE-2023-29202
|
CRITICAL
| 9
|
xwiki/xwiki-platform
|
generateEntries
|
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-rss/src/main/java/org/xwiki/rendering/internal/macro/rss/RssMacro.java
|
5c7ebe47c2897e92d8f04fe2e15027e84dc3ec03
| 1
|
Analyze the following code function for security vulnerabilities
|
private boolean isEmptyValue(String value)
{
// See XWIKI-10853: Some static lists in XWiki.XWikiPreferences have the "---" value
return StringUtils.isEmpty(value) || "---".equals(value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isEmptyValue
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-41046
|
MEDIUM
| 6.3
|
xwiki/xwiki-platform
|
isEmptyValue
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
|
edc52579eeaab1b4514785c134044671a1ecd839
| 0
|
Analyze the following code function for security vulnerabilities
|
public static URL getRequestURL(XWikiRequest request) throws XWikiException
{
try {
StringBuffer requestURL = request.getRequestURL();
String qs = request.getQueryString();
if ((qs != null) && (!qs.equals(""))) {
return new URL(requestURL.toString() + "?" + qs);
} else {
return new URL(requestURL.toString());
}
} catch (Exception e) {
throw new XWikiException(XWikiException.MODULE_XWIKI_APP, XWikiException.ERROR_XWIKI_APP_URL_EXCEPTION,
"Exception while getting URL from request", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequestURL
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
|
getRequestURL
|
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 static SVNClientManager createSvnClientManager(AbstractProject context) {
return createClientManager(context).getCore();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createSvnClientManager
File: src/main/java/hudson/scm/SubversionSCM.java
Repository: jenkinsci/subversion-plugin
The code follows secure coding practices.
|
[
"CWE-255"
] |
CVE-2013-6372
|
LOW
| 2.1
|
jenkinsci/subversion-plugin
|
createSvnClientManager
|
src/main/java/hudson/scm/SubversionSCM.java
|
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isDisabled() {
return disabled;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDisabled
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
|
isDisabled
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
ActivityTaskManagerInternal getActivityTaskManagerInternal() {
return LocalServices.getService(ActivityTaskManagerInternal.class);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getActivityTaskManagerInternal
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
|
getActivityTaskManagerInternal
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setSAXHandlerFactory(final SAXHandlerFactory factory) {
this.handlerfac = factory == null ? DEFAULTSAXHANDLERFAC : factory;
engine = null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSAXHandlerFactory
File: core/src/java/org/jdom2/input/SAXBuilder.java
Repository: hunterhacker/jdom
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-33813
|
MEDIUM
| 5
|
hunterhacker/jdom
|
setSAXHandlerFactory
|
core/src/java/org/jdom2/input/SAXBuilder.java
|
bd3ab78370098491911d7fe9d7a43b97144a234e
| 0
|
Analyze the following code function for security vulnerabilities
|
IPackageManager getIPackageManager() {
return AppGlobals.getPackageManager();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIPackageManager
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
|
getIPackageManager
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isLaunchTransitionRunning() {
return mIsLaunchTransitionRunning;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isLaunchTransitionRunning
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
isLaunchTransitionRunning
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void adjustConfigurationLw(Configuration config, int keyboardPresence,
int navigationPresence) {
mHaveBuiltInKeyboard = (keyboardPresence & PRESENCE_INTERNAL) != 0;
readConfigurationDependentBehaviors();
readLidState();
applyLidSwitchState();
if (config.keyboard == Configuration.KEYBOARD_NOKEYS
|| (keyboardPresence == PRESENCE_INTERNAL
&& isHidden(mLidKeyboardAccessibility))) {
config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_YES;
if (!mHasSoftInput) {
config.keyboardHidden = Configuration.KEYBOARDHIDDEN_YES;
}
}
if (config.navigation == Configuration.NAVIGATION_NONAV
|| (navigationPresence == PRESENCE_INTERNAL
&& isHidden(mLidNavigationAccessibility))) {
config.navigationHidden = Configuration.NAVIGATIONHIDDEN_YES;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: adjustConfigurationLw
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
adjustConfigurationLw
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
private void getUniqueLinkedEntityReferences(BaseObject xobject, Map<EntityType, Set<ResourceType>> entityTypes,
Set<EntityReference> references, XWikiContext xcontext)
{
if (xobject == null) {
return;
}
BaseClass xclass = xobject.getXClass(xcontext);
for (Object fieldClass : xclass.getProperties()) {
// Wiki content stored in xobjects
if (fieldClass instanceof TextAreaClass && ((TextAreaClass) fieldClass).isWikiContent()) {
TextAreaClass textAreaClass = (TextAreaClass) fieldClass;
PropertyInterface field = xobject.getField(textAreaClass.getName());
// Make sure the field is the right type (might happen while a document is being migrated)
if (field instanceof LargeStringProperty) {
LargeStringProperty largeField = (LargeStringProperty) field;
try {
XDOM dom = parseContent(getSyntax(), largeField.getValue(), getDocumentReference());
getUniqueLinkedEntityReferences(dom, entityTypes, references);
} catch (XWikiException e) {
LOGGER.warn("Failed to extract links from xobject property [{}], skipping it. Error: {}",
largeField.getReference(), ExceptionUtils.getRootCauseMessage(e));
}
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUniqueLinkedEntityReferences
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2023-29523
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getUniqueLinkedEntityReferences
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void keyguardGone() {
Trace.beginSection("KeyguardViewMediator.mViewMediatorCallback#keyguardGone");
if (DEBUG) Log.d(TAG, "keyguardGone");
mKeyguardViewControllerLazy.get().setKeyguardGoingAwayState(false);
mKeyguardDisplayManager.hide();
Trace.endSection();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: keyguardGone
File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21267
|
MEDIUM
| 5.5
|
android
|
keyguardGone
|
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
|
d18d8b350756b0e89e051736c1f28744ed31e93a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onCommitted(@Nullable AjaxRequestTarget target, RefUpdated refUpdated, @Nullable String position) {
Project project = getProject();
if (state.blobIdent.revision == null) {
state.blobIdent.revision = "master";
resolvedRevision = refUpdated.getNewCommitId();
project.setDefaultBranch("master");
}
String branch = state.blobIdent.revision;
getProject().cacheObjectId(branch, refUpdated.getNewCommitId());
Long projectId = project.getId();
String refName = refUpdated.getRefName();
ObjectId oldCommitId = refUpdated.getOldCommitId();
ObjectId newCommitId = refUpdated.getNewCommitId();
/*
* Update pull request as this is a direct consequence of editing source branch. Also this
* is necessary to show the latest changes of the pull request after editing
*/
PullRequest request = getPullRequest();
if (request != null)
OneDev.getInstance(PullRequestUpdateManager.class).checkUpdate(request);
OneDev.getInstance(TransactionManager.class).runAfterCommit(new Runnable() {
@Override
public void run() {
OneDev.getInstance(SessionManager.class).runAsync(new Runnable() {
@Override
public void run() {
Project project = OneDev.getInstance(ProjectManager.class).load(projectId);
project.cacheObjectId(branch, newCommitId);
RefUpdated refUpdated = new RefUpdated(project, refName, oldCommitId, newCommitId);
OneDev.getInstance(ListenerRegistry.class).post(refUpdated);
}
});
}
});
if (target != null) {
if (state.urlAfterEdit != null) {
throw new RedirectToUrlException(state.urlAfterEdit);
} else {
BlobIdent newBlobIdent;
if (state.mode == Mode.DELETE) {
try (RevWalk revWalk = new RevWalk(getProject().getRepository())) {
RevTree revTree = getProject().getRevCommit(refUpdated.getNewCommitId(), true).getTree();
String parentPath = StringUtils.substringBeforeLast(state.blobIdent.path, "/");
while (TreeWalk.forPath(getProject().getRepository(), parentPath, revTree) == null) {
if (parentPath.contains("/")) {
parentPath = StringUtils.substringBeforeLast(parentPath, "/");
} else {
parentPath = null;
break;
}
}
newBlobIdent = new BlobIdent(branch, parentPath, FileMode.TREE.getBits());
} catch (IOException e) {
throw new RuntimeException(e);
}
} else if (state.mode == Mode.ADD) {
newBlobIdent = new BlobIdent(branch, getNewPath(), FileMode.REGULAR_FILE.getBits());
} else if (state.mode == Mode.EDIT) {
newBlobIdent = new BlobIdent(branch, getNewPath(), FileMode.REGULAR_FILE.getBits());
} else {
// We've uploaded some files
newBlobIdent = null;
}
if (newBlobIdent != null) {
state.blobIdent = newBlobIdent;
state.position = position;
state.commentId = null;
state.mode = Mode.VIEW;
onResolvedRevisionChange(target);
pushState(target);
} else {
state.mode = Mode.VIEW;
onResolvedRevisionChange(target);
}
// fix the issue that sometimes indexing indicator of new commit does not disappear
target.appendJavaScript("Wicket.WebSocket.send('RenderCallback');");
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCommitted
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
|
onCommitted
|
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
|
0c060153fb97c0288a1917efdb17cc426934dacb
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<AnnotatedMethod> _findPotentialFactories(JavaType type, Class<?> primaryMixIn)
{
List<Method> candidates = null;
// First find all potentially relevant static methods
for (Method m : ClassUtil.getClassMethods(type.getRawClass())) {
if (!Modifier.isStatic(m.getModifiers())) {
continue;
}
// all factory methods are fine:
//int argCount = m.getParameterTypes().length;
if (candidates == null) {
candidates = new ArrayList<>();
}
candidates.add(m);
}
// and then locate mix-ins, if any
if (candidates == null) {
return Collections.emptyList();
}
int factoryCount = candidates.size();
List<AnnotatedMethod> result = new ArrayList<>(factoryCount);
for (int i = 0; i < factoryCount; ++i) {
result.add(null);
}
// so far so good; but do we also need to find mix-ins overrides?
if (primaryMixIn != null) {
MemberKey[] methodKeys = null;
for (Method mixinFactory : ClassUtil.getDeclaredMethods(primaryMixIn)) {
if (!Modifier.isStatic(mixinFactory.getModifiers())) {
continue;
}
if (methodKeys == null) {
methodKeys = new MemberKey[factoryCount];
for (int i = 0; i < factoryCount; ++i) {
methodKeys[i] = new MemberKey(candidates.get(i));
}
}
MemberKey key = new MemberKey(mixinFactory);
for (int i = 0; i < factoryCount; ++i) {
if (key.equals(methodKeys[i])) {
result.set(i,
constructFactoryCreator(candidates.get(i), mixinFactory));
break;
}
}
}
}
// Ok: anything within mix-ins has been resolved; anything remaining we must resolve
for (int i = 0; i < factoryCount; ++i) {
AnnotatedMethod factory = result.get(i);
if (factory == null) {
result.set(i,
constructFactoryCreator(candidates.get(i), null));
}
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _findPotentialFactories
File: src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
_findPotentialFactories
|
src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@Transactional
public void deleteProgram( Program program )
{
programStore.delete( program );
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteProgram
File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
Repository: dhis2/dhis2-core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24848
|
MEDIUM
| 6.5
|
dhis2/dhis2-core
|
deleteProgram
|
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
|
ef04483a9b177d62e48dcf4e498b302a11f95e7d
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN)
public void reportFailedBiometricAttempt(int userHandle) {
if (mService != null) {
try {
mService.reportFailedBiometricAttempt(userHandle);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reportFailedBiometricAttempt
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
|
reportFailedBiometricAttempt
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void run() {
try {
switch (mAction) {
case ACTION_FAVORITE:
mChannelToUpdate.setImportantConversation(true);
if (mChannelToUpdate.isImportantConversation()) {
mChannelToUpdate.setAllowBubbles(true);
if (mAppBubble == BUBBLE_PREFERENCE_NONE) {
mINotificationManager.setBubblesAllowed(mAppPkg, mAppUid,
BUBBLE_PREFERENCE_SELECTED);
}
if (mBubblesManagerOptional.isPresent()) {
post(() -> mBubblesManagerOptional.get()
.onUserSetImportantConversation(mEntry));
}
}
mChannelToUpdate.setImportance(Math.max(
mChannelToUpdate.getOriginalImportance(), IMPORTANCE_DEFAULT));
break;
case ACTION_DEFAULT:
mChannelToUpdate.setImportance(Math.max(
mChannelToUpdate.getOriginalImportance(), IMPORTANCE_DEFAULT));
if (mChannelToUpdate.isImportantConversation()) {
mChannelToUpdate.setImportantConversation(false);
mChannelToUpdate.setAllowBubbles(false);
}
break;
case ACTION_MUTE:
if (mChannelToUpdate.getImportance() == IMPORTANCE_UNSPECIFIED
|| mChannelToUpdate.getImportance() >= IMPORTANCE_DEFAULT) {
mChannelToUpdate.setImportance(IMPORTANCE_LOW);
}
if (mChannelToUpdate.isImportantConversation()) {
mChannelToUpdate.setImportantConversation(false);
mChannelToUpdate.setAllowBubbles(false);
}
break;
}
mINotificationManager.updateNotificationChannelForPackage(
mAppPkg, mAppUid, mChannelToUpdate);
} catch (RemoteException e) {
Log.e(TAG, "Unable to update notification channel", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: run
File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40098
|
MEDIUM
| 5.5
|
android
|
run
|
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
|
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Account login(String username, String password){
Account account = null;
Driver driver = new SQLServerDriver();
String connectionUrl = "jdbc:sqlserver://n8bu1j6855.database.windows.net:1433;database=VoyagerDB;user=VoyageLogin@n8bu1j6855;password={GroupP@ssword};encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;";
try {
Connection con = driver.connect(connectionUrl, new Properties());
PreparedStatement statement = con.prepareStatement("Select userName, userPassword, userEmail, userRole from UserTable where userName = '" + username + "'");
ResultSet rs = statement.executeQuery();
rs.next();
String storedPass = rs.getString("userPassword");
if(storedPass.equals(password)){
System.out.println("Successfully logged in");
account = new Account(rs.getString("userName"), rs.getString("userEmail"), "", Roles.valueOf(rs.getString("userRole")), rs.getString("userPassword"));
}
else{
throw new BadLoginException("The username/password combination is incorrect");
}
} catch (SQLException e) {
e.printStackTrace();
if(e.getMessage().contains("result set has no current row")){
throw new BadLoginException("The username/password combination is incorrect");
}
}
return account;
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2014-125074
- Severity: MEDIUM
- CVSS Score: 5.2
Description: fixed problems in register controller, and worked at preventing sql-injection in database access
Function: login
File: Voyager/src/models/DatabaseAccess.java
Repository: Nayshlok/Voyager
Fixed Code:
@Override
public Account login(String username, String password){
Account account = null;
Driver driver = new SQLServerDriver();
try {
Connection con = driver.connect(connectionUrl, new Properties());
PreparedStatement statement = con.prepareStatement("Select userName, userPassword, userEmail, userRole from UserTable where userName = ?");
statement.setString(1, username);
ResultSet rs = statement.executeQuery();
rs.next();
String storedPass = rs.getString("userPassword");
if(storedPass.equals(password)){
System.out.println("Successfully logged in");
account = new Account(rs.getString("userName"), rs.getString("userEmail"), "", Roles.valueOf(rs.getString("userRole")), rs.getString("userPassword"));
}
else{
throw new BadLoginException("The username/password combination is incorrect");
}
} catch (SQLException e) {
e.printStackTrace();
if(e.getMessage().contains("result set has no current row")){
throw new BadLoginException("The username/password combination is incorrect");
}
}
return account;
}
|
[
"CWE-89"
] |
CVE-2014-125074
|
MEDIUM
| 5.2
|
Nayshlok/Voyager
|
login
|
Voyager/src/models/DatabaseAccess.java
|
f1249f438cd8c39e7ef2f6c8f2ab76b239a02fae
| 1
|
Analyze the following code function for security vulnerabilities
|
private int executeSql(String sql, Object[] bindArgs) throws SQLException {
acquireReference();
try {
final int statementType = DatabaseUtils.getSqlStatementType(sql);
if (statementType == DatabaseUtils.STATEMENT_ATTACH) {
boolean disableWal = false;
synchronized (mLock) {
if (!mHasAttachedDbsLocked) {
mHasAttachedDbsLocked = true;
disableWal = true;
mConnectionPoolLocked.disableIdleConnectionHandler();
}
}
if (disableWal) {
disableWriteAheadLogging();
}
}
try (SQLiteStatement statement = new SQLiteStatement(this, sql, bindArgs)) {
return statement.executeUpdateDelete();
} finally {
// If schema was updated, close non-primary connections, otherwise they might
// have outdated schema information
if (statementType == DatabaseUtils.STATEMENT_DDL) {
mConnectionPoolLocked.closeAvailableNonPrimaryConnectionsAndLogExceptions();
}
}
} finally {
releaseReference();
}
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2018-9493
- Severity: LOW
- CVSS Score: 2.1
Description: DO NOT MERGE. Extend SQLiteQueryBuilder for update and delete.
Developers often accept selection clauses from untrusted code, and
SQLiteQueryBuilder already supports a "strict" mode to help catch
SQL injection attacks. This change extends the builder to support
update() and delete() calls, so that we can help secure those
selection clauses too.
Bug: 111085900
Test: atest packages/providers/DownloadProvider/tests/
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Change-Id: Ib4fc8400f184755ee7e971ab5f2095186341730c
Merged-In: Ib4fc8400f184755ee7e971ab5f2095186341730c
(cherry picked from commit 506994268bc4fa07d8798b7737a2952f74b8fd04)
Function: executeSql
File: core/java/android/database/sqlite/SQLiteDatabase.java
Repository: android
Fixed Code:
public int executeSql(String sql, Object[] bindArgs) throws SQLException {
acquireReference();
try {
final int statementType = DatabaseUtils.getSqlStatementType(sql);
if (statementType == DatabaseUtils.STATEMENT_ATTACH) {
boolean disableWal = false;
synchronized (mLock) {
if (!mHasAttachedDbsLocked) {
mHasAttachedDbsLocked = true;
disableWal = true;
mConnectionPoolLocked.disableIdleConnectionHandler();
}
}
if (disableWal) {
disableWriteAheadLogging();
}
}
try (SQLiteStatement statement = new SQLiteStatement(this, sql, bindArgs)) {
return statement.executeUpdateDelete();
} finally {
// If schema was updated, close non-primary connections, otherwise they might
// have outdated schema information
if (statementType == DatabaseUtils.STATEMENT_DDL) {
mConnectionPoolLocked.closeAvailableNonPrimaryConnectionsAndLogExceptions();
}
}
} finally {
releaseReference();
}
}
|
[
"CWE-89"
] |
CVE-2018-9493
|
LOW
| 2.1
|
android
|
executeSql
|
core/java/android/database/sqlite/SQLiteDatabase.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 1
|
Analyze the following code function for security vulnerabilities
|
@GetMapping("/edit")
public String edit(ModelMap mmap)
{
SysUser user = getSysUser();
mmap.put("user", userService.selectUserById(user.getUserId()));
return prefix + "/edit";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: edit
File: ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
Repository: yangzongzhuan/RuoYi
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-32065
|
LOW
| 3.5
|
yangzongzhuan/RuoYi
|
edit
|
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
|
d8b2a9a905fb750fa60e2400238cf4750a77c5e6
| 0
|
Analyze the following code function for security vulnerabilities
|
private void cleanupDisabledPackageComponentsLocked(
String packageName, int userId, boolean killProcess, String[] changedClasses) {
Set<String> disabledClasses = null;
boolean packageDisabled = false;
IPackageManager pm = AppGlobals.getPackageManager();
if (changedClasses == null) {
// Nothing changed...
return;
}
// Determine enable/disable state of the package and its components.
int enabled = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
for (int i = changedClasses.length - 1; i >= 0; i--) {
final String changedClass = changedClasses[i];
if (changedClass.equals(packageName)) {
try {
// Entire package setting changed
enabled = pm.getApplicationEnabledSetting(packageName,
(userId != UserHandle.USER_ALL) ? userId : UserHandle.USER_SYSTEM);
} catch (Exception e) {
// No such package/component; probably racing with uninstall. In any
// event it means we have nothing further to do here.
return;
}
packageDisabled = enabled != PackageManager.COMPONENT_ENABLED_STATE_ENABLED
&& enabled != PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
if (packageDisabled) {
// Entire package is disabled.
// No need to continue to check component states.
disabledClasses = null;
break;
}
} else {
try {
enabled = pm.getComponentEnabledSetting(
new ComponentName(packageName, changedClass),
(userId != UserHandle.USER_ALL) ? userId : UserHandle.USER_SYSTEM);
} catch (Exception e) {
// As above, probably racing with uninstall.
return;
}
if (enabled != PackageManager.COMPONENT_ENABLED_STATE_ENABLED
&& enabled != PackageManager.COMPONENT_ENABLED_STATE_DEFAULT) {
if (disabledClasses == null) {
disabledClasses = new ArraySet<>(changedClasses.length);
}
disabledClasses.add(changedClass);
}
}
}
if (!packageDisabled && disabledClasses == null) {
// Nothing to do here...
return;
}
// Clean-up disabled activities.
if (mStackSupervisor.finishDisabledPackageActivitiesLocked(
packageName, disabledClasses, true, false, userId) && mBooted) {
mStackSupervisor.resumeFocusedStackTopActivityLocked();
mStackSupervisor.scheduleIdleLocked();
}
// Clean-up disabled tasks
mRecentTasks.cleanupDisabledPackageTasksLocked(packageName, disabledClasses, userId);
// Clean-up disabled services.
mServices.bringDownDisabledPackageServicesLocked(
packageName, disabledClasses, userId, false, killProcess, true);
// Clean-up disabled providers.
ArrayList<ContentProviderRecord> providers = new ArrayList<>();
mProviderMap.collectPackageProvidersLocked(
packageName, disabledClasses, true, false, userId, providers);
for (int i = providers.size() - 1; i >= 0; i--) {
removeDyingProviderLocked(null, providers.get(i), true);
}
// Clean-up disabled broadcast receivers.
for (int i = mBroadcastQueues.length - 1; i >= 0; i--) {
mBroadcastQueues[i].cleanupDisabledPackageReceiversLocked(
packageName, disabledClasses, userId, true);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cleanupDisabledPackageComponentsLocked
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
|
cleanupDisabledPackageComponentsLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handleExceptionDuringRequest(VaadinRequest request,
VaadinResponse response, VaadinSession vaadinSession, Throwable t)
throws ServiceException {
if (vaadinSession != null) {
vaadinSession.lock();
}
try {
ErrorHandler errorHandler = ErrorEvent
.findErrorHandler(vaadinSession);
if (errorHandler != null) {
errorHandler.error(new ErrorEvent(t));
}
// if this was an UIDL request, send UIDL back to the client
if (ServletPortletHelper.isUIDLRequest(request)) {
SystemMessages ci = getSystemMessages(ServletPortletHelper
.findLocale(null, vaadinSession, request), request);
try {
writeUncachedStringResponse(response,
JsonConstants.JSON_CONTENT_TYPE,
createCriticalNotificationJSON(
ci.getInternalErrorCaption(),
ci.getInternalErrorMessage(), null,
ci.getInternalErrorURL()));
} catch (IOException e) {
// An exception occurred while writing the response. Log
// it and continue handling only the original error.
getLogger().log(Level.WARNING,
"Failed to write critical notification response to the client",
e);
}
} else {
// Re-throw other exceptions
throw new ServiceException(t);
}
} finally {
if (vaadinSession != null) {
vaadinSession.unlock();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleExceptionDuringRequest
File: server/src/main/java/com/vaadin/server/VaadinService.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31403
|
LOW
| 1.9
|
vaadin/framework
|
handleExceptionDuringRequest
|
server/src/main/java/com/vaadin/server/VaadinService.java
|
d852126ab6f0c43f937239305bd0e9594834fe34
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_CAMERA, conditional = true)
public void setCameraDisabled(@Nullable ComponentName admin, boolean disabled) {
if (mService != null) {
try {
mService.setCameraDisabled(admin, mContext.getPackageName(), disabled,
mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCameraDisabled
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
|
setCameraDisabled
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void registerListener(final INotificationListener listener,
final ComponentName component, final int userid) {
enforceSystemOrSystemUI("INotificationManager.registerListener");
mListeners.registerService(listener, component, userid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerListener
File: services/core/java/com/android/server/notification/NotificationManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3884
|
MEDIUM
| 4.3
|
android
|
registerListener
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public String[] getModels() {
return models;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getModels
File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
Repository: pytorch/serve
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2023-43654
|
CRITICAL
| 9.8
|
pytorch/serve
|
getModels
|
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
|
391bdec3348e30de173fbb7c7277970e0b53c8ad
| 0
|
Analyze the following code function for security vulnerabilities
|
public @Nullable Object getObject(String s, @Nullable Map<String, Class<?>> map) throws SQLException {
return getObjectImpl(s, map);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getObject
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
getObject
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
public Jooby renderer(final Renderer renderer) {
this.bag.add(requireNonNull(renderer, "A renderer is required."));
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: renderer
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
renderer
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
public String generateId() {
return "id"+iota++;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateId
File: core/src/main/java/hudson/Functions.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2014-2061
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
generateId
|
core/src/main/java/hudson/Functions.java
|
bf539198564a1108b7b71a973bf7de963a6213ef
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Response getResponse(byte [] bytes) {
Response temp = null;
if (bytes == null) {
return null;
}
try {
temp = Response.parseXML(new ByteArrayInputStream(bytes));
} catch (SAMLException se) {
debug.error("getResponse : " , se);
}
return temp;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getResponse
File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
Repository: OpenIdentityPlatform/OpenAM
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2023-37471
|
CRITICAL
| 9.8
|
OpenIdentityPlatform/OpenAM
|
getResponse
|
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
|
7c18543d126e8a567b83bb4535631825aaa9d742
| 0
|
Analyze the following code function for security vulnerabilities
|
public Long optLongObject(String key, Long defaultValue) {
final Number val = this.optNumber(key, null);
if (val == null) {
return defaultValue;
}
return val.longValue();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: optLongObject
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
|
optLongObject
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
private final String _findDecodedFromSymbols(final int len) throws IOException
{
if ((_inputEnd - _inputPtr) < len) {
_loadToHaveAtLeast(len);
}
// First: maybe we already have this name decoded?
if (len < 5) {
int inPtr = _inputPtr;
final byte[] inBuf = _inputBuffer;
int q = inBuf[inPtr] & 0xFF;
if (len > 1) {
q = (q << 8) + (inBuf[++inPtr] & 0xFF);
if (len > 2) {
q = (q << 8) + (inBuf[++inPtr] & 0xFF);
if (len > 3) {
q = (q << 8) + (inBuf[++inPtr] & 0xFF);
}
}
}
_quad1 = q;
return _symbols.findName(q);
}
final byte[] inBuf = _inputBuffer;
int inPtr = _inputPtr;
// First quadbyte is easy
int q1 = (inBuf[inPtr++] & 0xFF);
q1 = (q1 << 8) | (inBuf[inPtr++] & 0xFF);
q1 = (q1 << 8) | (inBuf[inPtr++] & 0xFF);
q1 = (q1 << 8) | (inBuf[inPtr++] & 0xFF);
if (len < 9) {
int q2 = (inBuf[inPtr++] & 0xFF);
int left = len - 5;
if (left > 0) {
q2 = (q2 << 8) + (inBuf[inPtr++] & 0xFF);
if (left > 1) {
q2 = (q2 << 8) + (inBuf[inPtr++] & 0xFF);
if (left > 2) {
q2 = (q2 << 8) + (inBuf[inPtr++] & 0xFF);
}
}
}
_quad1 = q1;
_quad2 = q2;
return _symbols.findName(q1, q2);
}
int q2 = (inBuf[inPtr++] & 0xFF);
q2 = (q2 << 8) | (inBuf[inPtr++] & 0xFF);
q2 = (q2 << 8) | (inBuf[inPtr++] & 0xFF);
q2 = (q2 << 8) | (inBuf[inPtr++] & 0xFF);
if (len < 13) {
int q3 = (inBuf[inPtr++] & 0xFF);
int left = len - 9;
if (left > 0) {
q3 = (q3 << 8) + (inBuf[inPtr++] & 0xFF);
if (left > 1) {
q3 = (q3 << 8) + (inBuf[inPtr++] & 0xFF);
if (left > 2) {
q3 = (q3 << 8) + (inBuf[inPtr++] & 0xFF);
}
}
}
_quad1 = q1;
_quad2 = q2;
_quad3 = q3;
return _symbols.findName(q1, q2, q3);
}
return _findDecodedLong(len, q1, q2);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _findDecodedFromSymbols
File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
Repository: FasterXML/jackson-dataformats-binary
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2020-28491
|
MEDIUM
| 5
|
FasterXML/jackson-dataformats-binary
|
_findDecodedFromSymbols
|
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
|
de072d314af8f5f269c8abec6930652af67bc8e6
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void selectPresenceToAttachFile(final int attachmentChoice) {
final Account account = conversation.getAccount();
final PresenceSelector.OnPresenceSelected callback = () -> {
Intent intent = new Intent();
boolean chooser = false;
switch (attachmentChoice) {
case ATTACHMENT_CHOICE_CHOOSE_IMAGE:
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setType("image/*");
chooser = true;
break;
case ATTACHMENT_CHOICE_RECORD_VIDEO:
intent.setAction(MediaStore.ACTION_VIDEO_CAPTURE);
break;
case ATTACHMENT_CHOICE_TAKE_PHOTO:
final Uri uri = activity.xmppConnectionService.getFileBackend().getTakePhotoUri();
pendingTakePhotoUri.push(uri);
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
break;
case ATTACHMENT_CHOICE_CHOOSE_FILE:
chooser = true;
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setAction(Intent.ACTION_GET_CONTENT);
break;
case ATTACHMENT_CHOICE_RECORD_VOICE:
intent = new Intent(getActivity(), RecordingActivity.class);
break;
case ATTACHMENT_CHOICE_LOCATION:
intent = GeoHelper.getFetchIntent(activity);
break;
}
if (intent.resolveActivity(getActivity().getPackageManager()) != null) {
if (chooser) {
startActivityForResult(
Intent.createChooser(intent, getString(R.string.perform_action_with)),
attachmentChoice);
} else {
startActivityForResult(intent, attachmentChoice);
}
}
};
if (account.httpUploadAvailable() || attachmentChoice == ATTACHMENT_CHOICE_LOCATION) {
conversation.setNextCounterpart(null);
callback.onPresenceSelected();
} else {
activity.selectPresence(conversation, callback);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectPresenceToAttachFile
File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
selectPresenceToAttachFile
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean validateBitSet(BitSet bitSet, int validValuesLength) {
if (bitSet == null) return false;
BitSet clonedBitset = (BitSet) bitSet.clone();
clonedBitset.clear(0, validValuesLength);
return clonedBitset.isEmpty();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateBitSet
File: service/java/com/android/server/wifi/WifiConfigurationUtil.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21252
|
MEDIUM
| 5.5
|
android
|
validateBitSet
|
service/java/com/android/server/wifi/WifiConfigurationUtil.java
|
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP,
"Permission Denial: can't dump from from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid());
synchronized (mLock) {
int N = mProviders.size();
pw.println("Providers:");
for (int i = 0; i < N; i++) {
dumpProvider(mProviders.get(i), i, pw);
}
N = mWidgets.size();
pw.println(" ");
pw.println("Widgets:");
for (int i = 0; i < N; i++) {
dumpWidget(mWidgets.get(i), i, pw);
}
N = mHosts.size();
pw.println(" ");
pw.println("Hosts:");
for (int i = 0; i < N; i++) {
dumpHost(mHosts.get(i), i, pw);
}
N = mPackagesWithBindWidgetPermission.size();
pw.println(" ");
pw.println("Grants:");
for (int i = 0; i < N; i++) {
Pair<Integer, String> grant = mPackagesWithBindWidgetPermission.valueAt(i);
dumpGrant(grant, i, pw);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dump
File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-1541
|
MEDIUM
| 4.3
|
android
|
dump
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
void dumpBroadcastStatsLocked(FileDescriptor fd, PrintWriter pw, String[] args,
int opti, boolean dumpAll, String dumpPackage) {
if (mCurBroadcastStats == null) {
return;
}
pw.println("ACTIVITY MANAGER BROADCAST STATS STATE (dumpsys activity broadcast-stats)");
final long now = SystemClock.elapsedRealtime();
if (mLastBroadcastStats != null) {
pw.print(" Last stats (from ");
TimeUtils.formatDuration(mLastBroadcastStats.mStartRealtime, now, pw);
pw.print(" to ");
TimeUtils.formatDuration(mLastBroadcastStats.mEndRealtime, now, pw);
pw.print(", ");
TimeUtils.formatDuration(mLastBroadcastStats.mEndUptime
- mLastBroadcastStats.mStartUptime, pw);
pw.println(" uptime):");
if (!mLastBroadcastStats.dumpStats(pw, " ", dumpPackage)) {
pw.println(" (nothing)");
}
pw.println();
}
pw.print(" Current stats (from ");
TimeUtils.formatDuration(mCurBroadcastStats.mStartRealtime, now, pw);
pw.print(" to now, ");
TimeUtils.formatDuration(SystemClock.uptimeMillis()
- mCurBroadcastStats.mStartUptime, pw);
pw.println(" uptime):");
if (!mCurBroadcastStats.dumpStats(pw, " ", dumpPackage)) {
pw.println(" (nothing)");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpBroadcastStatsLocked
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
|
dumpBroadcastStatsLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private void sendEnrollResult(Fingerprint fp, int remaining) {
if (mEnrollmentCallback != null) {
mEnrollmentCallback.onEnrollmentProgress(remaining);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendEnrollResult
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
|
sendEnrollResult
|
core/java/android/hardware/fingerprint/FingerprintManager.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void sendServiceRequest(String serviceName)
throws TransportException {
log.debug("Sending SSH_MSG_SERVICE_REQUEST for {}", serviceName);
write(new SSHPacket(Message.SERVICE_REQUEST).putString(serviceName));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendServiceRequest
File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java
Repository: hierynomus/sshj
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
hierynomus/sshj
|
sendServiceRequest
|
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
|
94fcc960e0fb198ddec0f7efc53f95ac627fe083
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean isMultipleInstancesAdmin(HttpServletRequest request) {
return (Config.SYSTEM_MULTIPLE_INSTANCES || Config.CLOUD_MODE) && request.getRemoteUser().equals(Config.ADMIN_USER) ||
!(Config.SYSTEM_MULTIPLE_INSTANCES || Config.CLOUD_MODE) && request.isUserInRole(Config.DEFAULT_ADMIN_ROLE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isMultipleInstancesAdmin
File: src/main/java/com/openkm/servlet/admin/BaseServlet.java
Repository: openkm/document-management-system
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2021-3628
|
LOW
| 3.5
|
openkm/document-management-system
|
isMultipleInstancesAdmin
|
src/main/java/com/openkm/servlet/admin/BaseServlet.java
|
c96f2e33adab3bbf550977b1b62acaa54f86fa03
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getVersion() {
return prop.getProperty(VERSION);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getVersion
File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
Repository: pytorch/serve
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2023-43654
|
CRITICAL
| 9.8
|
pytorch/serve
|
getVersion
|
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
|
391bdec3348e30de173fbb7c7277970e0b53c8ad
| 0
|
Analyze the following code function for security vulnerabilities
|
@Transactional
@Override
public void deleteBranch(Project project, String branchName) {
onDeleteBranch(project, branchName);
String refName = GitUtils.branch2ref(branchName);
ObjectId commitId = project.getObjectId(refName, true);
try {
project.git().branchDelete().setForce(true).setBranchNames(branchName).call();
} catch (Exception e) {
throw ExceptionUtils.unchecked(e);
}
Long projectId = project.getId();
transactionManager.runAfterCommit(new Runnable() {
@Override
public void run() {
sessionManager.runAsync(new Runnable() {
@Override
public void run() {
Project project = load(projectId);
listenerRegistry.post(new RefUpdated(project, refName, commitId, ObjectId.zeroId()));
}
});
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteBranch
File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39205
|
CRITICAL
| 9.8
|
theonedev/onedev
|
deleteBranch
|
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
File injectSystemDataPath() {
return Environment.getDataSystemDirectory();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: injectSystemDataPath
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
|
injectSystemDataPath
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void delete(String id) {
IssuesWithBLOBs issuesWithBLOBs = issuesMapper.selectByPrimaryKey(id);
List platforms = new ArrayList<>();
platforms.add(issuesWithBLOBs.getPlatform());
String projectId = issuesWithBLOBs.getProjectId();
Project project = baseProjectService.getProjectById(projectId);
IssuesRequest issuesRequest = new IssuesRequest();
issuesRequest.setWorkspaceId(project.getWorkspaceId());
if (PlatformPluginService.isPluginPlatform(issuesWithBLOBs.getPlatform())) {
platformPluginService.getPlatform(issuesWithBLOBs.getPlatform())
.deleteIssue(issuesWithBLOBs.getPlatformId());
deleteIssue(id);
} else {
IssuesPlatform platform = IssueFactory.createPlatform(issuesWithBLOBs.getPlatform(), issuesRequest);
platform.deleteIssue(id);
}
// 删除缺陷对应的附件
AttachmentRequest request = new AttachmentRequest();
request.setBelongId(id);
request.setBelongType(AttachmentType.ISSUE.type());
attachmentService.deleteAttachment(request);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: delete
File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
delete
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
private void dumpActivityStarterLocked(PrintWriter pw, String dumpPackage) {
pw.println("ACTIVITY MANAGER STARTER (dumpsys activity starter)");
mActivityStartController.dump(pw, "", dumpPackage);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpActivityStarterLocked
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
|
dumpActivityStarterLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean setAllowBubbles(String pkg, int uid, int preference) {
try {
sINM.setBubblesAllowed(pkg, uid, preference);
return true;
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAllowBubbles
File: src/com/android/settings/notification/NotificationBackend.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35667
|
HIGH
| 7.8
|
android
|
setAllowBubbles
|
src/com/android/settings/notification/NotificationBackend.java
|
d8355ac47e068ad20c6a7b1602e72f0585ec0085
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
boolean isSyncFinished() {
if (!super.isSyncFinished()) return false;
if (!isVisibleRequested()) return true;
// Wait for attach. That is the earliest time where we know if there will be an associated
// display rotation. If we don't wait, the starting-window can finishDrawing first and
// cause the display rotation to end-up in a following transition.
if (!isAttached()) return false;
// If visibleRequested, wait for at-least one visible child.
for (int i = mChildren.size() - 1; i >= 0; --i) {
if (mChildren.get(i).isVisibleRequested()) {
return true;
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSyncFinished
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
isSyncFinished
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
@SafeVarargs
public static ActivityOptions makeSceneTransitionAnimation(Activity activity,
Pair<View, String>... sharedElements) {
ActivityOptions opts = new ActivityOptions();
ExitTransitionCoordinator exit = makeSceneTransitionAnimation(
new ActivityExitTransitionCallbacks(activity), activity.mExitTransitionListener,
activity.getWindow(), opts, sharedElements);
opts.mExitCoordinatorIndex =
activity.mActivityTransitionState.addExitTransitionCoordinator(exit);
return opts;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeSceneTransitionAnimation
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
makeSceneTransitionAnimation
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseAttributesForKnownElements(Map<String, List<Entry>> subdirs, Node desc) {
// NOTE: NamedNodeMap does not have any particular order...
NamedNodeMap attributes = desc.getAttributes();
for (Node attr : asIterable(attributes)) {
if (!XMP.ELEMENTS.contains(attr.getNamespaceURI())) {
continue;
}
List<Entry> dir = subdirs.get(attr.getNamespaceURI());
if (dir == null) {
dir = new ArrayList<Entry>();
subdirs.put(attr.getNamespaceURI(), dir);
}
dir.add(new XMPEntry(attr.getNamespaceURI() + attr.getLocalName(), attr.getLocalName(), attr.getNodeValue()));
}
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2021-23792
- Severity: HIGH
- CVSS Score: 7.5
Description: Avoid fetching external resources in XMPReader.
Function: parseAttributesForKnownElements
File: imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/xmp/XMPReader.java
Repository: haraldk/TwelveMonkeys
Fixed Code:
private void parseAttributesForKnownElements(Map<String, List<Entry>> subdirs, Node desc) {
// NOTE: NamedNodeMap does not have any particular order...
NamedNodeMap attributes = desc.getAttributes();
for (Node attr : asIterable(attributes)) {
if (!XMP.ELEMENTS.contains(attr.getNamespaceURI())) {
continue;
}
List<Entry> dir = subdirs.get(attr.getNamespaceURI());
if (dir == null) {
dir = new ArrayList<>();
subdirs.put(attr.getNamespaceURI(), dir);
}
dir.add(new XMPEntry(attr.getNamespaceURI() + attr.getLocalName(), attr.getLocalName(), attr.getNodeValue()));
}
}
|
[
"CWE-611"
] |
CVE-2021-23792
|
HIGH
| 7.5
|
haraldk/TwelveMonkeys
|
parseAttributesForKnownElements
|
imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/xmp/XMPReader.java
|
da4efe98bf09e1cce91b7633cb251958a200fc80
| 1
|
Analyze the following code function for security vulnerabilities
|
public Rectangle getPageSize(int index) {
return getPageSize(pageRefs.getPageNRelease(index));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPageSize
File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
Repository: pdftk-java/pdftk
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2021-37819
|
HIGH
| 7.5
|
pdftk-java/pdftk
|
getPageSize
|
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
|
9b0cbb76c8434a8505f02ada02a94263dcae9247
| 0
|
Analyze the following code function for security vulnerabilities
|
public void runGlobalSessionTermination() {
final GlobalTerminationRevisionConfig globalTerminationRevisionConfig = clusterConfigService.getOrDefault(
GlobalTerminationRevisionConfig.class,
GlobalTerminationRevisionConfig.initial()
);
if (!globalTerminationRevisionConfig.isOutdated()) {
LOG.debug("Global session termination not required");
return;
}
long terminatedSessions = 0;
for (final Session activeSession : sessionDao.getActiveSessions()) {
terminateSessionForID(activeSession.getId());
terminatedSessions++;
}
LOG.info("Globally terminated {} session(s)", terminatedSessions);
clusterConfigService.write(GlobalTerminationRevisionConfig.withCurrentRevision());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: runGlobalSessionTermination
File: graylog2-server/src/main/java/org/graylog2/security/UserSessionTerminationService.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-613"
] |
CVE-2023-41041
|
LOW
| 3.1
|
Graylog2/graylog2-server
|
runGlobalSessionTermination
|
graylog2-server/src/main/java/org/graylog2/security/UserSessionTerminationService.java
|
bb88f3d0b2b0351669ab32c60b595ab7242a3fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean isIkvmDotNet() {
return IS_IVKVM_DOT_NET;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isIkvmDotNet
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
isIkvmDotNet
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Client buildHttpClient() {
// use the default client config if not yet initialized
if (clientConfig == null) {
clientConfig = getDefaultClientConfig();
}
ClientBuilder clientBuilder = ClientBuilder.newBuilder();
customizeClientBuilder(clientBuilder);
clientBuilder = clientBuilder.withConfig(clientConfig);
return clientBuilder.build();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildHttpClient
File: samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
buildHttpClient
|
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean shouldBeSaved() {
return mPressedApply;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldBeSaved
File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40098
|
MEDIUM
| 5.5
|
android
|
shouldBeSaved
|
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
|
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.