instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
private void addErrorPages() {
add(new DynamicPathPageMapper("/errors/404", PageNotFoundErrorPage.class));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addErrorPages
File: server-core/src/main/java/io/onedev/server/web/BaseUrlMapper.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-21242
|
HIGH
| 7.5
|
theonedev/onedev
|
addErrorPages
|
server-core/src/main/java/io/onedev/server/web/BaseUrlMapper.java
|
f864053176c08f59ef2d97fea192ceca46a4d9be
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
WindowState asWindowState() {
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: asWindowState
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
|
asWindowState
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean hasBack() {
return page > 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasBack
File: src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4040
|
MEDIUM
| 6.5
|
dotCMS/core
|
hasBack
|
src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
|
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
// 写入WebFilterChain对象
exchange.getAttributes().put(SaReactorHolder.CHAIN_KEY, chain);
// ---------- 全局认证处理
try {
// 写入全局上下文 (同步)
SaReactorSyncHolder.setContext(exchange);
// 执行全局过滤器
beforeAuth.run(null);
SaRouter.match(includeList).notMatch(excludeList).check(r -> {
auth.run(null);
});
} catch (StopMatchException e) {
// StopMatchException 异常代表:停止匹配,进入Controller
} catch (Throwable e) {
// 1. 获取异常处理策略结果
String result = (e instanceof BackResultException) ? e.getMessage() : String.valueOf(error.run(e));
// 2. 写入输出流
// 请注意此处默认 Content-Type 为 text/plain,如果需要返回 JSON 信息,需要在 return 前自行设置 Content-Type 为 application/json
// 例如:SaHolder.getResponse().setHeader("Content-Type", "application/json;charset=UTF-8");
if(exchange.getResponse().getHeaders().getFirst("Content-Type") == null) {
exchange.getResponse().getHeaders().set("Content-Type", "text/plain; charset=utf-8");
}
return exchange.getResponse().writeWith(Mono.just(exchange.getResponse().bufferFactory().wrap(result.getBytes())));
} finally {
// 清除上下文
SaReactorSyncHolder.clearContext();
}
// ---------- 执行
// 写入全局上下文 (同步)
SaReactorSyncHolder.setContext(exchange);
// 执行
return chain.filter(exchange).subscriberContext(ctx -> {
// 写入全局上下文 (异步)
ctx = ctx.put(SaReactorHolder.CONTEXT_KEY, exchange);
return ctx;
}).doFinally(r -> {
// 清除上下文
SaReactorSyncHolder.clearContext();
});
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-44794
- Severity: CRITICAL
- CVSS Score: 9.8
Description: 修复路由拦截鉴权可被绕过的问题 fix #515
Function: filter
File: sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java
Repository: dromara/Sa-Token
Fixed Code:
@Override
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
// 写入WebFilterChain对象
exchange.getAttributes().put(SaReactorHolder.CHAIN_KEY, chain);
// ---------- 全局认证处理
try {
// 写入全局上下文 (同步)
SaReactorSyncHolder.setContext(exchange);
// 执行全局过滤器
beforeAuth.run(null);
SaRouter.match(includeList).notMatch(excludeList).check(r -> {
auth.run(null);
});
} catch (StopMatchException e) {
// StopMatchException 异常代表:停止匹配,进入Controller
} catch (Throwable e) {
// 1. 获取异常处理策略结果
String result = (e instanceof BackResultException) ? e.getMessage() : String.valueOf(error.run(e));
// 2. 写入输出流
// 请注意此处默认 Content-Type 为 text/plain,如果需要返回 JSON 信息,需要在 return 前自行设置 Content-Type 为 application/json
// 例如:SaHolder.getResponse().setHeader("Content-Type", "application/json;charset=UTF-8");
if(exchange.getResponse().getHeaders().getFirst(SaTokenConsts.CONTENT_TYPE_KEY) == null) {
exchange.getResponse().getHeaders().set(SaTokenConsts.CONTENT_TYPE_KEY, SaTokenConsts.CONTENT_TYPE_TEXT_PLAIN);
}
return exchange.getResponse().writeWith(Mono.just(exchange.getResponse().bufferFactory().wrap(result.getBytes())));
} finally {
// 清除上下文
SaReactorSyncHolder.clearContext();
}
// ---------- 执行
// 写入全局上下文 (同步)
SaReactorSyncHolder.setContext(exchange);
// 执行
return chain.filter(exchange).subscriberContext(ctx -> {
// 写入全局上下文 (异步)
ctx = ctx.put(SaReactorHolder.CONTEXT_KEY, exchange);
return ctx;
}).doFinally(r -> {
// 清除上下文
SaReactorSyncHolder.clearContext();
});
}
|
[
"CWE-Other"
] |
CVE-2023-44794
|
CRITICAL
| 9.8
|
dromara/Sa-Token
|
filter
|
sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java
|
954efeb73277f924f836da2a25322ea35ee1bfa3
| 1
|
Analyze the following code function for security vulnerabilities
|
private void addBookmarkDialog()
{
final AbstractSecuredPage parentPage = (AbstractSecuredPage) getPage();
bookmarkDialog = new BookmarkDialog(parentPage.newModalDialogId());
bookmarkDialog.setOutputMarkupId(true);
parentPage.add(bookmarkDialog);
bookmarkDialog.init();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addBookmarkDialog
File: src/main/java/org/projectforge/web/core/NavTopPanel.java
Repository: micromata/projectforge-webapp
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2013-7251
|
MEDIUM
| 6.8
|
micromata/projectforge-webapp
|
addBookmarkDialog
|
src/main/java/org/projectforge/web/core/NavTopPanel.java
|
422de35e3c3141e418a73bfb39b430d5fd74077e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Transactional
@Override
public <E extends KrailEntity<ID, VER>> long count(@Nonnull Class<E> entityClass) {
checkNotNull(entityClass);
EntityManager entityManager = entityManagerProvider.get();
Query query = entityManager.createQuery("SELECT COUNT(c) FROM " + entityName(entityClass) + " c");
return (long) query.getSingleResult();
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2016-15018
- Severity: MEDIUM
- CVSS Score: 5.2
Description: Fix #18 SQLInjection vulnerability cleared
Pattern and Option DAOs re-written to a common key-value base class. Using composite primary key in place of surrogate key.
Function: count
File: src/main/java/uk/q3c/krail/jpa/persist/BaseJpaDao.java
Repository: KrailOrg/krail-jpa
Fixed Code:
@SuppressFBWarnings("SQL_INJECTION_JPA")
// The only parameter is entityName(), which is limited to either the simple class name of the entity, or its annotation
@Transactional
@Override
public <E extends KrailEntity<ID, VER>> long count(@Nonnull Class<E> entityClass) {
checkNotNull(entityClass);
EntityManager entityManager = entityManagerProvider.get();
Query query = entityManager.createQuery("SELECT COUNT(c) FROM " + entityName(entityClass) + " c");
return (long) query.getSingleResult();
}
|
[
"CWE-89"
] |
CVE-2016-15018
|
MEDIUM
| 5.2
|
KrailOrg/krail-jpa
|
count
|
src/main/java/uk/q3c/krail/jpa/persist/BaseJpaDao.java
|
c1e848665492e21ef6cc9be443205e36b9a1f6be
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void endDefinitionList(Map<String, String> parameters)
{
getXHTMLWikiPrinter().printXMLEndElement("dl");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: endDefinitionList
File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
Repository: xwiki/xwiki-rendering
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-32070
|
MEDIUM
| 6.1
|
xwiki/xwiki-rendering
|
endDefinitionList
|
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
|
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void notifyAppTransitionStarting(SparseIntArray reasons, long timestamp) {
synchronized (ActivityManagerService.this) {
mStackSupervisor.getActivityMetricsLogger().notifyTransitionStarting(
reasons, timestamp);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyAppTransitionStarting
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
|
notifyAppTransitionStarting
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public void addXObject(DocumentReference classReference, BaseObject object)
{
List<BaseObject> vobj = this.xObjects.get(classReference);
if (vobj == null) {
setXObject(classReference, 0, object);
} else {
setXObject(classReference, vobj.size(), object);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addXObject
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
|
addXObject
|
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 void addIntHeader(String name, int value) {
addHeader(name, "" + value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addIntHeader
File: src/java/winstone/WinstoneResponse.java
Repository: jenkinsci/winstone
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2011-4344
|
LOW
| 2.6
|
jenkinsci/winstone
|
addIntHeader
|
src/java/winstone/WinstoneResponse.java
|
410ed3001d51c689cf59085b7417466caa2ded7b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Order(2)
@Test
void testEditApplication()
{
// Edit the application.
ApplicationsLiveTableElement appsLiveTable = appWithinMinutesHomePage.getAppsLiveTable();
ApplicationClassEditPage classEditor = appsLiveTable.clickEditApplication(appName);
// Edit the existing class field.
ClassFieldEditPane fieldEditPane = new ClassFieldEditPane("shortText1");
fieldEditPane.setPrettyName("City Name");
fieldEditPane.openConfigPanel();
fieldEditPane.setName("cityName");
// Move to the next step.
ApplicationHomeEditPage homeEditPage = classEditor.clickNextStep().clickNextStep();
homeEditPage.setDescription("demo");
// Finish editing.
ApplicationHomePage homePage = homeEditPage.clickFinish();
assertTrue(homePage.getContent().contains("demo"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testEditApplication
File: xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-test/xwiki-platform-appwithinminutes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/AppsLiveTableIT.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29515
|
MEDIUM
| 5.4
|
xwiki/xwiki-platform
|
testEditApplication
|
xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-test/xwiki-platform-appwithinminutes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/AppsLiveTableIT.java
|
e73b890623efa604adc484ad82f37e31596fe1a6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onStrongAuthRequiredChanged(int userId) {
notifyStrongAuthStateChanged(userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onStrongAuthRequiredChanged
File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
onStrongAuthRequiredChanged
|
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setVisibilityOverride(String pkg, int uid, int visibility) {
checkCallerIsSystem();
mRankingHelper.setVisibilityOverride(pkg, uid, visibility);
savePolicyFile();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setVisibilityOverride
File: services/core/java/com/android/server/notification/NotificationManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3884
|
MEDIUM
| 4.3
|
android
|
setVisibilityOverride
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
Set<String> resolvedActions(final List<String> actions);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resolvedActions
File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
Repository: opensearch-project/security
The code follows secure coding practices.
|
[
"CWE-612",
"CWE-863"
] |
CVE-2022-41918
|
MEDIUM
| 6.3
|
opensearch-project/security
|
resolvedActions
|
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
|
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
| 0
|
Analyze the following code function for security vulnerabilities
|
public void refreshInitDataCache(String cachePath, Controller baseController, boolean cleanAble) {
if (cleanAble) {
clearCache();
FileUtils.deleteFile(cachePath);
new Tag().refreshTag();
}
initCache(baseController);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: refreshInitDataCache
File: web/src/main/java/com/zrlog/web/cache/CacheService.java
Repository: 94fzb/zrlog
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-16643
|
LOW
| 3.5
|
94fzb/zrlog
|
refreshInitDataCache
|
web/src/main/java/com/zrlog/web/cache/CacheService.java
|
4a91c83af669e31a22297c14f089d8911d353fa1
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onExtrasChanged(String callId, Bundle extras,
Session.Info info) throws RemoteException {
mConnectionServiceDelegateAdapter.onExtrasChanged(callId, extras, info);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onExtrasChanged
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
|
onExtrasChanged
|
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void animateCollapsePanels(int flags) {
animateCollapsePanels(flags, false /* force */, false /* delayed */,
1.0f /* speedUpFactor */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: animateCollapsePanels
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
animateCollapsePanels
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseUnits(final Element root) {
getChildren("unit", root).stream()
.map(e -> e.getAttribute("name"))
.map(name -> new UnitType(name, data))
.forEach(data.getUnitTypeList()::addUnitType);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseUnits
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000546
|
MEDIUM
| 6.8
|
triplea-game/triplea
|
parseUnits
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void removeByUuid_C(String uuid, long companyId) {
for (KBTemplate kbTemplate : findByUuid_C(uuid, companyId,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(kbTemplate);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeByUuid_C
File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
Repository: brianchandotcom/liferay-portal
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2017-12647
|
MEDIUM
| 4.3
|
brianchandotcom/liferay-portal
|
removeByUuid_C
|
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
|
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getQueryBaseRoute() {
final String[] split = explodePath();
if (split.length < 1) {
return "";
}
if (!split[0].toLowerCase().equals("api")) {
return split[0].toLowerCase();
}
// set the default api_version so the API call is handled by a serializer if
// an exception is thrown
this.api_version = MAX_API_VERSION;
if (split.length < 2) {
return "api";
}
if (split[1].toLowerCase().startsWith("v") && split[1].length() > 1 &&
Character.isDigit(split[1].charAt(1))) {
try {
final int version = Integer.parseInt(split[1].substring(1));
if (version > MAX_API_VERSION) {
throw new BadRequestException(HttpResponseStatus.NOT_IMPLEMENTED,
"Requested API version is greater than the max implemented",
"API version [" + version + "] is greater than the max [" +
MAX_API_VERSION + "]");
}
this.api_version = version;
} catch (NumberFormatException nfe) {
throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
"Invalid API version format supplied",
"API version [" + split[1].substring(1) +
"] cannot be parsed to an integer");
}
} else {
return "api/" + split[1].toLowerCase();
}
if (split.length < 3){
return "api";
}
return "api/" + split[2].toLowerCase();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getQueryBaseRoute
File: src/tsd/HttpQuery.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-25827
|
MEDIUM
| 6.1
|
OpenTSDB/opentsdb
|
getQueryBaseRoute
|
src/tsd/HttpQuery.java
|
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void convertNumberToInt() throws IOException
{
// First, converting from long ought to be easy
if ((_numTypesValid & NR_LONG) != 0) {
// Let's verify it's lossless conversion by simple roundtrip
int result = (int) _numberLong;
if (((long) result) != _numberLong) {
_reportError("Numeric value ("+getText()+") out of range of int");
}
_numberInt = result;
} else if ((_numTypesValid & NR_BIGINT) != 0) {
if (BI_MIN_INT.compareTo(_numberBigInt) > 0
|| BI_MAX_INT.compareTo(_numberBigInt) < 0) {
reportOverflowInt();
}
_numberInt = _numberBigInt.intValue();
} else if ((_numTypesValid & NR_DOUBLE) != 0) {
// Need to check boundaries
if (_numberDouble < MIN_INT_D || _numberDouble > MAX_INT_D) {
reportOverflowInt();
}
_numberInt = (int) _numberDouble;
} else if ((_numTypesValid & NR_FLOAT) != 0) {
if (_numberFloat < MIN_INT_D || _numberFloat > MAX_INT_D) {
reportOverflowInt();
}
_numberInt = (int) _numberFloat;
} else if ((_numTypesValid & NR_BIGDECIMAL) != 0) {
if (BD_MIN_INT.compareTo(_numberBigDecimal) > 0
|| BD_MAX_INT.compareTo(_numberBigDecimal) < 0) {
reportOverflowInt();
}
_numberInt = _numberBigDecimal.intValue();
} else {
_throwInternal();
}
_numTypesValid |= NR_INT;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertNumberToInt
File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
Repository: FasterXML/jackson-dataformats-binary
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2020-28491
|
MEDIUM
| 5
|
FasterXML/jackson-dataformats-binary
|
convertNumberToInt
|
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
|
de072d314af8f5f269c8abec6930652af67bc8e6
| 0
|
Analyze the following code function for security vulnerabilities
|
private void checkNameExist(SaveApiScenarioRequest request) {
ApiScenarioExample example = new ApiScenarioExample();
example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()).andStatusNotEqualTo("Trash").andIdNotEqualTo(request.getId());
if (apiScenarioMapper.countByExample(example) > 0) {
MSException.throwException(Translator.get("automation_name_already_exists"));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkNameExist
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
|
checkNameExist
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressJava6Requirement(reason = "Guarded by version check")
public static File createTempFile(String prefix, String suffix, File directory) throws IOException {
if (javaVersion() >= 7) {
if (directory == null) {
return Files.createTempFile(prefix, suffix).toFile();
}
return Files.createTempFile(directory.toPath(), prefix, suffix).toFile();
}
if (directory == null) {
return File.createTempFile(prefix, suffix);
}
File file = File.createTempFile(prefix, suffix, directory);
// Try to adjust the perms, if this fails there is not much else we can do...
file.setReadable(false, false);
file.setReadable(true, true);
return file;
}
|
Vulnerability Classification:
- CWE: CWE-668, CWE-378, CWE-379
- CVE: CVE-2022-24823
- Severity: LOW
- CVSS Score: 1.9
Description: Merge pull request from GHSA-269q-hmxg-m83q
* Correctly modify permission for temporary files when using Java 6 in all cases
Motivation:
[GHSA-5mcr-gq6c-3hq2](https://github.com/netty/netty/security/advisories/GHSA-5mcr-gq6c-3hq2) did not correctly fix all cases for temprory files when running on java 6.
Modifications:
- Add correctly adjust perms in all cases
- Add logging if adjusting of permissions fails
Result:
Fixes https://github.com/netty/netty/security/advisories/GHSA-269q-hmxg-m83q
* Throw on failure
Function: createTempFile
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
Fixed Code:
@SuppressJava6Requirement(reason = "Guarded by version check")
public static File createTempFile(String prefix, String suffix, File directory) throws IOException {
if (javaVersion() >= 7) {
if (directory == null) {
return Files.createTempFile(prefix, suffix).toFile();
}
return Files.createTempFile(directory.toPath(), prefix, suffix).toFile();
}
final File file;
if (directory == null) {
file = File.createTempFile(prefix, suffix);
} else {
file = File.createTempFile(prefix, suffix, directory);
}
// Try to adjust the perms, if this fails there is not much else we can do...
if (!file.setReadable(false, false)) {
throw new IOException("Failed to set permissions on temporary file " + file);
}
if (!file.setReadable(true, true)) {
throw new IOException("Failed to set permissions on temporary file " + file);
}
return file;
}
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
createTempFile
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 1
|
Analyze the following code function for security vulnerabilities
|
private void decOpenCountLocked() {
mOpenCount--;
if (mOpenCount == 0) {
nativeDestroy(mNative);
if (mAssets != null) {
mAssets.xmlBlockGone(hashCode());
}
}
}
|
Vulnerability Classification:
- CWE: CWE-415
- CVE: CVE-2023-40103
- Severity: HIGH
- CVSS Score: 7.8
Description: [res] Better native pointer tracking in Java
Make sure we clear the native pointers when freeing them,
so any race condition that calls into it gets a null instead
of calling into already freed object
Bug: 197260547
Test: build + unit tests
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7c2f195cfc8c02403d61a394213398d13584a5de)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b9ef411d0f480ee59d73601cce7fb40335a7d389)
Merged-In: I817dc2f5ef24e1fafeba3ce4c1c440abe70ad3ed
Change-Id: I817dc2f5ef24e1fafeba3ce4c1c440abe70ad3ed
Function: decOpenCountLocked
File: core/java/android/content/res/XmlBlock.java
Repository: android
Fixed Code:
private void decOpenCountLocked() {
mOpenCount--;
if (mOpenCount == 0) {
mStrings.close();
nativeDestroy(mNative);
mNative = 0;
if (mAssets != null) {
mAssets.xmlBlockGone(hashCode());
}
}
}
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
decOpenCountLocked
|
core/java/android/content/res/XmlBlock.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 1
|
Analyze the following code function for security vulnerabilities
|
@JsonIgnore
public String getWrappedPrivateData() {
return attributes.get(WRAPPED_PRIVATE_DATA);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWrappedPrivateData
File: base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getWrappedPrivateData
|
base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean appIsEligibleForBackup(ApplicationInfo app) {
// 1. their manifest states android:allowBackup="false"
if ((app.flags&ApplicationInfo.FLAG_ALLOW_BACKUP) == 0) {
return false;
}
// 2. they run as a system-level uid but do not supply their own backup agent
if ((app.uid < Process.FIRST_APPLICATION_UID) && (app.backupAgentName == null)) {
return false;
}
// 3. it is the special shared-storage backup package used for 'adb backup'
if (app.packageName.equals(BackupManagerService.SHARED_BACKUP_AGENT_PACKAGE)) {
return false;
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appIsEligibleForBackup
File: services/backup/java/com/android/server/backup/BackupManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3759
|
MEDIUM
| 5
|
android
|
appIsEligibleForBackup
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean getAutoTimeEnabled(ComponentName who) {
if (!mHasFeature) {
return false;
}
Objects.requireNonNull(who, "ComponentName is null");
final CallerIdentity caller = getCallerIdentity(who);
Preconditions.checkCallAuthorization(isProfileOwnerOnUser0(caller)
|| isProfileOwnerOfOrganizationOwnedDevice(caller) || isDefaultDeviceOwner(caller));
return mInjector.settingsGlobalGetInt(Global.AUTO_TIME, 0) > 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAutoTimeEnabled
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
|
getAutoTimeEnabled
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
protected CompletableFuture<Void> internalRemoveRetention() {
return getTopicPoliciesAsyncWithRetry(topicName)
.thenCompose(op -> {
if (!op.isPresent()) {
return CompletableFuture.completedFuture(null);
}
op.get().setRetentionPolicies(null);
return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, op.get());
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalRemoveRetention
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalRemoveRetention
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
private void associateStartingDataWithTask() {
mStartingData.mAssociatedTask = task;
task.forAllActivities(r -> {
if (r.mVisibleRequested && !r.firstWindowDrawn) {
r.mSharedStartingData = mStartingData;
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: associateStartingDataWithTask
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
associateStartingDataWithTask
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean canCallPhone(String callingPackage, String callingFeatureId, String message) {
// The system/default dialer can always read phone state - so that emergency calls will
// still work.
if (isPrivilegedDialerCalling(callingPackage)) {
return true;
}
// Accessing phone state is gated by a special permission.
mContext.enforceCallingOrSelfPermission(CALL_PHONE, message);
// Some apps that have the permission can be restricted via app ops.
return mAppOpsManager.noteOp(AppOpsManager.OP_CALL_PHONE,
Binder.getCallingUid(), callingPackage, callingFeatureId, message)
== AppOpsManager.MODE_ALLOWED;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canCallPhone
File: src/com/android/server/telecom/TelecomServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21394
|
MEDIUM
| 5.5
|
android
|
canCallPhone
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
68dca62035c49e14ad26a54f614199cb29a3393f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void clearUserPoliciesLocked(int userId) {
// Reset some of the user-specific policies.
final DevicePolicyData policy = getUserData(userId);
policy.mPermissionPolicy = DevicePolicyManager.PERMISSION_POLICY_PROMPT;
// Clear delegations.
policy.mDelegationMap.clear();
policy.mStatusBarDisabled = false;
policy.mSecondaryLockscreenEnabled = false;
policy.mUserProvisioningState = DevicePolicyManager.STATE_USER_UNMANAGED;
policy.mAffiliationIds.clear();
policy.mLockTaskPackages.clear();
updateLockTaskPackagesLocked(policy.mLockTaskPackages, userId);
policy.mLockTaskFeatures = DevicePolicyManager.LOCK_TASK_FEATURE_NONE;
saveSettingsLocked(userId);
try {
mIPermissionManager.updatePermissionFlagsForAllApps(
PackageManager.FLAG_PERMISSION_POLICY_FIXED,
0 /* flagValues */, userId);
pushUserRestrictions(userId);
} catch (RemoteException re) {
// Shouldn't happen.
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearUserPoliciesLocked
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
|
clearUserPoliciesLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void executeAs(final ServletRequest request, final ServletResponse response, final FilterChain chain, Subject subject) {
try {
Subject.doAs(subject, new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
chain.doFilter(request, response);
return null;
}
});
} catch (PrivilegedActionException e) {
LOG.info("Failed to invoke action " + ((HttpServletRequest) request).getPathInfo() + " due to:", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeAs
File: hawtio-system/src/main/java/io/hawt/web/AuthenticationFilter.java
Repository: hawtio
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2014-0121
|
HIGH
| 7.5
|
hawtio
|
executeAs
|
hawtio-system/src/main/java/io/hawt/web/AuthenticationFilter.java
|
5289715e4f2657562fdddcbad830a30969b96e1e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public WearableExtender setCustomSizePreset(int sizePreset) {
mCustomSizePreset = sizePreset;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCustomSizePreset
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
setCustomSizePreset
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
public void setMonitoring(String iface, boolean enabled) {
mMonitoringMap.put(iface, enabled);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMonitoring
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
|
setMonitoring
|
service/java/com/android/server/wifi/WifiMonitor.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<IssueWithParams> getErrors() {
return mErrors;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getErrors
File: src/main/java/com/android/apksig/ApkVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
getErrors
|
src/main/java/com/android/apksig/ApkVerifier.java
|
039f815895f62c9f8af23df66622b66246f3f61e
| 0
|
Analyze the following code function for security vulnerabilities
|
public CarExtender setLargeIcon(Bitmap largeIcon) {
mLargeIcon = largeIcon;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLargeIcon
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
setLargeIcon
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getAppOrientation(IApplicationToken token) {
synchronized(mWindowMap) {
AppWindowToken wtoken = findAppWindowToken(token.asBinder());
if (wtoken == null) {
return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
}
return wtoken.requestedOrientation;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAppOrientation
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
|
getAppOrientation
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 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 requestElement = toDOM(document);
document.appendChild(requestElement);
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/cert/CertRevokeRequest.java
Repository: dogtagpki/pki
Fixed Code:
public String toXML() throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();
Element requestElement = toDOM(document);
document.appendChild(requestElement);
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/cert/CertRevokeRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 1
|
Analyze the following code function for security vulnerabilities
|
boolean isAssociatedCompanionApp(int userId, int uid) {
final Set<Integer> allUids = mCompanionAppUidsMap.get(userId);
if (allUids == null) {
return false;
}
return allUids.contains(uid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAssociatedCompanionApp
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
isAssociatedCompanionApp
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
String findSelectAid(byte[] data) {
if (data == null || data.length < SELECT_APDU_HDR_LENGTH + MINIMUM_AID_LENGTH) {
if (DBG) Log.d(TAG, "Data size too small for SELECT APDU");
return null;
}
// To accept a SELECT AID for dispatch, we require the following:
// Class byte must be 0x00: logical channel set to zero, no secure messaging, no chaining
// Instruction byte must be 0xA4: SELECT instruction
// P1: must be 0x04: select by application identifier
// P2: File control information is only relevant for higher-level application,
// and we only support "first or only occurrence".
if (data[0] == 0x00 && data[1] == INSTR_SELECT && data[2] == 0x04) {
if (data[3] != 0x00) {
Log.d(TAG, "Selecting next, last or previous AID occurrence is not supported");
}
int aidLength = data[4];
if (data.length < SELECT_APDU_HDR_LENGTH + aidLength) {
return null;
}
return bytesToString(data, SELECT_APDU_HDR_LENGTH, aidLength);
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findSelectAid
File: src/com/android/nfc/cardemulation/HostEmulationManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35671
|
MEDIUM
| 5.5
|
android
|
findSelectAid
|
src/com/android/nfc/cardemulation/HostEmulationManager.java
|
745632835f3d97513a9c2a96e56e1dc06c4e4176
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isApiRequest(HttpServletRequest req) {
return req.getRequestURI().startsWith(CONF.serverContextPath() + "/api/") || req.getRequestURI().equals(CONF.serverContextPath() + "/api");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isApiRequest
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
isApiRequest
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
public synchronized void updateDouble(@Positive int columnIndex, double x) throws SQLException {
updateValue(columnIndex, x);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateDouble
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
|
updateDouble
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
public NotificationHistory getNotificationHistory(String pkg, String attributionTag) {
try {
return sINM.getNotificationHistory(pkg, attributionTag);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
}
return new NotificationHistory();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNotificationHistory
File: src/com/android/settings/notification/NotificationBackend.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35667
|
HIGH
| 7.8
|
android
|
getNotificationHistory
|
src/com/android/settings/notification/NotificationBackend.java
|
d8355ac47e068ad20c6a7b1602e72f0585ec0085
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public List<Structure> getStructuresByType(int structureType) {
List<Structure> structuresByType = null;
try{
structuresByType = (List<Structure>) cache.get(structuresByTypeGroup + structureType, structuresByTypeGroup);
return structuresByType;
} catch (DotCacheException e) {
Logger.debug(ContentTypeCacheImpl.class, "Cache Entry not found: ", e);
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStructuresByType
File: src/com/dotmarketing/cache/ContentTypeCacheImpl.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-2355
|
HIGH
| 7.5
|
dotCMS/core
|
getStructuresByType
|
src/com/dotmarketing/cache/ContentTypeCacheImpl.java
|
897f3632d7e471b7a73aabed5b19f6f53d4e5562
| 0
|
Analyze the following code function for security vulnerabilities
|
ActivityStarter setInTask(Task inTask) {
mRequest.inTask = inTask;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setInTask
File: services/core/java/com/android/server/wm/ActivityStarter.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-269"
] |
CVE-2023-21269
|
HIGH
| 7.8
|
android
|
setInTask
|
services/core/java/com/android/server/wm/ActivityStarter.java
|
70ec64dc5a2a816d6aa324190a726a85fd749b30
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handleIpReachabilityFailure(ReachabilityLossInfoParcelable lossInfo) {
if (lossInfo == null || lossInfo.reason == ReachabilityLossReason.CONFIRM
|| lossInfo.reason == ReachabilityLossReason.ORGANIC) {
mWifiMetrics.logStaEvent(mInterfaceName, StaEvent.TYPE_CMD_IP_REACHABILITY_LOST);
mWifiMetrics.logWifiIsUnusableEvent(mInterfaceName,
WifiIsUnusableEvent.TYPE_IP_REACHABILITY_LOST);
mWifiMetrics.addToWifiUsabilityStatsList(mInterfaceName,
WifiUsabilityStats.LABEL_BAD,
WifiUsabilityStats.TYPE_IP_REACHABILITY_LOST, -1);
if (mWifiGlobals.getIpReachabilityDisconnectEnabled()) {
handleIpReachabilityLost();
} else {
logd("CMD_IP_REACHABILITY_LOST but disconnect disabled -- ignore");
}
return;
}
if (lossInfo.reason == ReachabilityLossReason.ROAM) {
final WifiConfiguration config = getConnectedWifiConfigurationInternal();
final NetworkAgentConfig naConfig = getNetworkAgentConfigInternal(config);
final NetworkCapabilities nc = getCapabilities(
getConnectedWifiConfigurationInternal(), getConnectedBssidInternal());
mWifiInfo.setInetAddress(null);
if (mNetworkAgent != null) {
if (SdkLevel.isAtLeastT()) {
mNetworkAgent.unregisterAfterReplacement(NETWORK_AGENT_TEARDOWN_DELAY_MS);
} else {
mNetworkAgent.unregister();
}
}
mNetworkAgent = mWifiInjector.makeWifiNetworkAgent(nc, mLinkProperties, naConfig,
mNetworkFactory.getProvider(), new WifiNetworkAgentCallback());
mWifiScoreReport.setNetworkAgent(mNetworkAgent);
if (SdkLevel.isAtLeastT()) {
mQosPolicyRequestHandler.setNetworkAgent(mNetworkAgent);
}
transitionTo(mL3ProvisioningState);
} else {
logd("Invalid failure reason from onIpReachabilityFailure");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleIpReachabilityFailure
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
|
handleIpReachabilityFailure
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
private JsonNode yamlStreamToJson(InputStream yamlStream) {
Yaml reader = new Yaml();
ObjectMapper mapper = new ObjectMapper();
return mapper.valueToTree(reader.load(yamlStream));
}
|
Vulnerability Classification:
- CWE: CWE-502
- CVE: CVE-2021-41110
- Severity: HIGH
- CVSS Score: 7.5
Description: Use Yaml SafeConstructor (#355)
Function: yamlStreamToJson
File: src/main/java/org/commonwl/view/cwl/CWLService.java
Repository: common-workflow-language/cwlviewer
Fixed Code:
private JsonNode yamlStreamToJson(InputStream yamlStream) {
Yaml reader = new Yaml(new SafeConstructor());
ObjectMapper mapper = new ObjectMapper();
return mapper.valueToTree(reader.load(yamlStream));
}
|
[
"CWE-502"
] |
CVE-2021-41110
|
HIGH
| 7.5
|
common-workflow-language/cwlviewer
|
yamlStreamToJson
|
src/main/java/org/commonwl/view/cwl/CWLService.java
|
f6066f09edb70033a2ce80200e9fa9e70a5c29de
| 1
|
Analyze the following code function for security vulnerabilities
|
private boolean packageExistsForUser(String packageName, int userId) {
try {
final long identityToken = clearCallingIdentity();
try {
mPackageManager.getPackageUidAsUser(packageName, userId);
return true;
} finally {
restoreCallingIdentity(identityToken);
}
} catch (NameNotFoundException e) {
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: packageExistsForUser
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
packageExistsForUser
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setAttributes(Collection<ProfileAttribute> attrs) {
this.attrs.clear();
this.attrs.addAll(attrs);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAttributes
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setAttributes
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<WarmCacheEntry> getWarmCacheEntries() {
if (myWarmCacheEntries == null) {
myWarmCacheEntries = new ArrayList<>();
}
return myWarmCacheEntries;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWarmCacheEntries
File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
Repository: hapifhir/hapi-fhir
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-32053
|
MEDIUM
| 5
|
hapifhir/hapi-fhir
|
getWarmCacheEntries
|
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
|
f2934b229c491235ab0e7782dea86b324521082a
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean domainMatchesUser(LdapName domainName, String userDn) {
try {
// Extract the DC RDNs from the userDn.
LdapName userName = new LdapName(userDn);
ArrayList<Rdn> userDnDomain = new ArrayList<Rdn>(userName.size());
for (Rdn rdn : userName.getRdns()) {
if (rdn.getType().equalsIgnoreCase("dc")) {
userDnDomain.add(rdn);
}
}
// LDAP numbers RDNs from right to left, and we want a match on
// the left (starting with the subdomain), that is, on the end.
return new LdapName(userDnDomain).endsWith(domainName);
} catch (InvalidNameException e) {
LOGGER.log(Level.WARNING,
"Error matching domain " + domainName + " for user " + userDn, e);
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: domainMatchesUser
File: projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java
Repository: AnantLabs/google-enterprise-connector-dctm
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2014-125083
|
MEDIUM
| 5.2
|
AnantLabs/google-enterprise-connector-dctm
|
domainMatchesUser
|
projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java
|
6fba04f18ab7764002a1da308e7cd9712b501cb7
| 0
|
Analyze the following code function for security vulnerabilities
|
private void enforcePhoneAccountModificationForPackage(String packageName) {
// TODO: Use a new telecomm permission for this instead of reusing modify.
int result = mContext.checkCallingOrSelfPermission(MODIFY_PHONE_STATE);
// Callers with MODIFY_PHONE_STATE can use the PhoneAccount mechanism to implement
// built-in behavior even when PhoneAccounts are not exposed as a third-part API. They
// may also modify PhoneAccounts on behalf of any 'packageName'.
if (result != PackageManager.PERMISSION_GRANTED) {
// Other callers are only allowed to modify PhoneAccounts if the relevant system
// feature is enabled ...
enforceConnectionServiceFeature();
// ... and the PhoneAccounts they refer to are for their own package.
enforceCallingPackage(packageName);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enforcePhoneAccountModificationForPackage
File: src/com/android/server/telecom/TelecomServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0847
|
HIGH
| 7.2
|
android
|
enforcePhoneAccountModificationForPackage
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
2750faaa1ec819eed9acffea7bd3daf867fda444
| 0
|
Analyze the following code function for security vulnerabilities
|
public Connection newConnection(List<Address> addrs, String clientProvidedName) throws IOException, TimeoutException {
return newConnection(this.sharedExecutor, addrs, clientProvidedName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newConnection
File: src/main/java/com/rabbitmq/client/ConnectionFactory.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
newConnection
|
src/main/java/com/rabbitmq/client/ConnectionFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
private float getQsExpansionFraction() {
return Math.min(1f, (mQsExpansionHeight - mQsMinExpansionHeight)
/ (getTempQsMaxExpansion() - mQsMinExpansionHeight));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getQsExpansionFraction
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
getQsExpansionFraction
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public Object getDynamic(String token) {
for (Action a : getActions()) {
String url = a.getUrlName();
if (url==null) continue;
if (url.equals(token) || url.equals('/' + token))
return a;
}
for (Action a : getManagementLinks())
if(a.getUrlName().equals(token))
return a;
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDynamic
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
getDynamic
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private static EntityReferenceResolver<String> getXClassEntityReferenceResolver()
{
return Utils.getComponent(EntityReferenceResolver.TYPE_STRING, "xclass");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getXClassEntityReferenceResolver
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
|
getXClassEntityReferenceResolver
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
mAccessibilityController.removeStateChangedCallback(this);
mRightExtension.destroy();
mLeftExtension.destroy();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onDetachedFromWindow
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
onDetachedFromWindow
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void requestSuccess(Buffer buffer) throws Exception {
resetIdleTimeout();
// Remove at end
GlobalRequestFuture request = pendingGlobalRequests.pollLast();
if (request != null) {
// use a copy of the original data in case it is re-used on return
Buffer resultBuf = ByteArrayBuffer.getCompactClone(buffer.array(), buffer.rpos(), buffer.available());
GlobalRequestFuture.ReplyHandler handler = request.getHandler();
if (handler != null) {
handler.accept(SshConstants.SSH_MSG_REQUEST_SUCCESS, resultBuf);
} else {
request.setValue(resultBuf);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestSuccess
File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
Repository: apache/mina-sshd
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
apache/mina-sshd
|
requestSuccess
|
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
|
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
| 0
|
Analyze the following code function for security vulnerabilities
|
private void migrate60(File dataDir, Stack<Integer> versions) {
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("Settings.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
if (element.elementTextTrim("key").equals("JOB_EXECUTORS")) {
Element valueElement = element.element("value");
if (valueElement != null) {
for (Element executorElement: valueElement.elements()) {
if (executorElement.getName().equals("io.onedev.server.plugin.docker.DockerExecutor"))
executorElement.setName("io.onedev.server.plugin.executor.docker.DockerExecutor");
}
}
}
}
dom.writeToFile(file, false);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate60
File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2023-24828
|
HIGH
| 8.8
|
theonedev/onedev
|
migrate60
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isForegroundService() {
return (flags & Notification.FLAG_FOREGROUND_SERVICE) != 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isForegroundService
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
isForegroundService
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isAppSearchEnabled() {
return mIsAppSearchEnabled;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAppSearchEnabled
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
|
isAppSearchEnabled
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int focusChangedLw(WindowState lastFocus, WindowState newFocus) {
mFocusedWindow = newFocus;
if ((updateSystemUiVisibilityLw()&SYSTEM_UI_CHANGING_LAYOUT) != 0) {
// If the navigation bar has been hidden or shown, we need to do another
// layout pass to update that window.
return FINISH_LAYOUT_REDO_LAYOUT;
}
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: focusChangedLw
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
focusChangedLw
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void onInstalledCertificatesChanged(final UserHandle userHandle,
final @NonNull Collection<String> installedCertificates) {
if (!mHasFeature) {
return;
}
Preconditions.checkCallAuthorization(canManageUsers(getCallerIdentity()));
synchronized (getLockObject()) {
final DevicePolicyData policy = getUserData(userHandle.getIdentifier());
boolean changed = false;
changed |= policy.mAcceptedCaCertificates.retainAll(installedCertificates);
changed |= policy.mOwnerInstalledCaCerts.retainAll(installedCertificates);
if (changed) {
saveSettingsLocked(userHandle.getIdentifier());
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onInstalledCertificatesChanged
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
|
onInstalledCertificatesChanged
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean start(Activity activity, Bundle options) {
throw new RuntimeException("ChooserTargets should be started as caller.");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: start
File: core/java/com/android/internal/app/ChooserActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-254",
"CWE-19"
] |
CVE-2016-3752
|
HIGH
| 7.5
|
android
|
start
|
core/java/com/android/internal/app/ChooserActivity.java
|
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
| 0
|
Analyze the following code function for security vulnerabilities
|
List<String> getRawCommandLine( String executableParameter, String... argumentsParameter )
{
List<String> commandLine = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
if ( executableParameter != null )
{
String preamble = getExecutionPreamble();
if ( preamble != null )
{
sb.append( preamble );
}
if ( isQuotedExecutableEnabled() )
{
char[] escapeChars =
getEscapeChars( isSingleQuotedExecutableEscaped(), isDoubleQuotedExecutableEscaped() );
sb.append( StringUtils.quoteAndEscape( getExecutable(), getExecutableQuoteDelimiter(), escapeChars,
getQuotingTriggerChars(), '\\', false ) );
}
else
{
sb.append( getExecutable() );
}
}
for ( String argument : argumentsParameter )
{
if ( sb.length() > 0 )
{
sb.append( ' ' );
}
if ( isQuotedArgumentsEnabled() )
{
char[] escapeChars = getEscapeChars( isSingleQuotedArgumentEscaped(), isDoubleQuotedArgumentEscaped() );
sb.append( StringUtils.quoteAndEscape( argument, getArgumentQuoteDelimiter(), escapeChars,
getQuotingTriggerChars(), '\\', false ) );
}
else
{
sb.append( argument );
}
}
commandLine.add( sb.toString() );
return commandLine;
}
|
Vulnerability Classification:
- CWE: CWE-116
- CVE: CVE-2022-29599
- Severity: HIGH
- CVSS Score: 7.5
Description: [MSHARED-297] - BourneShell unconditionally single quotes executable and arguments
Function: getRawCommandLine
File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
Repository: apache/maven-shared-utils
Fixed Code:
List<String> getRawCommandLine( String executableParameter, String... argumentsParameter )
{
List<String> commandLine = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
if ( executableParameter != null )
{
String preamble = getExecutionPreamble();
if ( preamble != null )
{
sb.append( preamble );
}
if ( isQuotedExecutableEnabled() )
{
sb.append( quoteOneItem( executableParameter, true ) );
}
else
{
sb.append( executableParameter );
}
}
for ( String argument : argumentsParameter )
{
if ( sb.length() > 0 )
{
sb.append( ' ' );
}
if ( isQuotedArgumentsEnabled() )
{
sb.append( quoteOneItem( argument, false ) );
}
else
{
sb.append( argument );
}
}
commandLine.add( sb.toString() );
return commandLine;
}
|
[
"CWE-116"
] |
CVE-2022-29599
|
HIGH
| 7.5
|
apache/maven-shared-utils
|
getRawCommandLine
|
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
|
2735facbbbc2e13546328cb02dbb401b3776eea3
| 1
|
Analyze the following code function for security vulnerabilities
|
private static X509Certificate[] acceptedIssuers(KeyStore ks) {
try {
// Note that unlike the PKIXParameters code to create a Set of
// TrustAnchors from a KeyStore, this version takes from both
// TrustedCertificateEntry and PrivateKeyEntry, not just
// TrustedCertificateEntry, which is why TrustManagerImpl
// cannot just use an PKIXParameters(KeyStore)
// constructor.
// TODO remove duplicates if same cert is found in both a
// PrivateKeyEntry and TrustedCertificateEntry
List<X509Certificate> trusted = new ArrayList<X509Certificate>();
for (Enumeration<String> en = ks.aliases(); en.hasMoreElements();) {
final String alias = en.nextElement();
final X509Certificate cert = (X509Certificate) ks.getCertificate(alias);
if (cert != null) {
trusted.add(cert);
}
}
return trusted.toArray(new X509Certificate[trusted.size()]);
} catch (KeyStoreException e) {
return new X509Certificate[0];
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: acceptedIssuers
File: src/platform/java/org/conscrypt/TrustManagerImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-254",
"CWE-345"
] |
CVE-2016-0818
|
MEDIUM
| 4.3
|
android
|
acceptedIssuers
|
src/platform/java/org/conscrypt/TrustManagerImpl.java
|
c4ab1b959280413fb11bf4fd7f6b4c2ba38bd779
| 0
|
Analyze the following code function for security vulnerabilities
|
@GetMapping("/deleteFile")
public String deleteFile(String fileName) throws JsonProcessingException {
if (fileName.contains("/")) {
fileName = fileName.substring(fileName.lastIndexOf("/") + 1);
}
File file = new File(fileDir + demoPath + fileName);
logger.info("删除文件:{}", file.getAbsolutePath());
if (file.exists() && !file.delete()) {
logger.error("删除文件【{}】失败,请检查目录权限!", file.getPath());
}
return new ObjectMapper().writeValueAsString(ReturnResponse.success());
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2022-36593
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Fix #370
Function: deleteFile
File: server/src/main/java/cn/keking/web/controller/FileController.java
Repository: kekingcn/kkFileView
Fixed Code:
@GetMapping("/deleteFile")
public ReturnResponse<Object> deleteFile(String fileName) throws JsonProcessingException {
if (fileName.contains("/")) {
fileName = fileName.substring(fileName.lastIndexOf("/") + 1);
}
if (KkFileUtils.isIllegalFileName(fileName)) {
return ReturnResponse.failure("非法文件名,删除失败!");
}
File file = new File(fileDir + demoPath + fileName);
logger.info("删除文件:{}", file.getAbsolutePath());
if (file.exists() && !file.delete()) {
String msg = String.format("删除文件【%s】失败,请检查目录权限!", file.getPath());
logger.error(msg);
return ReturnResponse.failure(msg);
}
return ReturnResponse.success();
}
|
[
"CWE-22"
] |
CVE-2022-36593
|
MEDIUM
| 6.5
|
kekingcn/kkFileView
|
deleteFile
|
server/src/main/java/cn/keking/web/controller/FileController.java
|
86960e38135f551e8343d44caf4bac0a66234657
| 1
|
Analyze the following code function for security vulnerabilities
|
public void execute(String sql, JsonArray params, Handler<AsyncResult<UpdateResult>> replyHandler) {
long s = System.nanoTime();
client.getConnection(res -> {
if (res.failed()) {
replyHandler.handle(Future.failedFuture(res.cause()));
return;
}
SQLConnection connection = res.result();
try {
connection.updateWithParams(sql, params, query -> {
connection.close();
if (query.failed()) {
replyHandler.handle(Future.failedFuture(query.cause()));
} else {
replyHandler.handle(Future.succeededFuture(query.result()));
}
logTimer("executeWithParams", sql, s);
});
} catch (Exception e) {
if (connection != null) {
connection.close();
}
log.error(e.getMessage(), e);
replyHandler.handle(Future.failedFuture(e));
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: execute
File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
execute
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@Beta
@Deprecated
public static String toString(File file, Charset charset) throws IOException {
return asCharSource(file, charset).read();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: android/guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2020-8908
|
LOW
| 2.1
|
google/guava
|
toString
|
android/guava/src/com/google/common/io/Files.java
|
fec0dbc4634006a6162cfd4d0d09c962073ddf40
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public byte[] getJMSCorrelationIDAsBytes() throws JMSException {
String id = this.getStringProperty(JMS_MESSAGE_CORR_ID);
if (id != null)
return id.getBytes(getCharset());
else
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getJMSCorrelationIDAsBytes
File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java
Repository: rabbitmq/rabbitmq-jms-client
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2020-36282
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-jms-client
|
getJMSCorrelationIDAsBytes
|
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
|
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onDialogShowing() {
super.onDialogShowing();
setOnDismissListener(this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onDialogShowing
File: src/com/android/settings/users/UserSettings.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3889
|
HIGH
| 7.2
|
android
|
onDialogShowing
|
src/com/android/settings/users/UserSettings.java
|
bd5d5176c74021e8cf4970f93f273ba3023c3d72
| 0
|
Analyze the following code function for security vulnerabilities
|
void setOomAdjObserver(int uid, OomAdjObserver observer) {
synchronized (mOomAdjObserverLock) {
mCurOomAdjUid = uid;
mCurOomAdjObserver = observer;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOomAdjObserver
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
|
setOomAdjObserver
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean selectAll(boolean refresh) {
// select will fire the event
final Indexed container = getParentGrid().getContainerDataSource();
if (container != null) {
return select(container.getItemIds(), refresh);
} else if (selection.isEmpty()) {
return false;
} else {
/*
* this should never happen (no container but has a selection),
* but I guess the only theoretically correct course of
* action...
*/
return deselectAll(false);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectAll
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
selectAll
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
public XmlGenerator appendLabels(Set<String> labels) {
if (!labels.isEmpty()) {
open("client-labels");
for (String label : labels) {
node("label", label);
}
close();
}
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendLabels
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-522"
] |
CVE-2023-33264
|
MEDIUM
| 4.3
|
hazelcast
|
appendLabels
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
80a502d53cc48bf895711ab55f95e3a51e344ac1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public <T> List<T> search(String sql, int nb, int start, List<?> parameterValues, XWikiContext context)
throws XWikiException
{
return search(sql, nb, start, null, parameterValues, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: search
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
|
search
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean relative(int rows) throws SQLException {
checkScrollable();
if (onInsertRow) {
throw new PSQLException(GT.tr("Can''t use relative move methods while on the insert row."),
PSQLState.INVALID_CURSOR_STATE);
}
// have to add 1 since absolute expects a 1-based index
int index = currentRow + 1 + rows;
if (index < 0) {
beforeFirst();
return false;
}
return absolute(index);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: relative
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
|
relative
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@GetMapping("/search")
public String search(@RequestParam(defaultValue = "1") Integer pageNo, @RequestParam String keyword, Model model) {
model.addAttribute("pageNo", pageNo);
// model.addAttribute("keyword", SecurityUtil.sanitizeInput(keyword));
model.addAttribute("keyword", keyword);
return render("search");
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2022-23391
- Severity: MEDIUM
- CVSS Score: 4.3
Description: 修复了一部分页面上输入框的xss注入
https://github.com/atjiu/pybbs/issues/171
Function: search
File: src/main/java/co/yiiu/pybbs/controller/front/IndexController.java
Repository: atjiu/pybbs
Fixed Code:
@GetMapping("/search")
public String search(@RequestParam(defaultValue = "1") Integer pageNo, @RequestParam String keyword, Model model) {
model.addAttribute("pageNo", pageNo);
// model.addAttribute("keyword", SecurityUtil.sanitizeInput(keyword));
keyword = Jsoup.clean(keyword, Whitelist.basic());
model.addAttribute("keyword", keyword.replace("\"", "").replace("'", ""));
return render("search");
}
|
[
"CWE-79"
] |
CVE-2022-23391
|
MEDIUM
| 4.3
|
atjiu/pybbs
|
search
|
src/main/java/co/yiiu/pybbs/controller/front/IndexController.java
|
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean updateDocument(XWikiDocument document)
{
boolean needsUpdate = false;
if (updateReferences(document)) {
needsUpdate = true;
}
// Ensure the document is hidden, like every technical document
if (!document.isHidden()) {
document.setHidden(true);
needsUpdate = true;
}
// Set the title
if (document.getTitle().isEmpty()) {
document.setTitle("Mail Configuration");
needsUpdate = true;
}
// Ensure the document has a Mail.GeneralMailConfigClass xobject
if (addGeneralMailConfigClassXObject(document)) {
needsUpdate = true;
}
// Ensure the document has a Mail.SendMailConfigClass xobject
if (addSendMailConfigClassXObject(document)) {
needsUpdate = true;
}
// Migration: Since the XWiki.Configurable class used to be located in Mail.MailConfig and has been moved to
// Mail.MailConfigurable, we need to remove it from this page in case it's there as otherwise there would be
// duplicate Admin UI entries...
// TODO: Ideally this code should be executed only once.
if (removeConfigurableClass(document)) {
needsUpdate = true;
}
return needsUpdate;
}
|
Vulnerability Classification:
- CWE: CWE-269
- CVE: CVE-2023-34465
- Severity: HIGH
- CVSS Score: 8.1
Description: XWIKI-20519: Improve Mail.MailConfig initialization
Function: updateDocument
File: xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-default/src/main/java/org/xwiki/mail/internal/MailConfigMandatoryDocumentInitializer.java
Repository: xwiki/xwiki-platform
Fixed Code:
@Override
public boolean updateDocument(XWikiDocument document)
{
boolean needsUpdate = false;
if (updateReferences(document)) {
needsUpdate = true;
}
// Ensure the document is hidden, like every technical document
if (!document.isHidden()) {
document.setHidden(true);
needsUpdate = true;
}
// Set the title
if (document.getTitle().isEmpty()) {
document.setTitle("Mail Configuration");
needsUpdate = true;
}
// Ensure the document has a Mail.GeneralMailConfigClass xobject
if (addGeneralMailConfigClassXObject(document)) {
needsUpdate = true;
}
// Ensure the document has a Mail.SendMailConfigClass xobject
if (addSendMailConfigClassXObject(document)) {
needsUpdate = true;
}
// Migration: Since the XWiki.Configurable class used to be located in Mail.MailConfig and has been moved to
// Mail.MailConfigurable, we need to remove it from this page in case it's there as otherwise there would be
// duplicate Admin UI entries...
// TODO: Ideally this code should be executed only once.
if (removeConfigurableClass(document)) {
needsUpdate = true;
}
if (this.documentInitializerRightsManager.restrictToAdmin(document)) {
needsUpdate = true;
}
return needsUpdate;
}
|
[
"CWE-269"
] |
CVE-2023-34465
|
HIGH
| 8.1
|
xwiki/xwiki-platform
|
updateDocument
|
xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-default/src/main/java/org/xwiki/mail/internal/MailConfigMandatoryDocumentInitializer.java
|
d28d7739089e1ae8961257d9da7135d1a01cb7d4
| 1
|
Analyze the following code function for security vulnerabilities
|
private void addCookie(Cookie c, CookieManager mgr, java.text.SimpleDateFormat format) {
String d = c.getDomain();
String port = "";
if (d.contains(":")) {
// For some reason, the port must be stripped and stored separately
// or it won't retrieve it properly.
// https://github.com/codenameone/CodenameOne/issues/2804
port = "; Port=" + d.substring(d.indexOf(":")+1);
d = d.substring(0, d.indexOf(":"));
}
String cookieString = c.getName() + "=" + c.getValue() +
"; Domain=" + d +
port +
"; Path=" + c.getPath() +
"; " + (c.isSecure() ? "Secure;" : "")
+ (c.getExpires() != 0 ? (" Expires="+format.format(new Date(c.getExpires()))+";") : "")
+ (c.isHttpOnly() ? "httpOnly;" : "");
String cookieUrl = "http" +
(c.isSecure() ? "s" : "") + "://" +
d +
c.getPath();
mgr.setCookie(cookieUrl, cookieString);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addCookie
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
|
addCookie
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public UriBuilder getUriBuilder(Object resourceUri, Map<String, Object[]> queryParams)
{
// Create URI builder
UriBuilder builder;
if (resourceUri instanceof Class) {
builder = getUriBuilder((Class) resourceUri);
} else {
String stringResourceUri = (String) resourceUri;
builder = UriBuilder.fromUri(getBaseURL().substring(0, getBaseURL().length() - 1))
.path(!stringResourceUri.isEmpty() && stringResourceUri.charAt(0) == '/'
? stringResourceUri.substring(1) : stringResourceUri);
}
// Add query parameters
if (queryParams != null) {
for (Map.Entry<String, Object[]> entry : queryParams.entrySet()) {
builder.queryParam(entry.getKey(), entry.getValue());
}
}
return builder;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUriBuilder
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
|
getUriBuilder
|
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
|
private boolean insertSystemSetting(String name, String value, int requestingUserId,
boolean overrideableByRestore) {
if (DEBUG) {
Slog.v(LOG_TAG, "insertSystemSetting(" + name + ", " + value + ", "
+ requestingUserId + ")");
}
return mutateSystemSetting(name, value, requestingUserId, MUTATION_OPERATION_INSERT,
overrideableByRestore);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: insertSystemSetting
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
insertSystemSetting
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
private void hidePopupsAndClearSelection() {
mUnselectAllOnActionModeDismiss = true;
hidePopups();
// Clear the selection. The selection is cleared on destroying IME
// and also here since we may receive destroy first, for example
// when focus is lost in webview.
clearUserSelection();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hidePopupsAndClearSelection
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-1021"
] |
CVE-2015-1241
|
MEDIUM
| 4.3
|
chromium
|
hidePopupsAndClearSelection
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void wanReplicationConfigXmlGenerator(XmlGenerator gen, WanReplicationRef wan) {
if (wan != null) {
gen.open("wan-replication-ref", "name", wan.getName())
.node("merge-policy", wan.getMergePolicy());
List<String> filters = wan.getFilters();
if (CollectionUtil.isNotEmpty(filters)) {
gen.open("filters");
for (String f : filters) {
gen.node("filter-impl", f);
}
gen.close();
}
gen.node("republishing-enabled", wan.isRepublishingEnabled())
.close();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: wanReplicationConfigXmlGenerator
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
wanReplicationConfigXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public AsyncHttpClientConfigBean setIoThreadMultiplier(int ioThreadMultiplier) {
this.ioThreadMultiplier = ioThreadMultiplier;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setIoThreadMultiplier
File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java
Repository: AsyncHttpClient/async-http-client
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2013-7397
|
MEDIUM
| 4.3
|
AsyncHttpClient/async-http-client
|
setIoThreadMultiplier
|
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
public void addPackageDependency(String packageName) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addPackageDependency
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
addPackageDependency
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public IssuesWithBLOBs getUpdateIssues(Map bug) {
return getUpdateIssues(null, bug);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUpdateIssues
File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
getUpdateIssues
|
test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean hasUI(){
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasUI
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
|
hasUI
|
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean reset(boolean animate) {
final IAccessibilityServiceConnection connection =
AccessibilityInteractionClient.getInstance().getConnection(
mService.mConnectionId);
if (connection != null) {
try {
return connection.resetMagnification(animate);
} catch (RemoteException re) {
Log.w(LOG_TAG, "Failed to reset", re);
re.rethrowFromSystemServer();
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reset
File: core/java/android/accessibilityservice/AccessibilityService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3923
|
MEDIUM
| 4.3
|
android
|
reset
|
core/java/android/accessibilityservice/AccessibilityService.java
|
5f256310187b4ff2f13a7abb9afed9126facd7bc
| 0
|
Analyze the following code function for security vulnerabilities
|
private void doNotification(UserAccounts accounts, Account account, CharSequence message,
Intent intent, String packageName, final int userId) {
final long identityToken = clearCallingIdentity();
try {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "doNotification: " + message + " intent:" + intent);
}
if (intent.getComponent() != null &&
GrantCredentialsPermissionActivity.class.getName().equals(
intent.getComponent().getClassName())) {
createNoCredentialsPermissionNotification(account, intent, packageName, userId);
} else {
Context contextForUser = getContextForUser(new UserHandle(userId));
final NotificationId id = getSigninRequiredNotificationId(accounts, account);
intent.addCategory(id.mTag);
final String notificationTitleFormat =
contextForUser.getText(R.string.notification_title).toString();
Notification n =
new Notification.Builder(contextForUser, SystemNotificationChannels.ACCOUNT)
.setWhen(0)
.setSmallIcon(android.R.drawable.stat_sys_warning)
.setColor(contextForUser.getColor(
com.android.internal.R.color.system_notification_accent_color))
.setContentTitle(String.format(notificationTitleFormat, account.name))
.setContentText(message)
.setContentIntent(PendingIntent.getActivityAsUser(
mContext, 0, intent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
null, new UserHandle(userId)))
.build();
installNotification(id, n, packageName, userId);
}
} finally {
restoreCallingIdentity(identityToken);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doNotification
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
doNotification
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
public SAXHandlerFactory getSAXHandlerFactory() {
return handlerfac;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSAXHandlerFactory
File: core/src/java/org/jdom2/input/SAXBuilder.java
Repository: hunterhacker/jdom
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-33813
|
MEDIUM
| 5
|
hunterhacker/jdom
|
getSAXHandlerFactory
|
core/src/java/org/jdom2/input/SAXBuilder.java
|
bd3ab78370098491911d7fe9d7a43b97144a234e
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void requestFailure(Buffer buffer) throws Exception {
resetIdleTimeout();
// Remove at end
GlobalRequestFuture request = pendingGlobalRequests.pollLast();
if (request != null) {
GlobalRequestFuture.ReplyHandler handler = request.getHandler();
if (handler != null) {
Buffer resultBuf = ByteArrayBuffer.getCompactClone(buffer.array(), buffer.rpos(), buffer.available());
handler.accept(SshConstants.SSH_MSG_REQUEST_FAILURE, resultBuf);
} else {
request.setValue(new GlobalRequestException(SshConstants.SSH_MSG_REQUEST_FAILURE));
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestFailure
File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
Repository: apache/mina-sshd
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
apache/mina-sshd
|
requestFailure
|
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
|
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
| 0
|
Analyze the following code function for security vulnerabilities
|
public Builder setMaxRedirects(int maxRedirects) {
this.maxRedirects = maxRedirects;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMaxRedirects
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
|
setMaxRedirects
|
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
private void migrate7(File dataDir, Stack<Integer> versions) {
for (File file: dataDir.listFiles()) {
try {
String content = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
content = StringUtils.replace(content,
"com.gitplex.commons.hibernate.migration.VersionTable",
"com.gitplex.server.model.ModelVersion");
content = StringUtils.replace(content,
"com.gitplex.server.core.entity.support.IntegrationPolicy",
"com.gitplex.server.model.support.IntegrationPolicy");
content = StringUtils.replace(content,
"com.gitplex.server.core.entity.PullRequest_-IntegrationStrategy",
"com.gitplex.server.model.PullRequest_-IntegrationStrategy");
content = StringUtils.replace(content,
"com.gitplex.server.core.entity.", "com.gitplex.server.model.");
content = StringUtils.replace(content,
"com.gitplex.server.core.setting.SpecifiedGit", "com.gitplex.server.git.config.SpecifiedGit");
content = StringUtils.replace(content,
"com.gitplex.server.core.setting.SystemGit", "com.gitplex.server.git.config.SystemGit");
content = StringUtils.replace(content,
"com.gitplex.server.core.setting.", "com.gitplex.server.model.support.setting.");
content = StringUtils.replace(content,
"com.gitplex.server.core.gatekeeper.", "com.gitplex.server.gatekeeper.");
FileUtils.writeStringToFile(file, content, StandardCharsets.UTF_8);
if (file.getName().equals("VersionTables.xml")) {
FileUtils.moveFile(file, new File(file.getParentFile(), "ModelVersions.xml"));
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate7
File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2023-24828
|
HIGH
| 8.8
|
theonedev/onedev
|
migrate7
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void clearPackagePreferredActivities(String packageName) {
final int uid = Binder.getCallingUid();
// writer
synchronized (mPackages) {
PackageParser.Package pkg = mPackages.get(packageName);
if (pkg == null || pkg.applicationInfo.uid != uid) {
if (mContext.checkCallingOrSelfPermission(
android.Manifest.permission.SET_PREFERRED_APPLICATIONS)
!= PackageManager.PERMISSION_GRANTED) {
if (getUidTargetSdkVersionLockedLPr(Binder.getCallingUid())
< Build.VERSION_CODES.FROYO) {
Slog.w(TAG, "Ignoring clearPackagePreferredActivities() from uid "
+ Binder.getCallingUid());
return;
}
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.SET_PREFERRED_APPLICATIONS, null);
}
}
int user = UserHandle.getCallingUserId();
if (clearPackagePreferredActivitiesLPw(packageName, user)) {
scheduleWritePackageRestrictionsLocked(user);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearPackagePreferredActivities
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
clearPackagePreferredActivities
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
@Provides
@SysUISingleton
static CommonNotifCollection provideCommonNotifCollection(
NotifPipelineFlags notifPipelineFlags,
Lazy<NotifPipeline> pipeline,
NotificationEntryManager entryManager) {
return notifPipelineFlags.isNewPipelineEnabled()
? pipeline.get() : entryManager;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: provideCommonNotifCollection
File: packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40098
|
MEDIUM
| 5.5
|
android
|
provideCommonNotifCollection
|
packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java
|
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
| 0
|
Analyze the following code function for security vulnerabilities
|
void detachStackLocked(DisplayContent displayContent, TaskStack stack) {
displayContent.detachStack(stack);
stack.detachDisplay();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: detachStackLocked
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
|
detachStackLocked
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
protected QuestionItemImpl processItem(AssessmentItem assessmentItem, String comment, String originalItemFilename,
String editor, String editorVersion, String dir, AssessmentItemMetadata metadata) {
//filename
String filename;
String ident = assessmentItem.getIdentifier();
if(originalItemFilename != null) {
filename = originalItemFilename;
} else if(StringHelper.containsNonWhitespace(ident)) {
filename = StringHelper.transformDisplayNameToFileSystemName(ident) + ".xml";
} else {
filename = "item.xml";
}
//title
String title = assessmentItem.getTitle();
if(!StringHelper.containsNonWhitespace(title)) {
title = assessmentItem.getLabel();
}
if(!StringHelper.containsNonWhitespace(title)) {
title = ident;
}
QuestionItemImpl poolItem = questionItemDao.create(title, QTI21Constants.QTI_21_FORMAT, dir, filename);
//description
poolItem.setDescription(comment);
//language from default
poolItem.setLanguage(defaultLocale.getLanguage());
//question type first
if(StringHelper.containsNonWhitespace(editor)) {
poolItem.setEditor(editor);
poolItem.setEditorVersion(editorVersion);
}
//if question type not found, can be overridden by the metadatas
processItemMetadata(poolItem, metadata);
if(poolItem.getType() == null) {
QItemType defType = convertType(assessmentItem);
poolItem.setType(defType);
}
questionItemDao.persist(owner, poolItem);
createLicense(poolItem, metadata);
return poolItem;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processItem
File: src/main/java/org/olat/ims/qti21/pool/QTI21ImportProcessor.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
processItem
|
src/main/java/org/olat/ims/qti21/pool/QTI21ImportProcessor.java
|
5668a41ab3f1753102a89757be013487544279d5
| 0
|
Analyze the following code function for security vulnerabilities
|
public String[] getRecognizedProperties() {
return RECOGNIZED_PROPERTIES;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRecognizedProperties
File: src/org/cyberneko/html/HTMLScanner.java
Repository: sparklemotion/nekohtml
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-24839
|
MEDIUM
| 5
|
sparklemotion/nekohtml
|
getRecognizedProperties
|
src/org/cyberneko/html/HTMLScanner.java
|
a800fce3b079def130ed42a408ff1d09f89e773d
| 0
|
Analyze the following code function for security vulnerabilities
|
void postFinishBooting(boolean finishBooting, boolean enableScreen) {
mHandler.sendMessage(mHandler.obtainMessage(FINISH_BOOTING_MSG,
finishBooting? 1 : 0, enableScreen ? 1 : 0));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: postFinishBooting
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
postFinishBooting
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void listProjects(AsyncMethodCallback resultHandler) {
handle(() -> {
final Map<String, com.linecorp.centraldogma.server.storage.project.Project> projects =
projectManager.list();
final List<Project> ret = new ArrayList<>(projects.size());
projects.forEach((key, value) -> ret.add(convert(key, value)));
return ret;
}, resultHandler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: listProjects
File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
Repository: line/centraldogma
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2021-38388
|
MEDIUM
| 6.5
|
line/centraldogma
|
listProjects
|
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
|
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.