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
|
@PUT
@Path("task/{nodeId}/file")
@Operation(summary = "This attaches a Task file onto a given task element", description = "This attaches a Task file onto a given task element")
@ApiResponse(responseCode = "200", description = "The task node metadatas", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)),
@Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) })
@ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient")
@ApiResponse(responseCode = "404", description = "The course or parentNode not found")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response attachTaskFile(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId,
@Context HttpServletRequest request) {
ICourse course = CoursesWebService.loadCourse(courseId);
CourseEditorTreeNode parentNode = getParentNode(course, nodeId);
if(course == null) {
return Response.serverError().status(Status.NOT_FOUND).build();
}
if(parentNode == null) {
return Response.serverError().status(Status.NOT_FOUND).build();
} else if(!(parentNode.getCourseNode() instanceof TACourseNode)) {
return Response.serverError().status(Status.NOT_ACCEPTABLE).build();
}
if (!isAuthorEditor(course, request)) {
return Response.serverError().status(Status.UNAUTHORIZED).build();
}
InputStream in = null;
MultipartReader reader = null;
try {
reader = new MultipartReader(request);
String filename = reader.getValue("filename", "task");
String taskFolderPath = TACourseNode.getTaskFolderPathRelToFolderRoot(course, parentNode.getCourseNode());
VFSContainer taskFolder = VFSManager.olatRootContainer(taskFolderPath, null);
VFSLeaf singleFile = (VFSLeaf) taskFolder.resolve("/" + filename);
if (singleFile == null) {
singleFile = taskFolder.createChildLeaf("/" + filename);
}
File file = reader.getFile();
if(file != null) {
in = new FileInputStream(file);
OutputStream out = singleFile.getOutputStream(false);
IOUtils.copy(in, out);
IOUtils.closeQuietly(out);
} else {
return Response.status(Status.NOT_ACCEPTABLE).build();
}
} catch (Exception e) {
log.error("", e);
return Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build();
} finally {
MultipartReader.closeQuietly(reader);
IOUtils.closeQuietly(in);
}
return Response.ok().build();
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2021-41242
- Severity: HIGH
- CVSS Score: 7.9
Description: OO-5819: container can only create file in its own path
Function: attachTaskFile
File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
Repository: OpenOLAT
Fixed Code:
@PUT
@Path("task/{nodeId}/file")
@Operation(summary = "This attaches a Task file onto a given task element", description = "This attaches a Task file onto a given task element")
@ApiResponse(responseCode = "200", description = "The task node metadatas", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)),
@Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) })
@ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient")
@ApiResponse(responseCode = "404", description = "The course or parentNode not found")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response attachTaskFile(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId,
@Context HttpServletRequest request) {
ICourse course = CoursesWebService.loadCourse(courseId);
CourseEditorTreeNode parentNode = getParentNode(course, nodeId);
if(course == null) {
return Response.serverError().status(Status.NOT_FOUND).build();
}
if(parentNode == null) {
return Response.serverError().status(Status.NOT_FOUND).build();
} else if(!(parentNode.getCourseNode() instanceof TACourseNode)) {
return Response.serverError().status(Status.NOT_ACCEPTABLE).build();
}
if (!isAuthorEditor(course, request)) {
return Response.serverError().status(Status.UNAUTHORIZED).build();
}
InputStream in = null;
MultipartReader reader = null;
try {
reader = new MultipartReader(request);
String filename = reader.getValue("filename", "task");
String taskFolderPath = TACourseNode.getTaskFolderPathRelToFolderRoot(course, parentNode.getCourseNode());
VFSContainer taskFolder = VFSManager.olatRootContainer(taskFolderPath, null);
VFSLeaf singleFile = (VFSLeaf)taskFolder.resolve(filename);
if (singleFile == null) {
singleFile = taskFolder.createChildLeaf(filename);
}
File file = reader.getFile();
if(file != null) {
in = new FileInputStream(file);
OutputStream out = singleFile.getOutputStream(false);
IOUtils.copy(in, out);
IOUtils.closeQuietly(out);
} else {
return Response.status(Status.NOT_ACCEPTABLE).build();
}
} catch (Exception e) {
log.error("", e);
return Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build();
} finally {
MultipartReader.closeQuietly(reader);
IOUtils.closeQuietly(in);
}
return Response.ok().build();
}
|
[
"CWE-22"
] |
CVE-2021-41242
|
HIGH
| 7.9
|
OpenOLAT
|
attachTaskFile
|
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
|
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
| 1
|
Analyze the following code function for security vulnerabilities
|
public default void cometLeft(Event event) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cometLeft
File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
Repository: cometd
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-24721
|
MEDIUM
| 5.5
|
cometd
|
cometLeft
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
private void initVelocityTracker() {
if (mQsVelocityTracker != null) {
mQsVelocityTracker.recycle();
}
mQsVelocityTracker = VelocityTracker.obtain();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initVelocityTracker
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
|
initVelocityTracker
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected final String encodeUrl(final String url) {
if (url == null) {
return null;
}
try {
return URLEncoder.encode(url, "UTF-8");
} catch (final UnsupportedEncodingException e) {
return url;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: encodeUrl
File: cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java
Repository: apereo/java-cas-client
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2014-4172
|
HIGH
| 7.5
|
apereo/java-cas-client
|
encodeUrl
|
cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java
|
ae37092100c8eaec610dab6d83e5e05a8ee58814
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ConversationFragment get(Activity activity) {
FragmentManager fragmentManager = activity.getFragmentManager();
Fragment fragment = fragmentManager.findFragmentById(R.id.main_fragment);
if (fragment != null && fragment instanceof ConversationFragment) {
return (ConversationFragment) fragment;
} else {
fragment = fragmentManager.findFragmentById(R.id.secondary_fragment);
return fragment != null && fragment instanceof ConversationFragment ? (ConversationFragment) fragment : null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: get
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
|
get
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getValue() {
return value;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getValue
File: src/gribbit/auth/Cookie.java
Repository: lukehutch/gribbit
The code follows secure coding practices.
|
[
"CWE-346"
] |
CVE-2014-125071
|
MEDIUM
| 5.2
|
lukehutch/gribbit
|
getValue
|
src/gribbit/auth/Cookie.java
|
620418df247aebda3dd4be1dda10fe229ea505dd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handleIncomingSubscribe(Presence request) {
// perform Pre-Authenticated Roster Subscription, fallback to manual
try {
String jid = request.getFrom();
PreAuth preauth = (PreAuth)request.getExtension(PreAuth.ELEMENT, PreAuth.NAMESPACE);
String jid_or_token = jid;
if (preauth != null) {
jid_or_token = preauth.getToken();
Log.d(TAG, "PARS: found token " + jid_or_token);
}
if (mConfig.redeemInvitationCode(jid_or_token)) {
Log.d(TAG, "PARS: approving request from " + jid);
if (mRoster.getEntry(request.getFrom()) != null) {
// already in roster, only send approval
Presence response = new Presence(Presence.Type.subscribed);
response.setTo(jid);
mXMPPConnection.sendPacket(response);
} else {
tryToAddRosterEntry(jid, null, "", null);
}
return;
}
} catch (YaximXMPPException e) {
Log.d(TAG, "PARS: failed to send response: " + e);
}
subscriptionRequests.put(request.getFrom(), request);
final ContentValues values = new ContentValues();
values.put(RosterConstants.JID, request.getFrom());
values.put(RosterConstants.STATUS_MODE, getStatusInt(request));
values.put(RosterConstants.STATUS_MESSAGE, request.getStatus());
if (!mRoster.contains(request.getFrom())) {
// reset alias and group for new entries
values.put(RosterConstants.ALIAS, request.getFrom());
values.put(RosterConstants.GROUP, "");
};
upsertRoster(values, request.getFrom());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleIncomingSubscribe
File: src/org/yaxim/androidclient/service/SmackableImp.java
Repository: ge0rg/yaxim
The code follows secure coding practices.
|
[
"CWE-20",
"CWE-346"
] |
CVE-2017-5589
|
MEDIUM
| 4.3
|
ge0rg/yaxim
|
handleIncomingSubscribe
|
src/org/yaxim/androidclient/service/SmackableImp.java
|
65a38dc77545d9568732189e86089390f0ceaf9f
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean isFwdLocked() {
return (installFlags & PackageManager.INSTALL_FORWARD_LOCK) != 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isFwdLocked
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
isFwdLocked
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
private void destroyRemoteViewsService(final Intent intent, Widget widget) {
final ServiceConnection conn = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
final IRemoteViewsFactory cb = IRemoteViewsFactory.Stub.asInterface(service);
try {
cb.onDestroy(intent);
} catch (RemoteException re) {
Slog.e(TAG, "Error calling remove view factory", re);
}
mContext.unbindService(this);
}
@Override
public void onServiceDisconnected(ComponentName name) {
// Do nothing
}
};
// Bind to the service and remove the static intent->factory mapping in the
// RemoteViewsService.
final long token = Binder.clearCallingIdentity();
try {
mContext.bindServiceAsUser(intent, conn, Context.BIND_AUTO_CREATE,
widget.provider.info.getProfile());
} finally {
Binder.restoreCallingIdentity(token);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: destroyRemoteViewsService
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
|
destroyRemoteViewsService
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void printDashRow(int dateColWidth, int versionColWidth, int nameColWidth, int descColWidth,
int minDescColWidth, int authorsColWidth) {
printCharacter("|-", nameColWidth, "-", true);
if (descColWidth >= minDescColWidth) {
printCharacter("-", descColWidth - authorsColWidth, "-", true);
printCharacter("-", authorsColWidth, "-", true);
} else {
printCharacter("-", descColWidth, "-", true);
}
printCharacter("-", dateColWidth, "-", true);
printCharacter("-", versionColWidth, "-", true);
outStream.println();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: printDashRow
File: cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Search.java
Repository: ballerina-platform/ballerina-lang
The code follows secure coding practices.
|
[
"CWE-306"
] |
CVE-2021-32700
|
MEDIUM
| 5.8
|
ballerina-platform/ballerina-lang
|
printDashRow
|
cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Search.java
|
4609ffee1744ecd16aac09303b1783bf0a525816
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getPackageForIntentSender(IIntentSender pendingResult) {
if (!(pendingResult instanceof PendingIntentRecord)) {
return null;
}
try {
PendingIntentRecord res = (PendingIntentRecord)pendingResult;
return res.key.packageName;
} catch (ClassCastException e) {
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPackageForIntentSender
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
|
getPackageForIntentSender
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isFullScreen() {
return fullScreen || nativePlayer;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isFullScreen
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
|
isFullScreen
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void canEdit(Context context, Collection collection) throws SQLException, AuthorizeException {
canEdit(context, collection, true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canEdit
File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41189
|
HIGH
| 9
|
DSpace
|
canEdit
|
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
|
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean requestTargetProviderPermissionsReviewIfNeededLocked(ProviderInfo cpi,
ProcessRecord r, final int userId) {
if (getPackageManagerInternalLocked().isPermissionsReviewRequired(
cpi.packageName, userId)) {
final boolean callerForeground = r == null || r.setSchedGroup
!= ProcessList.SCHED_GROUP_BACKGROUND;
// Show a permission review UI only for starting from a foreground app
if (!callerForeground) {
Slog.w(TAG, "u" + userId + " Instantiating a provider in package"
+ cpi.packageName + " requires a permissions review");
return false;
}
final Intent intent = new Intent(Intent.ACTION_REVIEW_PERMISSIONS);
intent.addFlags(FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
intent.putExtra(Intent.EXTRA_PACKAGE_NAME, cpi.packageName);
if (DEBUG_PERMISSIONS_REVIEW) {
Slog.i(TAG, "u" + userId + " Launching permission review "
+ "for package " + cpi.packageName);
}
final UserHandle userHandle = new UserHandle(userId);
mHandler.post(new Runnable() {
@Override
public void run() {
mContext.startActivityAsUser(intent, userHandle);
}
});
return false;
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestTargetProviderPermissionsReviewIfNeededLocked
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
|
requestTargetProviderPermissionsReviewIfNeededLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setRestrictionsProvider(@NonNull ComponentName admin,
@Nullable ComponentName provider) {
throwIfParentInstance("setRestrictionsProvider");
if (mService != null) {
try {
mService.setRestrictionsProvider(admin, provider);
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRestrictionsProvider
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
|
setRestrictionsProvider
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
Rect initialBounds, boolean moveHomeStackFront) {
enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "moveTaskToDockedStack()");
synchronized (this) {
long ident = Binder.clearCallingIdentity();
try {
if (DEBUG_STACK) Slog.d(TAG_STACK, "moveTaskToDockedStack: moving task=" + taskId
+ " to createMode=" + createMode + " toTop=" + toTop);
mWindowManager.setDockedStackCreateState(createMode, initialBounds);
final boolean moved = mStackSupervisor.moveTaskToStackLocked(
taskId, DOCKED_STACK_ID, toTop, !FORCE_FOCUS, "moveTaskToDockedStack",
animate, DEFER_RESUME);
if (moved) {
if (moveHomeStackFront) {
mStackSupervisor.moveHomeStackToFront("moveTaskToDockedStack");
}
mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
}
return moved;
} finally {
Binder.restoreCallingIdentity(ident);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: moveTaskToDockedStack
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
|
moveTaskToDockedStack
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getY() { return 13; }
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getY
File: src/test/java/com/fasterxml/jackson/databind/ser/TestTreeSerialization.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2020-36518
|
MEDIUM
| 5
|
FasterXML/jackson-databind
|
getY
|
src/test/java/com/fasterxml/jackson/databind/ser/TestTreeSerialization.java
|
8238ab41d0350fb915797c89d46777b4496b74fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void logTimer(String description, String sql, long startNanoTime, long endNanoTime) {
log.debug(description + " timer: " + sql + " took " + ((endNanoTime - startNanoTime) / 1000000) + " ms");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logTimer
File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
logTimer
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Element createElement(String tag) {
return document.createElement(tag);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createElement
File: src/edu/stanford/nlp/util/XMLUtils.java
Repository: stanfordnlp/CoreNLP
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-3869
|
MEDIUM
| 5
|
stanfordnlp/CoreNLP
|
createElement
|
src/edu/stanford/nlp/util/XMLUtils.java
|
5d83f1e8482ca304db8be726cad89554c88f136a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void pauseCapture() {
int len=captureBuffer.length();
if (len>0) captureBuffer.deleteCharAt(len-1);
capture=false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pauseCapture
File: src/main/org/hjson/HjsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34620
|
HIGH
| 7.5
|
hjson/hjson-java
|
pauseCapture
|
src/main/org/hjson/HjsonParser.java
|
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
| 0
|
Analyze the following code function for security vulnerabilities
|
public String escapeXPath(String value)
{
return "concat('" + value.replace("'", "', \"'\", '") + "', '')";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: escapeXPath
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
|
escapeXPath
|
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
|
protected void fillProperties(final Node node, Map<String, Comparable> properties) {
if (properties == null) {
return;
}
for (Node n : childElements(node)) {
if (n.getNodeType() == Node.TEXT_NODE || n.getNodeType() == Node.COMMENT_NODE) {
continue;
}
final String name = cleanNodeName(n);
final String propertyName;
if ("property".equals(name)) {
propertyName = getTextContent(n.getAttributes().getNamedItem("name")).trim();
} else {
// old way - probably should be deprecated
propertyName = name;
}
final String value = getTextContent(n).trim();
properties.put(propertyName, value);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fillProperties
File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
fillProperties
|
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setOpen(boolean open) {
this.open = open;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOpen
File: src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4040
|
MEDIUM
| 6.5
|
dotCMS/core
|
setOpen
|
src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
|
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String toJSONString(Object object) {
ObjectMapper mapper = new ObjectMapper();
mapper.getJsonFactory().setCharacterEscapes(new OpenmrsCharacterEscapes());
try {
return mapper.writeValueAsString(object);
}
catch (IOException e) {
log.error("Failed to convert object to JSON");
throw new APIException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toJSONString
File: web/src/main/java/org/openmrs/web/filter/StartupFilter.java
Repository: openmrs/openmrs-core
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-23612
|
MEDIUM
| 5
|
openmrs/openmrs-core
|
toJSONString
|
web/src/main/java/org/openmrs/web/filter/StartupFilter.java
|
db8454bf19a092a78d53ee4dba2af628b730a6e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setLaunchContainer(@NonNull ViewGroup launchContainer) {
// No-op, launch container is always the shade.
Log.wtf(TAG, "Someone tried to change the launch container for the "
+ "ActivityLaunchAnimator, which should never happen.");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLaunchContainer
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
|
setLaunchContainer
|
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
|
d18d8b350756b0e89e051736c1f28744ed31e93a
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isConflictingWithVersion(XWikiContext context, XWikiDocument originalDoc, XWikiDocument modifiedDoc)
throws XWikiException
{
XWikiRequest request = context.getRequest();
// in case of force save we skip the check.
if (FORCE_SAVE_OVERRIDE.equals(request.getParameter("forceSave"))) {
return false;
}
// the document is new we don't have to check the version date or anything
if ("true".equals(request.getParameter("isNew")) && originalDoc.isNew()) {
return false;
}
// TODO The check of the previousVersion should be done at a lower level or with a semaphore since
// another job might have saved a different version of the document
Version previousVersion = new Version(request.getParameter("previousVersion"));
Version latestVersion = originalDoc.getRCSVersion();
Date editingVersionDate = new Date(Long.parseLong(request.getParameter("editingVersionDate")));
Date latestVersionDate = originalDoc.getDate();
// we ensure that nobody edited the document between the moment the user started to edit and now
if (!latestVersion.equals(previousVersion) || latestVersionDate.after(editingVersionDate)) {
try {
XWikiDocument previousDoc =
getDocumentRevisionProvider().getRevision(originalDoc, previousVersion.toString());
// We also check that the previousDoc revision exists to avoid an exception if it has been deleted
// Note that if we're here and the request says that the document is new, it's not necessarily a
// conflict: we might be in the case where the doc has been created during the edition because of
// an image added to it, without updating the client. So it's still accurate to check that the diff
// hasn't changed.
if (!originalDoc.isNew() && previousDoc != null) {
// if changes between previousVersion and latestVersion didn't change the content, it means it's ok
// to save the current changes.
List<Delta> contentDiff =
originalDoc.getContentDiff(previousVersion.toString(), latestVersion.toString(), context);
// we also need to check the object diff, to be sure there's no conflict with the inline form.
List<List<ObjectDiff>> objectDiff =
originalDoc.getObjectDiff(previousVersion.toString(), latestVersion.toString(), context);
// we finally check the metadata: we want to get a conflict if the title changed, or the syntax,
// the default language etc.
// However we have to filter out the author: we don't care if the author reference changed and it's
// actually most certainly the case if we are here.
List<MetaDataDiff> metaDataDiff =
originalDoc.getMetaDataDiff(previousVersion.toString(), latestVersion.toString(), context);
List<MetaDataDiff> filteredMetaDataDiff = new ArrayList<>();
for (MetaDataDiff dataDiff : metaDataDiff) {
if (!dataDiff.getField().equals("author")) {
filteredMetaDataDiff.add(dataDiff);
}
}
if (contentDiff.isEmpty() && objectDiff.isEmpty() && filteredMetaDataDiff.isEmpty()) {
return false;
} else {
MergeConfiguration mergeConfiguration = new MergeConfiguration();
// We need the reference of the user and the document in the config to retrieve
// the conflict decision in the MergeManager.
mergeConfiguration.setUserReference(context.getUserReference());
mergeConfiguration.setConcernedDocument(modifiedDoc.getDocumentReferenceWithLocale());
// The modified doc is actually the one we should save, so it's ok to modify it directly
// and better for performance.
mergeConfiguration.setProvidedVersionsModifiables(true);
// We need to retrieve the conflict decisions that might have occurred from the request.
recordConflictDecisions(context, modifiedDoc.getDocumentReferenceWithLocale());
MergeDocumentResult mergeDocumentResult =
getMergeManager().mergeDocument(previousDoc, originalDoc, modifiedDoc, mergeConfiguration);
// Be sure to not keep the conflict decisions we might have made if new conflicts occurred
// we don't want to pollute the list of decisions.
getConflictDecisionsManager().removeConflictDecisionList(
modifiedDoc.getDocumentReferenceWithLocale(), context.getUserReference());
// If we don't get any conflict, or if we want to force the merge even with conflicts,
// then we pursue to save the document.
if (FORCE_SAVE_MERGE.equals(request.getParameter("forceSave"))
|| !mergeDocumentResult.hasConflicts()) {
context.put(MERGED_DOCUMENTS, "true");
return false;
// If we got merge conflicts and we don't want to force it, then we record the conflict in
// order to allow fixing them independently.
} else {
getConflictDecisionsManager().recordConflicts(modifiedDoc.getDocumentReferenceWithLocale(),
context.getUserReference(),
mergeDocumentResult.getConflicts(MergeDocumentResult.DocumentPart.CONTENT));
}
}
}
// if the revision has been deleted or if the content/object diff is not empty
// we have a conflict.
// TODO: Improve it to return the diff between the current version and the latest recorder
Map<String, String> jsonObject = new LinkedHashMap<>();
jsonObject.put("previousVersion", previousVersion.toString());
jsonObject.put("previousVersionDate", editingVersionDate.toString());
jsonObject.put("latestVersion", latestVersion.toString());
jsonObject.put("latestVersionDate", latestVersionDate.toString());
this.answerJSON(context, HttpStatus.SC_CONFLICT, jsonObject);
return true;
} catch (DifferentiationFailedException e) {
throw new XWikiException("Error while loading the diff", e);
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isConflictingWithVersion
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SaveAction.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2022-23617
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
isConflictingWithVersion
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SaveAction.java
|
30c52b01559b8ef5ed1035dac7c34aaf805764d5
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void requireNonNullElement(Object values, @Nullable Object e) {
if (e == null) {
throw new NullPointerException("values contains null: " + values);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requireNonNullElement
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
|
requireNonNullElement
|
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
|
b597f7a865a527a84ee3d6937075cfbb4470ed20
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getHoldability() throws SQLException {
throw org.postgresql.Driver.notImplemented(this.getClass(), "getHoldability()");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHoldability
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
|
getHoldability
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
private static AtomicFile getSavedStateFile(int userId) {
File dir = Environment.getUserSystemDirectory(userId);
File settingsFile = getStateFile(userId);
if (!settingsFile.exists() && userId == UserHandle.USER_OWNER) {
if (!dir.exists()) {
dir.mkdirs();
}
// Migrate old data
File oldFile = new File("/data/system/" + STATE_FILENAME);
// Method doesn't throw an exception on failure. Ignore any errors
// in moving the file (like non-existence)
oldFile.renameTo(settingsFile);
}
return new AtomicFile(settingsFile);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSavedStateFile
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
|
getSavedStateFile
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setVersion(Integer version) {
this.version = version;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setVersion
File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setVersion
|
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
int getDelegateUid() {
return mTargetUid;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDelegateUid
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
|
getDelegateUid
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setEmailFromAddress(String theEmailFromAddress) {
myModelConfig.setEmailFromAddress(theEmailFromAddress);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setEmailFromAddress
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
|
setEmailFromAddress
|
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
|
@Override
public void resumeAppSwitches() {
mAmInternal.enforceCallingPermission(STOP_APP_SWITCHES, "resumeAppSwitches");
synchronized (mGlobalLock) {
mAppSwitchesState = APP_SWITCH_ALLOW;
mH.removeMessages(H.RESUME_FG_APP_SWITCH_MSG);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resumeAppSwitches
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
|
resumeAppSwitches
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean equals(Object o) {
if(o == null) {
return false;
}
NativeFont n = ((NativeFont)o);
if(fileName != null) {
return n.fileName != null && fileName.equals(n.fileName) && n.height == height && n.weight == weight;
}
return n.face == face && n.style == style && n.size == size && font.equals(n.font);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: equals
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
|
equals
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onEvent(Event event, Object source, Object data)
{
if (event instanceof JobFinishedEvent) {
// An extension just been initialized (after an install or upgrade for example)
onJobFinished((JobFinishedEvent) event);
} else if (event instanceof WikiDeletedEvent) {
// A wiki has been deleted
onWikiDeletedEvent((WikiDeletedEvent) event);
} else if (event instanceof ComponentDescriptorAddedEvent) {
// A new mandatory document initializer has been installed
onMandatoryDocumentInitializerAdded((ComponentDescriptorAddedEvent) event, (ComponentManager) source);
} else {
// Document modifications
XWikiDocument doc = (XWikiDocument) source;
if (event instanceof XObjectPropertyEvent) {
EntityReference reference = ((XObjectPropertyEvent) event).getReference();
String modifiedProperty = reference.getName();
if ("backlinks".equals(modifiedProperty)) {
this.hasBacklinks = doc.getXObject((ObjectReference) reference.getParent()).getIntValue("backlinks",
getConfiguration().getProperty("xwiki.backlinks", 0)) == 1;
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onEvent
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-287"
] |
CVE-2022-36092
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
onEvent
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
71a6d0bb6f8ab718fcfaae0e9b8c16c2d69cd4bb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, XWikiContext context)
throws XWikiException
{
return searchDocuments(wheresql, distinctbylanguage, 0, 0, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: searchDocuments
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
searchDocuments
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden,
int userId) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.MANAGE_USERS, null);
PackageSetting pkgSetting;
final int uid = Binder.getCallingUid();
enforceCrossUserPermission(uid, userId, true, true,
"setApplicationHiddenSetting for user " + userId);
if (hidden && isPackageDeviceAdmin(packageName, userId)) {
Slog.w(TAG, "Not hiding package " + packageName + ": has active device admin");
return false;
}
long callingId = Binder.clearCallingIdentity();
try {
boolean sendAdded = false;
boolean sendRemoved = false;
// writer
synchronized (mPackages) {
pkgSetting = mSettings.mPackages.get(packageName);
if (pkgSetting == null) {
return false;
}
if (pkgSetting.getHidden(userId) != hidden) {
pkgSetting.setHidden(hidden, userId);
mSettings.writePackageRestrictionsLPr(userId);
if (hidden) {
sendRemoved = true;
} else {
sendAdded = true;
}
}
}
if (sendAdded) {
sendPackageAddedForUser(packageName, pkgSetting, userId);
return true;
}
if (sendRemoved) {
killApplication(packageName, UserHandle.getUid(userId, pkgSetting.appId),
"hiding pkg");
sendApplicationHiddenForUser(packageName, pkgSetting, userId);
return true;
}
} finally {
Binder.restoreCallingIdentity(callingId);
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setApplicationHiddenSettingAsUser
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
setApplicationHiddenSettingAsUser
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
void onTaskListEmptyLocked() {
detachLocked();
deleteActivityContainer(this);
mHandler.obtainMessage(CONTAINER_CALLBACK_TASK_LIST_EMPTY, this).sendToTarget();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onTaskListEmptyLocked
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
onTaskListEmptyLocked
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getRealAssetPath(String inode) {
String _inode = inode;
String path = "";
String realPath = Config.getStringProperty("ASSET_REAL_PATH", null);
if (UtilMethods.isSet(realPath) && !realPath.endsWith(java.io.File.separator))
realPath = realPath + java.io.File.separator;
String assetPath = Config.getStringProperty("ASSET_PATH", "/assets");
if (UtilMethods.isSet(assetPath) && !assetPath.endsWith(java.io.File.separator))
assetPath = assetPath + java.io.File.separator;
path = ((!UtilMethods.isSet(realPath)) ? assetPath : realPath)
+ _inode.charAt(0) + java.io.File.separator + _inode.charAt(1)
+ java.io.File.separator + _inode+ java.io.File.separator + "fileAsset" + java.io.File.separator;
if (!UtilMethods.isSet(realPath))
return FileUtil.getRealPath(path);
else
return path;
}
|
Vulnerability Classification:
- CWE: CWE-434
- CVE: CVE-2017-11466
- Severity: HIGH
- CVSS Score: 9.0
Description: #12131 fixes jenkins feedback
Function: getRealAssetPath
File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
Repository: dotCMS/core
Fixed Code:
public String getRealAssetPath(String inode) {
String _inode = inode;
String path = "";
String realPath = Config.getStringProperty("ASSET_REAL_PATH", null);
if (UtilMethods.isSet(realPath) && !realPath.endsWith(java.io.File.separator))
realPath = realPath + java.io.File.separator;
String assetPath = Config.getStringProperty("ASSET_PATH", DEFAULT_RELATIVE_ASSET_PATH);
if (UtilMethods.isSet(assetPath) && !assetPath.endsWith(java.io.File.separator))
assetPath = assetPath + java.io.File.separator;
path = ((!UtilMethods.isSet(realPath)) ? assetPath : realPath)
+ _inode.charAt(0) + java.io.File.separator + _inode.charAt(1)
+ java.io.File.separator + _inode+ java.io.File.separator + "fileAsset" + java.io.File.separator;
if (!UtilMethods.isSet(realPath))
return FileUtil.getRealPath(path);
else
return path;
}
|
[
"CWE-434"
] |
CVE-2017-11466
|
HIGH
| 9
|
dotCMS/core
|
getRealAssetPath
|
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
|
150d85278c9b7738c79a25616c0d2ff690855c51
| 1
|
Analyze the following code function for security vulnerabilities
|
IAccountAuthenticatorCache getAccountAuthenticatorCache() {
return new AccountAuthenticatorCache(mContext);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAccountAuthenticatorCache
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
getAccountAuthenticatorCache
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getStatus()
{
return this.response.getStatus();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStatus
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-601"
] |
CVE-2022-23618
|
MEDIUM
| 5.8
|
xwiki/xwiki-platform
|
getStatus
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
|
5251c02080466bf9fb55288f04a37671108f8096
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void releasePersistableUriPermission(Uri uri, final int modeFlags,
@Nullable String toPackage, int userId) {
final int uid;
if (toPackage != null) {
enforceCallingPermission(android.Manifest.permission.FORCE_PERSISTABLE_URI_PERMISSIONS,
"releasePersistableUriPermission");
uid = mPackageManagerInt.getPackageUid(toPackage, 0, userId);
} else {
enforceNotIsolatedCaller("releasePersistableUriPermission");
uid = Binder.getCallingUid();
}
Preconditions.checkFlagsArgument(modeFlags,
Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
synchronized (this) {
boolean persistChanged = false;
UriPermission exactPerm = findUriPermissionLocked(uid,
new GrantUri(userId, uri, false));
UriPermission prefixPerm = findUriPermissionLocked(uid,
new GrantUri(userId, uri, true));
if (exactPerm == null && prefixPerm == null && toPackage == null) {
throw new SecurityException("No permission grants found for UID " + uid
+ " and Uri " + uri.toSafeString());
}
if (exactPerm != null) {
persistChanged |= exactPerm.releasePersistableModes(modeFlags);
removeUriPermissionIfNeededLocked(exactPerm);
}
if (prefixPerm != null) {
persistChanged |= prefixPerm.releasePersistableModes(modeFlags);
removeUriPermissionIfNeededLocked(prefixPerm);
}
if (persistChanged) {
schedulePersistUriGrants();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: releasePersistableUriPermission
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
|
releasePersistableUriPermission
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String getTextContent(final Node node) {
if (node != null) {
final String text;
if (domLevel3) {
text = node.getTextContent();
} else {
text = getTextContentOld(node);
}
return text != null ? text.trim() : "";
}
return "";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTextContent
File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
getTextContent
|
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int startActivityIntentSender(IApplicationThread caller, IIntentSender target,
IBinder whitelistToken, Intent fillInIntent, String resolvedType, IBinder resultTo,
String resultWho, int requestCode, int flagsMask, int flagsValues, Bundle bOptions)
throws TransactionTooLargeException {
enforceNotIsolatedCaller("startActivityIntentSender");
// Refuse possible leaked file descriptors
if (fillInIntent != null && fillInIntent.hasFileDescriptors()) {
throw new IllegalArgumentException("File descriptors passed in Intent");
}
if (!(target instanceof PendingIntentRecord)) {
throw new IllegalArgumentException("Bad PendingIntent object");
}
PendingIntentRecord pir = (PendingIntentRecord)target;
synchronized (this) {
// If this is coming from the currently resumed activity, it is
// effectively saying that app switches are allowed at this point.
final ActivityStack stack = getFocusedStack();
if (stack.mResumedActivity != null &&
stack.mResumedActivity.info.applicationInfo.uid == Binder.getCallingUid()) {
mAppSwitchesAllowedTime = 0;
}
}
int ret = pir.sendInner(0, fillInIntent, resolvedType, whitelistToken, null, null,
resultTo, resultWho, requestCode, flagsMask, flagsValues, bOptions);
return ret;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startActivityIntentSender
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
|
startActivityIntentSender
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setMasterSyncAutomatically(boolean flag, int userId) {
synchronized (mAuthorities) {
Boolean auto = mMasterSyncAutomatically.get(userId);
if (auto != null && auto.equals(flag)) {
return;
}
mMasterSyncAutomatically.put(userId, flag);
writeAccountInfoLocked();
}
if (flag) {
requestSync(null, userId, SyncOperation.REASON_MASTER_SYNC_AUTO, null,
new Bundle());
}
reportChange(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS);
mContext.sendBroadcast(ContentResolver.ACTION_SYNC_CONN_STATUS_CHANGED);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMasterSyncAutomatically
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
setMasterSyncAutomatically
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isAlphaGlobal() {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAlphaGlobal
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
|
isAlphaGlobal
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void executeParamConnectionException(TestContext context) throws Exception {
postgresClientConnectionThrowsException().execute("SELECT 1", new JsonArray(), context.asyncAssertFailure());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeParamConnectionException
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
executeParamConnectionException
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getServiceProviderNameByClientId(String clientId, String clientType,
String tenantDomain) throws IdentityApplicationManagementException {
String name = null;
// invoking the listeners
Collection<ApplicationMgtListener> listeners = getApplicationMgtListeners();
for (ApplicationMgtListener listener : listeners) {
if (listener.isEnable() && !listener.doPreGetServiceProviderNameByClientId(clientId, clientType,
tenantDomain)) {
return null;
}
}
if (StringUtils.isNotEmpty(clientId)) {
ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO();
name = appDAO.getServiceProviderNameByClientId(clientId, clientType, tenantDomain);
if (name == null) {
name = new FileBasedApplicationDAO().getServiceProviderNameByClientId(clientId,
clientType, tenantDomain);
}
}
if (name == null) {
ServiceProvider defaultSP = ApplicationManagementServiceComponent.getFileBasedSPs()
.get(IdentityApplicationConstants.DEFAULT_SP_CONFIG);
name = defaultSP.getApplicationName();
}
for (ApplicationMgtListener listener : listeners) {
if (listener.isEnable() && !listener.doPostGetServiceProviderNameByClientId(name, clientId, clientType,
tenantDomain)) {
return null;
}
}
return name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServiceProviderNameByClientId
File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
Repository: wso2/carbon-identity-framework
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-42646
|
MEDIUM
| 6.4
|
wso2/carbon-identity-framework
|
getServiceProviderNameByClientId
|
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
|
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
| 0
|
Analyze the following code function for security vulnerabilities
|
private void removeUriPermissionsForPackageLocked(
String packageName, int userHandle, boolean persistable) {
if (userHandle == UserHandle.USER_ALL && packageName == null) {
throw new IllegalArgumentException("Must narrow by either package or user");
}
boolean persistChanged = false;
int N = mGrantedUriPermissions.size();
for (int i = 0; i < N; i++) {
final int targetUid = mGrantedUriPermissions.keyAt(i);
final ArrayMap<GrantUri, UriPermission> perms = mGrantedUriPermissions.valueAt(i);
// Only inspect grants matching user
if (userHandle == UserHandle.USER_ALL
|| userHandle == UserHandle.getUserId(targetUid)) {
for (Iterator<UriPermission> it = perms.values().iterator(); it.hasNext();) {
final UriPermission perm = it.next();
// Only inspect grants matching package
if (packageName == null || perm.sourcePkg.equals(packageName)
|| perm.targetPkg.equals(packageName)) {
persistChanged |= perm.revokeModes(persistable
? ~0 : ~Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION, true);
// Only remove when no modes remain; any persisted grants
// will keep this alive.
if (perm.modeFlags == 0) {
it.remove();
}
}
}
if (perms.isEmpty()) {
mGrantedUriPermissions.remove(targetUid);
N--;
i--;
}
}
}
if (persistChanged) {
schedulePersistUriGrants();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeUriPermissionsForPackageLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
removeUriPermissionsForPackageLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean getBooleanPreference(String name, @BoolRes int res) {
return getPreferences().getBoolean(name, getResources().getBoolean(res));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBooleanPreference
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
|
getBooleanPreference
|
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setUseLegacySearchBuilder(boolean theUseLegacySearchBuilder) {
myUseLegacySearchBuilder = theUseLegacySearchBuilder;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUseLegacySearchBuilder
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
|
setUseLegacySearchBuilder
|
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
|
f2934b229c491235ab0e7782dea86b324521082a
| 0
|
Analyze the following code function for security vulnerabilities
|
public FrameHandler create(Address addr, String connectionName) throws IOException {
int portNumber = ConnectionFactory.portOrDefault(addr.getPort(), ssl);
Socket socket = null;
try {
socket = createSocket(connectionName);
configurator.configure(socket);
socket.connect(addr.toInetSocketAddress(portNumber), connectionTimeout);
return create(socket);
} catch (IOException ioe) {
quietTrySocketClose(socket);
throw ioe;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: create
File: src/main/java/com/rabbitmq/client/impl/SocketFrameHandlerFactory.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
create
|
src/main/java/com/rabbitmq/client/impl/SocketFrameHandlerFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String createImageFilename(long createTime, int taskId) {
return String.valueOf(taskId) + ACTIVITY_ICON_SUFFIX + createTime +
IMAGE_EXTENSION;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createImageFilename
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
|
createImageFilename
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
@TestOnly
public void submoduleRemove(String folderName) {
configRemoveSection("submodule." + folderName);
CommandLine gitConfig = gitWd().withArgs("config", "-f", ".gitmodules", "--remove-section", "submodule." + folderName);
runOrBomb(gitConfig);
CommandLine gitAdd = gitWd().withArgs("add", ".gitmodules");
runOrBomb(gitAdd);
CommandLine gitRm = gitWd().withArgs("rm", "--cached", folderName);
runOrBomb(gitRm);
FileUtils.deleteQuietly(new File(workingDir, folderName));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: submoduleRemove
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
|
submoduleRemove
|
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
public ObjectInputStream createObjectInputStream(Reader xmlReader) throws IOException {
return createObjectInputStream(hierarchicalStreamDriver.createReader(xmlReader));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createObjectInputStream
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
createObjectInputStream
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean getTls12Enable() {
return mTls12Enable;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTls12Enable
File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3897
|
MEDIUM
| 4.3
|
android
|
getTls12Enable
|
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
|
81be4e3aac55305cbb5c9d523cf5c96c66604b39
| 0
|
Analyze the following code function for security vulnerabilities
|
public Optional<MongoDbSession> forUser(User user) {
return sessions.getOrDefault(user.getId(), Optional.empty());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: forUser
File: graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-613"
] |
CVE-2023-41041
|
LOW
| 3.1
|
Graylog2/graylog2-server
|
forUser
|
graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java
|
bb88f3d0b2b0351669ab32c60b595ab7242a3fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
public SelectPopup getSelectPopupForTest() {
return mSelectPopup;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSelectPopupForTest
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
getSelectPopupForTest
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private ProcessExecutor createProcessExecutor(File targetDir, DbProperties dbProperties) {
ConnectionUrl connectionUrlInstance = ConnectionUrl.getConnectionUrlInstance(dbProperties.url(), dbProperties.connectionProperties());
LinkedHashMap<String, String> env = new LinkedHashMap<>();
if (isNotBlank(dbProperties.password())) {
env.put("MYSQL_PWD", dbProperties.password());
}
// override with any user specified environment
env.putAll(dbProperties.extraBackupEnv());
ArrayList<String> argv = new ArrayList<>();
argv.add("mysqldump");
String dbName = connectionUrlInstance.getDatabase();
HostInfo mainHost = connectionUrlInstance.getMainHost();
if (mainHost != null) {
argv.add("--host=" + mainHost.getHost());
argv.add("--port=" + mainHost.getPort());
}
if (isNotBlank(dbProperties.user())) {
argv.add("--user=" + dbProperties.user());
}
// append any user specified args for mysqldump
if (isNotBlank(dbProperties.extraBackupCommandArgs())) {
Collections.addAll(argv, Commandline.translateCommandline(dbProperties.extraBackupCommandArgs()));
}
argv.add("--result-file=" + new File(targetDir, "db." + dbName).toString());
argv.add(connectionUrlInstance.getDatabase());
ProcessExecutor processExecutor = new ProcessExecutor();
processExecutor.redirectOutputAlsoTo(Slf4jStream.of(getClass()).asDebug());
processExecutor.redirectErrorAlsoTo(Slf4jStream.of(getClass()).asDebug());
processExecutor.environment(env);
processExecutor.command(argv);
return processExecutor;
}
|
Vulnerability Classification:
- CWE: CWE-532
- CVE: CVE-2023-28630
- Severity: MEDIUM
- CVSS Score: 4.4
Description: Improve error messages on failure to launch backup process
ztexec can include env vars in the error message which we don't want in this case.
Function: createProcessExecutor
File: db-support/db-support-mysql/src/main/java/com/thoughtworks/go/server/database/mysql/MySQLBackupProcessor.java
Repository: gocd
Fixed Code:
private ProcessExecutor createProcessExecutor(File targetDir, DbProperties dbProperties) {
ConnectionUrl connectionUrlInstance = ConnectionUrl.getConnectionUrlInstance(dbProperties.url(), dbProperties.connectionProperties());
Map<String, String> env = new LinkedHashMap<>();
if (isNotBlank(dbProperties.password())) {
env.put("MYSQL_PWD", dbProperties.password());
}
// override with any user specified environment
env.putAll(dbProperties.extraBackupEnv());
List<String> argv = new ArrayList<>();
argv.add(COMMAND);
String dbName = connectionUrlInstance.getDatabase();
HostInfo mainHost = connectionUrlInstance.getMainHost();
if (mainHost != null) {
argv.add("--host=" + mainHost.getHost());
argv.add("--port=" + mainHost.getPort());
}
if (isNotBlank(dbProperties.user())) {
argv.add("--user=" + dbProperties.user());
}
// append any user specified args for mysqldump
if (isNotBlank(dbProperties.extraBackupCommandArgs())) {
Collections.addAll(argv, Commandline.translateCommandline(dbProperties.extraBackupCommandArgs()));
}
argv.add("--result-file=" + new File(targetDir, "db." + dbName));
argv.add(connectionUrlInstance.getDatabase());
ProcessExecutor processExecutor = new ProcessExecutor();
processExecutor.redirectOutputAlsoTo(Slf4jStream.of(getClass()).asDebug());
processExecutor.redirectErrorAlsoTo(Slf4jStream.of(getClass()).asDebug());
processExecutor.environment(env);
processExecutor.command(argv);
return processExecutor;
}
|
[
"CWE-532"
] |
CVE-2023-28630
|
MEDIUM
| 4.4
|
gocd
|
createProcessExecutor
|
db-support/db-support-mysql/src/main/java/com/thoughtworks/go/server/database/mysql/MySQLBackupProcessor.java
|
6545481e7b36817dd6033bf614585a8db242070d
| 1
|
Analyze the following code function for security vulnerabilities
|
public Statement getStatement() throws SQLException {
checkClosed();
return statement;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStatement
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
|
getStatement
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setPackageScreenCompatMode(String packageName, int mode) {
mActivityTaskManager.setPackageScreenCompatMode(packageName, mode);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPackageScreenCompatMode
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
setPackageScreenCompatMode
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ResolveInfo resolveService(Intent intent, String resolvedType, int flags, int userId) {
List<ResolveInfo> query = queryIntentServices(intent, resolvedType, flags, userId);
if (!sUserManager.exists(userId)) return null;
if (query != null) {
if (query.size() >= 1) {
// If there is more than one service with the same priority,
// just arbitrarily pick the first one.
return query.get(0);
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resolveService
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
resolveService
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
void reportCurWakefulnessUsageEventLocked() {
reportGlobalUsageEventLocked(mWakefulness == PowerManagerInternal.WAKEFULNESS_AWAKE
? UsageEvents.Event.SCREEN_INTERACTIVE
: UsageEvents.Event.SCREEN_NON_INTERACTIVE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reportCurWakefulnessUsageEventLocked
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
|
reportCurWakefulnessUsageEventLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
int getDisableFlags() {
return mDisableFlags;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDisableFlags
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
|
getDisableFlags
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setShellCommand( String shellCommand )
{
this.shellCommand = shellCommand;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setShellCommand
File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
Repository: codehaus-plexus/plexus-utils
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2017-1000487
|
HIGH
| 7.5
|
codehaus-plexus/plexus-utils
|
setShellCommand
|
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
|
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
| 0
|
Analyze the following code function for security vulnerabilities
|
public Document getDocument(String space, String fullname) throws XWikiException
{
XWikiDocument doc = this.xwiki.getDocument(space, fullname, getXWikiContext());
if (this.xwiki.getRightService().hasAccessLevel("view", getXWikiContext().getUser(), doc.getFullName(),
getXWikiContext()) == false) {
return null;
}
return doc.newDocument(getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDocument
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
getDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Intent getHomeIntent() {
synchronized (mGlobalLock) {
return ActivityTaskManagerService.this.getHomeIntent();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHomeIntent
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
|
getHomeIntent
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testPOSTAttachment() throws Exception
{
final String attachmentName = String.format("%s.txt", UUID.randomUUID());
final String content = "ATTACHMENT CONTENT";
String attachmentsUri = buildURIForThisPage(AttachmentsResource.class, attachmentName);
HttpClient httpClient = new HttpClient();
httpClient.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(
TestUtils.SUPER_ADMIN_CREDENTIALS.getUserName(), TestUtils.SUPER_ADMIN_CREDENTIALS.getPassword()));
httpClient.getParams().setAuthenticationPreemptive(true);
Part[] parts = new Part[1];
ByteArrayPartSource baps = new ByteArrayPartSource(attachmentName, content.getBytes());
parts[0] = new FilePart(attachmentName, baps);
PostMethod postMethod = new PostMethod(attachmentsUri);
MultipartRequestEntity mpre = new MultipartRequestEntity(parts, postMethod.getParams());
postMethod.setRequestEntity(mpre);
httpClient.executeMethod(postMethod);
Assert.assertEquals(getHttpMethodInfo(postMethod), HttpStatus.SC_CREATED, postMethod.getStatusCode());
this.unmarshaller.unmarshal(postMethod.getResponseBodyAsStream());
Header location = postMethod.getResponseHeader("location");
GetMethod getMethod = executeGet(location.getValue());
Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode());
Assert.assertEquals(content, getMethod.getResponseBodyAsString());
}
|
Vulnerability Classification:
- CWE: CWE-352
- CVE: CVE-2023-37277
- Severity: CRITICAL
- CVSS Score: 9.6
Description: XWIKI-20135: Require a CSRF token for some request types in the REST API
* Require a CSRF token in the XWiki-Form-Token header in content types
allowed in simple requests.
* Add integration tests to check that the check is indeed working.
* Automatically add the CSRF token header in same-origin requests
initiated from JavaScript.
* Add an integration test to check that the form token is correctly
added and fetch requests are still working.
Co-authored-by: Marius Dumitru Florea <marius@xwiki.com>
Function: testPOSTAttachment
File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java
Repository: xwiki/xwiki-platform
Fixed Code:
@Test
public void testPOSTAttachment() throws Exception
{
final String attachmentName = String.format("%s.txt", UUID.randomUUID());
final String content = "ATTACHMENT CONTENT";
String attachmentsUri = buildURIForThisPage(AttachmentsResource.class, attachmentName);
HttpClient httpClient = new HttpClient();
httpClient.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(
TestUtils.SUPER_ADMIN_CREDENTIALS.getUserName(), TestUtils.SUPER_ADMIN_CREDENTIALS.getPassword()));
httpClient.getParams().setAuthenticationPreemptive(true);
Part[] parts = new Part[1];
ByteArrayPartSource baps = new ByteArrayPartSource(attachmentName, content.getBytes());
parts[0] = new FilePart(attachmentName, baps);
PostMethod postMethod = new PostMethod(attachmentsUri);
MultipartRequestEntity mpre = new MultipartRequestEntity(parts, postMethod.getParams());
postMethod.setRequestEntity(mpre);
postMethod.setRequestHeader("XWiki-Form-Token", getFormToken(TestUtils.SUPER_ADMIN_CREDENTIALS.getUserName(),
TestUtils.SUPER_ADMIN_CREDENTIALS.getPassword()));
httpClient.executeMethod(postMethod);
Assert.assertEquals(getHttpMethodInfo(postMethod), HttpStatus.SC_CREATED, postMethod.getStatusCode());
this.unmarshaller.unmarshal(postMethod.getResponseBodyAsStream());
Header location = postMethod.getResponseHeader("location");
GetMethod getMethod = executeGet(location.getValue());
Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode());
Assert.assertEquals(content, getMethod.getResponseBodyAsString());
}
|
[
"CWE-352"
] |
CVE-2023-37277
|
CRITICAL
| 9.6
|
xwiki/xwiki-platform
|
testPOSTAttachment
|
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java
|
4c175405faa0e62437df397811c7526dfc0fbae7
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getMetricsCategory() {
return SettingsEnums.CHOOSE_LOCK_PATTERN;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMetricsCategory
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
|
getMetricsCategory
|
src/com/android/settings/password/ChooseLockPattern.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
public void doOpen() {
try {
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
FileInputStream input = new FileInputStream(file);
InputHandler xmlhandler = new InputHandler(handler);
parser.parse(input, xmlhandler);
input.close();
} catch (Exception e) {
log.error("Cannot open the file: " + file.getAbsolutePath(), e);
}
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2018-1000548
- Severity: MEDIUM
- CVSS Score: 6.8
Description: #500 secure xml parsing; new cfg secure_xml_processing
Function: doOpen
File: umlet-swing/src/main/java/com/baselet/diagram/io/DiagramFileHandler.java
Repository: umlet
Fixed Code:
public void doOpen() {
try {
SAXParserFactory spf = SAXParserFactory.newInstance();
if (Config.getInstance().isSecureXmlProcessing()) {
// use secure xml processing (see https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Prevention_Cheat_Sheet#JAXP_DocumentBuilderFactory.2C_SAXParserFactory_and_DOM4J)
spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
spf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
spf.setFeature("http://xml.org/sax/features/external-general-entities", false);
spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
}
SAXParser parser = spf.newSAXParser();
FileInputStream input = new FileInputStream(file);
InputHandler xmlhandler = new InputHandler(handler);
parser.parse(input, xmlhandler);
input.close();
} catch (Exception e) {
log.error("Cannot open the file: " + file.getAbsolutePath(), e);
}
}
|
[
"CWE-611"
] |
CVE-2018-1000548
|
MEDIUM
| 6.8
|
umlet
|
doOpen
|
umlet-swing/src/main/java/com/baselet/diagram/io/DiagramFileHandler.java
|
e1c4cc6ae692cc8d1c367460dbf79343e996f9bd
| 1
|
Analyze the following code function for security vulnerabilities
|
public DefaultHandler2 create(XMLStreamWriter xtw);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: create
File: src/main/java/org/olat/ims/qti21/repository/handlers/CopyAndConvertVisitor.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
create
|
src/main/java/org/olat/ims/qti21/repository/handlers/CopyAndConvertVisitor.java
|
5668a41ab3f1753102a89757be013487544279d5
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean hasNext() {
return (count * (page + 1)) < totalCount;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasNext
File: src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4040
|
MEDIUM
| 6.5
|
dotCMS/core
|
hasNext
|
src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
|
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
| 0
|
Analyze the following code function for security vulnerabilities
|
public static DocumentBuilderFactory getNsAwareDocumentBuilderFactory() throws ParserConfigurationException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
setFeature(dbf, "http://apache.org/xml/features/disallow-doctype-decl");
return dbf;
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2022-0265
- Severity: HIGH
- CVSS Score: 7.5
Description: Add helper method to XmlUtil to enable XXE protection in the SAXParserFactory and XMLInputFactory (#20407)
Function: getNsAwareDocumentBuilderFactory
File: hazelcast/src/main/java/com/hazelcast/internal/util/XmlUtil.java
Repository: hazelcast
Fixed Code:
public static DocumentBuilderFactory getNsAwareDocumentBuilderFactory() throws ParserConfigurationException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
setFeature(dbf, FEATURES_DISALLOW_DOCTYPE);
return dbf;
}
|
[
"CWE-611"
] |
CVE-2022-0265
|
HIGH
| 7.5
|
hazelcast
|
getNsAwareDocumentBuilderFactory
|
hazelcast/src/main/java/com/hazelcast/internal/util/XmlUtil.java
|
4d6b666cd0291abd618c3b95cdbb51aa4208e748
| 1
|
Analyze the following code function for security vulnerabilities
|
public void ok(PrintWriter out, String msg) {
out.print("<div class=\"ok\">" + msg + "</div>");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: ok
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
|
ok
|
src/main/java/com/openkm/servlet/admin/BaseServlet.java
|
c96f2e33adab3bbf550977b1b62acaa54f86fa03
| 0
|
Analyze the following code function for security vulnerabilities
|
public Builder addResponseFilter(ResponseFilter responseFilter) {
responseFilters.add(responseFilter);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addResponseFilter
File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
Repository: AsyncHttpClient/async-http-client
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2013-7397
|
MEDIUM
| 4.3
|
AsyncHttpClient/async-http-client
|
addResponseFilter
|
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public AutomaticZenRule getAutomaticZenRule(String id) throws RemoteException {
Preconditions.checkNotNull(id, "Id is null");
enforcePolicyAccess(Binder.getCallingUid(), "getAutomaticZenRule");
return mZenModeHelper.getAutomaticZenRule(id);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAutomaticZenRule
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
|
getAutomaticZenRule
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
int clientPSKKeyRequested(
String identityHint, byte[] identityBytesOut, byte[] key, PSKCallbacks pskCallbacks) {
PSKKeyManager pskKeyManager = getPSKKeyManager();
if (pskKeyManager == null) {
return 0;
}
String identity = pskCallbacks.chooseClientPSKIdentity(pskKeyManager, identityHint);
// Store identity in NULL-terminated modified UTF-8 representation into ientityBytesOut
byte[] identityBytes;
if (identity == null) {
identity = "";
identityBytes = EmptyArray.BYTE;
} else if (identity.isEmpty()) {
identityBytes = EmptyArray.BYTE;
} else {
try {
identityBytes = identity.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("UTF-8 encoding not supported", e);
}
}
if (identityBytes.length + 1 > identityBytesOut.length) {
// Insufficient space in the output buffer
return 0;
}
if (identityBytes.length > 0) {
System.arraycopy(identityBytes, 0, identityBytesOut, 0, identityBytes.length);
}
identityBytesOut[identityBytes.length] = 0;
SecretKey secretKey = pskCallbacks.getPSKKey(pskKeyManager, identityHint, identity);
byte[] secretKeyBytes = secretKey.getEncoded();
if (secretKeyBytes == null) {
return 0;
} else if (secretKeyBytes.length > key.length) {
// Insufficient space in the output buffer
return 0;
}
System.arraycopy(secretKeyBytes, 0, key, 0, secretKeyBytes.length);
return secretKeyBytes.length;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clientPSKKeyRequested
File: src/main/java/org/conscrypt/SSLParametersImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3840
|
HIGH
| 10
|
android
|
clientPSKKeyRequested
|
src/main/java/org/conscrypt/SSLParametersImpl.java
|
5af5e93463f4333187e7e35f3bd2b846654aa214
| 0
|
Analyze the following code function for security vulnerabilities
|
public void dump(PrintWriter pw, String prefix) {
pw.print(prefix); pw.print("mFocusedStack=" + mFocusedStack);
pw.print(" mLastFocusedStack="); pw.println(mLastFocusedStack);
pw.print(prefix); pw.println("mSleepTimeout=" + mSleepTimeout);
pw.print(prefix); pw.println("mCurTaskId=" + mCurTaskId);
pw.print(prefix); pw.println("mUserStackInFront=" + mUserStackInFront);
pw.print(prefix); pw.println("mActivityContainers=" + mActivityContainers);
pw.print(prefix); pw.print("mLockTaskModeState=" + lockTaskModeToString());
final SparseArray<String[]> packages = mService.mLockTaskPackages;
if (packages.size() > 0) {
pw.println(" mLockTaskPackages (userId:packages)=");
for (int i = 0; i < packages.size(); ++i) {
pw.print(prefix); pw.print(prefix); pw.print(packages.keyAt(i));
pw.print(":"); pw.println(Arrays.toString(packages.valueAt(i)));
}
}
pw.println(" mLockTaskModeTasks" + mLockTaskModeTasks);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dump
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
dump
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
private DocumentReferenceResolver<String> getCurrentMixedDocumentReferenceResolver()
{
if (this.currentMixedDocumentReferenceResolver == null) {
this.currentMixedDocumentReferenceResolver =
Utils.getComponent(DocumentReferenceResolver.TYPE_STRING, "currentmixed");
}
return this.currentMixedDocumentReferenceResolver;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentMixedDocumentReferenceResolver
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
|
getCurrentMixedDocumentReferenceResolver
|
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 byte[] getURLContentAsBytes(String surl, XWikiContext context) throws IOException
{
return getURLContentAsBytes(surl, getHttpTimeout(context), getHttpUserAgent(context));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getURLContentAsBytes
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
|
getURLContentAsBytes
|
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 <T> void getById(String table, String id, Class<T> clazz,
Handler<AsyncResult<T>> replyHandler) {
getById(table, id, json -> mapper.readValue(json, clazz), replyHandler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getById
File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
getById
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final void activityResumed(IBinder token) {
final long origId = Binder.clearCallingIdentity();
synchronized(this) {
ActivityStack stack = ActivityRecord.getStackLocked(token);
if (stack != null) {
stack.activityResumedLocked(token);
}
}
Binder.restoreCallingIdentity(origId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: activityResumed
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
|
activityResumed
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
public void detectEncoding(String[] encodings) throws IOException {
if (fDetected) {
throw new IOException("Should not detect encoding twice.");
}
fDetected = true;
int b1 = read();
if (b1 == -1) {
return;
}
int b2 = read();
if (b2 == -1) {
fPushbackLength = 1;
return;
}
// UTF-8 BOM: 0xEFBBBF
if (b1 == 0xEF && b2 == 0xBB) {
int b3 = read();
if (b3 == 0xBF) {
fPushbackOffset = 3;
encodings[0] = "UTF-8";
encodings[1] = "UTF8";
return;
}
fPushbackLength = 3;
}
// UTF-16 LE BOM: 0xFFFE
if (b1 == 0xFF && b2 == 0xFE) {
encodings[0] = "UTF-16";
encodings[1] = "UnicodeLittleUnmarked";
return;
}
// UTF-16 BE BOM: 0xFEFF
else if (b1 == 0xFE && b2 == 0xFF) {
encodings[0] = "UTF-16";
encodings[1] = "UnicodeBigUnmarked";
return;
}
// unknown
fPushbackLength = 2;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: detectEncoding
File: src/org/cyberneko/html/HTMLScanner.java
Repository: sparklemotion/nekohtml
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-24839
|
MEDIUM
| 5
|
sparklemotion/nekohtml
|
detectEncoding
|
src/org/cyberneko/html/HTMLScanner.java
|
a800fce3b079def130ed42a408ff1d09f89e773d
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean pollSCMChanges( TaskListener listener ) {
return poll(listener).hasChanges();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pollSCMChanges
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
|
pollSCMChanges
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void fillPolygon(Object graphics, int[] xPoints, int[] yPoints, int nPoints) {
((AndroidGraphics) graphics).fillPolygon(xPoints, yPoints, nPoints);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fillPolygon
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
|
fillPolygon
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final boolean containsInt(CharSequence name, int value) {
return contains(name, String.valueOf(value));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: containsInt
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
|
containsInt
|
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
|
b597f7a865a527a84ee3d6937075cfbb4470ed20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getLowerThanConditionSQL(String column, Object param) {
String paramStr = getParameterSQL(param);
return column + " < " + paramStr;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLowerThanConditionSQL
File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
Repository: dashbuilder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4999
|
HIGH
| 7.5
|
dashbuilder
|
getLowerThanConditionSQL
|
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
|
8574899e3b6455547b534f570b2330ff772e524b
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Map<String, Set<AuthAction>> internalGetPermissionsOnTopic() {
// This operation should be reading from zookeeper and it should be allowed without having admin privileges
validateAdminAccessForTenant(namespaceName.getTenant());
String topicUri = topicName.toString();
try {
Policies policies = namespaceResources().get(path(POLICIES, namespaceName.toString()))
.orElseThrow(() -> new RestException(Status.NOT_FOUND, "Namespace does not exist"));
Map<String, Set<AuthAction>> permissions = Maps.newHashMap();
AuthPolicies auth = policies.auth_policies;
// First add namespace level permissions
auth.getNamespaceAuthentication().forEach(permissions::put);
// Then add topic level permissions
if (auth.getTopicAuthentication().containsKey(topicUri)) {
for (Map.Entry<String, Set<AuthAction>> entry :
auth.getTopicAuthentication().get(topicUri).entrySet()) {
String role = entry.getKey();
Set<AuthAction> topicPermissions = entry.getValue();
if (!permissions.containsKey(role)) {
permissions.put(role, topicPermissions);
} else {
// Do the union between namespace and topic level
Set<AuthAction> union = Sets.union(permissions.get(role), topicPermissions);
permissions.put(role, union);
}
}
}
return permissions;
} catch (Exception e) {
log.error("[{}] Failed to get permissions for topic {}", clientAppId(), topicUri, e);
throw new RestException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalGetPermissionsOnTopic
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalGetPermissionsOnTopic
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void setScheduled(boolean scheduled) {
CmsVersion.scheduled = scheduled;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setScheduled
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-29784
|
MEDIUM
| 5
|
sanluan/PublicCMS
|
setScheduled
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java
|
d8d7626cf51e4968fb384e1637a3c0c9921f33e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addPackageDependency(String packageName) {
synchronized (this) {
int callingPid = Binder.getCallingPid();
if (callingPid == Process.myPid()) {
// Yeah, um, no.
return;
}
ProcessRecord proc;
synchronized (mPidsSelfLocked) {
proc = mPidsSelfLocked.get(Binder.getCallingPid());
}
if (proc != null) {
if (proc.pkgDeps == null) {
proc.pkgDeps = new ArraySet<String>(1);
}
proc.pkgDeps.add(packageName);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addPackageDependency
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
addPackageDependency
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@JRubyMethod(visibility=Visibility.PRIVATE)
public IRubyObject validate_file(ThreadContext context, IRubyObject file) {
Ruby runtime = context.runtime;
XmlDomParserContext ctx = new XmlDomParserContext(runtime, RubyFixnum.newFixnum(runtime, 1L));
ctx.setInputSourceFile(context, file);
XmlDocument xmlDocument = ctx.parse(context, getNokogiriClass(runtime, "Nokogiri::XML::Document"), context.nil);
return validate_document_or_file(context, xmlDocument);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validate_file
File: ext/java/nokogiri/XmlSchema.java
Repository: sparklemotion/nokogiri
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2020-26247
|
MEDIUM
| 4
|
sparklemotion/nokogiri
|
validate_file
|
ext/java/nokogiri/XmlSchema.java
|
9c87439d9afa14a365ff13e73adc809cb2c3d97b
| 0
|
Analyze the following code function for security vulnerabilities
|
void addRenderer(Renderer<?> renderer) {
addExtension(renderer);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addRenderer
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
|
addRenderer
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) {
enforceNotIsolatedCaller("getProcessMemoryInfo");
Debug.MemoryInfo[] infos = new Debug.MemoryInfo[pids.length];
for (int i=pids.length-1; i>=0; i--) {
ProcessRecord proc;
int oomAdj;
synchronized (this) {
synchronized (mPidsSelfLocked) {
proc = mPidsSelfLocked.get(pids[i]);
oomAdj = proc != null ? proc.setAdj : 0;
}
}
infos[i] = new Debug.MemoryInfo();
long startTime = SystemClock.currentThreadTimeMillis();
Debug.getMemoryInfo(pids[i], infos[i]);
long endTime = SystemClock.currentThreadTimeMillis();
if (proc != null) {
synchronized (this) {
if (proc.thread != null && proc.setAdj == oomAdj) {
// Record this for posterity if the process has been stable.
proc.baseProcessTracker.addPss(infos[i].getTotalPss(),
infos[i].getTotalUss(), infos[i].getTotalRss(), false,
ProcessStats.ADD_PSS_EXTERNAL_SLOW, endTime-startTime,
proc.pkgList);
}
}
}
}
return infos;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProcessMemoryInfo
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
|
getProcessMemoryInfo
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Document stringToDocument(String xml) throws Exception {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(new InputSource(new StringReader(xml)));
return document;
}
catch (Exception e) {
log.error("Error converting String to Document:\n" + xml);
throw e;
}
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2018-16521
- Severity: HIGH
- CVSS Score: 7.5
Description: Configure xml parser to ignore xxe entities
Function: stringToDocument
File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
Repository: openmrs/openmrs-module-htmlformentry
Fixed Code:
public static Document stringToDocument(String xml) throws Exception {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
// Disable XXE: security measure to prevent DOS, arbitrary-file-read, and possibly RCE
dbf.setExpandEntityReferences(false);
dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl",true);
dbf.setFeature("http://xml.org/sax/features/external-general-entities",false);
dbf.setFeature("http://xml.org/sax/features/external-parameter-entities",false);
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(new InputSource(new StringReader(xml)));
return document;
}
catch (Exception e) {
log.error("Error converting String to Document:\n" + xml);
throw e;
}
}
|
[
"CWE-611"
] |
CVE-2018-16521
|
HIGH
| 7.5
|
openmrs/openmrs-module-htmlformentry
|
stringToDocument
|
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
|
c095610518d9d0e4fdcb915884ad10f9c5b75eb6
| 1
|
Analyze the following code function for security vulnerabilities
|
public synchronized void updateBytes(@Positive int columnIndex, byte @Nullable [] x) throws SQLException {
updateValue(columnIndex, x);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateBytes
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
|
updateBytes
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
@Override
public List<LegacyPermission> getLegacyPermissions() {
return mPermissionManagerServiceImpl.getLegacyPermissions();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLegacyPermissions
File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
getLegacyPermissions
|
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
public void endElement(final String uri,
final String localName,
final String qname) throws SAXException {
direction = -1;
final Handler handler = getHandler( uri,
localName );
if ( handler == null ) {
if ( this.configurationStack.size() >= 1 ) {
endElementBuilder();
}
return;
}
this.current = removeParent();
this.peer = handler.end( uri,
localName,
this );
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: endElement
File: drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java
Repository: apache/incubator-kie-drools
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2014-8125
|
HIGH
| 7.5
|
apache/incubator-kie-drools
|
endElement
|
drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java
|
c48464c3b246e6ef0d4cd0dbf67e83ccd532c6d3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void resizeTask(int taskId, Rect bounds, int resizeMode) {
enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "resizeTask()");
long ident = Binder.clearCallingIdentity();
try {
synchronized (this) {
TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId);
if (task == null) {
Slog.w(TAG, "resizeTask: taskId=" + taskId + " not found");
return;
}
int stackId = task.stack.mStackId;
// We allow the task to scroll instead of resizing if this is a non-resizeable task
// in crop windows resize mode or if the task size is affected by the docked stack
// changing size. No need to update configuration.
if (bounds != null && task.inCropWindowsResizeMode()
&& mStackSupervisor.isStackDockedInEffect(stackId)) {
mWindowManager.scrollTask(task.taskId, bounds);
return;
}
// Place the task in the right stack if it isn't there already based on
// the requested bounds.
// The stack transition logic is:
// - a null bounds on a freeform task moves that task to fullscreen
// - a non-null bounds on a non-freeform (fullscreen OR docked) task moves
// that task to freeform
// - otherwise the task is not moved
if (!StackId.isTaskResizeAllowed(stackId)) {
throw new IllegalArgumentException("resizeTask not allowed on task=" + task);
}
if (bounds == null && stackId == FREEFORM_WORKSPACE_STACK_ID) {
stackId = FULLSCREEN_WORKSPACE_STACK_ID;
} else if (bounds != null && stackId != FREEFORM_WORKSPACE_STACK_ID ) {
stackId = FREEFORM_WORKSPACE_STACK_ID;
}
boolean preserveWindow = (resizeMode & RESIZE_MODE_PRESERVE_WINDOW) != 0;
if (stackId != task.stack.mStackId) {
mStackSupervisor.moveTaskToStackUncheckedLocked(
task, stackId, ON_TOP, !FORCE_FOCUS, "resizeTask");
preserveWindow = false;
}
mStackSupervisor.resizeTaskLocked(task, bounds, resizeMode, preserveWindow,
false /* deferResume */);
}
} finally {
Binder.restoreCallingIdentity(ident);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resizeTask
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
|
resizeTask
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setValue(String value) {
this.value = value;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setValue
File: base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setValue
|
base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_USER_ADDED.equals(intent.getAction())) {
// Notify keystore that a new user was added.
final int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0);
final KeyStore ks = KeyStore.getInstance();
final UserManager um = (UserManager) mContext.getSystemService(USER_SERVICE);
final UserInfo parentInfo = um.getProfileParent(userHandle);
final int parentHandle = parentInfo != null ? parentInfo.id : -1;
ks.onUserAdded(userHandle, parentHandle);
} else if (Intent.ACTION_USER_STARTING.equals(intent.getAction())) {
final int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0);
mStorage.prefetchUser(userHandle);
} else if (Intent.ACTION_USER_PRESENT.equals(intent.getAction())) {
mStrongAuth.reportUnlock(getSendingUserId());
} else if (Intent.ACTION_USER_REMOVED.equals(intent.getAction())) {
final int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0);
if (userHandle > 0) {
removeUser(userHandle);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onReceive
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
|
onReceive
|
services/core/java/com/android/server/LockSettingsService.java
|
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.