instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
private HashMap<String, String> cleanString(HashMap<String, String> strList, String[] allowed) {
String allow = "";
HashMap<String, String> cleaned = null;
Iterator<String> it = null;
String cleanStr = null;
String key = null;
for (int i = 0; i < allowed.length; i++) {
allow += "\\" + allowed[i];
}
if (strList != null) {
cleaned = new HashMap<String, String>();
it = strList.keySet().iterator();
while (it.hasNext()) {
key = it.next();
if (Boolean.valueOf(getConfig("chars_only_latin"))) {
// 去除特殊字符和中文
cleanStr = strList.get(key).replaceAll("[^{" + allow + "}_a-zA-Z0-9]", "");
}
cleanStr = strList.get(key);
cleaned.put(key, cleanStr);
}
}
return cleaned;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cleanString
File: src/main/java/com/jflyfox/modules/filemanager/FileManager.java
Repository: jflyfox/jfinal_cms
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2021-37262
|
MEDIUM
| 5
|
jflyfox/jfinal_cms
|
cleanString
|
src/main/java/com/jflyfox/modules/filemanager/FileManager.java
|
e7fd0fe9362464c4d2bd308318eecc89a847b116
| 0
|
Analyze the following code function for security vulnerabilities
|
public void dumpPendingOperations(StringBuilder sb) {
sb.append("Pending Ops: ").append(mPendingOperations.size()).append(" operation(s)\n");
for (PendingOperation pop : mPendingOperations) {
sb.append("(info: " + pop.target.toString())
.append(", extras: " + pop.extras)
.append(")\n");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpPendingOperations
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
|
dumpPendingOperations
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
private Map<String, List<String>> getHeaders(RoutingContext ctx) {
Map<String, List<String>> h = new HashMap<>();
MultiMap headers = ctx.request().headers();
for (String header : headers.names()) {
h.put(header, headers.getAll(header));
}
return h;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHeaders
File: extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java
Repository: quarkusio/quarkus
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2022-2466
|
CRITICAL
| 9.8
|
quarkusio/quarkus
|
getHeaders
|
extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java
|
08e5c3106ce4bfb18b24a38514eeba6464668b07
| 0
|
Analyze the following code function for security vulnerabilities
|
private void appendExtraInformation(StringBuilder breadcrumb) {
if (StringUtil.isDefined(getExtraInformation())) {
if (breadcrumb.length() > 0) {
breadcrumb.append(CONNECTOR);
}
breadcrumb.append("<span class=\"information\">");
breadcrumb.append(getExtraInformation());
breadcrumb.append("</span>");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendExtraInformation
File: core-web/src/main/java/org/silverpeas/core/web/util/viewgenerator/html/browsebars/BrowseBarComplete.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
appendExtraInformation
|
core-web/src/main/java/org/silverpeas/core/web/util/viewgenerator/html/browsebars/BrowseBarComplete.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
public JDK getJDK(String name) {
if(name==null) {
// if only one JDK is configured, "default JDK" should mean that JDK.
List<JDK> jdks = getJDKs();
if(jdks.size()==1) return jdks.get(0);
return null;
}
for (JDK j : getJDKs()) {
if(j.getName().equals(name))
return j;
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getJDK
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
getJDK
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public static int makeKey(int type, int userId) {
return (type << SETTINGS_TYPE_SHIFT) | userId;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeKey
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3876
|
HIGH
| 7.2
|
android
|
makeKey
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
91fc934bb2e5ea59929bb2f574de6db9b5100745
| 0
|
Analyze the following code function for security vulnerabilities
|
protected final void initContentViewCore() {
initContentViewCore(ContentViewUtil.createNativeWebContents(mIncognito));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initContentViewCore
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
initContentViewCore
|
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Unstable
public boolean exists(PageReference reference, XWikiContext context)
{
// Try as space
DocumentReference documentReference = getCurrentReferenceDocumentReferenceResolver().resolve(reference);
if (exists(documentReference, context)) {
return true;
}
// Try as document
if (documentReference.getParent().getParent().getType() == EntityType.SPACE) {
return exists(new DocumentReference(documentReference.getParent().getName(),
documentReference.getParent().getParent(), documentReference.getParameters()), context);
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: exists
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
|
exists
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
71a6d0bb6f8ab718fcfaae0e9b8c16c2d69cd4bb
| 0
|
Analyze the following code function for security vulnerabilities
|
private void removeUserNow() {
if (mRemovingUserId == UserHandle.myUserId()) {
removeThisUser();
} else {
new Thread() {
public void run() {
synchronized (mUserLock) {
mUserManager.removeUser(mRemovingUserId);
mHandler.sendEmptyMessage(MESSAGE_UPDATE_LIST);
}
}
}.start();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeUserNow
File: src/com/android/settings/users/UserSettings.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3889
|
HIGH
| 7.2
|
android
|
removeUserNow
|
src/com/android/settings/users/UserSettings.java
|
bd5d5176c74021e8cf4970f93f273ba3023c3d72
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void shutdown() {
try {
sendShutdown();
channel.close();
} finally {
server.getClientConnectionManager().disconnect(connection.id);
if (OLogManager.instance().isDebugEnabled())
OLogManager.instance().debug(this, "Connection closed");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shutdown
File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
Repository: orientechnologies/orientdb
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2015-2912
|
MEDIUM
| 6.8
|
orientechnologies/orientdb
|
shutdown
|
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
|
d5a45e608ba8764fd817c1bdd7cf966564e828e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isTopologyRecoveryEnabled() {
return topologyRecovery;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isTopologyRecoveryEnabled
File: src/main/java/com/rabbitmq/client/ConnectionFactory.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
isTopologyRecoveryEnabled
|
src/main/java/com/rabbitmq/client/ConnectionFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
List<Rect> getSystemGestureExclusion() {
return mExclusionRects;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSystemGestureExclusion
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
|
getSystemGestureExclusion
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getRequestURL() throws XWikiException
{
return getXWikiContext().getURLFactory().getRequestURL(getXWikiContext()).toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequestURL
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
getRequestURL
|
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
|
public void setUseDesktopUserAgent(boolean useDesktop, boolean reloadOnChange) {
if (mContentViewCore != null) {
mContentViewCore.setUseDesktopUserAgent(useDesktop, reloadOnChange);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUseDesktopUserAgent
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
setUseDesktopUserAgent
|
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public double getScale() {
return scale;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getScale
File: src/net/sourceforge/plantuml/ugraphic/UImageSvg.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-1231
|
MEDIUM
| 4.3
|
plantuml
|
getScale
|
src/net/sourceforge/plantuml/ugraphic/UImageSvg.java
|
c9137be051ce98b3e3e27f65f54ec7d9f8886903
| 0
|
Analyze the following code function for security vulnerabilities
|
public static final boolean is64Bit() {
return VMRuntime.getRuntime().is64Bit();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: is64Bit
File: core/java/android/os/Process.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3911
|
HIGH
| 9.3
|
android
|
is64Bit
|
core/java/android/os/Process.java
|
2c7008421cb67f5d89f16911bdbe36f6c35311ad
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getProjection(String query) {
Assert.hasText(query, "Query must not be null or empty!");
Matcher matcher = PROJECTION_CLAUSE.matcher(query);
return matcher.find() ? matcher.group(1) : "";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProjection
File: src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
Repository: spring-projects/spring-data-jpa
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-6652
|
MEDIUM
| 6.8
|
spring-projects/spring-data-jpa
|
getProjection
|
src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
|
b8e7fe
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean isEncrypting() {
return encrypting;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isEncrypting
File: src/main/java/org/conscrypt/OpenSSLCipher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2461
|
HIGH
| 7.6
|
android
|
isEncrypting
|
src/main/java/org/conscrypt/OpenSSLCipher.java
|
1638945d4ed9403790962ec7abed1b7a232a9ff8
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
@RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
conditional = true)
public Set<String> getAllowlistedRestrictedPermissions(@NonNull String packageName,
@PackageManager.PermissionWhitelistFlags int allowlistFlag) {
try {
final List<String> allowlist = mPermissionManager.getAllowlistedRestrictedPermissions(
packageName, allowlistFlag, mContext.getUserId());
if (allowlist == null) {
return Collections.emptySet();
}
return new ArraySet<>(allowlist);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllowlistedRestrictedPermissions
File: core/java/android/permission/PermissionManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
getAllowlistedRestrictedPermissions
|
core/java/android/permission/PermissionManager.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getViewExt(String type) {
if ("freemarker".equals(type)) {
return ".ftl";
} else {
return ".jsp";
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getViewExt
File: common/src/main/java/com/zrlog/util/ZrLogUtil.java
Repository: 94fzb/zrlog
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-16643
|
LOW
| 3.5
|
94fzb/zrlog
|
getViewExt
|
common/src/main/java/com/zrlog/util/ZrLogUtil.java
|
4a91c83af669e31a22297c14f089d8911d353fa1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public SSLSessionInfo getSslSessionInfo() {
return sslSessionInfo;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSslSessionInfo
File: servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2019-10184
|
MEDIUM
| 5
|
undertow-io/undertow
|
getSslSessionInfo
|
servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
|
d2715e3afa13f50deaa19643676816ce391551e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@PipelineProperty(description = "The XML fragment wrapper that should be used to wrap the input XML.")
@PipelinePropertyDocRef(types=TextConverter.ENTITY_TYPE)
public void setTextConverter(final DocRef textConverterRef) {
this.textConverterRef = textConverterRef;
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2018-1000651
- Severity: HIGH
- CVSS Score: 7.5
Description: gh-813 Turn on secure processing feature for XML parsers etc
Function: setTextConverter
File: stroom-pipeline/src/main/java/stroom/xml/converter/xmlfragment/XMLFragmentParser.java
Repository: gchq/stroom
Fixed Code:
@PipelineProperty(description = "The XML fragment wrapper that should be used to wrap the input XML.")
@PipelinePropertyDocRef(types = TextConverter.ENTITY_TYPE)
public void setTextConverter(final DocRef textConverterRef) {
this.textConverterRef = textConverterRef;
}
|
[
"CWE-611"
] |
CVE-2018-1000651
|
HIGH
| 7.5
|
gchq/stroom
|
setTextConverter
|
stroom-pipeline/src/main/java/stroom/xml/converter/xmlfragment/XMLFragmentParser.java
|
ba30ffd415bd7d32ee40ba4b04035267ce80b499
| 1
|
Analyze the following code function for security vulnerabilities
|
public final void publishContentProviders(IApplicationThread caller,
List<ContentProviderHolder> providers) {
if (providers == null) {
return;
}
enforceNotIsolatedCaller("publishContentProviders");
synchronized (this) {
final ProcessRecord r = getRecordForAppLocked(caller);
if (DEBUG_MU)
Slog.v(TAG_MU, "ProcessRecord uid = " + r.uid);
if (r == null) {
throw new SecurityException(
"Unable to find app for caller " + caller
+ " (pid=" + Binder.getCallingPid()
+ ") when publishing content providers");
}
final long origId = Binder.clearCallingIdentity();
final int N = providers.size();
for (int i=0; i<N; i++) {
ContentProviderHolder src = providers.get(i);
if (src == null || src.info == null || src.provider == null) {
continue;
}
ContentProviderRecord dst = r.pubProviders.get(src.info.name);
if (DEBUG_MU)
Slog.v(TAG_MU, "ContentProviderRecord uid = " + dst.uid);
if (dst != null) {
ComponentName comp = new ComponentName(dst.info.packageName, dst.info.name);
mProviderMap.putProviderByClass(comp, dst);
String names[] = dst.info.authority.split(";");
for (int j = 0; j < names.length; j++) {
mProviderMap.putProviderByName(names[j], dst);
}
int NL = mLaunchingProviders.size();
int j;
for (j=0; j<NL; j++) {
if (mLaunchingProviders.get(j) == dst) {
mLaunchingProviders.remove(j);
j--;
NL--;
}
}
synchronized (dst) {
dst.provider = src.provider;
dst.proc = r;
dst.notifyAll();
}
updateOomAdjLocked(r);
}
}
Binder.restoreCallingIdentity(origId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: publishContentProviders
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
|
publishContentProviders
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void getEntryBatchSize(CompletableFuture<Integer> batchSizeFuture, PersistentTopic topic,
MessageIdImpl messageId, int batchIndex) {
if (batchIndex >= 0) {
try {
ManagedLedgerImpl ledger = (ManagedLedgerImpl) topic.getManagedLedger();
ledger.asyncReadEntry(new PositionImpl(messageId.getLedgerId(),
messageId.getEntryId()), new AsyncCallbacks.ReadEntryCallback() {
@Override
public void readEntryFailed(ManagedLedgerException exception, Object ctx) {
// Since we can't read the message from the storage layer,
// it might be an already delete message ID or an invalid message ID
// We should fall back to non batch index seek.
batchSizeFuture.complete(0);
}
@Override
public void readEntryComplete(Entry entry, Object ctx) {
try {
try {
if (entry == null) {
batchSizeFuture.complete(0);
} else {
MessageMetadata metadata =
Commands.parseMessageMetadata(entry.getDataBuffer());
batchSizeFuture.complete(metadata.getNumMessagesInBatch());
}
} catch (Exception e) {
batchSizeFuture.completeExceptionally(new RestException(e));
}
} finally {
if (entry != null) {
entry.release();
}
}
}
}, null);
} catch (NullPointerException npe) {
batchSizeFuture.completeExceptionally(new RestException(Status.NOT_FOUND, "Message not found"));
} catch (Exception exception) {
log.error("[{}] Failed to get message with ledgerId {} entryId {} from {}",
clientAppId(), messageId.getLedgerId(), messageId.getEntryId(), topicName, exception);
batchSizeFuture.completeExceptionally(new RestException(exception));
}
} else {
batchSizeFuture.complete(0);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEntryBatchSize
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
|
getEntryBatchSize
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
@JsonProperty("SubjectDN")
public String getSubjectDN() {
return subjectDN;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSubjectDN
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
|
getSubjectDN
|
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public static byte[] getStreamBytesRaw(PRStream stream, RandomAccessFileOrArray file) throws IOException {
PdfReader reader = stream.getReader();
byte b[];
if (stream.getOffset() < 0)
b = stream.getBytes();
else {
b = new byte[stream.getLength()];
file.seek(stream.getOffset());
file.readFully(b);
PdfEncryption decrypt = reader.getDecrypt();
if (decrypt != null) {
PdfObject filter = getPdfObjectRelease(stream.get(PdfName.FILTER));
ArrayList filters = new ArrayList();
if (filter != null) {
if (filter.isName())
filters.add(filter);
else if (filter.isArray())
filters = ((PdfArray)filter).getArrayList();
}
boolean skip = false;
for (int k = 0; k < filters.size(); ++k) {
PdfObject obj = getPdfObjectRelease((PdfObject)filters.get(k));
if (obj != null && obj.toString().equals("/Crypt")) {
skip = true;
break;
}
}
if (!skip) {
decrypt.setHashKey(stream.getObjNum(), stream.getObjGen());
b = decrypt.decryptByteArray(b);
}
}
}
return b;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStreamBytesRaw
File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
Repository: pdftk-java/pdftk
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2021-37819
|
HIGH
| 7.5
|
pdftk-java/pdftk
|
getStreamBytesRaw
|
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
|
9b0cbb76c8434a8505f02ada02a94263dcae9247
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean matchParentBounds() {
final Rect overrideBounds = getResolvedOverrideBounds();
if (overrideBounds.isEmpty()) {
return true;
}
// An activity in size compatibility mode may have override bounds which equals to its
// parent bounds, so the exact bounds should also be checked to allow IME window to attach
// to the activity. See {@link DisplayContent#shouldImeAttachedToApp}.
final WindowContainer parent = getParent();
return parent == null || parent.getBounds().equals(overrideBounds);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: matchParentBounds
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
|
matchParentBounds
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public InboxStyle addLine(CharSequence cs) {
mTexts.add(safeCharSequence(cs));
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addLine
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
addLine
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public <T> void join(JoinBy from, JoinBy to, String operation, String joinType,
Class<T> returnedClazz, CQLWrapper cr, boolean setId,
Handler<AsyncResult<Results<T>>> replyHandler){
String filter = "";
if(cr != null){
filter = cr.toString();
}
join(from, to, operation, joinType, filter, returnedClazz, setId, replyHandler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: join
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
|
join
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
private OutputStream getOutput() throws IOException {
if(os == null) {
os = socketInstance.getOutputStream();
}
return os;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOutput
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
|
getOutput
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected OutputStream getFileOutputLocal(String name) throws DirectoryException {
try {
return new FileOutputStream(generatePath(name));
} catch (FileNotFoundException e) {
throw new DirectoryException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFileOutputLocal
File: brut.j.dir/src/main/java/brut/directory/FileDirectory.java
Repository: iBotPeaches/Apktool
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2024-21633
|
HIGH
| 7.8
|
iBotPeaches/Apktool
|
getFileOutputLocal
|
brut.j.dir/src/main/java/brut/directory/FileDirectory.java
|
d348c43b24a9de350ff6e5bd610545a10c1fc712
| 0
|
Analyze the following code function for security vulnerabilities
|
public void handleAtRule(ApplContext ac, String ident, String string) {
style.getWarnings().addWarning(new Warning(cssFouffa.getSourceFile(),
cssFouffa.getLine(),
"at-rule",
2,
new String[]{ident, string},
ac));
//stylesheet.addAtRule(atRule);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleAtRule
File: org/w3c/css/css/StyleSheetParser.java
Repository: w3c/css-validator
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-4070
|
LOW
| 3.5
|
w3c/css-validator
|
handleAtRule
|
org/w3c/css/css/StyleSheetParser.java
|
e5c09a9119167d3064db786d5f00d730b584a53b
| 0
|
Analyze the following code function for security vulnerabilities
|
private XWikiDocument beforeDelete(XWikiDocument doc, XWikiContext context) throws XWikiException
{
XWikiDocument blankDoc = prepareDocumentDelete(doc, context);
ObservationManager om = getObservationManager();
// Inform notification mechanisms that a document is about to be deleted
// Note that for the moment the event being send is a bridge event, as we are still passing around
// an XWikiDocument as source and an XWikiContext as data.
if (om != null) {
CancelableEvent documentEvent = new DocumentDeletingEvent(doc.getDocumentReference());
om.notify(documentEvent, blankDoc, context);
// If the action has been canceled by the user then don't perform any deletion and throw an exception
if (documentEvent.isCanceled()) {
throw new XWikiException(XWikiException.MODULE_XWIKI_STORE,
XWikiException.ERROR_XWIKI_STORE_HIBERNATE_DELETING_DOC,
String.format("An Event Listener has cancelled the document deletion for [%s]. Reason: [%s]",
doc.getDocumentReference(), documentEvent.getReason()));
}
}
return blankDoc;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: beforeDelete
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
|
beforeDelete
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<PermissionInfo> queryPermissionsByGroup(String group, int flags) {
// reader
synchronized (mPackages) {
ArrayList<PermissionInfo> out = new ArrayList<PermissionInfo>(10);
for (BasePermission p : mSettings.mPermissions.values()) {
if (group == null) {
if (p.perm == null || p.perm.info.group == null) {
out.add(generatePermissionInfo(p, flags));
}
} else {
if (p.perm != null && group.equals(p.perm.info.group)) {
out.add(PackageParser.generatePermissionInfo(p.perm, flags));
}
}
}
if (out.size() > 0) {
return out;
}
return mPermissionGroups.containsKey(group) ? out : null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: queryPermissionsByGroup
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
|
queryPermissionsByGroup
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public ClientConfig getClientConfig() {
return clientConfig;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getClientConfig
File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
getClientConfig
|
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getSQL(Insert insert) {
// Insert clause
StringBuilder sql = new StringBuilder();
String insertClause = getInsertStatement(insert);
sql.append(insertClause);
// Table
sql.append(" ").append(getTableSQL(insert));
// Columns
boolean first = true;
sql.append(" (");
for (Column column : insert.getColumns()) {
if (!first) {
sql.append(",");
}
String str = getColumnSQL(column);
sql.append(str);
first = false;
}
sql.append(")");
// Values
first = true;
sql.append(" VALUES (");
for (Object value : insert.getValues()) {
if (!first) {
sql.append(",");
}
String str = getParameterSQL(value);
sql.append(str);
first = false;
}
sql.append(")");
return sql.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSQL
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
|
getSQL
|
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
|
public String toString()
{
return name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: ext/java/nokogiri/Html4SaxParserContext.java
Repository: sparklemotion/nokogiri
The code follows secure coding practices.
|
[
"CWE-241"
] |
CVE-2022-29181
|
MEDIUM
| 6.4
|
sparklemotion/nokogiri
|
toString
|
ext/java/nokogiri/Html4SaxParserContext.java
|
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
| 0
|
Analyze the following code function for security vulnerabilities
|
public OutputStream openFileOutputStream(String file) throws IOException {
file = removeFilePrefix(file);
OutputStream os = null;
try{
os = createFileOuputStream(file);
}catch(FileNotFoundException fne){
//It is impossible to know if a path is considered an external
//storage on the various android's versions.
//So we try to open the path and if failed due to permission we will
//ask for the permission from the user
if(fne.getMessage().contains("Permission denied")){
if(!checkForPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE, "This is required to access the file")){
//The user refused to give access.
return null;
}else{
//The user gave permission try again to access the path
return createFileOuputStream(file);
}
}else{
throw fne;
}
}
return os;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: openFileOutputStream
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
|
openFileOutputStream
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void startLockTaskModeByToken(IBinder token) {
synchronized (this) {
final ActivityRecord r = ActivityRecord.forTokenLocked(token);
if (r == null) {
return;
}
startLockTaskModeLocked(r.getTask(), false /* isSystemCaller */);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startLockTaskModeByToken
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
|
startLockTaskModeByToken
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void serializeAppWidget(XmlSerializer out, Widget widget) throws IOException {
out.startTag(null, "g");
out.attribute(null, "id", Integer.toHexString(widget.appWidgetId));
out.attribute(null, "rid", Integer.toHexString(widget.restoredId));
out.attribute(null, "h", Integer.toHexString(widget.host.tag));
if (widget.provider != null) {
out.attribute(null, "p", Integer.toHexString(widget.provider.tag));
}
if (widget.options != null) {
out.attribute(null, "min_width", Integer.toHexString(widget.options.getInt(
AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH)));
out.attribute(null, "min_height", Integer.toHexString(widget.options.getInt(
AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT)));
out.attribute(null, "max_width", Integer.toHexString(widget.options.getInt(
AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH)));
out.attribute(null, "max_height", Integer.toHexString(widget.options.getInt(
AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT)));
out.attribute(null, "host_category", Integer.toHexString(widget.options.getInt(
AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY)));
}
out.endTag(null, "g");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: serializeAppWidget
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
|
serializeAppWidget
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
private void writeByteDirect(int n) throws TException {
writeByteDirect((byte) n);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeByteDirect
File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
Repository: facebook/fbthrift
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2019-11938
|
MEDIUM
| 5
|
facebook/fbthrift
|
writeByteDirect
|
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
|
08c2d412adb214c40bb03be7587057b25d053030
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isKeyguardLocked(int displayId) {
return mKeyguardController.isKeyguardLocked(displayId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isKeyguardLocked
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
|
isKeyguardLocked
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setJSONContextClient(JSONContext.Client jsonContext) {
_jsonContext = jsonContext;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setJSONContextClient
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
|
setJSONContextClient
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
IIntentSender getIntentSenderLocked(int type, String packageName, String featureId,
int callingUid, int userId, IBinder token, String resultWho, int requestCode,
Intent[] intents, String[] resolvedTypes, int flags, Bundle bOptions) {
ActivityRecord activity = null;
if (type == ActivityManager.INTENT_SENDER_ACTIVITY_RESULT) {
activity = ActivityRecord.isInRootTaskLocked(token);
if (activity == null) {
Slog.w(TAG, "Failed createPendingResult: activity " + token
+ " not in any root task");
return null;
}
if (activity.finishing) {
Slog.w(TAG, "Failed createPendingResult: activity " + activity + " is finishing");
return null;
}
}
final PendingIntentRecord rec = mPendingIntentController.getIntentSender(type, packageName,
featureId, callingUid, userId, token, resultWho, requestCode, intents,
resolvedTypes, flags, bOptions);
final boolean noCreate = (flags & PendingIntent.FLAG_NO_CREATE) != 0;
if (noCreate) {
return rec;
}
if (type == ActivityManager.INTENT_SENDER_ACTIVITY_RESULT) {
if (activity.pendingResults == null) {
activity.pendingResults = new HashSet<>();
}
activity.pendingResults.add(rec.ref);
}
return rec;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIntentSenderLocked
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
|
getIntentSenderLocked
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
CompatibilityInfo compatibilityInfoForPackage(ApplicationInfo ai) {
return mAtmInternal.compatibilityInfoForPackage(ai);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: compatibilityInfoForPackage
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
|
compatibilityInfoForPackage
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getShutdownTimeout() {
return shutdownTimeout;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getShutdownTimeout
File: src/main/java/com/rabbitmq/client/ConnectionFactory.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
getShutdownTimeout
|
src/main/java/com/rabbitmq/client/ConnectionFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void requestNotificationUpdate() {
updateNotifications();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestNotificationUpdate
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
requestNotificationUpdate
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void unzip(String zipFilePath, String targetPath, boolean overwrite) throws IOException {
ZipFile zipFile = new ZipFile(zipFilePath);
Enumeration<? extends ZipEntry> entryEnum = zipFile.getEntries();
if (null != entryEnum) {
while (entryEnum.hasMoreElements()) {
ZipEntry zipEntry = entryEnum.nextElement();
if (zipEntry.isDirectory()) {
File dir = new File(targetPath + File.separator + zipEntry.getName());
dir.mkdirs();
} else {
File targetFile = new File(targetPath + File.separator + zipEntry.getName());
if (!targetFile.exists() || overwrite) {
targetFile.getParentFile().mkdirs();
write(zipFile.getInputStream(zipEntry), new FileOutputStream(targetFile));
}
}
}
}
zipFile.close();
}
|
Vulnerability Classification:
- CWE: CWE-434
- CVE: CVE-2018-12914
- Severity: HIGH
- CVSS Score: 7.5
Description: https://github.com/sanluan/PublicCMS/issues/13 Unsafe Unzip bug fix
Function: unzip
File: publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/ZipUtils.java
Repository: sanluan/PublicCMS
Fixed Code:
public static void unzip(String zipFilePath, String targetPath, boolean overwrite) throws IOException {
ZipFile zipFile = new ZipFile(zipFilePath);
Enumeration<? extends ZipEntry> entryEnum = zipFile.getEntries();
if (null != entryEnum) {
while (entryEnum.hasMoreElements()) {
ZipEntry zipEntry = entryEnum.nextElement();
String filePath = zipEntry.getName();
if (filePath.contains("..")) {
filePath = filePath.replace("..", BLANK);
}
if (zipEntry.isDirectory()) {
File dir = new File(targetPath + File.separator + filePath);
dir.mkdirs();
} else {
File targetFile = new File(targetPath + File.separator + filePath);
if (!targetFile.exists() || overwrite) {
targetFile.getParentFile().mkdirs();
write(zipFile.getInputStream(zipEntry), new FileOutputStream(targetFile));
}
}
}
}
zipFile.close();
}
|
[
"CWE-434"
] |
CVE-2018-12914
|
HIGH
| 7.5
|
sanluan/PublicCMS
|
unzip
|
publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/ZipUtils.java
|
c19fe66378c75725f3e3a380a6cb9f8b8a7dcb71
| 1
|
Analyze the following code function for security vulnerabilities
|
public String getFullName()
{
return this.deletedDoc.getFullName();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFullName
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/DeletedDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-29208
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getFullName
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/DeletedDocument.java
|
d9e947559077e947315bf700c5703dfc7dd8a8d7
| 0
|
Analyze the following code function for security vulnerabilities
|
public S3PluginActifactPullRequestDto createS3PluginActifactPullRequest(S3PluginActifactDto pullRequestDto) {
if (pullRequestDto == null) {
throw new WecubeCoreException("3095", "Illegal argument.");
}
if (StringUtils.isBlank(pullRequestDto.getKeyName())) {
throw new WecubeCoreException("3096", "Key name cannot be blank.");
}
// get system variables
String releaseFileUrl = getGlobalSystemVariableByName(SYS_VAR_PUBLIC_PLUGIN_ARTIFACTS_RELEASE_URL);
if (org.apache.commons.lang3.StringUtils.isBlank(releaseFileUrl)) {
throw new WecubeCoreException("3097", "The remote plugin artifacts release file is not properly provided.");
}
PluginArtifactPullReq entity = new PluginArtifactPullReq();
entity.setId(LocalIdGenerator.generateId());
entity.setBucketName(null);
entity.setKeyName(pullRequestDto.getKeyName());
entity.setRev(0);
entity.setState(PluginArtifactPullReq.STATE_IN_PROGRESS);
entity.setCreatedTime(new Date());
entity.setCreatedBy(AuthenticationContextHolder.getCurrentUsername());
pluginArtifactPullReqMapper.insert(entity);
PluginArtifactPullContext ctx = new PluginArtifactPullContext();
ctx.setAccessKey(null);
ctx.setBucketName(null);
ctx.setKeyName(pullRequestDto.getKeyName());
ctx.setRemoteEndpoint(releaseFileUrl);
ctx.setSecretKey(null);
ctx.setRequestId(entity.getId());
ctx.setEntity(entity);
pluginArtifactOperationExecutor.pullPluginArtifact(ctx);
return buildS3PluginActifactPullRequestDto(entity);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createS3PluginActifactPullRequest
File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
Repository: WeBankPartners/wecube-platform
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-45746
|
MEDIUM
| 5
|
WeBankPartners/wecube-platform
|
createS3PluginActifactPullRequest
|
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
|
1164dae43c505f8a0233cc049b2689d6ca6d0c37
| 0
|
Analyze the following code function for security vulnerabilities
|
private ConsumerBrokerExchange addConsumerBrokerExchange(ConsumerId id) {
ConsumerBrokerExchange result = consumerExchanges.get(id);
if (result == null) {
synchronized (consumerExchanges) {
result = new ConsumerBrokerExchange();
TransportConnectionState state = lookupConnectionState(id);
context = state.getContext();
result.setConnectionContext(context);
SessionState ss = state.getSessionState(id.getParentId());
if (ss != null) {
ConsumerState cs = ss.getConsumerState(id);
if (cs != null) {
ConsumerInfo info = cs.getInfo();
if (info != null) {
if (info.getDestination() != null && info.getDestination().isPattern()) {
result.setWildcard(true);
}
}
}
}
consumerExchanges.put(id, result);
}
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addConsumerBrokerExchange
File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
Repository: apache/activemq
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-3576
|
MEDIUM
| 5
|
apache/activemq
|
addConsumerBrokerExchange
|
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
|
00921f2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected final Object clone() {
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clone
File: src/main/java/org/json/JSONObject.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-5072
|
HIGH
| 7.5
|
stleary/JSON-java
|
clone
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setClassLoader(ClassLoader classLoader) {
classLoaderReference.setReference(classLoader);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setClassLoader
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
|
setClassLoader
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean setFocusedStack(ActivityRecord r, String reason) {
if (r == null) {
// Not sure what you are trying to do, but it is not going to work...
return false;
}
final TaskRecord task = r.task;
if (task == null || task.stack == null) {
Slog.w(TAG, "Can't set focus stack for r=" + r + " task=" + task);
return false;
}
task.stack.moveToFront(reason);
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setFocusedStack
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
|
setFocusedStack
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
private void schedulePersistUriGrants() {
if (!mHandler.hasMessages(PERSIST_URI_GRANTS_MSG)) {
mHandler.sendMessageDelayed(mHandler.obtainMessage(PERSIST_URI_GRANTS_MSG),
10 * DateUtils.SECOND_IN_MILLIS);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: schedulePersistUriGrants
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
|
schedulePersistUriGrants
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<String> getFollows(String scenarioId) {
List<String> result = new ArrayList<>();
if (StringUtils.isBlank(scenarioId)) {
return result;
}
ApiScenarioFollowExample example = new ApiScenarioFollowExample();
example.createCriteria().andScenarioIdEqualTo(scenarioId);
List<ApiScenarioFollow> follows = apiScenarioFollowMapper.selectByExample(example);
return follows.stream().map(ApiScenarioFollow::getFollowId).distinct().collect(Collectors.toList());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFollows
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2021-45789
|
MEDIUM
| 6.5
|
metersphere
|
getFollows
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onServiceDisconnected(ComponentName name) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onServiceDisconnected
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
|
onServiceDisconnected
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public <T> PageSerializable<T> toPageSerializable(Function<E, T> function) {
List<T> list = new ArrayList<T>(this.size());
for (E e : this) {
list.add(function.apply(e));
}
PageSerializable<T> pageSerializable = new PageSerializable<T>(list);
pageSerializable.setTotal(this.getTotal());
return pageSerializable;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toPageSerializable
File: src/main/java/com/github/pagehelper/Page.java
Repository: pagehelper/Mybatis-PageHelper
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-28111
|
HIGH
| 7.5
|
pagehelper/Mybatis-PageHelper
|
toPageSerializable
|
src/main/java/com/github/pagehelper/Page.java
|
554a524af2d2b30d09505516adc412468a84d8fa
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void selectStreamParam(TestContext context) {
createNumbers(context, 25, 26, 27)
.selectStream("SELECT i FROM numbers WHERE i IN (?, ?, ?) ORDER BY i",
new JsonArray().add(25).add(27).add(29),
context.asyncAssertSuccess(select -> {
intsAsString(select, context.asyncAssertSuccess(string -> {
context.assertEquals("25, 27", string);
}));
}));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectStreamParam
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
|
selectStreamParam
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean startUserInBackground(final int userId) {
return mUserController.startUser(userId, /* foreground */ false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startUserInBackground
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
|
startUserInBackground
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public ServerBuilder tlsAllowUnsafeCiphers(boolean tlsAllowUnsafeCiphers) {
virtualHostTemplate.tlsAllowUnsafeCiphers(tlsAllowUnsafeCiphers);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: tlsAllowUnsafeCiphers
File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
line/armeria
|
tlsAllowUnsafeCiphers
|
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
|
df7f85824a62e997b910b5d6194a3335841065fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public java.lang.Object parseGroovyFromString(String script) throws XWikiException
{
if (hasProgrammingRights()) {
return this.xwiki.parseGroovyFromString(script, getXWikiContext());
}
return "groovy_missingrights";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseGroovyFromString
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
|
parseGroovyFromString
|
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
|
private boolean isBodyParsed() {
return getStartLineNumber() != -1 && getEndLineNumber() == -1;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isBodyParsed
File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
Repository: HtmlUnit/htmlunit
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-2798
|
HIGH
| 7.5
|
HtmlUnit/htmlunit
|
isBodyParsed
|
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
|
940dc7fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void mapQueryCachePredicateConfigXmlGenerator(XmlGenerator gen,
QueryCacheConfig queryCacheConfig) {
PredicateConfig predicateConfig = queryCacheConfig.getPredicateConfig();
String type = predicateConfig.getClassName() != null ? "class-name" : "sql";
String content = predicateConfig.getClassName() != null ? predicateConfig.getClassName() : predicateConfig
.getSql();
gen.node("predicate", content, "type", type);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: mapQueryCachePredicateConfigXmlGenerator
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
mapQueryCachePredicateConfigXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public AdjunctManager getAdjuncts(String dummy) {
return adjuncts;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAdjuncts
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
getAdjuncts
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public WifiConfiguration getSavedNetworkForScanDetailAndCache(ScanDetail scanDetail) {
WifiConfiguration network = getSavedNetworkForScanDetail(scanDetail);
if (network == null) {
return null;
}
saveToScanDetailCacheForNetwork(network, scanDetail);
// Cache DTIM values parsed from the beacon frame Traffic Indication Map (TIM)
// Information Element (IE), into the associated WifiConfigurations. Most of the
// time there is no TIM IE in the scan result (Probe Response instead of Beacon
// Frame), these scanResult DTIM's are negative and ignored.
// Used for metrics collection.
if (scanDetail.getNetworkDetail() != null
&& scanDetail.getNetworkDetail().getDtimInterval() > 0) {
network.dtimInterval = scanDetail.getNetworkDetail().getDtimInterval();
}
return createExternalWifiConfiguration(network, true, Process.WIFI_UID);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSavedNetworkForScanDetailAndCache
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
getSavedNetworkForScanDetailAndCache
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setProviderIndex(long providerIndex) {
mProviderIndex = providerIndex;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setProviderIndex
File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
setProviderIndex
|
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public byte[] get() throws IOException {
if (file == null) {
return EmptyArrays.EMPTY_BYTES;
}
return readFrom(file);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: get
File: codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-378",
"CWE-379"
] |
CVE-2021-21290
|
LOW
| 1.9
|
netty
|
get
|
codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
|
c735357bf29d07856ad171c6611a2e1a0e0000ec
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "2.2M2")
public BaseObject getObject(String className, boolean create, XWikiContext context)
{
return getXObject(
getXClassEntityReferenceResolver().resolve(className, EntityType.DOCUMENT, getDocumentReference()), create,
context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getObject
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2023-29523
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getObject
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
public static final native int[] getPidsForCommands(String[] cmds);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPidsForCommands
File: core/java/android/os/Process.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3911
|
HIGH
| 9.3
|
android
|
getPidsForCommands
|
core/java/android/os/Process.java
|
2c7008421cb67f5d89f16911bdbe36f6c35311ad
| 0
|
Analyze the following code function for security vulnerabilities
|
public static <K, V> ConcurrentMap<K, V> newConcurrentHashMap(int initialCapacity, float loadFactor) {
return new ConcurrentHashMap<K, V>(initialCapacity, loadFactor);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newConcurrentHashMap
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
newConcurrentHashMap
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ResolveInfo getLastChosenActivity(Intent intent, String resolvedType, int flags) {
final int userId = UserHandle.getCallingUserId();
if (DEBUG_PREFERRED) Log.v(TAG, "Querying last chosen activity for " + intent);
List<ResolveInfo> query = queryIntentActivities(intent, resolvedType, flags, userId);
return findPreferredActivity(intent, resolvedType, flags, query, 0,
false, false, false, userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLastChosenActivity
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
|
getLastChosenActivity
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public Map<String, Authentication> getAuthentications() {
return authentications;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAuthentications
File: samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
getAuthentications
|
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void replace(int start, int end, String s) {
elide(start, end);
sanitizedJson.append(s);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: replace
File: src/main/java/com/google/json/JsonSanitizer.java
Repository: OWASP/json-sanitizer
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-13973
|
MEDIUM
| 4.3
|
OWASP/json-sanitizer
|
replace
|
src/main/java/com/google/json/JsonSanitizer.java
|
53ceaac3e0a10e86d512ce96a0056578f2d1978f
| 0
|
Analyze the following code function for security vulnerabilities
|
void systemPropertiesSet(String key, String value) {
SystemProperties.set(key, value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: systemPropertiesSet
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
systemPropertiesSet
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public void updateAsciiStream(@Positive int columnIndex,
@Nullable InputStream inputStream) throws SQLException {
throw org.postgresql.Driver.notImplemented(this.getClass(),
"updateAsciiStream(int, InputStream)");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateAsciiStream
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
|
updateAsciiStream
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
private void scanDirLI(File dir, int parseFlags, int scanFlags, long currentTime) {
final File[] files = dir.listFiles();
if (ArrayUtils.isEmpty(files)) {
Log.d(TAG, "No files in app dir " + dir);
return;
}
if (DEBUG_PACKAGE_SCANNING) {
Log.d(TAG, "Scanning app dir " + dir + " scanFlags=" + scanFlags
+ " flags=0x" + Integer.toHexString(parseFlags));
}
for (File file : files) {
final boolean isPackage = (isApkFile(file) || file.isDirectory())
&& !PackageInstallerService.isStageName(file.getName());
if (!isPackage) {
// Ignore entries which are not packages
continue;
}
try {
scanPackageLI(file, parseFlags | PackageParser.PARSE_MUST_BE_APK,
scanFlags, currentTime, null);
} catch (PackageManagerException e) {
Slog.w(TAG, "Failed to parse " + file + ": " + e.getMessage());
// Delete invalid userdata apps
if ((parseFlags & PackageParser.PARSE_IS_SYSTEM) == 0 &&
e.error == PackageManager.INSTALL_FAILED_INVALID_APK) {
logCriticalInfo(Log.WARN, "Deleting invalid package at " + file);
if (file.isDirectory()) {
mInstaller.rmPackageDir(file.getAbsolutePath());
} else {
file.delete();
}
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scanDirLI
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
|
scanDirLI
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public BaseObject addObjectFromRequest(String className, XWikiContext context) throws XWikiException
{
return addObjectFromRequest(className, "", 0, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addObjectFromRequest
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
addObjectFromRequest
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
private void validateAttachments(final Attachable attachable) throws GameParseException {
for (final IAttachment a : attachable.getAttachments().values()) {
a.validate(data);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateAttachments
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000546
|
MEDIUM
| 6.8
|
triplea-game/triplea
|
validateAttachments
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getColumnCastSQL(Column column) {
String columnSQL = getColumnSQL(column);
return "CAST(" + columnSQL + " AS VARCHAR)";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getColumnCastSQL
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
|
getColumnCastSQL
|
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
|
public Builder setAllowSslConnectionPool(boolean allowSslConnectionPool) {
this.allowSslConnectionPool = allowSslConnectionPool;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAllowSslConnectionPool
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
|
setAllowSslConnectionPool
|
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
public long getLongValue(DocumentReference classReference, String fieldName)
{
BaseObject obj = getXObject(classReference, 0);
if (obj == null) {
return 0;
}
return obj.getLongValue(fieldName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLongValue
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getLongValue
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void startDocument() throws SAXException {
startBuffer();
super.startDocument();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startDocument
File: stroom-pipeline/src/test/java/stroom/util/UniqueXMLEvents.java
Repository: gchq/stroom
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000651
|
HIGH
| 7.5
|
gchq/stroom
|
startDocument
|
stroom-pipeline/src/test/java/stroom/util/UniqueXMLEvents.java
|
ba30ffd415bd7d32ee40ba4b04035267ce80b499
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getRenderedContent() throws XWikiException
{
return this.doc.getRenderedContent(getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRenderedContent
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
getRenderedContent
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public void setPreloadBlobFromInputStream(Boolean thePreloadBlobFromInputStream) {
// ignore
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPreloadBlobFromInputStream
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
|
setPreloadBlobFromInputStream
|
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 ParaObject checkAuth(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
Profile authUser = null;
String jwt = HttpUtils.getStateParam(CONF.authCookie(), req);
if (isApiRequest(req)) {
return checkApiAuth(req);
} else if (jwt != null && !StringUtils.endsWithAny(req.getRequestURI(),
".js", ".css", ".svg", ".png", ".jpg", ".ico", ".gif", ".woff2", ".woff", "people/avatar")) {
User u = pc.me(jwt);
if (u != null && isEmailDomainApproved(u.getEmail())) {
authUser = getOrCreateProfile(u, req);
authUser.setUser(u);
authUser.setOriginalPicture(u.getPicture());
boolean updatedRank = promoteOrDemoteUser(authUser, u);
boolean updatedProfile = updateProfilePictureAndName(authUser, u);
if (updatedRank || updatedProfile) {
authUser.update();
}
} else {
clearSession(req, res);
logger.info("Invalid JWT found in cookie {}.", CONF.authCookie());
res.sendRedirect(CONF.serverUrl() + CONF.serverContextPath() + SIGNINLINK + "?code=3&error=true");
return null;
}
}
return authUser;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkAuth
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
checkAuth
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
public Node getSingleNode() {
// Drop the STREAM-START event.
parser.getEvent();
// Compose a document if the stream is not empty.
Node document = null;
if (!parser.checkEvent(Event.ID.StreamEnd)) {
document = getNode();
}
// Ensure that the stream contains no more documents.
if (!parser.checkEvent(Event.ID.StreamEnd)) {
Event event = parser.getEvent();
Mark contextMark = document != null ? document.getStartMark(): null;
throw new ComposerException("expected a single document in the stream",
contextMark, "but found another document", event.getStartMark());
}
// Drop the STREAM-END event.
parser.getEvent();
return document;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSingleNode
File: src/main/java/org/yaml/snakeyaml/composer/Composer.java
Repository: snakeyaml
The code follows secure coding practices.
|
[
"CWE-776"
] |
CVE-2022-25857
|
HIGH
| 7.5
|
snakeyaml
|
getSingleNode
|
src/main/java/org/yaml/snakeyaml/composer/Composer.java
|
fc300780da21f4bb92c148bc90257201220cf174
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void writeAuthTokenIntoCacheLocked(UserAccounts accounts,
Account account, String key, String value) {
Map<String, String> authTokensForAccount = accounts.authTokenCache.get(account);
if (authTokensForAccount == null) {
authTokensForAccount = accounts.accountsDb.findAuthTokensByAccount(account);
accounts.authTokenCache.put(account, authTokensForAccount);
}
if (value == null) {
authTokensForAccount.remove(key);
} else {
authTokensForAccount.put(key, value);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeAuthTokenIntoCacheLocked
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
|
writeAuthTokenIntoCacheLocked
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<Cliente> buscarFuncionarioNome(String nome) throws SQLException, ClassNotFoundException {
Connection con = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
con = ConnectionFactory.getConnection();
stmt = con.prepareStatement(stmtBuscarNome + "'%" + nome + "%' and (perfil = 2 or perfil = 3) and inativo=false order by nome");
rs = stmt.executeQuery();
return montaListaClientes(rs);
} catch (SQLException e) {
throw new RuntimeException(e);
} finally {
try {
rs.close();
} catch (Exception ex) {
System.out.println("Erro ao fechar result set.Erro: " + ex.getMessage());
}
try {
stmt.close();
} catch (SQLException ex) {
System.out.println("Erro ao fechar statement. Ex = " + ex.getMessage());
}
try {
con.close();
} catch (SQLException ex) {
System.out.println("Erro ao fechar a conexao. Ex = " + ex.getMessage());
}
}
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2015-10061
- Severity: MEDIUM
- CVSS Score: 5.2
Description: ClienteDAO - alterados statements para utilizar o metodo setString do PreparedStatement para evitar SQL Injection
- alterados statements para utilizar ilike ao inves de like para pesquisar sem case sensitivity
BancoDeDados - colocado ponto e virgula apos todas as queries.
Function: buscarFuncionarioNome
File: src/java/br/com/magazine/dao/ClienteDAO.java
Repository: evandro-machado/Trabalho-Web2
Fixed Code:
public List<Cliente> buscarFuncionarioNome(String nome) throws SQLException, ClassNotFoundException {
Connection con = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
con = ConnectionFactory.getConnection();
nome = "%"+nome+"%";
stmt = con.prepareStatement(stmtBuscarNomeFuncionario);
stmt.setString(1,nome);
rs = stmt.executeQuery();
return montaListaClientes(rs);
} catch (SQLException e) {
throw new RuntimeException(e);
} finally {
try {
rs.close();
} catch (Exception ex) {
System.out.println("Erro ao fechar result set.Erro: " + ex.getMessage());
}
try {
stmt.close();
} catch (SQLException ex) {
System.out.println("Erro ao fechar statement. Ex = " + ex.getMessage());
}
try {
con.close();
} catch (SQLException ex) {
System.out.println("Erro ao fechar a conexao. Ex = " + ex.getMessage());
}
}
}
|
[
"CWE-89"
] |
CVE-2015-10061
|
MEDIUM
| 5.2
|
evandro-machado/Trabalho-Web2
|
buscarFuncionarioNome
|
src/java/br/com/magazine/dao/ClienteDAO.java
|
f59ac954625d0a4f6d34f069a2e26686a7a20aeb
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setInterruptionFilter(String pkg, int filter) throws RemoteException {
enforcePolicyAccess(pkg, "setInterruptionFilter");
final int zen = NotificationManager.zenModeFromInterruptionFilter(filter, -1);
if (zen == -1) throw new IllegalArgumentException("Invalid filter: " + filter);
final long identity = Binder.clearCallingIdentity();
try {
mZenModeHelper.setManualZenMode(zen, null, "setInterruptionFilter");
} finally {
Binder.restoreCallingIdentity(identity);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setInterruptionFilter
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
|
setInterruptionFilter
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
private void cleanUpOldUsers() {
// This is needed in case the broadcast {@link Intent.ACTION_USER_REMOVED} was not handled
// before reboot
Set<Integer> usersWithProfileOwners;
Set<Integer> usersWithData;
synchronized (getLockObject()) {
usersWithProfileOwners = mOwners.getProfileOwnerKeys();
usersWithData = new ArraySet<>();
for (int i = 0; i < mUserData.size(); i++) {
usersWithData.add(mUserData.keyAt(i));
}
}
List<UserInfo> allUsers = mUserManager.getUsers();
Set<Integer> deletedUsers = new ArraySet<>();
deletedUsers.addAll(usersWithProfileOwners);
deletedUsers.addAll(usersWithData);
for (UserInfo userInfo : allUsers) {
deletedUsers.remove(userInfo.id);
}
for (Integer userId : deletedUsers) {
removeUserData(userId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cleanUpOldUsers
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
cleanUpOldUsers
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isKeyguardHostWindow(WindowManager.LayoutParams attrs) {
return attrs.type == TYPE_STATUS_BAR;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isKeyguardHostWindow
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
isKeyguardHostWindow
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public DynamicForm withGlobalError(final String error) {
return withGlobalError(error, new ArrayList<>());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: withGlobalError
File: web/play-java-forms/src/main/java/play/data/DynamicForm.java
Repository: playframework
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-31018
|
MEDIUM
| 5
|
playframework
|
withGlobalError
|
web/play-java-forms/src/main/java/play/data/DynamicForm.java
|
15393b736df939e35e275af2347155f296c684f2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Iterable<File> successors(File file) {
return fileTreeChildren(file);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: successors
File: android/guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2020-8908
|
LOW
| 2.1
|
google/guava
|
successors
|
android/guava/src/com/google/common/io/Files.java
|
fec0dbc4634006a6162cfd4d0d09c962073ddf40
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setCriteriaService(XWikiCriteriaService criteriaService)
{
this.criteriaService = criteriaService;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCriteriaService
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
|
setCriteriaService
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public TranslationBundle getBundle(String bundleId) throws TranslationBundleDoesNotExistsException
{
String roleHint = ID_PREFIX + bundleId;
if (this.componentManagerProvider.get().hasComponent(TranslationBundle.class, roleHint)) {
try {
return this.componentManagerProvider.get().getInstance(TranslationBundle.class, roleHint);
} catch (ComponentLookupException e) {
this.logger.debug("Failed to lookup component [{}] with hint [{}].", TranslationBundle.class, bundleId,
e);
}
}
return getOnDemandDocumentBundle(this.currentResolver.resolve(bundleId));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBundle
File: xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/src/main/java/org/xwiki/localization/wiki/internal/DocumentTranslationBundleFactory.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2023-29510
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getBundle
|
xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/src/main/java/org/xwiki/localization/wiki/internal/DocumentTranslationBundleFactory.java
|
d06ff8a58480abc7f63eb1d4b8b366024d990643
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isJsonMime(String mime) {
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isJsonMime
File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
isJsonMime
|
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public KeyguardAffordanceView getRightIcon() {
return getLayoutDirection() == LAYOUT_DIRECTION_RTL
? mKeyguardBottomArea.getLeftView()
: mKeyguardBottomArea.getRightView();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRightIcon
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
|
getRightIcon
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<Gadget> prepareGadgets(List<BaseObject> objects, Syntax sourceSyntax,
MacroTransformationContext context) throws Exception
{
List<Gadget> gadgets = new ArrayList<>();
// prepare velocity tools to render title
VelocityContext velocityContext = velocityManager.getVelocityContext();
// Use the Transformation id as the name passed to the Velocity Engine. This name is used internally
// by Velocity as a cache index key for caching macros.
String key = context.getTransformationContext().getId();
if (key == null) {
key = "unknown namespace";
}
VelocityEngine velocityEngine = velocityManager.getVelocityEngine();
for (BaseObject xObject : objects) {
if (xObject != null) {
this.progress.startStep(this, "dashboard.progress.prepareGadget", "Prepare gadget [{}:{}]",
xObject.getDocumentReference(), xObject.getNumber());
// get the data about the gadget from the object
// TODO: filter for dashboard name when that field will be in
String title = xObject.getStringValue("title");
String content = xObject.getLargeStringValue("content");
String position = xObject.getStringValue("position");
String id = xObject.getNumber() + "";
// render title with velocity
StringWriter writer = new StringWriter();
// FIXME: the engine has an issue with $ and # as last character. To test and fix if it happens
velocityEngine.evaluate(velocityContext, writer, key, title);
String gadgetTitle = writer.toString();
// parse both the title and content in the syntax of the transformation context
List<Block> titleBlocks =
renderGadgetProperty(gadgetTitle, sourceSyntax, xObject.getDocumentReference(),
xObject.getOwnerDocument(), context);
List<Block> contentBlocks =
renderGadgetProperty(content, sourceSyntax, xObject.getDocumentReference(),
xObject.getOwnerDocument(), context);
// create a gadget will all these and add the gadget to the container of gadgets
Gadget gadget = new Gadget(id, titleBlocks, contentBlocks, position);
gadget.setTitleSource(title);
gadgets.add(gadget);
} else {
this.progress.startStep(this, "dashboard.progress.skipNullGadget", "Null gadget object");
}
this.progress.endStep(this);
}
return gadgets;
}
|
Vulnerability Classification:
- CWE: CWE-94
- CVE: CVE-2021-32621
- Severity: MEDIUM
- CVSS Score: 6.5
Description: XWIKI-17794: Properly interpret velocity in gadget titles
Function: prepareGadgets
File: xwiki-platform-core/xwiki-platform-dashboard/xwiki-platform-dashboard-macro/src/main/java/org/xwiki/rendering/internal/macro/dashboard/DefaultGadgetSource.java
Repository: xwiki/xwiki-platform
Fixed Code:
private List<Gadget> prepareGadgets(List<BaseObject> objects, Syntax sourceSyntax,
MacroTransformationContext context) throws Exception
{
List<Gadget> gadgets = new ArrayList<>();
// prepare velocity tools to render title
VelocityContext velocityContext = velocityManager.getVelocityContext();
// Use the Transformation id as the name passed to the Velocity Engine. This name is used internally
// by Velocity as a cache index key for caching macros.
String key = context.getTransformationContext().getId();
if (key == null) {
key = "unknown namespace";
}
VelocityEngine velocityEngine = velocityManager.getVelocityEngine();
for (BaseObject xObject : objects) {
if (xObject != null) {
this.progress.startStep(this, "dashboard.progress.prepareGadget", "Prepare gadget [{}:{}]",
xObject.getDocumentReference(), xObject.getNumber());
// get the data about the gadget from the object
// TODO: filter for dashboard name when that field will be in
String title = xObject.getStringValue("title");
String content = xObject.getLargeStringValue("content");
String position = xObject.getStringValue("position");
String id = xObject.getNumber() + "";
String gadgetTitle;
XWikiDocument ownerDocument = xObject.getOwnerDocument();
if (this.authorizationManager.hasAccess(Right.SCRIPT, ownerDocument.getAuthorReference(), ownerDocument.getDocumentReference())) {
gadgetTitle =
this.evaluateVelocityTitle(velocityContext, velocityEngine, key, title, ownerDocument);
} else {
gadgetTitle = title;
}
// parse both the title and content in the syntax of the transformation context
List<Block> titleBlocks =
renderGadgetProperty(gadgetTitle, sourceSyntax, xObject.getDocumentReference(),
ownerDocument, context);
List<Block> contentBlocks =
renderGadgetProperty(content, sourceSyntax, xObject.getDocumentReference(),
ownerDocument, context);
// create a gadget will all these and add the gadget to the container of gadgets
Gadget gadget = new Gadget(id, titleBlocks, contentBlocks, position);
gadget.setTitleSource(title);
gadgets.add(gadget);
} else {
this.progress.startStep(this, "dashboard.progress.skipNullGadget", "Null gadget object");
}
this.progress.endStep(this);
}
return gadgets;
}
|
[
"CWE-94"
] |
CVE-2021-32621
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
prepareGadgets
|
xwiki-platform-core/xwiki-platform-dashboard/xwiki-platform-dashboard-macro/src/main/java/org/xwiki/rendering/internal/macro/dashboard/DefaultGadgetSource.java
|
bb7068bd911f91e5511f3cfb03276c7ac81100bc
| 1
|
Analyze the following code function for security vulnerabilities
|
private void startMoveAnimation(int left, int top) {
// If we are an inset provider, all our animations are driven by the inset client.
if (mControllableInsetProvider != null) {
return;
}
ProtoLog.v(WM_DEBUG_ANIM, "Setting move animation on %s", this);
final Point oldPosition = new Point();
final Point newPosition = new Point();
transformFrameToSurfacePosition(mWindowFrames.mLastFrame.left, mWindowFrames.mLastFrame.top,
oldPosition);
transformFrameToSurfacePosition(left, top, newPosition);
final AnimationAdapter adapter = new LocalAnimationAdapter(
new MoveAnimationSpec(oldPosition.x, oldPosition.y, newPosition.x, newPosition.y),
mWmService.mSurfaceAnimationRunner);
startAnimation(getPendingTransaction(), adapter);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startMoveAnimation
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
|
startMoveAnimation
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.