instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
@Override
public INfcAdapterExtras getNfcAdapterExtrasInterface(String pkg) throws RemoteException {
// nfc-extras implementation is no longer present in AOSP.
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNfcAdapterExtrasInterface
File: src/com/android/nfc/NfcService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3761
|
LOW
| 2.1
|
android
|
getNfcAdapterExtrasInterface
|
src/com/android/nfc/NfcService.java
|
9ea802b5456a36f1115549b645b65c791eff3c2c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public HttpHeaders set(String name, Iterable<?> values) {
headers.setObject(name, values);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: set
File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2021-43797
|
MEDIUM
| 4.3
|
netty
|
set
|
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
|
07aa6b5938a8b6ed7a6586e066400e2643897323
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onRemoveCompleted(String packageName, boolean succeeded) throws RemoteException {
synchronized (this) {
finished = true;
result = succeeded;
notifyAll();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onRemoveCompleted
File: cmds/pm/src/com/android/commands/pm/Pm.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3833
|
HIGH
| 9.3
|
android
|
onRemoveCompleted
|
cmds/pm/src/com/android/commands/pm/Pm.java
|
4e4743a354e26467318b437892a9980eb9b8328a
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_PROFILE_INTERACTION, conditional = true)
public @NonNull List<String> getCrossProfileWidgetProviders(@Nullable ComponentName admin) {
throwIfParentInstance("getCrossProfileWidgetProviders");
if (mService != null) {
try {
List<String> providers = mService.getCrossProfileWidgetProviders(admin,
mContext.getPackageName());
if (providers != null) {
return providers;
}
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
return Collections.emptyList();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCrossProfileWidgetProviders
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getCrossProfileWidgetProviders
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private Column<T, ?> getColumnOrThrow(String columnId) {
Objects.requireNonNull(columnId, "Column id cannot be null");
Column<T, ?> column = getColumn(columnId);
if (column == null) {
throw new IllegalStateException(
"There is no column with the id " + columnId);
}
return column;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getColumnOrThrow
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
|
getColumnOrThrow
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
public void allowTypesByRegExp(Pattern[] regexps) {
addPermission(new RegExpTypePermission(regexps));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: allowTypesByRegExp
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
allowTypesByRegExp
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
private @UserIdInt int getManagedUserId() {
// On HSUM, there is only one main user and only the main user
// can have a managed profile (for now). On non-HSUM, only user 0
// can host the managed profile and user 0 is the main user.
// So in both cases, we could just get the main user and
// search for the profile user under it.
UserHandle mainUser = mUserManager.getMainUser();
if (mainUser == null) return UserHandle.USER_NULL;
return getManagedUserId(mainUser.getIdentifier());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getManagedUserId
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getManagedUserId
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public List<BaseObject> addObjectsFromRequest(String className, String pref, XWikiContext context)
throws XWikiException
{
return addXObjectsFromRequest(resolveClassReference(className), pref, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addObjectsFromRequest
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
addObjectsFromRequest
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public SocketAddress getPeerAddress() {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPeerAddress
File: servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2019-10184
|
MEDIUM
| 5
|
undertow-io/undertow
|
getPeerAddress
|
servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
|
d2715e3afa13f50deaa19643676816ce391551e9
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void addCookie(String name, String val, int age, HttpServletResponse response)
{
response.addHeader("Set-Cookie", name + "=" + val + "; Max-Age=" + age + ";path=" + cookiePath + "; Secure; HttpOnly; SameSite=none");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addCookie
File: src/main/java/com/mxgraph/online/AbsAuthServlet.java
Repository: jgraph/drawio
The code follows secure coding practices.
|
[
"CWE-601",
"CWE-918"
] |
CVE-2022-1767
|
MEDIUM
| 5
|
jgraph/drawio
|
addCookie
|
src/main/java/com/mxgraph/online/AbsAuthServlet.java
|
c63f3a04450f30798df47f9badbc74eb8a69fbdf
| 0
|
Analyze the following code function for security vulnerabilities
|
@ApiOperation(value = "Close Composite Solution Operation")
@RequestMapping(value = "/closeCompositeSolution ", method = RequestMethod.POST)
@ResponseBody
public String closeCompositeSolution(@RequestParam(value = "userId", required = true) String userId,
@RequestParam(value = "solutionId", required = false) String solutionId,
@RequestParam(value = "solutionVersion", required = false) String solutionVersion,
@RequestParam(value = "cid", required = false) String cid) {
logger.debug(EELFLoggerDelegator.debugLogger, " closeCompositeSolution(): Begin ");
String result = "";
try {
result = compositeServiceImpl.closeCompositeSolution(userId, solutionId, solutionVersion, cid);
} catch (Exception e) {
logger.error(EELFLoggerDelegator.errorLogger, " Exception in closeCompositeSolution() ", e);
}
logger.debug(EELFLoggerDelegator.debugLogger, " closeCompositeSolution(): End ");
return result;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2018-25097
- Severity: MEDIUM
- CVSS Score: 4.0
Description: Senitization for CSS Vulnerability
Issue-Id : ACUMOS-1650
Description : Senitization for CSS Vulnerability - Design Studio
Change-Id: If8fd4b9b06f884219d93881f7922421870de8e3d
Signed-off-by: Ramanaiah Pirla <RP00490596@techmahindra.com>
Function: closeCompositeSolution
File: ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java
Repository: acumos/design-studio
Fixed Code:
@ApiOperation(value = "Close Composite Solution Operation")
@RequestMapping(value = "/closeCompositeSolution ", method = RequestMethod.POST)
@ResponseBody
public String closeCompositeSolution(@RequestParam(value = "userId", required = true) String userId,
@RequestParam(value = "solutionId", required = false) String solutionId,
@RequestParam(value = "solutionVersion", required = false) String solutionVersion,
@RequestParam(value = "cid", required = false) String cid) {
logger.debug(EELFLoggerDelegator.debugLogger, " closeCompositeSolution(): Begin ");
String result = "";
try {
result = compositeServiceImpl.closeCompositeSolution(userId, SanitizeUtils.sanitize(solutionId), solutionVersion, cid);
} catch (Exception e) {
logger.error(EELFLoggerDelegator.errorLogger, " Exception in closeCompositeSolution() ", e);
}
logger.debug(EELFLoggerDelegator.debugLogger, " closeCompositeSolution(): End ");
return result;
}
|
[
"CWE-79"
] |
CVE-2018-25097
|
MEDIUM
| 4
|
acumos/design-studio
|
closeCompositeSolution
|
ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java
|
0df8a5e8722188744973168648e4c74c69ce67fd
| 1
|
Analyze the following code function for security vulnerabilities
|
public Jooby executor(final String name) {
defaultExecSet = true;
this.executors.add(binder -> {
binder.bind(Key.get(String.class, Names.named("deferred"))).toInstance(name);
});
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executor
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
executor
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
public void writeContent(final String iContent) throws IOException {
if (iContent != null) {
out.write(iContent.getBytes(utf8));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeContent
File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
Repository: orientechnologies/orientdb
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2015-2912
|
MEDIUM
| 6.8
|
orientechnologies/orientdb
|
writeContent
|
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
|
d5a45e608ba8764fd817c1bdd7cf966564e828e9
| 0
|
Analyze the following code function for security vulnerabilities
|
private static File getCacheFileIfExist(File urlPath) {
CacheLRUWrapper lruHandler = CacheLRUWrapper.getInstance();
synchronized (lruHandler) {
File cacheFile = null;
List<Entry<String, String>> entries = lruHandler.getLRUSortedEntries();
// Start searching from the most recent to least recent.
for (Entry<String, String> e : entries) {
final String key = e.getKey();
final String path = e.getValue();
if (pathToURLPath(path).equals(urlPath.getPath())) { // Match found.
cacheFile = new File(path);
lruHandler.updateEntry(key);
break; // Stop searching since we got newest one already.
}
}
return cacheFile;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCacheFileIfExist
File: core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices.
|
[
"CWE-345",
"CWE-94",
"CWE-22"
] |
CVE-2019-10182
|
MEDIUM
| 5.8
|
AdoptOpenJDK/IcedTea-Web
|
getCacheFileIfExist
|
core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java
|
2ab070cdac087bd208f64fa8138bb709f8d7680c
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("mLock")
private void updateTimesLocked() {
final long now = injectCurrentTimeMillis();
final long prevLastResetTime = mRawLastResetTime;
if (mRawLastResetTime == 0) { // first launch.
// TODO Randomize??
mRawLastResetTime = now;
} else if (now < mRawLastResetTime) {
// Clock rewound.
if (isClockValid(now)) {
Slog.w(TAG, "Clock rewound");
// TODO Randomize??
mRawLastResetTime = now;
}
} else {
if ((mRawLastResetTime + mResetInterval) <= now) {
final long offset = mRawLastResetTime % mResetInterval;
mRawLastResetTime = ((now / mResetInterval) * mResetInterval) + offset;
}
}
if (prevLastResetTime != mRawLastResetTime) {
scheduleSaveBaseState();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateTimesLocked
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40092
|
MEDIUM
| 5.5
|
android
|
updateTimesLocked
|
services/core/java/com/android/server/pm/ShortcutService.java
|
a5e55363e69b3c84d3f4011c7b428edb1a25752c
| 0
|
Analyze the following code function for security vulnerabilities
|
private static XMLInputFactory getXMLInputFactory() {
boolean tccl_jaxp = SystemPropertiesUtil.getSystemProperty(GeneralConstants.TCCL_JAXP, "false")
.equalsIgnoreCase("true");
ClassLoader prevTCCL = SecurityActions.getTCCL();
try {
if (tccl_jaxp) {
SecurityActions.setTCCL(StaxParserUtil.class.getClassLoader());
}
XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
xmlInputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.TRUE);
xmlInputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
xmlInputFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE);
xmlInputFactory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE);
return xmlInputFactory;
} finally {
if (tccl_jaxp) {
SecurityActions.setTCCL(prevTCCL);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getXMLInputFactory
File: saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2017-2582
|
MEDIUM
| 4
|
keycloak
|
getXMLInputFactory
|
saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
|
0cb5ba0f6e83162d221681f47b470c3042eef237
| 0
|
Analyze the following code function for security vulnerabilities
|
public static final native void setThreadPriority(int priority)
throws IllegalArgumentException, SecurityException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setThreadPriority
File: core/java/android/os/Process.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3911
|
HIGH
| 9.3
|
android
|
setThreadPriority
|
core/java/android/os/Process.java
|
2c7008421cb67f5d89f16911bdbe36f6c35311ad
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void walkFileTreeContents(@NonNull Path path, @NonNull Consumer<Path> operation) {
try {
Files.walkFileTree(path, new FileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
if (!Objects.equals(path, file)) {
operation.accept(file);
}
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFileFailed(Path file, IOException e) {
Log.w(TAG, "Failed to visit " + file, e);
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult postVisitDirectory(Path dir, IOException e) {
if (!Objects.equals(path, dir)) {
operation.accept(dir);
}
return FileVisitResult.CONTINUE;
}
});
} catch (IOException e) {
Log.w(TAG, "Failed to walk " + path, e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: walkFileTreeContents
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
walkFileTreeContents
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Analyze the following code function for security vulnerabilities
|
protected final float _parseFloatPrimitive(JsonParser p, DeserializationContext ctxt, String text)
throws IOException
{
try {
return NumberInput.parseFloat(text, p.isEnabled(StreamReadFeature.USE_FAST_DOUBLE_PARSER));
} catch (IllegalArgumentException iae) { }
Number v = (Number) ctxt.handleWeirdStringValue(Float.TYPE, text,
"not a valid `float` value");
return _nonNullNumber(v).floatValue();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _parseFloatPrimitive
File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2022-42003
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
_parseFloatPrimitive
|
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
|
d78d00ee7b5245b93103fef3187f70543d67ca33
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void addSecretKey(WebClient.Builder webClientBuilder,
DatasourceConfiguration datasourceConfiguration) throws AppsmithPluginException {
// If users have chosen to share the Appsmith signature in the header, calculate and add that
String secretKey;
secretKey = headerUtils.getSignatureKey(datasourceConfiguration);
if (secretKey != null) {
final SecretKey key = Keys.hmacShaKeyFor(secretKey.getBytes(StandardCharsets.UTF_8));
final Instant now = Instant.now();
final String token = Jwts.builder()
.setIssuer("Appsmith")
.setIssuedAt(new Date(now.toEpochMilli()))
.setExpiration(new Date(now.plusSeconds(600).toEpochMilli()))
.signWith(key)
.compact();
webClientBuilder.defaultHeader(SIGNATURE_HEADER_NAME, token);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addSecretKey
File: app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/TriggerUtils.java
Repository: appsmithorg/appsmith
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-4096
|
MEDIUM
| 6.5
|
appsmithorg/appsmith
|
addSecretKey
|
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/TriggerUtils.java
|
769719ccfe667f059fe0b107a19ec9feb90f2e40
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String toString() {
return type.getSimpleName() + " " + name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: core/src/main/java/io/micronaut/core/type/DefaultArgument.java
Repository: micronaut-projects/micronaut-core
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
toString
|
core/src/main/java/io/micronaut/core/type/DefaultArgument.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
public HttpRequest clearQueries() {
query.clear();
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearQueries
File: src/main/java/jodd/http/HttpRequest.java
Repository: oblac/jodd-http
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2022-29631
|
MEDIUM
| 5
|
oblac/jodd-http
|
clearQueries
|
src/main/java/jodd/http/HttpRequest.java
|
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private IOException handleInvocationTargetException(InvocationTargetException e) {
Throwable t = e.getTargetException();
if(t instanceof Error) throw (Error)t;
if(t instanceof RuntimeException) throw (RuntimeException)t;
if(t instanceof IOException) return (IOException)t;
throw new Error(t);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleInvocationTargetException
File: core/src/main/java/hudson/model/AbstractProject.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
handleInvocationTargetException
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setIsOpen(Integer isOpen) {
this.isOpen = isOpen;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-7171
- Severity: LOW
- CVSS Score: 3.3
Description: fix(novel-admin): 友情链接URL格式校验
Function: setIsOpen
File: novel-admin/src/main/java/com/java2nb/novel/domain/FriendLinkDO.java
Repository: 201206030/novel-plus
Fixed Code:
public void setIsOpen(Integer isOpen) {
this.isOpen = isOpen;
}
|
[
"CWE-79"
] |
CVE-2023-7171
|
LOW
| 3.3
|
201206030/novel-plus
|
setIsOpen
|
novel-admin/src/main/java/com/java2nb/novel/domain/FriendLinkDO.java
|
d6093d8182362422370d7eaf6c53afde9ee45215
| 1
|
Analyze the following code function for security vulnerabilities
|
public void setMinPushSize(int size) {
if (size < 0) {
throw new IllegalArgumentException("Value cannot be negative");
}
minPushSize = size;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMinPushSize
File: server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2021-33609
|
MEDIUM
| 4
|
vaadin/framework
|
setMinPushSize
|
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
|
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
| 0
|
Analyze the following code function for security vulnerabilities
|
public WorkspaceEdit doRename(DOMDocument xmlDocument, Position position, String newText) {
return rename.doRename(xmlDocument, position, newText);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doRename
File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
Repository: eclipse/lemminx
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2019-18212
|
MEDIUM
| 4
|
eclipse/lemminx
|
doRename
|
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
|
e37c399aa266be1b7a43061d4afc43dc230410d2
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getTokenInRequest(String tokenId, HttpServletRequest request) {
String token = request.getHeader(tokenId);
if (StringUtil.isNotDefined(token)) {
token = request.getParameter(tokenId);
if (StringUtil.isNotDefined(token)) {
token = (String) request.getAttribute(tokenId);
}
}
return token;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTokenInRequest
File: core-rs/src/main/java/org/silverpeas/core/web/token/SynchronizerTokenService.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
getTokenInRequest
|
core-rs/src/main/java/org/silverpeas/core/web/token/SynchronizerTokenService.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final int startActivityWithConfig(IApplicationThread caller, String callingPackage,
Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
int startFlags, Configuration config, Bundle bOptions, int userId) {
enforceNotIsolatedCaller("startActivityWithConfig");
userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
userId, false, ALLOW_FULL_ONLY, "startActivityWithConfig", null);
// TODO: Switch to user app stacks here.
return mActivityStartController.obtainStarter(intent, "startActivityWithConfig")
.setCaller(caller)
.setCallingPackage(callingPackage)
.setResolvedType(resolvedType)
.setResultTo(resultTo)
.setResultWho(resultWho)
.setRequestCode(requestCode)
.setStartFlags(startFlags)
.setGlobalConfiguration(config)
.setActivityOptions(bOptions)
.setMayWait(userId)
.execute();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startActivityWithConfig
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
|
startActivityWithConfig
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isWikiContent()
{
String contentType = getContentType();
if (contentType != null && !contentType.equals("puretext") && !contentType.equals("velocitycode")) {
return true;
} else {
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isWikiContent
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-41046
|
MEDIUM
| 6.3
|
xwiki/xwiki-platform
|
isWikiContent
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
|
edc52579eeaab1b4514785c134044671a1ecd839
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public <T> T getValueHandler() { return (T) _valueHandler; }
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getValueHandler
File: src/main/java/com/fasterxml/jackson/databind/JavaType.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
getValueHandler
|
src/main/java/com/fasterxml/jackson/databind/JavaType.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setDefaultLocale(Locale defaultLocale)
{
this.doc.setDefaultLocale(defaultLocale);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDefaultLocale
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
setDefaultLocale
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequestMapping(value = "/{appId}" + REPORT_URL + "/{referenceId:\\S+}", method = RequestMethod.GET)
public final void getReportSpecificAppId(
@SuppressWarnings("unused") @PathVariable final String appId,
@PathVariable final String referenceId,
@RequestParam(value = "inline", defaultValue = "false") final boolean inline,
final HttpServletResponse getReportResponse)
throws IOException, ServletException {
getReport(referenceId, inline, getReportResponse);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getReportSpecificAppId
File: core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
Repository: mapfish/mapfish-print
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-15231
|
MEDIUM
| 4.3
|
mapfish/mapfish-print
|
getReportSpecificAppId
|
core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
|
89155f2506b9cee822e15ce60ccae390a1419d5e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String hexStringToBase64(String hexString) {
int read = hexString.length();
byte[] byteArray = new byte[read/2];
for (int i=0, j=0; i < read; i++, j++) {
String part = hexString.substring(i,i+2);
byteArray[j] =
new Short(Integer.toString(Integer.parseInt(part,16))).
byteValue();
i++;
}
String encodedID = null;
try {
encodedID = Base64.encode(byteArray).trim();
} catch (Exception e) {
if (SAMLUtils.debug.messageEnabled()) {
SAMLUtils.debug.message("SAMLUtil:hexStringToBase64: "
+ "exception encode input:", e);
}
}
if (SAMLUtils.debug.messageEnabled()) {
SAMLUtils.debug.message("base 64 source id is :"+encodedID);
}
return encodedID;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hexStringToBase64
File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
Repository: OpenIdentityPlatform/OpenAM
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2023-37471
|
CRITICAL
| 9.8
|
OpenIdentityPlatform/OpenAM
|
hexStringToBase64
|
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
|
7c18543d126e8a567b83bb4535631825aaa9d742
| 0
|
Analyze the following code function for security vulnerabilities
|
protected ValueInstantiator _constructDefaultValueInstantiator(DeserializationContext ctxt,
BeanDescription beanDesc)
throws JsonMappingException
{
CreatorCollector creators = new CreatorCollector(beanDesc, ctxt.getConfig());
AnnotationIntrospector intr = ctxt.getAnnotationIntrospector();
// need to construct suitable visibility checker:
final DeserializationConfig config = ctxt.getConfig();
VisibilityChecker<?> vchecker = config.getDefaultVisibilityChecker(beanDesc.getBeanClass(),
beanDesc.getClassInfo());
/* 24-Sep-2014, tatu: Tricky part first; need to merge resolved property information
* (which has creator parameters sprinkled around) with actual creator
* declarations (which are needed to access creator annotation, amongst other things).
* Easiest to combine that info first, then pass it to remaining processing.
*/
/* 15-Mar-2015, tatu: Alas, this won't help with constructors that only have implicit
* names. Those will need to be resolved later on.
*/
Map<AnnotatedWithParams,BeanPropertyDefinition[]> creatorDefs = _findCreatorsFromProperties(ctxt,
beanDesc);
// Important: first add factory methods; then constructors, so
// latter can override former!
_addDeserializerFactoryMethods(ctxt, beanDesc, vchecker, intr, creators, creatorDefs);
// constructors only usable on concrete types:
if (beanDesc.getType().isConcrete()) {
_addDeserializerConstructors(ctxt, beanDesc, vchecker, intr, creators, creatorDefs);
}
return creators.constructValueInstantiator(ctxt);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _constructDefaultValueInstantiator
File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
_constructDefaultValueInstantiator
|
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
// If this is a write, the caller must have the EmailProvider permission, which is
// based on signature only
if (mode.equals("w")) {
Context context = getContext();
if (context.checkCallingOrSelfPermission(EmailContent.PROVIDER_PERMISSION)
!= PackageManager.PERMISSION_GRANTED) {
throw new FileNotFoundException();
}
List<String> segments = uri.getPathSegments();
String accountId = segments.get(0);
String id = segments.get(1);
File saveIn =
AttachmentUtilities.getAttachmentDirectory(context, Long.parseLong(accountId));
if (!saveIn.exists()) {
saveIn.mkdirs();
}
File newFile = new File(saveIn, id);
return ParcelFileDescriptor.open(
newFile, ParcelFileDescriptor.MODE_READ_WRITE |
ParcelFileDescriptor.MODE_CREATE | ParcelFileDescriptor.MODE_TRUNCATE);
}
long callingId = Binder.clearCallingIdentity();
try {
List<String> segments = uri.getPathSegments();
String accountId = segments.get(0);
String id = segments.get(1);
String format = segments.get(2);
if (AttachmentUtilities.FORMAT_THUMBNAIL.equals(format)) {
int width = Integer.parseInt(segments.get(3));
int height = Integer.parseInt(segments.get(4));
String filename = "thmb_" + accountId + "_" + id;
File dir = getContext().getCacheDir();
File file = new File(dir, filename);
if (!file.exists()) {
Uri attachmentUri = AttachmentUtilities.
getAttachmentUri(Long.parseLong(accountId), Long.parseLong(id));
Cursor c = query(attachmentUri,
new String[] { Columns.DATA }, null, null, null);
if (c != null) {
try {
if (c.moveToFirst()) {
attachmentUri = Uri.parse(c.getString(0));
} else {
return null;
}
} finally {
c.close();
}
}
String type = getContext().getContentResolver().getType(attachmentUri);
try {
InputStream in =
getContext().getContentResolver().openInputStream(attachmentUri);
Bitmap thumbnail = createThumbnail(type, in);
if (thumbnail == null) {
return null;
}
thumbnail = Bitmap.createScaledBitmap(thumbnail, width, height, true);
FileOutputStream out = new FileOutputStream(file);
thumbnail.compress(Bitmap.CompressFormat.PNG, 100, out);
out.close();
in.close();
} catch (IOException ioe) {
LogUtils.d(Logging.LOG_TAG, "openFile/thumbnail failed with " +
ioe.getMessage());
return null;
} catch (OutOfMemoryError oome) {
LogUtils.d(Logging.LOG_TAG, "openFile/thumbnail failed with " +
oome.getMessage());
return null;
}
}
return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
}
else {
return ParcelFileDescriptor.open(
new File(getContext().getDatabasePath(accountId + ".db_att"), id),
ParcelFileDescriptor.MODE_READ_ONLY);
}
} finally {
Binder.restoreCallingIdentity(callingId);
}
}
|
Vulnerability Classification:
- CWE: CWE-200
- CVE: CVE-2016-3918
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Limit account id and id to longs
The security issue occurs because id is allowed to be an arbitrary
path instead of being limited to what it is -- a long. Both id
and account id are now parsed into longs (and if either fails, an
error will be logged and null will be returned).
Tested/verified error is logged using the reported attack.
BUG=30745403
Change-Id: Ia21418545bbaeb96fb5ab6c3f4e71858e57b8684
(cherry picked from commit 9794d7e8216138adf143a3b6faf3d5683316a662)
Function: openFile
File: provider_src/com/android/email/provider/AttachmentProvider.java
Repository: android
Fixed Code:
@Override
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
// If this is a write, the caller must have the EmailProvider permission, which is
// based on signature only
if (mode.equals("w")) {
Context context = getContext();
if (context.checkCallingOrSelfPermission(EmailContent.PROVIDER_PERMISSION)
!= PackageManager.PERMISSION_GRANTED) {
throw new FileNotFoundException();
}
List<String> segments = uri.getPathSegments();
String accountId = segments.get(0);
String id = segments.get(1);
File saveIn =
AttachmentUtilities.getAttachmentDirectory(context, Long.parseLong(accountId));
if (!saveIn.exists()) {
saveIn.mkdirs();
}
File newFile = new File(saveIn, id);
return ParcelFileDescriptor.open(
newFile, ParcelFileDescriptor.MODE_READ_WRITE |
ParcelFileDescriptor.MODE_CREATE | ParcelFileDescriptor.MODE_TRUNCATE);
}
long callingId = Binder.clearCallingIdentity();
try {
List<String> segments = uri.getPathSegments();
final long accountId = Long.parseLong(segments.get(0));
final long id = Long.parseLong(segments.get(1));
String format = segments.get(2);
if (AttachmentUtilities.FORMAT_THUMBNAIL.equals(format)) {
int width = Integer.parseInt(segments.get(3));
int height = Integer.parseInt(segments.get(4));
String filename = "thmb_" + accountId + "_" + id;
File dir = getContext().getCacheDir();
File file = new File(dir, filename);
if (!file.exists()) {
Uri attachmentUri = AttachmentUtilities.getAttachmentUri(accountId, id);
Cursor c = query(attachmentUri,
new String[] { Columns.DATA }, null, null, null);
if (c != null) {
try {
if (c.moveToFirst()) {
attachmentUri = Uri.parse(c.getString(0));
} else {
return null;
}
} finally {
c.close();
}
}
String type = getContext().getContentResolver().getType(attachmentUri);
try {
InputStream in =
getContext().getContentResolver().openInputStream(attachmentUri);
Bitmap thumbnail = createThumbnail(type, in);
if (thumbnail == null) {
return null;
}
thumbnail = Bitmap.createScaledBitmap(thumbnail, width, height, true);
FileOutputStream out = new FileOutputStream(file);
thumbnail.compress(Bitmap.CompressFormat.PNG, 100, out);
out.close();
in.close();
} catch (IOException ioe) {
LogUtils.d(Logging.LOG_TAG, "openFile/thumbnail failed with " +
ioe.getMessage());
return null;
} catch (OutOfMemoryError oome) {
LogUtils.d(Logging.LOG_TAG, "openFile/thumbnail failed with " +
oome.getMessage());
return null;
}
}
return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
}
else {
return ParcelFileDescriptor.open(
new File(getContext().getDatabasePath(accountId + ".db_att"),
String.valueOf(id)),
ParcelFileDescriptor.MODE_READ_ONLY);
}
} catch (NumberFormatException e) {
LogUtils.e(Logging.LOG_TAG,
"AttachmentProvider.openFile: Failed to open as id is not a long");
return null;
} finally {
Binder.restoreCallingIdentity(callingId);
}
}
|
[
"CWE-200"
] |
CVE-2016-3918
|
MEDIUM
| 4.3
|
android
|
openFile
|
provider_src/com/android/email/provider/AttachmentProvider.java
|
6b2b0bd7c771c698f11d7be89c2c57c8722c7454
| 1
|
Analyze the following code function for security vulnerabilities
|
public SearchResult getByQuery(String query, int limit, int offset) throws SearchException {
try {
logger.debug("Searching index using custom query '" + query + "'");
return solrRequester.getByQuery(query, limit, offset);
} catch (SolrServerException e) {
throw new SearchException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getByQuery
File: modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-21318
|
MEDIUM
| 5.5
|
opencast
|
getByQuery
|
modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
|
b18c6a7f81f08ed14884592a6c14c9ab611ad450
| 0
|
Analyze the following code function for security vulnerabilities
|
public String toSafeString() {
String result = Integer.toString(sourceUserId) + " @ " + uri.toSafeString();
if (prefix) result += " [prefix]";
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toSafeString
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
|
toSafeString
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static org.xwiki.rest.model.jaxb.Object object(String className)
{
org.xwiki.rest.model.jaxb.Object obj = new org.xwiki.rest.model.jaxb.Object();
obj.setClassName(className);
return obj;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: object
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
|
object
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String self(String pipelineName, String pipelineCounter, String stageName, String stageCounter) {
return StrSubstitutor.replace("/api/stages/${pipeline_name}/${pipeline_counter}/${stage_name}/${stage_counter}", of(
"pipeline_name", pipelineName,
"pipeline_counter", pipelineCounter,
"stage_name", stageName,
"stage_counter", stageCounter));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: self
File: spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-697"
] |
CVE-2022-39308
|
MEDIUM
| 5.9
|
gocd
|
self
|
spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java
|
236d4baf92e6607f2841c151c855adcc477238b8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected AbstractFileResolvingResource getResource(String path) throws MalformedURLException {
if (path == null || !path.startsWith("/")) {
throw new MalformedURLException(path);
}
try {
path = UriPath.canonical(path);
final String addedPath = addPaths(baseResource, path);
ExternalResource resource = new ExternalResource(addedPath);
if (resource.exists() && resource.isDirectory()) {
if (welcomeFile != null) {
resource = new ExternalResource(addPaths(resource.getPath(), welcomeFile));
} else {
// No welcome file configured, serve nothing since it's a directory
resource = null;
}
}
return (resource != null && resource.exists()) ? resource : null;
} catch (Exception e) {
if (LOG.isDebugEnabled()) {
LOG.debug(e.getClass().getSimpleName() + " when trying to get resource. " + e.getMessage());
}
}
return null;
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2016-9177
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Fix for #700 - Arbitrary File Read Vulnerability
Function: getResource
File: src/main/java/spark/resource/ExternalResourceHandler.java
Repository: perwendel/spark
Fixed Code:
@Override
protected AbstractFileResolvingResource getResource(String path) throws MalformedURLException {
if (path == null || !path.startsWith("/")) {
throw new MalformedURLException(path);
}
try {
path = UriPath.canonical(path);
final String addedPath = addPaths(baseResource, path);
ExternalResource resource = new ExternalResource(addedPath);
DirectoryTraversal.protectAgainstForExternal(resource.getPath());
if (resource.exists() && resource.isDirectory()) {
if (welcomeFile != null) {
resource = new ExternalResource(addPaths(resource.getPath(), welcomeFile));
} else {
// No welcome file configured, serve nothing since it's a directory
resource = null;
}
}
return (resource != null && resource.exists()) ? resource : null;
} catch (DirectoryTraversal.DirectoryTraversalDetection directoryTraversalDetection) {
throw directoryTraversalDetection;
} catch (Exception e) {
if (LOG.isDebugEnabled()) {
LOG.debug(e.getClass().getSimpleName() + " when trying to get resource. " + e.getMessage());
}
}
return null;
}
|
[
"CWE-22"
] |
CVE-2016-9177
|
MEDIUM
| 5
|
perwendel/spark
|
getResource
|
src/main/java/spark/resource/ExternalResourceHandler.java
|
26b57d0596ee73c14c558463943ef0857e53b91f
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void run() {
mService.mAppErrors.appNotResponding(mApp, null, null, false, mAnnotation);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: run
File: services/core/java/com/android/server/am/BroadcastQueue.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
run
|
services/core/java/com/android/server/am/BroadcastQueue.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isExitAnimationRunningSelfOrParent() {
return inTransitionSelfOrParent()
|| isAnimating(0 /* flags */, ANIMATION_TYPE_WINDOW_ANIMATION);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isExitAnimationRunningSelfOrParent
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
|
isExitAnimationRunningSelfOrParent
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void noteAlarmStart(IIntentSender sender, WorkSource workSource, int sourceUid,
String tag) {
if (workSource != null && workSource.isEmpty()) {
workSource = null;
}
if (sourceUid <= 0 && workSource == null) {
// Try and derive a UID to attribute things to based on the caller.
if (sender != null) {
if (!(sender instanceof PendingIntentRecord)) {
return;
}
final PendingIntentRecord rec = (PendingIntentRecord) sender;
final int callerUid = Binder.getCallingUid();
sourceUid = rec.uid == callerUid ? SYSTEM_UID : rec.uid;
} else {
// TODO(narayan): Should we throw an exception in this case ? It means that we
// haven't been able to derive a UID to attribute things to.
return;
}
}
if (DEBUG_POWER) {
Slog.w(TAG, "noteAlarmStart[sourceUid=" + sourceUid + ", workSource=" + workSource +
", tag=" + tag + "]");
}
mBatteryStatsService.noteAlarmStart(tag, workSource, sourceUid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: noteAlarmStart
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
|
noteAlarmStart
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addGeoFencing(final Class GeofenceListenerClass, final com.codename1.location.Geofence gf) {
//Display.getInstance().scheduleBackgroundTask(new Runnable() {
boolean fineLocationAllowed = AndroidNativeUtil.checkForPermission(Manifest.permission.ACCESS_FINE_LOCATION, "This is required to get location");
if (fineLocationAllowed && android.os.Build.VERSION.SDK_INT >= 29) {
if (!checkBackgroundLocationPermission()) {
return;
}
} else if (!fineLocationAllowed) {
fineLocationAllowed = AndroidNativeUtil.checkForPermission(Manifest.permission.ACCESS_FINE_LOCATION, "This is required to get the location");
}
if (!fineLocationAllowed) {
Log.e(new RuntimeException("Permission denied for geofence"));
return;
}
Thread t = new Thread(new Runnable() {
@Override
public void run() {
//wait until the client is connected, otherwise the call to
//requestLocationUpdates will fail
//com.codename1.io.Log.p("PLACES add "+gf.getId()+" 1");
while (!getmGoogleApiClient().isConnected()) {
try {
Thread.sleep(300);
} catch (Exception ex) {
}
}
//com.codename1.io.Log.p("PLACES add "+gf.getId()+" 2");
Handler mHandler = new Handler(Looper.getMainLooper());
mHandler.post(new Runnable() {
public void run() {
Context context = AndroidNativeUtil.getContext().getApplicationContext();
PendingIntent pendingIntent = createGeofencePendingIntent(GeofenceListenerClass, gf, false);
final ArrayList<Geofence> geofences = new ArrayList<Geofence>();
geofences.add(new Geofence.Builder()
.setRequestId(gf.getId())
.setCircularRegion(gf.getLoc().getLatitude(), gf.getLoc().getLongitude(), gf.getRadius())
.setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER
| Geofence.GEOFENCE_TRANSITION_EXIT)
.setExpirationDuration(gf.getExpiration() > 0 ? gf.getExpiration() : Geofence.NEVER_EXPIRE)
.build());
GeofencingRequest.Builder builder = new GeofencingRequest.Builder();
builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER);
builder.addGeofences(geofences);
if (!AndroidNativeUtil.checkForPermission(Manifest.permission.ACCESS_FINE_LOCATION, "Fine location permission required")) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
System.out.println("No permission");
return;
}
geofencingClient = geofencingClient == null ? LocationServices.getGeofencingClient(AndroidNativeUtil.getContext().getApplicationContext()) :
geofencingClient;
geofencingClient.addGeofences(builder.build(), pendingIntent)
.addOnSuccessListener(AndroidNativeUtil.getActivity(), new OnSuccessListener<Void>() {
@Override
public void onSuccess(Void aVoid) {
// Geofences added
// ...
//com.codename1.io.Log.p("Geofence added successfully " + geofences);
}
})
.addOnFailureListener(AndroidNativeUtil.getActivity(), new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
// Failed to add geofences
// ...
com.codename1.io.Log.e(e);
}
});
}
});
}
});
t.setUncaughtExceptionHandler(AndroidImplementation.exceptionHandler);
t.start();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addGeoFencing
File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
addGeoFencing
|
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public void setCertInstallerPackage(@NonNull ComponentName admin, @Nullable String
installerPackage) throws SecurityException {
throwIfParentInstance("setCertInstallerPackage");
if (mService != null) {
try {
mService.setCertInstallerPackage(admin, installerPackage);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCertInstallerPackage
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
setCertInstallerPackage
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onUserSwitched(int user) {
synchronized (mNotificationList) {
int i = mServices.size()-1;
while (i --> 0) {
final ManagedServiceInfo info = mServices.get(i);
unregisterService(info.service, info.userid);
}
}
registerRanker();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUserSwitched
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
|
onUserSwitched
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void registerUidObserver(IUidObserver observer, int which) {
enforceCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER,
"registerUidObserver()");
synchronized (this) {
mUidObservers.register(observer, which);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerUidObserver
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
registerUidObserver
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
public void showKeyguard() {
if (mLaunchTransitionFadingAway) {
mNotificationPanel.animate().cancel();
onLaunchTransitionFadingEnded();
}
mHandler.removeMessages(MSG_LAUNCH_TRANSITION_TIMEOUT);
if (mUserSwitcherController != null && mUserSwitcherController.useFullscreenUserSwitcher()) {
setBarState(StatusBarState.FULLSCREEN_USER_SWITCHER);
} else {
setBarState(StatusBarState.KEYGUARD);
}
updateKeyguardState(false /* goingToFullShade */, false /* fromShadeLocked */);
if (mState == StatusBarState.KEYGUARD) {
instantExpandNotificationsPanel();
} else if (mState == StatusBarState.FULLSCREEN_USER_SWITCHER) {
instantCollapseNotificationPanel();
}
mLeaveOpenOnKeyguardHide = false;
if (mDraggedDownRow != null) {
mDraggedDownRow.setUserLocked(false);
mDraggedDownRow.notifyHeightChanged(false /* needsAnimation */);
mDraggedDownRow = null;
}
mPendingRemoteInputView = null;
mAssistManager.onLockscreenShown();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showKeyguard
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
|
showKeyguard
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected boolean isCleanUpSetAttributes() {
return _CLEAN_UP_SET_ATTRIBUTES;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCleanUpSetAttributes
File: util-taglib/src/com/liferay/taglib/ui/HeaderTag.java
Repository: brianchandotcom/liferay-portal
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2017-12647
|
MEDIUM
| 4.3
|
brianchandotcom/liferay-portal
|
isCleanUpSetAttributes
|
util-taglib/src/com/liferay/taglib/ui/HeaderTag.java
|
bd92daa70ab77a40eff0eb18e8e91f3e095694e1
| 0
|
Analyze the following code function for security vulnerabilities
|
private Pair<File, File> validateFiles(File npmFolder)
throws ExecutionFailedException {
assert port == 0;
// Skip checks if we have a webpack-dev-server already running
File webpack = new File(npmFolder, WEBPACK_SERVER);
File webpackConfig = new File(npmFolder, FrontendUtils.WEBPACK_CONFIG);
if (!npmFolder.exists()) {
getLogger().warn("No project folder '{}' exists", npmFolder);
throw new ExecutionFailedException(START_FAILURE
+ " the target execution folder doesn't exist.");
}
if (!webpack.exists()) {
getLogger().warn("'{}' doesn't exist. Did you run `npm install`?",
webpack);
throw new ExecutionFailedException(String.format(
"%s '%s' doesn't exist. `npm install` has not run or failed.",
START_FAILURE, webpack));
} else if (!webpack.canExecute()) {
getLogger().warn(
" '{}' is not an executable. Did you run `npm install`?",
webpack);
throw new ExecutionFailedException(String.format(
"%s '%s' is not an executable."
+ " `npm install` has not run or failed.",
START_FAILURE, webpack));
}
if (!webpackConfig.canRead()) {
getLogger().warn(
"Webpack configuration '{}' is not found or is not readable.",
webpackConfig);
throw new ExecutionFailedException(
String.format("%s '%s' doesn't exist or is not readable.",
START_FAILURE, webpackConfig));
}
return new Pair<>(webpack, webpackConfig);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateFiles
File: vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-172"
] |
CVE-2021-33604
|
LOW
| 1.2
|
vaadin/flow
|
validateFiles
|
vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java
|
2a801c42b406a00c44f4a85b4b4e4a4c5bf89adc
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public Builder setSound(Uri sound, int streamType) {
PlayerBase.deprecateStreamTypeForPlayback(streamType, "Notification", "setSound()");
mN.sound = sound;
mN.audioStreamType = streamType;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSound
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
setSound
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
private void _expect (@Nonnull final String sKeyword) throws JsonParseException
{
final IJsonParsePosition aStartPos = _getCurrentParsePos ();
for (final char cExpected : sKeyword.toCharArray ())
{
final int c = _readChar ();
if (c != cExpected)
throw _parseEx (aStartPos,
"Expected " +
_getPrintableChar (cExpected) +
" but got " +
_getPrintableChar (c) +
" as part of JSON keyword \"" +
sKeyword +
"\"");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _expect
File: ph-json/src/main/java/com/helger/json/parser/JsonParser.java
Repository: phax/ph-commons
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34612
|
HIGH
| 7.5
|
phax/ph-commons
|
_expect
|
ph-json/src/main/java/com/helger/json/parser/JsonParser.java
|
02a4d034dcfb2b6e1796b25f519bf57a6796edce
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setRecordLanguages(List<String> recordLanguages) {
this.recordLanguages = recordLanguages;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRecordLanguages
File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29014
|
MEDIUM
| 6.1
|
intranda/goobi-viewer-core
|
setRecordLanguages
|
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
|
c29efe60e745a94d03debc17681c4950f3917455
| 0
|
Analyze the following code function for security vulnerabilities
|
protected abstract void readLongToBcd(long input);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readLongToBcd
File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
Repository: unicode-org/icu
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2018-18928
|
HIGH
| 7.5
|
unicode-org/icu
|
readLongToBcd
|
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
|
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Route.Definition use(final String path, final Route.Filter filter) {
return appendDefinition("*", path, filter);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: use
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
use
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
public UI findUI(VaadinRequest request) {
// getForSession asserts that the lock is held
VaadinSession session = loadSession(request.getWrappedSession());
// Get UI id from the request
String uiIdString = request
.getParameter(ApplicationConstants.UI_ID_PARAMETER);
UI ui = null;
if (uiIdString != null && session != null) {
int uiId = Integer.parseInt(uiIdString);
ui = session.getUIById(uiId);
}
UI.setCurrent(ui);
return ui;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findUI
File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31404
|
LOW
| 1.9
|
vaadin/flow
|
findUI
|
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
|
621ef1b322737d963bee624b2d2e38cd739903d9
| 0
|
Analyze the following code function for security vulnerabilities
|
public static LocalizationService getInstance() {
return instance;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInstance
File: java/code/src/com/redhat/rhn/common/localization/LocalizationService.java
Repository: spacewalkproject/spacewalk
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2016-3079
|
MEDIUM
| 4.3
|
spacewalkproject/spacewalk
|
getInstance
|
java/code/src/com/redhat/rhn/common/localization/LocalizationService.java
|
7b9ff9ad
| 0
|
Analyze the following code function for security vulnerabilities
|
@CalledByNative
protected void onNavEntryChanged() {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onNavEntryChanged
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
onNavEntryChanged
|
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private void generateValuesFile(ResValuesFile valuesFile, Directory out,
ExtXmlSerializer serial) throws AndrolibException {
try {
OutputStream outStream = out.getFileOutput(valuesFile.getPath());
serial.setOutput((outStream), null);
serial.startDocument(null, null);
serial.startTag(null, "resources");
for (ResResource res : valuesFile.listResources()) {
if (valuesFile.isSynthesized(res)) {
continue;
}
((ResValuesXmlSerializable) res.getValue()).serializeToResValuesXml(serial, res);
}
serial.endTag(null, "resources");
serial.newLine();
serial.endDocument();
serial.flush();
outStream.close();
} catch (IOException | DirectoryException ex) {
throw new AndrolibException("Could not generate: " + valuesFile.getPath(), ex);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateValuesFile
File: brut.apktool/apktool-lib/src/main/java/brut/androlib/res/ResourcesDecoder.java
Repository: iBotPeaches/Apktool
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2024-21633
|
HIGH
| 7.8
|
iBotPeaches/Apktool
|
generateValuesFile
|
brut.apktool/apktool-lib/src/main/java/brut/androlib/res/ResourcesDecoder.java
|
d348c43b24a9de350ff6e5bd610545a10c1fc712
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void handleMessage(android.os.Message msg) {
switch (msg.what) {
case MSG_USER_SWITCHING:
handleUserSwitching(msg.arg1);
break;
default:
Slog.w(TAG, "Unknown message:" + msg.what);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleMessage
File: services/core/java/com/android/server/fingerprint/FingerprintService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
handleMessage
|
services/core/java/com/android/server/fingerprint/FingerprintService.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
public SQLiteStatement compileStatement(String sql) throws SQLException {
acquireReference();
try {
return new SQLiteStatement(this, sql, null);
} finally {
releaseReference();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: compileStatement
File: core/java/android/database/sqlite/SQLiteDatabase.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2018-9493
|
LOW
| 2.1
|
android
|
compileStatement
|
core/java/android/database/sqlite/SQLiteDatabase.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isUninstallInQueue(final String packageName) {
final CallerIdentity caller = getCallerIdentity();
Preconditions.checkCallAuthorization(
hasCallingOrSelfPermission(permission.MANAGE_DEVICE_ADMINS));
Pair<String, Integer> packageUserPair = new Pair<>(packageName, caller.getUserId());
synchronized (getLockObject()) {
return mPackagesToRemove.contains(packageUserPair);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isUninstallInQueue
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
|
isUninstallInQueue
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void release() {
synchronized (ActivityManagerService.this) {
if (mSleepTokens.remove(this)) {
updateSleepIfNeededLocked();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: release
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
release
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void addImmutableType(final Class type, final boolean isReferenceable) {
if (immutableTypesMapper == null) {
throw new com.thoughtworks.xstream.InitializationException("No "
+ ImmutableTypesMapper.class.getName()
+ " available");
}
immutableTypesMapper.addImmutableType(type, isReferenceable);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addImmutableType
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
addImmutableType
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
static int getPropertyInt(String[] tokens, int index, int defUnits, int defDps,
DisplayMetrics dm) {
if (index < tokens.length) {
String str = tokens[index];
if (str != null && str.length() > 0) {
try {
int val = Integer.parseInt(str);
return val;
} catch (Exception e) {
}
}
}
if (defUnits == TypedValue.COMPLEX_UNIT_PX) {
return defDps;
}
int val = (int)TypedValue.applyDimension(defUnits, defDps, dm);
return val;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPropertyInt
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
|
getPropertyInt
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void loginAsSuperAdmin()
{
login(SUPER_ADMIN_CREDENTIALS.getUserName(), SUPER_ADMIN_CREDENTIALS.getPassword());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loginAsSuperAdmin
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
|
loginAsSuperAdmin
|
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
|
@Override
public List<XWikiDocument> searchDocuments(String wheresql, int nb, int start, List<?> parameterValues,
XWikiContext context) throws XWikiException
{
return searchDocuments(wheresql, true, nb, start, parameterValues, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: searchDocuments
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
searchDocuments
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setCellDescriptionGenerator(CellDescriptionGenerator generator,
ContentMode contentMode) {
if (contentMode == null) {
throw new IllegalArgumentException("Content mode cannot be null");
}
cellDescriptionGenerator = generator;
getState().hasDescriptions = (generator != null || rowDescriptionGenerator != null);
getState().cellTooltipContentMode = contentMode;
datasourceExtension.refreshCache();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCellDescriptionGenerator
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
|
setCellDescriptionGenerator
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
private final int _decodeUTF8_4(int c) throws IOException
{
int d = _nextByte();
if ((d & 0xC0) != 0x080) {
_reportInvalidOther(d & 0xFF, _inputPtr);
}
c = ((c & 0x07) << 6) | (d & 0x3F);
d = _nextByte();
if ((d & 0xC0) != 0x080) {
_reportInvalidOther(d & 0xFF, _inputPtr);
}
c = (c << 6) | (d & 0x3F);
d = _nextByte();
if ((d & 0xC0) != 0x080) {
_reportInvalidOther(d & 0xFF, _inputPtr);
}
return ((c << 6) | (d & 0x3F)) - 0x10000;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _decodeUTF8_4
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
|
_decodeUTF8_4
|
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
|
de072d314af8f5f269c8abec6930652af67bc8e6
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setDebugging(boolean debugging) {
this.debugging = debugging;
// Rebuild HTTP Client according to the new "debugging" value.
this.httpClient = buildHttpClient();
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDebugging
File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setDebugging
|
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isRpaOffloadSupported() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
return mAdapterProperties.isRpaOffloadSupported();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isRpaOffloadSupported
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
isRpaOffloadSupported
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public CharSequence getDeviceOwnerLockScreenInfo() {
final CallerIdentity caller = getCallerIdentity();
Preconditions.checkCallAuthorization(
isDefaultDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller));
return mInjector.binderWithCleanCallingIdentity(() ->
mLockPatternUtils.getDeviceOwnerInfo());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDeviceOwnerLockScreenInfo
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getDeviceOwnerLockScreenInfo
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isBroadcastReceiverRestrictionsEnforced() {
synchronized (mLock) {
return mEnforceBroadcastReceiverRestrictions;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isBroadcastReceiverRestrictionsEnforced
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
|
isBroadcastReceiverRestrictionsEnforced
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public static VaadinService getCurrent() {
return CurrentInstance.get(VaadinService.class);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrent
File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31404
|
LOW
| 1.9
|
vaadin/flow
|
getCurrent
|
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
|
621ef1b322737d963bee624b2d2e38cd739903d9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
long longValue = 0;
boolean failed = false;
String errorMessage = "";
try {
longValue = Long.parseLong(value);
} catch (NumberFormatException ex) {
failed = true;
errorMessage = String.format("Invalid integer value: '%s'", value);
}
if (!failed && longValue < 0) {
failed = true;
errorMessage = String.format("Expected positive integer value, got: '%s'", value);
}
if (!failed) {
return true;
}
LOG.warn(errorMessage);
context.buildConstraintViolationWithTemplate(errorMessage).addConstraintViolation();
return false;
}
|
Vulnerability Classification:
- CWE: CWE-74
- CVE: CVE-2020-26282
- Severity: HIGH
- CVSS Score: 7.5
Description: Fix Critical Java EL Injection RCE vulnerability from GHSL-2020-213
Function: isValid
File: browserup-proxy-rest/src/main/java/com/browserup/bup/rest/validation/LongPositiveConstraint.java
Repository: browserup/browserup-proxy
Fixed Code:
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
long longValue = 0;
boolean failed = false;
String errorMessage = "";
try {
longValue = Long.parseLong(value);
} catch (NumberFormatException ex) {
failed = true;
String escapedValue = MessageSanitizer.escape(value);
errorMessage = String.format("Invalid integer value: '%s'", escapedValue);
}
if (!failed && longValue < 0) {
failed = true;
String escapedValue = MessageSanitizer.escape(value);
errorMessage = String.format("Expected positive integer value, got: '%s'", escapedValue);
}
if (!failed) {
return true;
}
LOG.warn(errorMessage);
context.buildConstraintViolationWithTemplate(errorMessage).addConstraintViolation();
return false;
}
|
[
"CWE-74"
] |
CVE-2020-26282
|
HIGH
| 7.5
|
browserup/browserup-proxy
|
isValid
|
browserup-proxy-rest/src/main/java/com/browserup/bup/rest/validation/LongPositiveConstraint.java
|
4b38e7a3e20917e5c3329d0d4e9590bed9d578ab
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public int hashCode() {
return Objects.hash(authenticatorId, authzAcl, classId, description, enabled, enabledBy, id, inputs, name,
outputs, policySets, renewal, visible, xmlOutput);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hashCode
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
hashCode
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Route.Definition delete(final String path, final Route.Filter filter) {
return appendDefinition(DELETE, path, filter);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: delete
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
delete
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean hasShortcutHostPermission(@NonNull String callingPackage, int userId,
int callingPid, int callingUid) {
if (canSeeAnyPinnedShortcut(callingPackage, userId, callingPid, callingUid)) {
return true;
}
final long start = getStatStartTime();
try {
return hasShortcutHostPermissionInner(callingPackage, userId);
} finally {
logDurationStat(Stats.LAUNCHER_PERMISSION_CHECK, start);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasShortcutHostPermission
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
|
hasShortcutHostPermission
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void rollBackTo(String space, String page, String version)
{
gotoPage(space, page, "rollback", "rev", version, "confirm", "1");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: rollBackTo
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
|
rollBackTo
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
public File prepareDownloadFile(Response response) throws IOException {
String filename = null;
String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition");
if (contentDisposition != null && !"".equals(contentDisposition)) {
// Get filename from the Content-Disposition header.
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
Matcher matcher = pattern.matcher(contentDisposition);
if (matcher.find())
filename = matcher.group(1);
}
String prefix;
String suffix = null;
if (filename == null) {
prefix = "download-";
suffix = "";
} else {
int pos = filename.lastIndexOf('.');
if (pos == -1) {
prefix = filename + "-";
} else {
prefix = filename.substring(0, pos) + "-";
suffix = filename.substring(pos);
}
// File.createTempFile requires the prefix to be at least three characters long
if (prefix.length() < 3)
prefix = "download-";
}
if (tempFolderPath == null)
return File.createTempFile(prefix, suffix);
else
return File.createTempFile(prefix, suffix, new File(tempFolderPath));
}
|
Vulnerability Classification:
- CWE: CWE-668
- CVE: CVE-2021-21430
- Severity: LOW
- CVSS Score: 2.1
Description: use Files.createTempFile
Function: prepareDownloadFile
File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
Fixed Code:
public File prepareDownloadFile(Response response) throws IOException {
String filename = null;
String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition");
if (contentDisposition != null && !"".equals(contentDisposition)) {
// Get filename from the Content-Disposition header.
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
Matcher matcher = pattern.matcher(contentDisposition);
if (matcher.find())
filename = matcher.group(1);
}
String prefix;
String suffix = null;
if (filename == null) {
prefix = "download-";
suffix = "";
} else {
int pos = filename.lastIndexOf('.');
if (pos == -1) {
prefix = filename + "-";
} else {
prefix = filename.substring(0, pos) + "-";
suffix = filename.substring(pos);
}
// Files.createTempFile requires the prefix to be at least three characters long
if (prefix.length() < 3)
prefix = "download-";
}
if (tempFolderPath == null)
return Files.createTempFile(prefix, suffix).toFile();
else
return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile();
}
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
prepareDownloadFile
|
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 1
|
Analyze the following code function for security vulnerabilities
|
private boolean shouldEnableNonPersistentRandomizationOnOpenNetwork(WifiConfiguration config) {
if (!mDeviceConfigFacade.allowNonPersistentMacRandomizationOnOpenSsids()
&& !mContext.getResources().getBoolean(
R.bool.config_wifiAllowNonPersistentMacRandomizationOnOpenSsids)) {
return false;
}
return config.getNetworkSelectionStatus().hasEverConnected()
&& config.getNetworkSelectionStatus().hasNeverDetectedCaptivePortal();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldEnableNonPersistentRandomizationOnOpenNetwork
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
shouldEnableNonPersistentRandomizationOnOpenNetwork
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected String getSubTitle() {
return "Enter your user name or email to reset password";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSubTitle
File: server-core/src/main/java/io/onedev/server/web/page/simple/security/PasswordResetPage.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2023-24828
|
HIGH
| 8.8
|
theonedev/onedev
|
getSubTitle
|
server-core/src/main/java/io/onedev/server/web/page/simple/security/PasswordResetPage.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getResponseCharSet() {
return responseCharSet;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getResponseCharSet
File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
Repository: orientechnologies/orientdb
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2015-2912
|
MEDIUM
| 6.8
|
orientechnologies/orientdb
|
getResponseCharSet
|
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
|
d5a45e608ba8764fd817c1bdd7cf966564e828e9
| 0
|
Analyze the following code function for security vulnerabilities
|
private TelephonyManager getTelephonyManager() {
return (TelephonyManager)mContext.getSystemService(Context.TELEPHONY_SERVICE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTelephonyManager
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
|
getTelephonyManager
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
2750faaa1ec819eed9acffea7bd3daf867fda444
| 0
|
Analyze the following code function for security vulnerabilities
|
private native int nativeGetSecurityLevel(long nativeTabAndroid);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeGetSecurityLevel
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
nativeGetSecurityLevel
|
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private static native @Nullable @AttrRes int[] nativeGetStyleAttributes(long ptr,
@StyleRes int resId);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeGetStyleAttributes
File: core/java/android/content/res/AssetManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
nativeGetStyleAttributes
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isDefaultDeviceOwner(CallerIdentity caller) {
synchronized (getLockObject()) {
return isDeviceOwnerLocked(caller) && getDeviceOwnerTypeLocked(
mOwners.getDeviceOwnerPackageName()) == DEVICE_OWNER_TYPE_DEFAULT;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDefaultDeviceOwner
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
|
isDefaultDeviceOwner
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private void iteratePages(PRIndirectReference rpage) throws IOException {
PdfDictionary page = (PdfDictionary)getPdfObject(rpage);
PdfArray kidsPR = page.getAsArray(PdfName.KIDS);
// reference to a leaf
if (kidsPR == null) {
page.put(PdfName.TYPE, PdfName.PAGE);
PdfDictionary dic = (PdfDictionary)pageInh.get(pageInh.size() - 1);
PdfName key;
for (Iterator i = dic.getKeys().iterator(); i.hasNext();) {
key = (PdfName)i.next();
if (page.get(key) == null)
page.put(key, dic.get(key));
}
if (page.get(PdfName.MEDIABOX) == null) {
PdfArray arr = new PdfArray(new float[]{0,0,PageSize.LETTER.width(),PageSize.LETTER.height()});
page.put(PdfName.MEDIABOX, arr);
}
refsn.add(rpage);
}
// reference to a branch
else {
page.put(PdfName.TYPE, PdfName.PAGES);
pushPageAttributes(page);
for (int k = 0; k < kidsPR.size(); ++k){
PdfObject obj = kidsPR.getPdfObject(k);
if (!obj.isIndirect()) {
while (k < kidsPR.size())
kidsPR.remove(k);
break;
}
iteratePages((PRIndirectReference)obj);
}
popPageAttributes();
}
}
|
Vulnerability Classification:
- CWE: CWE-835
- CVE: CVE-2021-37819
- Severity: HIGH
- CVSS Score: 7.5
Description: bug fix due to invalid reference
Function: iteratePages
File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
Repository: pdftk-java/pdftk
Fixed Code:
private void iteratePages(PRIndirectReference rpage) throws IOException {
PdfDictionary page = (PdfDictionary)getPdfObject(rpage);
PdfArray kidsPR = page.getAsArray(PdfName.KIDS);
// reference to a leaf
if (kidsPR == null) {
page.put(PdfName.TYPE, PdfName.PAGE);
PdfDictionary dic = (PdfDictionary)pageInh.get(pageInh.size() - 1);
PdfName key;
for (Iterator i = dic.getKeys().iterator(); i.hasNext();) {
key = (PdfName)i.next();
if (page.get(key) == null)
page.put(key, dic.get(key));
}
if (page.get(PdfName.MEDIABOX) == null) {
PdfArray arr = new PdfArray(new float[]{0,0,PageSize.LETTER.width(),PageSize.LETTER.height()});
page.put(PdfName.MEDIABOX, arr);
}
refsn.add(rpage);
}
// reference to a branch
else {
page.put(PdfName.TYPE, PdfName.PAGES);
pushPageAttributes(page);
for (int k = 0; k < kidsPR.size(); ++k){
PdfObject obj = kidsPR.getPdfObject(k);
if (!obj.isIndirect()) {
while (k < kidsPR.size())
kidsPR.remove(k);
break;
}
int rpageObjectNumber = rpage.getNumber();
PRIndirectReference kidObjIndirectRef = (PRIndirectReference)obj;
int kidObjectNumber = kidObjIndirectRef.getNumber();
if (rpageObjectNumber == kidObjectNumber) {
System.err.println("Error: Invalid referece on Kids: ");
System.exit(0);
}
iteratePages((PRIndirectReference)obj);
}
popPageAttributes();
}
}
|
[
"CWE-835"
] |
CVE-2021-37819
|
HIGH
| 7.5
|
pdftk-java/pdftk
|
iteratePages
|
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
|
75deacdf5c46fd4eefb310c784eb9dfdc7b9fdc9
| 1
|
Analyze the following code function for security vulnerabilities
|
@POST
@Produces(MediaType.TEXT_XML)
@Path("addTrack")
@RestQuery(name = "addTrackURL", description = "Add a media track to a given media package using an URL", restParameters = {
@RestParameter(description = "The location of the media", isRequired = true, name = "url", type = RestParameter.Type.STRING),
@RestParameter(description = "The kind of media", isRequired = true, name = "flavor", type = RestParameter.Type.STRING),
@RestParameter(description = "The Tags of the media track", isRequired = false, name = "tags", type = RestParameter.Type.STRING),
@RestParameter(description = "The media package as XML", isRequired = true, name = "mediaPackage", type = RestParameter.Type.TEXT) }, reponses = {
@RestResponse(description = "Returns augmented media package", responseCode = HttpServletResponse.SC_OK),
@RestResponse(description = "Media package not valid", responseCode = HttpServletResponse.SC_BAD_REQUEST),
@RestResponse(description = "", responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR) }, returnDescription = "")
public Response addMediaPackageTrack(@FormParam("url") String url, @FormParam("flavor") String flavor, @FormParam("tags") String tags,
@FormParam("mediaPackage") String mpx) {
logger.trace("add media package from url: {} flavor: {} tags: {} mediaPackage: {}", url, flavor, tags, mpx);
try {
MediaPackage mp = factory.newMediaPackageBuilder().loadFromXml(mpx);
if (MediaPackageSupport.sanityCheck(mp).isSome())
return Response.serverError().status(Status.BAD_REQUEST).build();
String[] tagsArray = null;
if (tags != null) {
tagsArray = tags.split(",");
}
mp = ingestService.addTrack(new URI(url), MediaPackageElementFlavor.parseFlavor(flavor), tagsArray, mp);
return Response.ok(mp).build();
} catch (Exception e) {
logger.warn(e.getMessage(), e);
return Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addMediaPackageTrack
File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2020-5230
|
MEDIUM
| 5
|
opencast
|
addMediaPackageTrack
|
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java
|
bbb473f34ab95497d6c432c81285efb0c739f317
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void extend(AbstractListing<T> grid) {
if (!(grid instanceof Grid)) {
throw new IllegalArgumentException(
getClass().getSimpleName() + " can only extend Grid");
}
super.extend(grid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: extend
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
|
extend
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: broadcastStickyIntent
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
broadcastStickyIntent
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
@Editable(order=500, description=
"Specifies the base node for user search. For example: <i>ou=users, dc=example, dc=com</i>")
@NotEmpty
public String getUserSearchBase() {
return userSearchBase;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserSearchBase
File: server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-90"
] |
CVE-2021-32651
|
MEDIUM
| 4.3
|
theonedev/onedev
|
getUserSearchBase
|
server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java
|
4440f0c57e440488d7e653417b2547eaae8ad19c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public XMLBuilder element(String name, String namespaceURI) {
Element elem = super.elementImpl(name, namespaceURI);
return new XMLBuilder(elem, this.getElement());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: element
File: src/main/java/com/jamesmurty/utils/XMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
element
|
src/main/java/com/jamesmurty/utils/XMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: beforeTextChanged
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
beforeTextChanged
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public static DocumentBuilder getXmlParser() {
DocumentBuilder db = null;
try {
DocumentBuilderFactory dbf = safeDocumentBuilderFactory();
dbf.setValidating(false);
//Disable DTD loading and validation
//See http://stackoverflow.com/questions/155101/make-documentbuilder-parse-ignore-dtd-references
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false);
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
db = dbf.newDocumentBuilder();
db.setErrorHandler(new SAXErrorHandler());
} catch (ParserConfigurationException e) {
log.warnf("%s: Unable to create XML parser\n", XMLUtils.class.getName());
log.warn(e);
} catch(UnsupportedOperationException e) {
log.warnf("%s: API error while setting up XML parser. Check your JAXP version\n", XMLUtils.class.getName());
log.warn(e);
}
return db;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getXmlParser
File: src/edu/stanford/nlp/util/XMLUtils.java
Repository: stanfordnlp/CoreNLP
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-0239
|
HIGH
| 7.5
|
stanfordnlp/CoreNLP
|
getXmlParser
|
src/edu/stanford/nlp/util/XMLUtils.java
|
1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void liteMemberXmlGenerator(XmlGenerator gen, Config config) {
gen.node("lite-member", null, "enabled", config.isLiteMember());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: liteMemberXmlGenerator
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
|
liteMemberXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
80a502d53cc48bf895711ab55f95e3a51e344ac1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeInt(mPendingIntent != null ? 1 : 0);
if (mPendingIntent != null) {
mPendingIntent.writeToParcel(out, 0);
}
out.writeInt(mIcon != null ? 1 : 0);
if (mIcon != null) {
mIcon.writeToParcel(out, 0);
}
out.writeInt(mDesiredHeight);
out.writeInt(mFlags);
out.writeInt(mDeleteIntent != null ? 1 : 0);
if (mDeleteIntent != null) {
mDeleteIntent.writeToParcel(out, 0);
}
out.writeInt(mDesiredHeightResId);
out.writeInt(TextUtils.isEmpty(mShortcutId) ? 0 : 1);
if (!TextUtils.isEmpty(mShortcutId)) {
out.writeString8(mShortcutId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeToParcel
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
writeToParcel
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void sendFile(final String path,
final int max_age) throws IOException {
sendFile(HttpResponseStatus.OK, path, max_age);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendFile
File: src/tsd/HttpQuery.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-25827
|
MEDIUM
| 6.1
|
OpenTSDB/opentsdb
|
sendFile
|
src/tsd/HttpQuery.java
|
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void writeAndHandleProgress(InputStream inputStream, FileOutputStream outputStream,
long totalSizeInKB, String fullModuleName) {
int count;
byte[] buffer = new byte[1024];
try (ProgressBar progressBar = new ProgressBar(fullModuleName + " [central.ballerina.io -> home repo] ",
totalSizeInKB, 1000, outStream, ProgressBarStyle.ASCII, " KB", 1)) {
while ((count = inputStream.read(buffer)) > 0) {
outputStream.write(buffer, 0, count);
progressBar.step();
}
} catch (IOException e) {
outStream.println(logFormatter.formatLog(fullModuleName + "pulling the module from central failed"));
} finally {
outStream.println(logFormatter.formatLog(fullModuleName + " pulled from central successfully"));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeAndHandleProgress
File: cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Pull.java
Repository: ballerina-platform/ballerina-lang
The code follows secure coding practices.
|
[
"CWE-306"
] |
CVE-2021-32700
|
MEDIUM
| 5.8
|
ballerina-platform/ballerina-lang
|
writeAndHandleProgress
|
cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Pull.java
|
4609ffee1744ecd16aac09303b1783bf0a525816
| 0
|
Analyze the following code function for security vulnerabilities
|
private static CookieManager getCookieManager() {
if (android.os.Build.VERSION.SDK_INT >= 21) {
return CookieManager.getInstance();
}
if (cookieManager == null) {
CookieSyncManager.createInstance(getContext()); // Fixes a crash on Android 4.3
// https://stackoverflow.com/a/20552998/2935174
cookieManager = CookieManager.getInstance();
}
return CookieManager.getInstance();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCookieManager
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
|
getCookieManager
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.