instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
public ApiScenarioDTO getDto(String id) {
ApiScenarioRequest request = new ApiScenarioRequest();
request.setId(id);
List<ApiScenarioDTO> list = extApiScenarioMapper.list(request);
if (CollectionUtils.isNotEmpty(list)) {
return list.get(0);
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDto
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
|
getDto
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String translateQuerySortBy(String sortBy, String originalQuery) {
if(sortBy == null)
return null;
List<RegExMatch> matches = RegEX.find(originalQuery, "structureName:([^\\s)]+)");
List<com.dotmarketing.portlets.structure.model.Field> fields = null;
Structure structure = null;
if(matches.size() > 0) {
String structureName = matches.get(0).getGroups().get(0).getMatch();
fields = FieldsCache.getFieldsByStructureVariableName(structureName);
structure = CacheLocator.getContentTypeCache().getStructureByVelocityVarName(structureName);
} else {
matches = RegEX.find(originalQuery, "structureInode:([^\\s)]+)");
if(matches.size() > 0) {
String structureInode = matches.get(0).getGroups().get(0).getMatch();
fields = FieldsCache.getFieldsByStructureInode(structureInode);
structure = CacheLocator.getContentTypeCache().getStructureByInode(structureInode);
}
}
if(fields == null)
return sortBy;
Map<String, com.dotmarketing.portlets.structure.model.Field> fieldsMap;
try {
fieldsMap = UtilMethods.convertListToHashMap(fields, "getFieldContentlet", String.class);
} catch (Exception e) {
Logger.error(ESContentFactoryImpl.class, e.getMessage(), e);
return sortBy;
}
String[] matcher = { "date", "text", "text_area", "integer", "float", "bool" };
List<RegExMatch> mathes;
String oldField, oldFieldTrim, newField;
for (String match : matcher) {
if (sortBy.contains(match)) {
mathes = RegEX.find(sortBy, match + "([1-9][1-5]?)");
for (RegExMatch regExMatch : mathes) {
oldField = regExMatch.getMatch();
oldFieldTrim = oldField.replaceAll("[,\\s]", "");
if(fieldsMap.get(oldFieldTrim) != null) {
newField = oldField.replace(oldFieldTrim, structure.getVelocityVarName() + "." + fieldsMap.get(oldFieldTrim).getVelocityVarName());
sortBy = sortBy.replace(oldField, newField);
}
}
}
}
return sortBy;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: translateQuerySortBy
File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-2355
|
HIGH
| 7.5
|
dotCMS/core
|
translateQuerySortBy
|
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
|
897f3632d7e471b7a73aabed5b19f6f53d4e5562
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public void readFromTemplate(String template, XWikiContext context) throws XWikiException
{
// Keep the same behavior for backward compatibility
DocumentReference templateDocumentReference = null;
if (StringUtils.isNotEmpty(template)) {
templateDocumentReference = getCurrentMixedDocumentReferenceResolver().resolve(template);
}
readFromTemplate(templateDocumentReference, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readFromTemplate
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
|
readFromTemplate
|
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 static void updateFlippingStrategy(Feature fp, String strategy, String strategyParams) {
if (null != strategy && !strategy.isEmpty()) {
try {
Class<?> strategyClass = Class.forName(strategy);
FlippingStrategy fstrategy = (FlippingStrategy) strategyClass.newInstance();
if (null != strategyParams && !strategyParams.isEmpty()) {
Map<String, String> initParams = new HashMap<String, String>();
String[] params = strategyParams.split(";");
for (String currentP : params) {
String[] cur = currentP.split("=");
if (cur.length < 2) {
throw new IllegalArgumentException("Invalid Syntax : param1=val1,val2;param2=val3,val4");
}
initParams.put(cur[0], cur[1]);
}
fstrategy.init(fp.getUid(), initParams);
}
fp.setFlippingStrategy(fstrategy);
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Cannot find strategy class", e);
} catch (InstantiationException e) {
throw new IllegalArgumentException("Cannot instantiate strategy", e);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Cannot instantiate : no public constructor", e);
}
}
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2022-44262
- Severity: CRITICAL
- CVSS Score: 9.8
Description: fix: Validate FlippingStrategy in various parsers (#624)
Function: updateFlippingStrategy
File: ff4j-web/src/main/java/org/ff4j/web/embedded/ConsoleOperations.java
Repository: ff4j
Fixed Code:
private static void updateFlippingStrategy(Feature fp, String strategy, String strategyParams) {
if (null != strategy && !strategy.isEmpty()) {
try {
Class<?> strategyClass = Class.forName(strategy);
if (!FlippingStrategy.class.isAssignableFrom(strategyClass)) {
throw new IllegalArgumentException("Cannot create flipstrategy <" + strategy + "> invalid type");
}
FlippingStrategy fstrategy = (FlippingStrategy) strategyClass.newInstance();
if (null != strategyParams && !strategyParams.isEmpty()) {
Map<String, String> initParams = new HashMap<String, String>();
String[] params = strategyParams.split(";");
for (String currentP : params) {
String[] cur = currentP.split("=");
if (cur.length < 2) {
throw new IllegalArgumentException("Invalid Syntax : param1=val1,val2;param2=val3,val4");
}
initParams.put(cur[0], cur[1]);
}
fstrategy.init(fp.getUid(), initParams);
}
fp.setFlippingStrategy(fstrategy);
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Cannot find strategy class", e);
} catch (InstantiationException e) {
throw new IllegalArgumentException("Cannot instantiate strategy", e);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Cannot instantiate : no public constructor", e);
}
}
}
|
[
"CWE-Other"
] |
CVE-2022-44262
|
CRITICAL
| 9.8
|
ff4j
|
updateFlippingStrategy
|
ff4j-web/src/main/java/org/ff4j/web/embedded/ConsoleOperations.java
|
991df72725f78adbc413d9b0fbb676201f1882e0
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public ServerHttpResponse addCloseHandler(Runnable onClose) {
this.response.closeHandler(new Handler<Void>() {
@Override
public void handle(Void v) {
onClose.run();
}
});
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addCloseHandler
File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
Repository: quarkusio/quarkus
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-0981
|
MEDIUM
| 6.5
|
quarkusio/quarkus
|
addCloseHandler
|
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
|
96c64fd8f09c02a497e2db366c64dd9196582442
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void specialFilterContentForOnlineReport(String value) {
String specialXssStr = " exec | insert | delete | update | drop | chr | mid | master | truncate | char | declare |user()";
String[] xssArr = specialXssStr.split("\\|");
if (value == null || "".equals(value)) {
return;
}
// 统一转为小写
value = value.toLowerCase();
//SQL注入检测存在绕过风险 https://gitee.com/jeecg/jeecg-boot/issues/I4NZGE
value = value.replaceAll("/\\*.*\\*/","");
for (int i = 0; i < xssArr.length; i++) {
if (value.indexOf(xssArr[i]) > -1 || value.startsWith(xssArr[i].trim())) {
log.error("请注意,存在SQL注入关键词---> {}", xssArr[i]);
log.error("请注意,值可能存在SQL注入风险!---> {}", value);
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
}
if(Pattern.matches(SHOW_TABLES, value) || Pattern.matches(REGULAR_EXPRE_USER, value)){
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
return;
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2022-45206
- Severity: CRITICAL
- CVSS Score: 9.8
Description: sql注入检查更加严格,修复/sys/duplicate/check存在sql注入漏洞 #4129
Function: specialFilterContentForOnlineReport
File: jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java
Repository: jeecgboot/jeecg-boot
Fixed Code:
public static void specialFilterContentForOnlineReport(String value) {
String specialXssStr = " exec |extractvalue|updatexml| insert | delete | update | drop | chr | mid | master | truncate | char | declare |user()";
String[] xssArr = specialXssStr.split("\\|");
if (value == null || "".equals(value)) {
return;
}
// 校验sql注释 不允许有sql注释
checkSqlAnnotation(value);
// 统一转为小写
value = value.toLowerCase();
//SQL注入检测存在绕过风险 https://gitee.com/jeecg/jeecg-boot/issues/I4NZGE
//value = value.replaceAll("/\\*.*\\*/"," ");
for (int i = 0; i < xssArr.length; i++) {
if (value.indexOf(xssArr[i]) > -1 || value.startsWith(xssArr[i].trim())) {
log.error("请注意,存在SQL注入关键词---> {}", xssArr[i]);
log.error("请注意,值可能存在SQL注入风险!---> {}", value);
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
}
if(Pattern.matches(SHOW_TABLES, value) || Pattern.matches(REGULAR_EXPRE_USER, value)){
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
return;
}
|
[
"CWE-89"
] |
CVE-2022-45206
|
CRITICAL
| 9.8
|
jeecgboot/jeecg-boot
|
specialFilterContentForOnlineReport
|
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java
|
f18ced524c9ec13e876bfb74785a1b112cc8b6bb
| 1
|
Analyze the following code function for security vulnerabilities
|
boolean dumpBinderProxiesCounts(PrintWriter pw, SparseIntArray counts, String header) {
if(counts != null) {
pw.println(header);
for (int i = 0; i < counts.size(); i++) {
final int uid = counts.keyAt(i);
final int binderCount = counts.valueAt(i);
pw.print(" UID ");
pw.print(uid);
pw.print(", binder count = ");
pw.print(binderCount);
pw.print(", package(s)= ");
final String[] pkgNames = mContext.getPackageManager().getPackagesForUid(uid);
if (pkgNames != null) {
for (int j = 0; j < pkgNames.length; j++) {
pw.print(pkgNames[j]);
pw.print("; ");
}
} else {
pw.print("NO PACKAGE NAME FOUND");
}
pw.println();
}
pw.println();
return true;
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpBinderProxiesCounts
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
|
dumpBinderProxiesCounts
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) {
if (operation instanceof GetServerInfoOperation) {
if (operation.hashCode() == mWaitingForOpId) {
onGetServerInfoFinish(result);
} // else nothing ; only the last check operation is considered;
// multiple can be started if the user amends a URL quickly
} else if (operation instanceof GetUserInfoRemoteOperation) {
onGetUserNameFinish(result);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onRemoteOperationFinish
File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-248"
] |
CVE-2021-32694
|
MEDIUM
| 4.3
|
nextcloud/android
|
onRemoteOperationFinish
|
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
|
9343bdd85d70625a90e0c952897957a102c2421b
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
public DhcpResultsParcelable syncGetDhcpResultsParcelable() {
synchronized (mDhcpResultsParcelableLock) {
return mDhcpResultsParcelable;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: syncGetDhcpResultsParcelable
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
syncGetDhcpResultsParcelable
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isSmEnabled() {
return smEnabledSyncPoint.wasSuccessful();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSmEnabled
File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
Repository: igniterealtime/Smack
The code follows secure coding practices.
|
[
"CWE-362"
] |
CVE-2016-10027
|
MEDIUM
| 4.3
|
igniterealtime/Smack
|
isSmEnabled
|
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
@SystemApi
public boolean isAutojoinEnabled() {
return mIsAutojoinEnabled;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAutojoinEnabled
File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
isAutojoinEnabled
|
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
public void pokeDrawLock(Session session, IBinder token) {
synchronized (mWindowMap) {
WindowState window = windowForClientLocked(session, token, false);
if (window != null) {
window.pokeDrawLockLw(mDrawLockTimeoutMillis);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pokeDrawLock
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
pokeDrawLock
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
@TestOnly
public void submoduleAdd(String repoUrl, String submoduleNameToPutInGitSubmodules, String folder) {
String[] addSubmoduleWithSameNameArgs = new String[]{"submodule", "add", repoUrl, folder};
String[] changeSubmoduleNameInGitModules = new String[]{"config", "--file", ".gitmodules", "--rename-section", "submodule." + folder, "submodule." + submoduleNameToPutInGitSubmodules};
String[] addGitModules = new String[]{"add", ".gitmodules"};
runOrBomb(gitWd().withArgs(addSubmoduleWithSameNameArgs));
runOrBomb(gitWd().withArgs(changeSubmoduleNameInGitModules));
runOrBomb(gitWd().withArgs(addGitModules));
}
|
Vulnerability Classification:
- CWE: CWE-77
- CVE: CVE-2021-43286
- Severity: MEDIUM
- CVSS Score: 6.5
Description: #000 - Validate URLs provided
- Disallow URLs which are obviously not URLs.
Function: submoduleAdd
File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
Repository: gocd
Fixed Code:
@TestOnly
public void submoduleAdd(String repoUrl, String submoduleNameToPutInGitSubmodules, String folder) {
String[] addSubmoduleWithSameNameArgs = new String[]{"submodule", "add", "--", repoUrl, folder};
String[] changeSubmoduleNameInGitModules = new String[]{"config", "--file", ".gitmodules", "--rename-section", "submodule." + folder, "submodule." + submoduleNameToPutInGitSubmodules};
String[] addGitModules = new String[]{"add", ".gitmodules"};
runOrBomb(gitWd().withArgs(addSubmoduleWithSameNameArgs));
runOrBomb(gitWd().withArgs(changeSubmoduleNameInGitModules));
runOrBomb(gitWd().withArgs(addGitModules));
}
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
submoduleAdd
|
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 1
|
Analyze the following code function for security vulnerabilities
|
@Before
public void setup() throws WebdavException {
when(request.getContentType()).thenReturn("application/xml");
requestPars = new PostRequestPars(request, webdavNsIntf, UUID.randomUUID().toString());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setup
File: src/test/java/org/bedework/webdav/servlet/common/TestPostRequestPars.java
Repository: Bedework/bw-webdav
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-20000
|
MEDIUM
| 5
|
Bedework/bw-webdav
|
setup
|
src/test/java/org/bedework/webdav/servlet/common/TestPostRequestPars.java
|
67283fb8b9609acdb1a8d2e7fefe195b4a261062
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setPassword(String password) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setPassword(password);
return this;
}
}
throw new RuntimeException("No HTTP basic authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPassword
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
|
setPassword
|
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
|
private void startTrackingAppOpsChange(@NonNull String packageName, int uid) {
// The package is already registered.
if (mAppOpsChangedListenerPerApp.containsKey(packageName)) return;
AppOpsChangedListener appOpsChangedListener = new AppOpsChangedListener(packageName, uid);
mAppOps.startWatchingMode(OPSTR_CHANGE_WIFI_STATE, packageName, appOpsChangedListener);
mAppOpsChangedListenerPerApp.put(packageName, appOpsChangedListener);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startTrackingAppOpsChange
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
|
startTrackingAppOpsChange
|
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private String classname(String name) {
if (name.equals(Jooby.class.getName()) || name.equals("org.jooby.Kooby")) {
return SourceProvider.INSTANCE.get()
.map(StackTraceElement::getClassName)
.orElse(name);
}
return name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: classname
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
classname
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void answerJSON(XWikiContext context, int status, Map<String, String> answer) throws XWikiException
{
ObjectMapper mapper = new ObjectMapper();
try {
String jsonAnswerAsString = mapper.writeValueAsString(answer);
context.getResponse().setContentType("application/json");
context.getResponse().setContentLength(jsonAnswerAsString.length());
context.getResponse().setStatus(status);
context.getResponse().setCharacterEncoding(context.getWiki().getEncoding());
context.getResponse().getWriter().print(jsonAnswerAsString);
context.setResponseSent(true);
} catch (IOException e) {
throw new XWikiException("Error while sending JSON answer.", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: answerJSON
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-29208
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
answerJSON
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
|
d9e947559077e947315bf700c5703dfc7dd8a8d7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void executeNSU() throws Exception {
final DeferredGroupException dge = mock(DeferredGroupException.class);
when(dge.getCause()).thenReturn(new NoSuchUniqueName("foo", "metrics"));
when(query_result.configureFromQuery((TSQuery)any(), anyInt()))
.thenReturn(Deferred.fromError(dge));
final HttpQuery query = NettyMocks.getQuery(tsdb,
"/api/query?start=1h-ago&m=sum:sys.cpu.user");
rpc.execute(tsdb, query);
assertEquals(HttpResponseStatus.BAD_REQUEST, query.response().getStatus());
final String json =
query.response().getContent().toString(Charset.forName("UTF-8"));
assertTrue(json.contains("No such name for 'foo': 'metrics'"));
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-25827
- Severity: MEDIUM
- CVSS Score: 6.1
Description: Fix for #2269 and #2267 XSS vulnerability.
Escaping the user supplied input when outputing the HTML for the old BadRequest
HTML handlers should help. Thanks to the reporters.
Fixes CVE-2018-13003.
Function: executeNSU
File: test/tsd/TestQueryRpc.java
Repository: OpenTSDB/opentsdb
Fixed Code:
@Test
public void executeNSU() throws Exception {
final DeferredGroupException dge = mock(DeferredGroupException.class);
when(dge.getCause()).thenReturn(new NoSuchUniqueName("foo", "metrics"));
when(query_result.configureFromQuery((TSQuery)any(), anyInt()))
.thenReturn(Deferred.fromError(dge));
final HttpQuery query = NettyMocks.getQuery(tsdb,
"/api/query?start=1h-ago&m=sum:sys.cpu.user");
rpc.execute(tsdb, query);
assertEquals(HttpResponseStatus.BAD_REQUEST, query.response().getStatus());
final String json =
query.response().getContent().toString(Charset.forName("UTF-8"));
assertTrue(json.contains("No such name for 'foo': 'metrics'"));
}
|
[
"CWE-79"
] |
CVE-2023-25827
|
MEDIUM
| 6.1
|
OpenTSDB/opentsdb
|
executeNSU
|
test/tsd/TestQueryRpc.java
|
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
| 1
|
Analyze the following code function for security vulnerabilities
|
public abstract InputStream getThemeResourceAsStream(UI ui,
String themeName, String resource) throws IOException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getThemeResourceAsStream
File: server/src/main/java/com/vaadin/server/VaadinService.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31403
|
LOW
| 1.9
|
vaadin/framework
|
getThemeResourceAsStream
|
server/src/main/java/com/vaadin/server/VaadinService.java
|
d852126ab6f0c43f937239305bd0e9594834fe34
| 0
|
Analyze the following code function for security vulnerabilities
|
private void doFileRetrieve(HttpSession session, HttpServletRequest request,
HttpServletResponse response) throws IOException {
try {
String userId = null;
// if we want front end access, this validation would need to be altered
if(UtilMethods.isSet(session.getAttribute("USER_ID"))) {
userId = (String) session.getAttribute("USER_ID");
User user = UserLocalManagerUtil.getUserById(userId);
if(!UtilMethods.isSet(user) || !UtilMethods.isSet(user.getUserId())) {
throw new Exception("Could not download File. Invalid User");
}
} else {
throw new Exception("Could not download File. Invalid User");
}
String fieldName = request.getParameter("fieldName");
String fileName = request.getParameter("fileName");
File tempUserFolder = new File(APILocator.getFileAssetAPI().getRealAssetPathTmpBinary() + File.separator + userId + File.separator + fieldName);
File file = new File(tempUserFolder.getAbsolutePath() + File.separator + fileName);
if(!isValidPath(file.getCanonicalPath())) {
throw new Exception("Invalid fileName or Path");
}
if(file.exists()) {
FileInputStream fis = new FileInputStream(file);
byte[] buffer = new byte[1000];
int count = 0;
String mimeType = this.getServletContext().getMimeType(file.getName());
response.setContentType(mimeType);
ServletOutputStream outStream = response.getOutputStream();
while((count = fis.read(buffer)) > 0) {
outStream.write(buffer, 0, count);
}
outStream.flush();
outStream.close();
}
} catch (Exception e) {
sendCompleteResponse(response, e.getMessage());
e.printStackTrace();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doFileRetrieve
File: dotCMS/src/main/java/com/dotmarketing/servlets/AjaxFileUploadServlet.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-434"
] |
CVE-2017-11466
|
HIGH
| 9
|
dotCMS/core
|
doFileRetrieve
|
dotCMS/src/main/java/com/dotmarketing/servlets/AjaxFileUploadServlet.java
|
ab2bb2e00b841d131b8734227f9106e3ac31bb99
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void closeSystemDialogs(String reason) {
mAtmInternal.closeSystemDialogs(reason);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: closeSystemDialogs
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
|
closeSystemDialogs
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void fatalError(SAXParseException ex) throws SAXParseException {
throw new SAXParseException(makeBetterErrorString("Fatal Error", ex),
ex.getPublicId(), ex.getSystemId(), ex.getLineNumber(), ex.getColumnNumber());
// throw new RuntimeException(makeBetterErrorString("Fatal Error", ex));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fatalError
File: src/edu/stanford/nlp/util/XMLUtils.java
Repository: stanfordnlp/CoreNLP
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-0239
|
HIGH
| 7.5
|
stanfordnlp/CoreNLP
|
fatalError
|
src/edu/stanford/nlp/util/XMLUtils.java
|
1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd
| 0
|
Analyze the following code function for security vulnerabilities
|
protected synchronized void deployWatch(File warDir, final File deployTarDir, String virtualHost) {
server.setHost(virtualHost);
final HashSet<String> apps = new HashSet<String>();
warDir.listFiles(new FileFilter() {
public boolean accept(File file) {
if (file.isDirectory() == false) {
String name = file.getName();
if (name.endsWith(DEPLOY_ARCH_EXT))
apps.add(name.substring(0, name.length() - DEPLOY_ARCH_EXT.length()));
}
return false;
}
});
Enumeration se = server.getServlets();
ArrayList<WebAppServlet> markedServlets = new ArrayList<WebAppServlet>(10);
while (se.hasMoreElements()) {
Object servlet = se.nextElement();
if (servlet instanceof WebAppServlet) {
WebAppServlet was = (WebAppServlet) servlet;
String name = was.deployDir.getName();
File war = new File(warDir, name + DEPLOY_ARCH_EXT);
apps.remove(name);
if (war.exists() && war.lastModified() > was.deployDir.lastModified()) {
// deployWar(new File(warDir, was.deployDir.getName() +
// DEPLOY_ARCH_EXT), deployTarDir);
markedServlets.add(was);
}
}
}
for (WebAppServlet was : markedServlets) {
redeploy(warDir, deployTarDir, was, virtualHost);
}
for (String name : apps) {
// remaining not deployed yet apps
try {
if (deployWar(new File(warDir, name + DEPLOY_ARCH_EXT), deployTarDir)) {
WebAppServlet was = WebAppServlet.create(new File(deployTarDir, name), name, server, virtualHost);
attachApp(was, virtualHost);
}
} catch (Throwable t) {
if (t instanceof ThreadDeath)
throw (ThreadDeath) t;
markFailed(deployTarDir, name);
server.log("Unexpected problem in deployment of aplication " + name, t);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deployWatch
File: 1.x/src/rogatkin/web/WarRoller.java
Repository: drogatkin/TJWS2
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-4594
|
CRITICAL
| 9.8
|
drogatkin/TJWS2
|
deployWatch
|
1.x/src/rogatkin/web/WarRoller.java
|
1bac15c496ec54efe21ad7fab4e17633778582fc
| 0
|
Analyze the following code function for security vulnerabilities
|
private void reuseExistingPort(int port) {
getLogger().info("Reusing webpack-dev-server running at {}:{}",
WEBPACK_HOST, port);
// Save running port for next usage
saveRunningDevServerPort();
watchDog.set(null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reuseExistingPort
File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-36321
|
MEDIUM
| 5
|
vaadin/flow
|
reuseExistingPort
|
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
|
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
| 0
|
Analyze the following code function for security vulnerabilities
|
void validateName(K name);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateName
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-436",
"CWE-113"
] |
CVE-2022-41915
|
MEDIUM
| 6.5
|
netty
|
validateName
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
private int jjMoveStringLiteralDfa0_1()
{
switch(curChar)
{
case 33:
jjmatchedKind = 39;
return jjMoveStringLiteralDfa1_1(0x2000000000L);
case 37:
return jjStopAtPos(0, 53);
case 38:
return jjMoveStringLiteralDfa1_1(0x20000000000L);
case 40:
return jjStopAtPos(0, 20);
case 41:
return jjStopAtPos(0, 21);
case 42:
return jjStopAtPos(0, 47);
case 43:
jjmatchedKind = 48;
return jjMoveStringLiteralDfa1_1(0x80000000000000L);
case 44:
return jjStopAtPos(0, 25);
case 45:
jjmatchedKind = 49;
return jjMoveStringLiteralDfa1_1(0x200000000000000L);
case 46:
return jjStartNfaWithStates_1(0, 19, 1);
case 47:
return jjStopAtPos(0, 51);
case 58:
return jjStopAtPos(0, 24);
case 59:
return jjStopAtPos(0, 26);
case 60:
jjmatchedKind = 29;
return jjMoveStringLiteralDfa1_1(0x200000000L);
case 61:
jjmatchedKind = 56;
return jjMoveStringLiteralDfa1_1(0x800000000L);
case 62:
jjmatchedKind = 27;
return jjMoveStringLiteralDfa1_1(0x80000000L);
case 63:
return jjStopAtPos(0, 50);
case 91:
return jjStopAtPos(0, 22);
case 93:
return jjStopAtPos(0, 23);
case 97:
return jjMoveStringLiteralDfa1_1(0x40000000000L);
case 100:
return jjMoveStringLiteralDfa1_1(0x10000000000000L);
case 101:
return jjMoveStringLiteralDfa1_1(0x201000000000L);
case 102:
return jjMoveStringLiteralDfa1_1(0x20000L);
case 103:
return jjMoveStringLiteralDfa1_1(0x110000000L);
case 105:
return jjMoveStringLiteralDfa1_1(0x400000000000L);
case 108:
return jjMoveStringLiteralDfa1_1(0x440000000L);
case 109:
return jjMoveStringLiteralDfa1_1(0x40000000000000L);
case 110:
return jjMoveStringLiteralDfa1_1(0x14000040000L);
case 111:
return jjMoveStringLiteralDfa1_1(0x100000000000L);
case 116:
return jjMoveStringLiteralDfa1_1(0x10000L);
case 123:
return jjStopAtPos(0, 9);
case 124:
return jjMoveStringLiteralDfa1_1(0x80000000000L);
case 125:
return jjStopAtPos(0, 10);
default :
return jjMoveNfa_1(0, 0);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jjMoveStringLiteralDfa0_1
File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
Repository: jakartaee/expression-language
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2021-28170
|
MEDIUM
| 5
|
jakartaee/expression-language
|
jjMoveStringLiteralDfa0_1
|
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
|
b6a3943ac5fba71cbc6719f092e319caa747855b
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_SECURITY_LOGGING, conditional = true)
public void setSecurityLoggingEnabled(@Nullable ComponentName admin, boolean enabled) {
throwIfParentInstance("setSecurityLoggingEnabled");
try {
mService.setSecurityLoggingEnabled(admin, mContext.getPackageName(), enabled);
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSecurityLoggingEnabled
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
setSecurityLoggingEnabled
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private static HandshakeStatus pendingStatus(int pendingStatus) {
// Depending on if there is something left in the BIO we need to WRAP or UNWRAP
return pendingStatus > 0 ? NEED_WRAP : NEED_UNWRAP;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pendingStatus
File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2016-4970
|
HIGH
| 7.8
|
netty
|
pendingStatus
|
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
|
bc8291c80912a39fbd2303e18476d15751af0bf1
| 0
|
Analyze the following code function for security vulnerabilities
|
public void removeFromTree() {
if (getOwner() instanceof StateTree) {
ComponentUtil.setData(((StateTree) getOwner()).getUI(),
ReplacedViaPreserveOnRefresh.class, REPLACED_MARKER);
}
visitNodeTree(StateNode::reset);
setParent(null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeFromTree
File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2023-25499
|
MEDIUM
| 6.5
|
vaadin/flow
|
removeFromTree
|
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
|
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getURLToLogout()
{
return getURL("XWiki", "XWikiLogin", "logout");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getURLToLogout
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getURLToLogout
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
public void index(short siteId, Serializable[] ids) {
dao.index(siteId, ids);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: index
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-21333
|
LOW
| 3.5
|
sanluan/PublicCMS
|
index
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java
|
b4d5956e65b14347b162424abb197a180229b3db
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handlePendingSystemServerWtfs(
final LinkedList<Pair<String, ApplicationErrorReport.CrashInfo>> list) {
ProcessRecord proc;
synchronized (mPidsSelfLocked) {
proc = mPidsSelfLocked.get(MY_PID);
}
for (Pair<String, ApplicationErrorReport.CrashInfo> p = list.poll();
p != null; p = list.poll()) {
addErrorToDropBox("wtf", proc, "system_server", null, null, null, p.first, null, null,
p.second, null, null, null);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handlePendingSystemServerWtfs
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
|
handlePendingSystemServerWtfs
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public InternetResource createUserResource(boolean cacheable,
boolean session, String mime) throws FacesException {
String path = getUserResourceKey(cacheable, session, mime);
InternetResource userResource;
try {
userResource = getResource(path);
} catch (ResourceNotFoundException e) {
userResource = new UserResource(cacheable, session, mime);
addResource(path, userResource);
}
return userResource;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createUserResource
File: framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
Repository: nuxeo/richfaces-3.3
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2013-4521
|
HIGH
| 7.5
|
nuxeo/richfaces-3.3
|
createUserResource
|
framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
|
6cbad2a6dcb70d3e33a6ce5879b1a3ad79eb1aec
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isPackageAllowedToAccessCalendarForUser(String packageName,
int userHandle) {
if (!mHasFeature) {
return false;
}
Preconditions.checkStringNotEmpty(packageName, "Package name is null or empty");
Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId");
final CallerIdentity caller = getCallerIdentity();
final int packageUid = mInjector.binderWithCleanCallingIdentity(() -> {
try {
return mInjector.getPackageManager().getPackageUidAsUser(packageName, userHandle);
} catch (NameNotFoundException e) {
Slogf.w(LOG_TAG, e,
"Couldn't find package %s in user %d", packageName, userHandle);
return -1;
}
});
if (caller.getUid() != packageUid) {
Preconditions.checkCallAuthorization(
hasCallingOrSelfPermission(permission.INTERACT_ACROSS_USERS)
|| hasCallingOrSelfPermission(permission.INTERACT_ACROSS_USERS_FULL));
}
synchronized (getLockObject()) {
if (mInjector.settingsSecureGetIntForUser(
Settings.Secure.CROSS_PROFILE_CALENDAR_ENABLED, 0, userHandle) == 0) {
return false;
}
final ActiveAdmin admin = getProfileOwnerAdminLocked(userHandle);
if (admin != null) {
if (admin.mCrossProfileCalendarPackages == null) {
return true;
}
return admin.mCrossProfileCalendarPackages.contains(packageName);
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPackageAllowedToAccessCalendarForUser
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
|
isPackageAllowedToAccessCalendarForUser
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String processHandleFile(Context c, Item i, String path, String filename)
{
File file = new File(path + File.separatorChar + filename);
String result = null;
System.out.println("Processing handle file: " + filename);
if (file.exists())
{
BufferedReader is = null;
try
{
is = new BufferedReader(new FileReader(file));
// result gets contents of file, or null
result = is.readLine();
System.out.println("read handle: '" + result + "'");
}
catch (FileNotFoundException e)
{
// probably no handle file, just return null
System.out.println("It appears there is no handle file -- generating one");
}
catch (IOException e)
{
// probably no handle file, just return null
System.out.println("It appears there is no handle file -- generating one");
}
finally
{
if (is != null)
{
try
{
is.close();
}
catch (IOException e1)
{
System.err.println("Non-critical problem releasing resources.");
}
}
}
}
else
{
// probably no handle file, just return null
System.out.println("It appears there is no handle file -- generating one");
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processHandleFile
File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31195
|
HIGH
| 7.2
|
DSpace
|
processHandleFile
|
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
|
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void setWaitingForResult(boolean waitingForResult) {
this.waitingForResult = waitingForResult;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setWaitingForResult
File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
setWaitingForResult
|
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
static byte[] generateApkVerity(String apkPath, ByteBufferFactory bufferFactory)
throws IOException, SignatureNotFoundException, SecurityException, DigestException,
NoSuchAlgorithmException {
try (RandomAccessFile apk = new RandomAccessFile(apkPath, "r")) {
SignatureInfo signatureInfo = findSignature(apk);
return VerityBuilder.generateApkVerity(apkPath, bufferFactory, signatureInfo);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateApkVerity
File: core/java/android/util/apk/ApkSignatureSchemeV2Verifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
generateApkVerity
|
core/java/android/util/apk/ApkSignatureSchemeV2Verifier.java
|
84df68840b6f2407146e722ebd95a7d8bc6e3529
| 0
|
Analyze the following code function for security vulnerabilities
|
protected AlgorithmParameterSpec localEngineGetParameterSpec(Class paramSpec)
throws InvalidParameterSpecException
{
if (paramSpec == AlgorithmParameterSpec.class || GcmSpecUtil.isGcmSpec(paramSpec))
{
if (GcmSpecUtil.gcmSpecExists())
{
return GcmSpecUtil.extractGcmSpec(ccmParams.toASN1Primitive());
}
return new AEADParameterSpec(ccmParams.getNonce(), ccmParams.getIcvLen() * 8);
}
if (paramSpec == AEADParameterSpec.class)
{
return new AEADParameterSpec(ccmParams.getNonce(), ccmParams.getIcvLen() * 8);
}
if (paramSpec == IvParameterSpec.class)
{
return new IvParameterSpec(ccmParams.getNonce());
}
throw new InvalidParameterSpecException("AlgorithmParameterSpec not recognized: " + paramSpec.getName());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: localEngineGetParameterSpec
File: prov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/AES.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2016-1000339
|
MEDIUM
| 5
|
bcgit/bc-java
|
localEngineGetParameterSpec
|
prov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/AES.java
|
413b42f4d770456508585c830cfcde95f9b0e93b
| 0
|
Analyze the following code function for security vulnerabilities
|
private void startKeyguardExitAnimation(@WindowManager.TransitionOldType int transit,
long startTime, long fadeoutDuration,
RemoteAnimationTarget[] apps, RemoteAnimationTarget[] wallpapers,
RemoteAnimationTarget[] nonApps, IRemoteAnimationFinishedCallback finishedCallback) {
Trace.beginSection("KeyguardViewMediator#startKeyguardExitAnimation");
mInteractionJankMonitor.cancel(CUJ_LOCKSCREEN_TRANSITION_FROM_AOD);
Message msg = mHandler.obtainMessage(START_KEYGUARD_EXIT_ANIM,
new StartKeyguardExitAnimParams(transit, startTime, fadeoutDuration, apps,
wallpapers, nonApps, finishedCallback));
mHandler.sendMessage(msg);
Trace.endSection();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startKeyguardExitAnimation
File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21267
|
MEDIUM
| 5.5
|
android
|
startKeyguardExitAnimation
|
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
|
d18d8b350756b0e89e051736c1f28744ed31e93a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Long getTimeMillis(CharSequence name) {
return headers.getTimeMillis(name);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTimeMillis
File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2021-43797
|
MEDIUM
| 4.3
|
netty
|
getTimeMillis
|
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
|
07aa6b5938a8b6ed7a6586e066400e2643897323
| 0
|
Analyze the following code function for security vulnerabilities
|
public void continuePendingReload() {
if (mNativeContentViewCore != 0) nativeContinuePendingReload(mNativeContentViewCore);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: continuePendingReload
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
continuePendingReload
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void unlockOrientation() {
if (getActivity() == null) {
return;
}
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unlockOrientation
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
|
unlockOrientation
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void loadMetadata(Context c, Item myitem, String path)
throws SQLException, IOException, ParserConfigurationException,
SAXException, TransformerException, AuthorizeException
{
// Load the dublin core metadata
loadDublinCore(c, myitem, path + "dublin_core.xml");
// Load any additional metadata schemas
File folder = new File(path);
File file[] = folder.listFiles(metadataFileFilter);
for (int i = 0; i < file.length; i++)
{
loadDublinCore(c, myitem, file[i].getAbsolutePath());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadMetadata
File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31195
|
HIGH
| 7.2
|
DSpace
|
loadMetadata
|
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
|
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Beta
public static void createParentDirs(File file) throws IOException {
checkNotNull(file);
File parent = file.getCanonicalFile().getParentFile();
if (parent == null) {
/*
* The given directory is a filesystem root. All zero of its ancestors exist. This doesn't
* mean that the root itself exists -- consider x:\ on a Windows machine without such a drive
* -- or even that the caller can create it, but this method makes no such guarantees even for
* non-root files.
*/
return;
}
parent.mkdirs();
if (!parent.isDirectory()) {
throw new IOException("Unable to create parent directories of " + file);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createParentDirs
File: 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
|
createParentDirs
|
guava/src/com/google/common/io/Files.java
|
fec0dbc4634006a6162cfd4d0d09c962073ddf40
| 0
|
Analyze the following code function for security vulnerabilities
|
private ArrayList<File> getAllRecordingsFor(String recordId) {
String[] format = getPlaybackFormats(publishedDir);
ArrayList<File> ids = new ArrayList<File>();
for (int i = 0; i < format.length; i++) {
List<File> recordings = getDirectories(publishedDir + File.separatorChar + format[i]);
for (int f = 0; f < recordings.size(); f++) {
if (recordId.equals(recordings.get(f).getName()))
ids.add(recordings.get(f));
}
}
return ids;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllRecordingsFor
File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
Repository: bigbluebutton
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-12443
|
HIGH
| 7.5
|
bigbluebutton
|
getAllRecordingsFor
|
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
|
b21ca8355a57286a1e6df96984b3a4c57679a463
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean validateAssociationAllowedLocked(String pkg1, int uid1, String pkg2, int uid2) {
ensureAllowedAssociations();
// Interactions with the system uid are always allowed, since that is the core system
// that everyone needs to be able to interact with. Also allow reflexive associations
// within the same uid.
if (uid1 == uid2 || UserHandle.getAppId(uid1) == SYSTEM_UID
|| UserHandle.getAppId(uid2) == SYSTEM_UID) {
return true;
}
// Check for association on both source and target packages.
PackageAssociationInfo pai = mAllowedAssociations.get(pkg1);
if (pai != null && !pai.isPackageAssociationAllowed(pkg2)) {
return false;
}
pai = mAllowedAssociations.get(pkg2);
if (pai != null && !pai.isPackageAssociationAllowed(pkg1)) {
return false;
}
// If no explicit associations are provided in the manifest, then assume the app is
// allowed associations with any package.
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateAssociationAllowedLocked
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
|
validateAssociationAllowedLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private HttpServletRequest wrapMultipartRequest(HttpServletRequest request)
throws ServletException, FileSizeLimitExceededException
{
HttpServletRequest wrappedRequest;
try
{
// if not already wrapped
if (!Class.forName("org.dspace.app.webui.util.FileUploadRequest")
.isInstance(request))
{
// Wrap multipart request
wrappedRequest = new FileUploadRequest(request);
return (HttpServletRequest) wrappedRequest;
}
else
{ // already wrapped
return request;
}
}
catch (FileSizeLimitExceededException e)
{
throw new FileSizeLimitExceededException(e.getMessage(),e.getActualSize(),e.getPermittedSize());
}
catch (Exception e)
{
throw new ServletException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: wrapMultipartRequest
File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31194
|
HIGH
| 7.2
|
DSpace
|
wrapMultipartRequest
|
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
|
d1dd7d23329ef055069759df15cfa200c8e3
| 0
|
Analyze the following code function for security vulnerabilities
|
private RemoteViews applyStandardTemplateWithActions(int layoutId,
StandardTemplateParams p, TemplateBindResult result) {
RemoteViews big = applyStandardTemplate(layoutId, p, result);
resetStandardTemplateWithActions(big);
bindSnoozeAction(big, p);
// color the snooze and bubble actions with the theme color
ColorStateList actionColor = ColorStateList.valueOf(getStandardActionColor(p));
big.setColorStateList(R.id.snooze_button, "setImageTintList", actionColor);
big.setColorStateList(R.id.bubble_button, "setImageTintList", actionColor);
boolean validRemoteInput = false;
// In the UI, contextual actions appear separately from the standard actions, so we
// filter them out here.
List<Notification.Action> nonContextualActions = getNonContextualActions();
int numActions = Math.min(nonContextualActions.size(), MAX_ACTION_BUTTONS);
boolean emphazisedMode = mN.fullScreenIntent != null || p.mCallStyleActions;
if (p.mCallStyleActions) {
// Clear view padding to allow buttons to start on the left edge.
// This must be done before 'setEmphasizedMode' which sets top/bottom margins.
big.setViewPadding(R.id.actions, 0, 0, 0, 0);
// Add an optional indent that will make buttons start at the correct column when
// there is enough space to do so (and fall back to the left edge if not).
big.setInt(R.id.actions, "setCollapsibleIndentDimen",
R.dimen.call_notification_collapsible_indent);
}
big.setBoolean(R.id.actions, "setEmphasizedMode", emphazisedMode);
if (numActions > 0 && !p.mHideActions) {
big.setViewVisibility(R.id.actions_container, View.VISIBLE);
big.setViewVisibility(R.id.actions, View.VISIBLE);
big.setViewLayoutMarginDimen(R.id.notification_action_list_margin_target,
RemoteViews.MARGIN_BOTTOM, 0);
for (int i = 0; i < numActions; i++) {
Action action = nonContextualActions.get(i);
boolean actionHasValidInput = hasValidRemoteInput(action);
validRemoteInput |= actionHasValidInput;
final RemoteViews button = generateActionButton(action, emphazisedMode, p);
if (actionHasValidInput && !emphazisedMode) {
// Clear the drawable
button.setInt(R.id.action0, "setBackgroundResource", 0);
}
if (emphazisedMode && i > 0) {
// Clear start margin from non-first buttons to reduce the gap between them.
// (8dp remaining gap is from all buttons' standard 4dp inset).
button.setViewLayoutMarginDimen(R.id.action0, RemoteViews.MARGIN_START, 0);
}
big.addView(R.id.actions, button);
}
} else {
big.setViewVisibility(R.id.actions_container, View.GONE);
}
RemoteInputHistoryItem[] replyText = getParcelableArrayFromBundle(
mN.extras, EXTRA_REMOTE_INPUT_HISTORY_ITEMS, RemoteInputHistoryItem.class);
if (validRemoteInput && replyText != null && replyText.length > 0
&& !TextUtils.isEmpty(replyText[0].getText())
&& p.maxRemoteInputHistory > 0) {
boolean showSpinner = mN.extras.getBoolean(EXTRA_SHOW_REMOTE_INPUT_SPINNER);
big.setViewVisibility(R.id.notification_material_reply_container, View.VISIBLE);
big.setViewVisibility(R.id.notification_material_reply_text_1_container,
View.VISIBLE);
big.setTextViewText(R.id.notification_material_reply_text_1,
processTextSpans(replyText[0].getText()));
setTextViewColorSecondary(big, R.id.notification_material_reply_text_1, p);
big.setViewVisibility(R.id.notification_material_reply_progress,
showSpinner ? View.VISIBLE : View.GONE);
big.setProgressIndeterminateTintList(
R.id.notification_material_reply_progress,
ColorStateList.valueOf(getPrimaryAccentColor(p)));
if (replyText.length > 1 && !TextUtils.isEmpty(replyText[1].getText())
&& p.maxRemoteInputHistory > 1) {
big.setViewVisibility(R.id.notification_material_reply_text_2, View.VISIBLE);
big.setTextViewText(R.id.notification_material_reply_text_2,
processTextSpans(replyText[1].getText()));
setTextViewColorSecondary(big, R.id.notification_material_reply_text_2, p);
if (replyText.length > 2 && !TextUtils.isEmpty(replyText[2].getText())
&& p.maxRemoteInputHistory > 2) {
big.setViewVisibility(
R.id.notification_material_reply_text_3, View.VISIBLE);
big.setTextViewText(R.id.notification_material_reply_text_3,
processTextSpans(replyText[2].getText()));
setTextViewColorSecondary(big, R.id.notification_material_reply_text_3, p);
}
}
}
return big;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: applyStandardTemplateWithActions
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
applyStandardTemplateWithActions
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void maybePruneOldTraces(File tracesDir) {
final File[] files = tracesDir.listFiles();
if (files == null) return;
final int max = SystemProperties.getInt("tombstoned.max_anr_count", 64);
final long now = System.currentTimeMillis();
try {
Arrays.sort(files, Comparator.comparingLong(File::lastModified).reversed());
for (int i = 0; i < files.length; ++i) {
if (i > max || (now - files[i].lastModified()) > DAY_IN_MILLIS) {
if (!files[i].delete()) {
Slog.w(TAG, "Unable to prune stale trace file: " + files[i]);
}
}
}
} catch (IllegalArgumentException e) {
// The modification times changed while we were sorting. Bail...
// https://issuetracker.google.com/169836837
Slog.w(TAG, "tombstone modification times changed while sorting; not pruning", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: maybePruneOldTraces
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
|
maybePruneOldTraces
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isValidArgs(int args)
{
return termType == UserFunctions.FunctionType.IDENTITY || terms.length == args;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isValidArgs
File: app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java
Repository: mkulesh/microMathematics
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000821
|
HIGH
| 7.5
|
mkulesh/microMathematics
|
isValidArgs
|
app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java
|
5c05ac8de16c569ff0a1816f20be235090d3dd9d
| 0
|
Analyze the following code function for security vulnerabilities
|
@GetMapping("/logout")
public String logout(HttpSession session) {
User user = getUser();
if (user != null) {
// 清除redis里的缓存
userService.delRedisUser(user);
// 清除session里的用户信息
session.removeAttribute("_user");
// 清除cookie里的用户token
cookieUtil.clearCookie(systemConfigService.selectAllConfig().get("cookie_name").toString());
}
return redirect("/");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logout
File: src/main/java/co/yiiu/pybbs/controller/front/IndexController.java
Repository: atjiu/pybbs
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-23391
|
MEDIUM
| 4.3
|
atjiu/pybbs
|
logout
|
src/main/java/co/yiiu/pybbs/controller/front/IndexController.java
|
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
| 0
|
Analyze the following code function for security vulnerabilities
|
public int writeData(ByteBuffer[] srcs, int offset, int length) {
debug("JSSEngine: writeData()");
// This is the tough end of reading/writing. There's two potential
// places buffering could occur:
//
// - Inside the NSS library (unclear if this happens).
// - write_buf
//
// So when we call PR.Write(ssl_fd, data), it isn't guaranteed that
// we can write all of data to ssl_fd (unlike with all our other read
// or write operations where we have a clear bound). In the event that
// our Write call is truncated, we have to put data back into the
// buffer from whence it was read.
//
// However, we do use Buffer.WriteCapacity(write_buf) as a proxy
// metric for how much we can write without having to place data back
// in a src buffer.
//
// When we don't perform an actual NSPR write call, make a dummy
// invocation to ensure we always attempt to flush these buffers.
int data_length = 0;
int index = offset;
int max_index = offset + length;
boolean attempted_write = false;
while (index < max_index) {
// If we don't have any remaining bytes in this buffer, skip it.
if (srcs[index] == null || srcs[index].remaining() <= 0) {
index += 1;
continue;
}
debug("JSSEngine.writeData(): index=" + index + " max_index=" + max_index);
// We expect (i.e., need to construct a buffer) to write up to
// this much. Note that this is non-zero since we're taking the
// max here and we guarantee with the previous statement that
// srcs[index].remaining() > 0. There's no point in getting more
// than BUFFER_SIZE bytes either; so cap at the minimum of the
// two sizes.
int expected_write = Math.min(srcs[index].remaining(), BUFFER_SIZE);
debug("JSSEngine.writeData(): expected_write=" + expected_write + " write_cap=" + Buffer.WriteCapacity(write_buf) + " read_cap=" + Buffer.ReadCapacity(read_buf));
// Get data from our current srcs[index] buffer.
byte[] app_data = new byte[expected_write];
srcs[index].get(app_data);
// Actual amount written. Since this is a PR.Write call, mark
// attempted_write.
int this_write = PR.Write(ssl_fd, app_data);
attempted_write = true;
// Reset our buffer's position in event of sub-optimal write.
if (this_write < expected_write) {
int pos = srcs[index].position();
// When this_write < 0, we want to reset to the beginning
// because we assume we haven't written any data due to an
// error before writing.
int delta = expected_write - Math.max(0, this_write);
srcs[index].position(pos - delta);
}
debug("JSSEngine.writeData(): this_write=" + this_write);
if (this_write < 0) {
int error = PR.GetError();
if (error == PRErrors.SOCKET_SHUTDOWN_ERROR) {
debug("NSPR reports outbound socket is shutdown.");
is_outbound_closed = true;
} else if (error != PRErrors.WOULD_BLOCK_ERROR) {
throw new RuntimeException("Unable to write to internal ssl_fd: " + errorText(PR.GetError()));
}
break;
}
data_length += this_write;
if (this_write < expected_write) {
// If we didn't get an error but we got less than our expected
// write, it is best to exit to give us time to drain the
// buffers before attempting another write. We're guaranteed
// to be called again because we wrote a non-zero amount here.
break;
}
}
// When we didn't call PR.Write, invoke a dummy call to PR.Write to
// ensure we always attempt to write to push data from NSS's internal
// buffers into our network buffers.
if (!attempted_write) {
PR.Write(ssl_fd, null);
}
debug("JSSEngine.writeData(): data_length=" + data_length);
return data_length;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeData
File: src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
Repository: dogtagpki/jss
The code follows secure coding practices.
|
[
"CWE-401"
] |
CVE-2021-4213
|
HIGH
| 7.5
|
dogtagpki/jss
|
writeData
|
src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
|
5922560a78d0dee61af8a33cc9cfbf4cfa291448
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String[] getResourceList(Class<?> base, String pckgname, String ext) {
String path = absPath(base, pckgname);
ArrayList<String> als = new ArrayList<String>();
try {
ClassLoader cld = Thread.currentThread().getContextClassLoader();
URL resource = cld.getResource(path);
File dir = new File(resource.getFile());
if (dir.exists()) {
// we're running from the file system;
for (String fnm : dir.list()) {
if (ext == null || fnm.endsWith(ext)) {
als.add(fnm);
}
}
} else {
// we're running from a jar file;
JarURLConnection conn = (JarURLConnection) resource.openConnection();
String starts = conn.getEntryName();
JarFile jfile = conn.getJarFile();
Enumeration<JarEntry> e = jfile.entries();
while (e.hasMoreElements()) {
ZipEntry entry = e.nextElement();
String entryname = entry.getName();
if (entryname.startsWith(starts)
&& (entryname.lastIndexOf('/') <= starts.length())) {
String rnm = entryname.substring(starts.length()+1, entryname.length());
if (rnm.length() > 1 && (ext == null || rnm.endsWith(ext))) {
als.add(rnm);
}
}
}
}
} catch (Exception ex) {
E.error("cant list resources? " + ex);
}
return als.toArray(new String[als.size()]);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getResourceList
File: src/main/java/org/lemsml/jlems/io/util/JUtil.java
Repository: LEMS/jLEMS
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-4583
|
HIGH
| 8.8
|
LEMS/jLEMS
|
getResourceList
|
src/main/java/org/lemsml/jlems/io/util/JUtil.java
|
8c224637d7d561076364a9e3c2c375daeaf463dc
| 0
|
Analyze the following code function for security vulnerabilities
|
private BaseObjectReference getBaseObjectReference(ObjectReference objectReference)
{
if (objectReference instanceof BaseObjectReference) {
return (BaseObjectReference) objectReference;
} else {
return new BaseObjectReference(objectReference);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBaseObjectReference
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
|
getBaseObjectReference
|
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 abstract T createComponentSessionController(MainSessionController mainSessionCtrl,
ComponentContext componentContext);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createComponentSessionController
File: core-web/src/main/java/org/silverpeas/core/web/mvc/route/ComponentRequestRouter.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
createComponentSessionController
|
core-web/src/main/java/org/silverpeas/core/web/mvc/route/ComponentRequestRouter.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void writeAccountInfoLocked() {
if (Log.isLoggable(TAG_FILE, Log.VERBOSE)) {
Log.v(TAG_FILE, "Writing new " + mAccountInfoFile.getBaseFile());
}
FileOutputStream fos = null;
try {
fos = mAccountInfoFile.startWrite();
XmlSerializer out = new FastXmlSerializer();
out.setOutput(fos, "utf-8");
out.startDocument(null, true);
out.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
out.startTag(null, "accounts");
out.attribute(null, "version", Integer.toString(ACCOUNTS_VERSION));
out.attribute(null, XML_ATTR_NEXT_AUTHORITY_ID, Integer.toString(mNextAuthorityId));
out.attribute(null, XML_ATTR_SYNC_RANDOM_OFFSET, Integer.toString(mSyncRandomOffset));
// Write the Sync Automatically flags for each user
final int M = mMasterSyncAutomatically.size();
for (int m = 0; m < M; m++) {
int userId = mMasterSyncAutomatically.keyAt(m);
Boolean listen = mMasterSyncAutomatically.valueAt(m);
out.startTag(null, XML_TAG_LISTEN_FOR_TICKLES);
out.attribute(null, XML_ATTR_USER, Integer.toString(userId));
out.attribute(null, XML_ATTR_ENABLED, Boolean.toString(listen));
out.endTag(null, XML_TAG_LISTEN_FOR_TICKLES);
}
final int N = mAuthorities.size();
for (int i = 0; i < N; i++) {
AuthorityInfo authority = mAuthorities.valueAt(i);
EndPoint info = authority.target;
out.startTag(null, "authority");
out.attribute(null, "id", Integer.toString(authority.ident));
out.attribute(null, XML_ATTR_USER, Integer.toString(info.userId));
out.attribute(null, XML_ATTR_ENABLED, Boolean.toString(authority.enabled));
if (info.service == null) {
out.attribute(null, "account", info.account.name);
out.attribute(null, "type", info.account.type);
out.attribute(null, "authority", info.provider);
} else {
out.attribute(null, "package", info.service.getPackageName());
out.attribute(null, "class", info.service.getClassName());
}
if (authority.syncable < 0) {
out.attribute(null, "syncable", "unknown");
} else {
out.attribute(null, "syncable", Boolean.toString(authority.syncable != 0));
}
for (PeriodicSync periodicSync : authority.periodicSyncs) {
out.startTag(null, "periodicSync");
out.attribute(null, "period", Long.toString(periodicSync.period));
out.attribute(null, "flex", Long.toString(periodicSync.flexTime));
final Bundle extras = periodicSync.extras;
extrasToXml(out, extras);
out.endTag(null, "periodicSync");
}
out.endTag(null, "authority");
}
out.endTag(null, "accounts");
out.endDocument();
mAccountInfoFile.finishWrite(fos);
} catch (java.io.IOException e1) {
Log.w(TAG, "Error writing accounts", e1);
if (fos != null) {
mAccountInfoFile.failWrite(fos);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeAccountInfoLocked
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
|
writeAccountInfoLocked
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
@CalledByNative
public long getNativeContentViewCore() {
return mNativeContentViewCore;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNativeContentViewCore
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
getNativeContentViewCore
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void showRecentApps() {
mPolicy.showRecentApps();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showRecentApps
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
showRecentApps
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
public BaseObject getFirstObject(String fieldname, XWikiContext context)
{
Collection<List<BaseObject>> objectscoll = getXObjects().values();
if (objectscoll == null) {
return null;
}
for (List<BaseObject> objects : objectscoll) {
for (BaseObject obj : objects) {
if (obj != null) {
BaseClass bclass = obj.getXClass(context);
if (bclass != null) {
Set<String> set = bclass.getPropertyList();
if ((set != null) && set.contains(fieldname)) {
return obj;
}
}
Set<String> set = obj.getPropertyList();
if ((set != null) && set.contains(fieldname)) {
return obj;
}
}
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFirstObject
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
|
getFirstObject
|
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
|
public static <T> T unmarshal(final Class<T> clazz, final InputStream stream) {
try (final Reader reader = new InputStreamReader(stream)) {
return unmarshal(clazz, reader, VALIDATE_IF_POSSIBLE);
} catch (final IOException e) {
throw EXCEPTION_TRANSLATOR.translate("reading stream", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unmarshal
File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2023-0871
|
MEDIUM
| 6.1
|
OpenNMS/opennms
|
unmarshal
|
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
|
3c17231714e3d55809efc580a05734ed530f9ad4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onPerform(CommandEvent commandEvent) {
if (!commandEvent.getGuild().getSelfMember().hasPermission(Permission.MANAGE_WEBHOOKS)) {
Main.getInstance().getCommandManager().sendMessage("I need the permission `Manage Webhooks` to use this command!", commandEvent.getChannel(), commandEvent.getInteractionHook());
}
if (commandEvent.isSlashCommand()) {
Main.getInstance().getCommandManager().sendMessage("This Command doesn't support slash commands yet.", commandEvent.getChannel(), commandEvent.getInteractionHook());
return;
}
if(commandEvent.getArguments().length == 1) {
if(commandEvent.getArguments()[0].equalsIgnoreCase("list")) {
StringBuilder end = new StringBuilder("```\n");
for(String users : Main.getInstance().getSqlConnector().getSqlWorker().getAllInstagramUsers(commandEvent.getGuild().getId())) {
end.append(users).append("\n");
}
end.append("```");
Main.getInstance().getCommandManager().sendMessage(end.toString(), 10, commandEvent.getChannel(), commandEvent.getInteractionHook());
} else {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier list/add/remove", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
}
} else if(commandEvent.getArguments().length == 3) {
if (commandEvent.getMessage().getMentions().getChannels(TextChannel.class).isEmpty()) {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier add/remove InstagramName #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
return;
}
String name = commandEvent.getArguments()[1];
if (commandEvent.getArguments()[0].equalsIgnoreCase("add")) {
commandEvent.getMessage().getMentions().getChannels(TextChannel.class).get(0).createWebhook("Ree6-InstagramNotifier-" + name).queue(w -> Main.getInstance().getSqlConnector().getSqlWorker().addInstagramWebhook(commandEvent.getGuild().getId(), w.getId(), w.getToken(), name.toLowerCase()));
Main.getInstance().getCommandManager().sendMessage("A Instagram Notifier has been created for the User " + name + "!", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
if (!Main.getInstance().getNotifier().isInstagramUserRegistered(name)) {
Main.getInstance().getNotifier().registerInstagramUser(name);
}
} else if (commandEvent.getArguments()[0].equalsIgnoreCase("remove")) {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier remove InstagramName", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
} else {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier add InstagramName #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
}
} else if(commandEvent.getArguments().length == 2) {
String name = commandEvent.getArguments()[1];
if(commandEvent.getArguments()[0].equalsIgnoreCase("remove")) {
Main.getInstance().getSqlConnector().getSqlWorker().removeInstagramWebhook(commandEvent.getGuild().getId(), name);
Main.getInstance().getCommandManager().sendMessage("A Instagram Notifier has been removed from the User " + name + "!", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
if (Main.getInstance().getNotifier().isInstagramUserRegistered(name)) {
Main.getInstance().getNotifier().unregisterInstagramUser(name);
}
} else if (commandEvent.getArguments()[0].equalsIgnoreCase("add")) {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier add InstagramName #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
} else {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier remove InstagramName", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
}
} else {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier list/add/remove", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
}
Main.getInstance().getCommandManager().deleteMessage(commandEvent.getMessage(), commandEvent.getInteractionHook());
}
|
Vulnerability Classification:
- CWE: CWE-863
- CVE: CVE-2022-39302
- Severity: MEDIUM
- CVSS Score: 5.4
Description: Removed News-Channel.
Fixed Cross-Server Channel Exploit.
Fixed Temporal-Voice setup.
Function: onPerform
File: src/main/java/de/presti/ree6/commands/impl/community/InstagramNotifier.java
Repository: Ree6-Applications/Ree6
Fixed Code:
@Override
public void onPerform(CommandEvent commandEvent) {
if (!commandEvent.getGuild().getSelfMember().hasPermission(Permission.MANAGE_WEBHOOKS)) {
Main.getInstance().getCommandManager().sendMessage("I need the permission `Manage Webhooks` to use this command!", commandEvent.getChannel(), commandEvent.getInteractionHook());
}
if (commandEvent.isSlashCommand()) {
Main.getInstance().getCommandManager().sendMessage("This Command doesn't support slash commands yet.", commandEvent.getChannel(), commandEvent.getInteractionHook());
return;
}
if(commandEvent.getArguments().length == 1) {
if(commandEvent.getArguments()[0].equalsIgnoreCase("list")) {
StringBuilder end = new StringBuilder("```\n");
for(String users : Main.getInstance().getSqlConnector().getSqlWorker().getAllInstagramUsers(commandEvent.getGuild().getId())) {
end.append(users).append("\n");
}
end.append("```");
Main.getInstance().getCommandManager().sendMessage(end.toString(), 10, commandEvent.getChannel(), commandEvent.getInteractionHook());
} else {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier list/add/remove", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
}
} else if(commandEvent.getArguments().length == 3) {
if (commandEvent.getMessage().getMentions().getChannels(TextChannel.class).isEmpty() ||
!commandEvent.getMessage().getMentions().getChannels(TextChannel.class).get(0).getGuild().getId().equals(commandEvent.getGuild().getId())) {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier add/remove InstagramName #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
return;
}
String name = commandEvent.getArguments()[1];
if (commandEvent.getArguments()[0].equalsIgnoreCase("add")) {
commandEvent.getMessage().getMentions().getChannels(TextChannel.class).get(0).createWebhook("Ree6-InstagramNotifier-" + name).queue(w -> Main.getInstance().getSqlConnector().getSqlWorker().addInstagramWebhook(commandEvent.getGuild().getId(), w.getId(), w.getToken(), name.toLowerCase()));
Main.getInstance().getCommandManager().sendMessage("A Instagram Notifier has been created for the User " + name + "!", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
if (!Main.getInstance().getNotifier().isInstagramUserRegistered(name)) {
Main.getInstance().getNotifier().registerInstagramUser(name);
}
} else if (commandEvent.getArguments()[0].equalsIgnoreCase("remove")) {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier remove InstagramName", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
} else {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier add InstagramName #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
}
} else if(commandEvent.getArguments().length == 2) {
String name = commandEvent.getArguments()[1];
if(commandEvent.getArguments()[0].equalsIgnoreCase("remove")) {
Main.getInstance().getSqlConnector().getSqlWorker().removeInstagramWebhook(commandEvent.getGuild().getId(), name);
Main.getInstance().getCommandManager().sendMessage("A Instagram Notifier has been removed from the User " + name + "!", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
if (Main.getInstance().getNotifier().isInstagramUserRegistered(name)) {
Main.getInstance().getNotifier().unregisterInstagramUser(name);
}
} else if (commandEvent.getArguments()[0].equalsIgnoreCase("add")) {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier add InstagramName #Channel", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
} else {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier remove InstagramName", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
}
} else {
Main.getInstance().getCommandManager().sendMessage("Please use " + Main.getInstance().getSqlConnector().getSqlWorker().getSetting(commandEvent.getGuild().getId(), "chatprefix").getStringValue() + "instagramnotifier list/add/remove", 5, commandEvent.getChannel(), commandEvent.getInteractionHook());
}
Main.getInstance().getCommandManager().deleteMessage(commandEvent.getMessage(), commandEvent.getInteractionHook());
}
|
[
"CWE-863"
] |
CVE-2022-39302
|
MEDIUM
| 5.4
|
Ree6-Applications/Ree6
|
onPerform
|
src/main/java/de/presti/ree6/commands/impl/community/InstagramNotifier.java
|
459b5bc24f0ea27e50031f563373926e94b9aa0a
| 1
|
Analyze the following code function for security vulnerabilities
|
public void applyToView(@NonNull RemoteViews views, @IdRes int viewId,
float extraMarginDp) {
final float marginEndDp = getDpValue() + extraMarginDp;
if (viewId == R.id.notification_header) {
views.setFloat(R.id.notification_header,
"setTopLineExtraMarginEndDp", marginEndDp);
} else if (viewId == R.id.text || viewId == R.id.big_text) {
if (mValueIfGone != 0) {
throw new RuntimeException("Programming error: `text` and `big_text` use "
+ "ImageFloatingTextView which can either show a margin or not; "
+ "thus mValueIfGone must be 0, but it was " + mValueIfGone);
}
// Note that the caller must set "setNumIndentLines" to a positive int in order
// for this margin to do anything at all.
views.setFloat(viewId, "setImageEndMarginDp", mValueIfVisible);
views.setBoolean(viewId, "setHasImage", mRightIconVisible);
// Apply just the *extra* margin as the view layout margin; this will be
// unchanged depending on the visibility of the image, but it means that the
// extra margin applies to *every* line of text instead of just indented lines.
views.setViewLayoutMargin(viewId, RemoteViews.MARGIN_END,
extraMarginDp, TypedValue.COMPLEX_UNIT_DIP);
} else {
views.setViewLayoutMargin(viewId, RemoteViews.MARGIN_END,
marginEndDp, TypedValue.COMPLEX_UNIT_DIP);
}
if (mRightIconVisible) {
views.setIntTag(viewId, R.id.tag_margin_end_when_icon_visible,
TypedValue.createComplexDimension(
mValueIfVisible + extraMarginDp, TypedValue.COMPLEX_UNIT_DIP));
views.setIntTag(viewId, R.id.tag_margin_end_when_icon_gone,
TypedValue.createComplexDimension(
mValueIfGone + extraMarginDp, TypedValue.COMPLEX_UNIT_DIP));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: applyToView
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
applyToView
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Bean(name = "myPersistenceDataSourceDstu1", destroyMethod = "close")
public DataSource dataSource() {
BasicDataSource retVal = new BasicDataSource();
if (CommonConfig.isLocalTestMode()) {
retVal.setUrl("jdbc:derby:memory:fhirtest_dstu2;create=true");
} else {
retVal.setDriver(new org.postgresql.Driver());
retVal.setUrl("jdbc:postgresql://localhost/fhirtest_dstu2");
}
retVal.setUsername(myDbUsername);
retVal.setPassword(myDbPassword);
retVal.setDefaultQueryTimeout(20);
retVal.setTestOnBorrow(true);
DataSource dataSource = ProxyDataSourceBuilder
.create(retVal)
// .logQueryBySlf4j(SLF4JLogLevel.INFO, "SQL")
.logSlowQueryBySlf4j(10000, TimeUnit.MILLISECONDS)
.afterQuery(new CurrentThreadCaptureQueriesListener())
.countQuery()
.build();
return dataSource;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dataSource
File: hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/config/TestDstu2Config.java
Repository: hapifhir/hapi-fhir
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-32053
|
MEDIUM
| 5
|
hapifhir/hapi-fhir
|
dataSource
|
hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/config/TestDstu2Config.java
|
a5e4f56e1c6f55093ff334cf698ffdeea2f33960
| 0
|
Analyze the following code function for security vulnerabilities
|
public SparseArray<ArraySet<String>> getSystemPermissions() {
return mSystemPermissions;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSystemPermissions
File: services/core/java/com/android/server/SystemConfig.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3759
|
MEDIUM
| 5
|
android
|
getSystemPermissions
|
services/core/java/com/android/server/SystemConfig.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isNewConnectionInProgress(@NonNull String disconnectingSsid) {
String targetSsid = getConnectingSsidInternal();
// If network is removed while connecting, targetSsid can be null.
if (targetSsid == null) {
return false;
}
// When connecting to another network while already connected, the old network will first
// disconnect before the new connection can begin. Thus, the presence of a mLastNetworkId
// that's different from the mTargetNetworkId indicates that this network disconnection is
// triggered for the previously connected network as opposed to the current ongoing
// connection.
boolean isConnectingWhileAlreadyConnected =
mLastNetworkId != WifiConfiguration.INVALID_NETWORK_ID
&& mLastNetworkId != mTargetNetworkId;
// This second condition is needed to catch cases where 2 simultaneous connections happen
// back-to-back. When a new connection start before the previous one finishes, the
// previous network will get removed from the supplicant and cause a disconnect message
// to be received with the previous network's SSID. Thus, if the disconnecting SSID does not
// match the target SSID, it means a new connection is in progress.
boolean isConnectingToAnotherNetwork = !disconnectingSsid.equals(targetSsid);
return isConnectingWhileAlreadyConnected || isConnectingToAnotherNetwork;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isNewConnectionInProgress
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
isNewConnectionInProgress
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public ImageTile getImageTile() {
return m_imageTile;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getImageTile
File: src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-31544
|
MEDIUM
| 5.4
|
alkacon/opencms-core
|
getImageTile
|
src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java
|
21bfbeaf6b038e2c03bb421ce7f0933dd7a7633e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void sendQueryRemoteConnectionServices() throws Exception {
mRemoteConnectionServices.clear();
for (IConnectionServiceAdapter a : mConnectionServiceAdapters) {
a.queryRemoteConnectionServices(new RemoteServiceCallback.Stub() {
@Override
public void onError() throws RemoteException {
throw new RuntimeException();
}
@Override
public void onResult(
List<ComponentName> names,
List<IBinder> services)
throws RemoteException {
TestCase.assertEquals(names.size(), services.size());
mRemoteConnectionServiceNames.addAll(names);
mRemoteConnectionServices.addAll(services);
}
@Override
public IBinder asBinder() {
return this;
}
}, "" /* callingPackage */, null /*Session.Info*/);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendQueryRemoteConnectionServices
File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
sendQueryRemoteConnectionServices
|
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean shouldWriteUTFAsGetBytes() {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldWriteUTFAsGetBytes
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
|
shouldWriteUTFAsGetBytes
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Enum read(ObjectDataInput in) throws IOException {
String clazzName = in.readUTF();
Class clazz;
try {
clazz = ClassLoaderUtil.loadClass(in.getClassLoader(), clazzName);
} catch (ClassNotFoundException e) {
throw new HazelcastSerializationException("Failed to deserialize enum: " + clazzName, e);
}
String name = in.readUTF();
return Enum.valueOf(clazz, name);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: read
File: hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/JavaDefaultSerializers.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
read
|
hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/JavaDefaultSerializers.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getNoPrefixResourceUri() {
return noPrefixResourceUri;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNoPrefixResourceUri
File: src/main/java/org/bedework/webdav/servlet/common/PostRequestPars.java
Repository: Bedework/bw-webdav
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-20000
|
MEDIUM
| 5
|
Bedework/bw-webdav
|
getNoPrefixResourceUri
|
src/main/java/org/bedework/webdav/servlet/common/PostRequestPars.java
|
67283fb8b9609acdb1a8d2e7fefe195b4a261062
| 0
|
Analyze the following code function for security vulnerabilities
|
public abstract BaseXMLBuilder importXMLBuilder(BaseXMLBuilder builder);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: importXMLBuilder
File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
importXMLBuilder
|
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void tenantSeparation(TestContext context) {
String tenant = "tenantSeparation";
String tenant2 = "tenantSeparation2";
PostgresClient c1 = createA(context, tenant);
PostgresClient c2 = createA(context, tenant2);
fillA(context, c1, tenant, 5);
fillA(context, c2, tenant2, 8);
// c1 must be blocked from accessing schema TENANT2
selectAFail(context, c1, tenant2);
// c2 must be blocked from accessing schema TENANT
selectAFail(context, c2, tenant);
c1.closeClient(context.asyncAssertSuccess());
c2.closeClient(context.asyncAssertSuccess());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: tenantSeparation
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
|
tenantSeparation
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public String parseTemplate(String template, XWikiContext context)
{
String result = "";
try {
result = evaluateTemplate(template, context);
} catch (Exception e) {
LOGGER.debug("Exception while parsing template [{}] from /templates/", template, e);
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseTemplate
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
|
parseTemplate
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("mNonPersistentUsersLock")
@NonNull
ShortcutNonPersistentUser getNonPersistentUserLocked(@UserIdInt int userId) {
ShortcutNonPersistentUser ret = mShortcutNonPersistentUsers.get(userId);
if (ret == null) {
ret = new ShortcutNonPersistentUser(this, userId);
mShortcutNonPersistentUsers.put(userId, ret);
}
return ret;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNonPersistentUserLocked
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40079
|
HIGH
| 7.8
|
android
|
getNonPersistentUserLocked
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public void deleteXWikiCollection(BaseCollection object, XWikiContext inputxcontext, boolean bTransaction,
boolean evict) throws XWikiException
{
if (object == null) {
return;
}
XWikiContext context = getExecutionXContext(inputxcontext, true);
try {
if (bTransaction) {
checkHibernate(context);
bTransaction = beginTransaction(context);
}
try {
Session session = getSession(context);
// Let's check if the class has a custom mapping
BaseClass bclass = object.getXClass(context);
List<String> handledProps = new ArrayList<>();
if ((bclass != null) && (bclass.hasCustomMapping()) && context.getWiki().hasCustomMappings()) {
handledProps = bclass.getCustomMappingPropertyList(context);
Object map = session.get(bclass.getName(), object.getId());
if (map != null) {
if (evict) {
session.evict(map);
}
session.delete(map);
}
}
if (object.getXClassReference() != null) {
for (BaseElement property : (Collection<BaseElement>) object.getFieldList()) {
if (!handledProps.contains(property.getName())) {
if (evict) {
session.evict(property);
}
if (session.get(property.getClass(), property) != null) {
session.delete(property);
}
}
}
}
// In case of custom class we need to force it as BaseObject to delete the xwikiobject row
if (!"".equals(bclass.getCustomClass())) {
BaseObject cobject = new BaseObject();
cobject.setDocumentReference(object.getDocumentReference());
cobject.setClassName(object.getClassName());
cobject.setNumber(object.getNumber());
if (object instanceof BaseObject) {
cobject.setGuid(((BaseObject) object).getGuid());
}
cobject.setId(object.getId());
if (evict) {
session.evict(cobject);
}
session.delete(cobject);
} else {
if (evict) {
session.evict(object);
}
session.delete(object);
}
if (bTransaction) {
endTransaction(context, true);
}
} finally {
if (bTransaction) {
try {
endTransaction(context, false);
} catch (Exception e) {
}
}
}
} catch (Exception e) {
Object[] args = {object.getName()};
throw new XWikiException(XWikiException.MODULE_XWIKI_STORE,
XWikiException.ERROR_XWIKI_STORE_HIBERNATE_DELETING_OBJECT, "Exception while deleting object {0}", e,
args);
} finally {
restoreExecutionXContext();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteXWikiCollection
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
deleteXWikiCollection
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setClientTransportFactories(List<ClientTransport.Factory> factories) {
_transportFactories.clear();
_transportFactories.addAll(factories);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setClientTransportFactories
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
|
setClientTransportFactories
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
MediaButtonReceiver.handleIntent(mMediaSessionCompat, intent);
return super.onStartCommand(intent, flags, startId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onStartCommand
File: Ports/Android/src/com/codename1/media/BackgroundAudioService.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
onStartCommand
|
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean showEvenIfUnstableOption(@CheckForNull Class<? extends AbstractProject<?,?>> jobType) {
// UGLY: for promotion process, this option doesn't make sense.
return jobType == null || !jobType.getName().contains("PromotionProcess");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showEvenIfUnstableOption
File: core/src/main/java/hudson/tasks/BuildTrigger.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
showEvenIfUnstableOption
|
core/src/main/java/hudson/tasks/BuildTrigger.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
@GET
@Path("threads")
@Operation(summary = "Get threads", description = "Retrieves the threads in the forum.")
@ApiResponse(responseCode = "200", description = "Request was successful.",
content = {
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = MessageVO.class))),
@Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = MessageVO.class)))
})
@ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient.")
@ApiResponse(responseCode = "404", description = "The author, forum or message not found.")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response getThreads(@QueryParam("start") @Parameter(description = "Set the date for the earliest thread.")@DefaultValue("0") Integer start,
@QueryParam("limit") @Parameter(description = "Limit the amount of threads to be returned.") @DefaultValue("25") Integer limit, @QueryParam("orderBy") @Parameter(description = "orderBy (value name,creationDate)") @DefaultValue("creationDate") String orderBy,
@QueryParam("asc") @Parameter(description = "Determine the type of order.") @DefaultValue("true") Boolean asc, @Context HttpServletRequest httpRequest, @Context UriInfo uriInfo,
@Context Request request) {
if(forum == null) {
return Response.serverError().status(Status.NOT_FOUND).build();
}
if(MediaTypeVariants.isPaged(httpRequest, request)) {
int totalCount = fom.countThreadsByForumID(forum.getKey());
Message.OrderBy order = toEnum(orderBy);
List<Message> threads = fom.getThreadsByForumID(forum.getKey(), start, limit, order, asc);
MessageVO[] vos = toArrayOfVO(threads, uriInfo);
MessageVOes voes = new MessageVOes();
voes.setMessages(vos);
voes.setTotalCount(totalCount);
return Response.ok(voes).build();
} else {
List<Message> threads = fom.getThreadsByForumID(forum.getKey(), 0, -1, null, true);
MessageVO[] voes = toArrayOfVO(threads, uriInfo);
return Response.ok(voes).build();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getThreads
File: src/main/java/org/olat/modules/fo/restapi/ForumWebService.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41242
|
HIGH
| 7.9
|
OpenOLAT
|
getThreads
|
src/main/java/org/olat/modules/fo/restapi/ForumWebService.java
|
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
| 0
|
Analyze the following code function for security vulnerabilities
|
WindowState getReplacingWindow() {
if (mAnimatingExit && mWillReplaceWindow && mAnimateReplacingWindow) {
return this;
}
for (int i = mChildren.size() - 1; i >= 0; i--) {
final WindowState c = mChildren.get(i);
final WindowState replacing = c.getReplacingWindow();
if (replacing != null) {
return replacing;
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getReplacingWindow
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
|
getReplacingWindow
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setPasswordMinimumNumeric(ComponentName who, int length, boolean parent) {
if (!mHasFeature || notSupportedOnAutomotive("setPasswordMinimumNumeric")) {
return;
}
Objects.requireNonNull(who, "ComponentName is null");
final int userId = mInjector.userHandleGetCallingUserId();
synchronized (getLockObject()) {
ActiveAdmin ap = getActiveAdminForCallerLocked(
who, DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD, parent);
ensureMinimumQuality(userId, ap, PASSWORD_QUALITY_COMPLEX, "setPasswordMinimumNumeric");
final PasswordPolicy passwordPolicy = ap.mPasswordPolicy;
if (passwordPolicy.numeric != length) {
passwordPolicy.numeric = length;
updatePasswordValidityCheckpointLocked(userId, parent);
saveSettingsLocked(userId);
}
logPasswordQualitySetIfSecurityLogEnabled(who, userId, parent, passwordPolicy);
}
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.SET_PASSWORD_MINIMUM_NUMERIC)
.setAdmin(who)
.setInt(length)
.write();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPasswordMinimumNumeric
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
|
setPasswordMinimumNumeric
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
Version fetchLastVersion(boolean ckPreview) throws IOException, ParseException {
String versionUrl;
if (ckPreview) {
versionUrl = Constants.ZRLOG_RESOURCE_DOWNLOAD_URL + "/preview/last.version.json";
} else {
versionUrl = Constants.ZRLOG_RESOURCE_DOWNLOAD_URL + "/release/last.version.json";
}
Version lastVersion = getVersion(versionUrl);
Date buildDate = new SimpleDateFormat(Constants.DATE_FORMAT_PATTERN).parse(lastVersion.getReleaseDate());
//如果已是最新预览版,那么尝试检查正式版本
if (checkPreview && !ZrLogUtil.greatThenCurrentVersion(lastVersion.getBuildId(), buildDate, lastVersion.getVersion())) {
lastVersion = getVersion(Constants.ZRLOG_RESOURCE_DOWNLOAD_URL + "/release/last.version.json");
buildDate = new SimpleDateFormat(Constants.DATE_FORMAT_PATTERN).parse(lastVersion.getReleaseDate());
}
if (ZrLogUtil.greatThenCurrentVersion(lastVersion.getBuildId(), buildDate, lastVersion.getVersion())) {
LOGGER.info("ZrLog New update found new [" + lastVersion.getVersion() + "-" + lastVersion.getBuildId() + "]");
this.version = lastVersion;
version.setReleaseDate(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(buildDate));
return version;
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fetchLastVersion
File: web/src/main/java/com/zrlog/web/plugin/UpdateVersionTimerTask.java
Repository: 94fzb/zrlog
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-16643
|
LOW
| 3.5
|
94fzb/zrlog
|
fetchLastVersion
|
web/src/main/java/com/zrlog/web/plugin/UpdateVersionTimerTask.java
|
4a91c83af669e31a22297c14f089d8911d353fa1
| 0
|
Analyze the following code function for security vulnerabilities
|
public ComponentName getActivityClassForToken(IBinder token)
throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeStrongBinder(token);
mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
reply.readException();
ComponentName res = ComponentName.readFromParcel(reply);
data.recycle();
reply.recycle();
return res;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getActivityClassForToken
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getActivityClassForToken
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getUriSegment(Uri uri, int index) {
if (uri != null) {
if (index == 0) {
return uri.getAuthority();
} else {
return uri.getPathSegments().get(index - 1);
}
} else {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUriSegment
File: services/core/java/com/android/server/content/ContentService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2426
|
MEDIUM
| 4.3
|
android
|
getUriSegment
|
services/core/java/com/android/server/content/ContentService.java
|
63363af721650e426db5b0bdfb8b2d4fe36abdb0
| 0
|
Analyze the following code function for security vulnerabilities
|
public synchronized void registerHandler(String iface, int what, Handler handler) {
SparseArray<Set<Handler>> ifaceHandlers = mHandlerMap.get(iface);
if (ifaceHandlers == null) {
ifaceHandlers = new SparseArray<>();
mHandlerMap.put(iface, ifaceHandlers);
}
Set<Handler> ifaceWhatHandlers = ifaceHandlers.get(what);
if (ifaceWhatHandlers == null) {
ifaceWhatHandlers = new ArraySet<>();
ifaceHandlers.put(what, ifaceWhatHandlers);
}
ifaceWhatHandlers.add(handler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerHandler
File: service/java/com/android/server/wifi/WifiMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
registerHandler
|
service/java/com/android/server/wifi/WifiMonitor.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
List<Modification> findRecentModifications(int count) {
// Currently impossible to check modifications on a remote repository.
InMemoryStreamConsumer consumer = inMemoryConsumer();
bombUnless(pull(consumer), "Failed to run hg pull command: " + consumer.getAllOutput());
CommandLine hg = hg("log", "--limit", String.valueOf(count), "-b", branch, "--style", templatePath());
return new HgModificationSplitter(execute(hg)).modifications();
}
|
Vulnerability Classification:
- CWE: CWE-77
- CVE: CVE-2022-29184
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Improve escaping of arguments when constructing Hg command calls
Function: findRecentModifications
File: domain/src/main/java/com/thoughtworks/go/domain/materials/mercurial/HgCommand.java
Repository: gocd
Fixed Code:
private List<Modification> findRecentModifications(int count) {
// Currently impossible to check modifications on a remote repository.
InMemoryStreamConsumer consumer = inMemoryConsumer();
bombUnless(pull(consumer), "Failed to run hg pull command: " + consumer.getAllOutput());
CommandLine hg = hg("log", "--limit", String.valueOf(count), branchArg(), "--style", templatePath());
return new HgModificationSplitter(execute(hg)).modifications();
}
|
[
"CWE-77"
] |
CVE-2022-29184
|
MEDIUM
| 6.5
|
gocd
|
findRecentModifications
|
domain/src/main/java/com/thoughtworks/go/domain/materials/mercurial/HgCommand.java
|
37d35115db2ada2190173f9413cfe1bc6c295ecb
| 1
|
Analyze the following code function for security vulnerabilities
|
Pair<String, String> getDeviceOwnerRemoteBugreportUriAndHash() {
synchronized (getLockObject()) {
final String uri = mOwners.getDeviceOwnerRemoteBugreportUri();
return uri == null ? null
: new Pair<>(uri, mOwners.getDeviceOwnerRemoteBugreportHash());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDeviceOwnerRemoteBugreportUriAndHash
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
|
getDeviceOwnerRemoteBugreportUriAndHash
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Pure
private @Nullable Number getNumeric(
int columnIndex, int scale, boolean allowNaN) throws SQLException {
byte[] value = getRawValue(columnIndex);
if (value == null) {
return null;
}
if (isBinary(columnIndex)) {
int sqlType = getSQLType(columnIndex);
if (sqlType != Types.NUMERIC && sqlType != Types.DECIMAL) {
Object obj = internalGetObject(columnIndex, fields[columnIndex - 1]);
if (obj == null) {
return null;
}
if (obj instanceof Long || obj instanceof Integer || obj instanceof Byte) {
BigDecimal res = BigDecimal.valueOf(((Number) obj).longValue());
res = scaleBigDecimal(res, scale);
return res;
}
return toBigDecimal(trimMoney(String.valueOf(obj)), scale);
} else {
Number num = ByteConverter.numeric(value);
if (allowNaN && Double.isNaN(num.doubleValue())) {
return Double.NaN;
}
return num;
}
}
Encoding encoding = connection.getEncoding();
if (encoding.hasAsciiNumbers()) {
try {
BigDecimal res = getFastBigDecimal(value);
res = scaleBigDecimal(res, scale);
return res;
} catch (NumberFormatException ignore) {
}
}
String stringValue = getFixedString(columnIndex);
if (allowNaN && "NaN".equalsIgnoreCase(stringValue)) {
return Double.NaN;
}
return toBigDecimal(stringValue, scale);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNumeric
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
|
getNumeric
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String renderString(String translationKey, Object[] parameters)
{
String word;
if (parameters.length == 0) {
word = translationKey;
} else {
String parametersString = Arrays.stream(parameters)
.map(String::valueOf)
.collect(Collectors.joining(", ", "[", "]"));
word = String.format("%s %s", translationKey, parametersString);
}
return word;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: renderString
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-page/src/main/java/org/xwiki/test/page/LocalizationSetup.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2023-29213
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
renderString
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-page/src/main/java/org/xwiki/test/page/LocalizationSetup.java
|
49fdfd633ddfa346c522d2fe71754dc72c9496ca
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addIntHeader(String arg0, int arg1) {
// ignore
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addIntHeader
File: h2/src/test/org/h2/test/server/TestWeb.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
addIntHeader
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
@JsonProperty
public String getName() {
return name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getName
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getName
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public String toXML() throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();
Element element = toDOM(document);
document.appendChild(element);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
DOMSource domSource = new DOMSource(document);
StringWriter sw = new StringWriter();
StreamResult streamResult = new StreamResult(sw);
transformer.transform(domSource, streamResult);
return sw.toString();
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2022-2414
- Severity: HIGH
- CVSS Score: 7.5
Description: Disable access to external entities when parsing XML
This reduces the vulnerability of XML parsers to XXE (XML external
entity) injection.
The best way to prevent XXE is to stop using XML altogether, which we do
plan to do. Until that happens I consider it worthwhile to tighten the
security here though.
Function: toXML
File: base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java
Repository: dogtagpki/pki
Fixed Code:
public String toXML() throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();
Element element = toDOM(document);
document.appendChild(element);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
DOMSource domSource = new DOMSource(document);
StringWriter sw = new StringWriter();
StreamResult streamResult = new StreamResult(sw);
transformer.transform(domSource, streamResult);
return sw.toString();
}
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
toXML
|
base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 1
|
Analyze the following code function for security vulnerabilities
|
public void setValidNotAfterFrom(String validNotAfterFrom) {
this.validNotAfterFrom = validNotAfterFrom;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setValidNotAfterFrom
File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setValidNotAfterFrom
|
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setValidator(Validator validator) {
this.validator = validator;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setValidator
File: ext/java/nokogiri/XmlSchema.java
Repository: sparklemotion/nokogiri
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2020-26247
|
MEDIUM
| 4
|
sparklemotion/nokogiri
|
setValidator
|
ext/java/nokogiri/XmlSchema.java
|
9c87439d9afa14a365ff13e73adc809cb2c3d97b
| 0
|
Analyze the following code function for security vulnerabilities
|
public SSLContext getSSLContext() {
return sslContext;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSSLContext
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
|
getSSLContext
|
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getActivePasswordQuality(int userId) {
int quality = getKeyguardStoredPasswordQuality(userId);
if (isLockPasswordEnabled(quality, userId)) {
// Quality is a password and a password exists. Return the quality.
return quality;
}
if (isLockPatternEnabled(quality, userId)) {
// Quality is a pattern and a pattern exists. Return the quality.
return quality;
}
return DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getActivePasswordQuality
File: core/java/com/android/internal/widget/LockPatternUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3908
|
MEDIUM
| 4.3
|
android
|
getActivePasswordQuality
|
core/java/com/android/internal/widget/LockPatternUtils.java
|
96daf7d4893f614714761af2d53dfb93214a32e4
| 0
|
Analyze the following code function for security vulnerabilities
|
public Map<String, Long> getQueueSizePerType()
{
return this.taskManager.getQueueSizePerType(this.xcontextProvider.get().getWikiId());
}
|
Vulnerability Classification:
- CWE: CWE-94
- CVE: CVE-2023-35150
- Severity: HIGH
- CVSS Score: 8.0
Description: XWIKI-20285: Improve escaping of the Invitation Application
- Introduce an internal role (DefaultXARExtensionIndex) to know if a document is provided by an extension
- Split index-api to index-api/index-default to be able to use the api in oldcore
- Fix the escaping in invitation-ui
- Provide an automatic fix during upgrade for potential escaping issues in generated code
Function: getQueueSizePerType
File: xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-api/src/main/java/org/xwiki/index/TaskConsumerScriptService.java
Repository: xwiki/xwiki-platform
Fixed Code:
public Map<String, Long> getQueueSizePerType()
{
return this.taskManager.getQueueSizePerType(this.wikiDescriptorManager.getCurrentWikiId());
}
|
[
"CWE-94"
] |
CVE-2023-35150
|
HIGH
| 8
|
xwiki/xwiki-platform
|
getQueueSizePerType
|
xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-api/src/main/java/org/xwiki/index/TaskConsumerScriptService.java
|
b65220a4d86b8888791c3b643074ebca5c089a3a
| 1
|
Analyze the following code function for security vulnerabilities
|
private static boolean isScreenshotsDirNonHidden(@NonNull String[] relativePath,
@NonNull String name) {
if (name.equalsIgnoreCase(Environment.DIRECTORY_SCREENSHOTS)) {
return (relativePath.length == 1 &&
(TextUtils.isEmpty(relativePath[0]) || isDefaultDirectoryName(relativePath[0])));
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isScreenshotsDirNonHidden
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
isScreenshotsDirNonHidden
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getProjectListString(List<Project> projects) {
return Items.toNameList(projects);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProjectListString
File: core/src/main/java/hudson/Functions.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2014-2061
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
getProjectListString
|
core/src/main/java/hudson/Functions.java
|
bf539198564a1108b7b71a973bf7de963a6213ef
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.