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 | protected <F> void setFilter(F filter) {
this.filter = filter;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setFilter
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 | setFilter | server/src/main/java/com/vaadin/data/provider/DataCommunicator.java | 9a93593d9f3802d2881fc8ad22dbc210d0d1d295 | 0 |
Analyze the following code function for security vulnerabilities | private void abortFailed(UserRequest ureq, String errorMessageKey) {
getWindowControl().setError(translator.translate(errorMessageKey));
status = FolderCommandStatus.STATUS_FAILED;
fireEvent(ureq, FOLDERCOMMAND_FINISHED);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: abortFailed
File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdMoveCopy.java
Repository: OpenOLAT
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2021-41152 | MEDIUM | 4 | OpenOLAT | abortFailed | src/main/java/org/olat/core/commons/modules/bc/commands/CmdMoveCopy.java | 418bb509ffcb0e25ab4390563c6c47f0458583eb | 0 |
Analyze the following code function for security vulnerabilities | public boolean isRebuilt() {
return this.rebuilt;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isRebuilt
File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
Repository: pdftk-java/pdftk
The code follows secure coding practices. | [
"CWE-835"
] | CVE-2021-37819 | HIGH | 7.5 | pdftk-java/pdftk | isRebuilt | java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java | 9b0cbb76c8434a8505f02ada02a94263dcae9247 | 0 |
Analyze the following code function for security vulnerabilities | public void setExpireSearchResultsAfterMillis(long theExpireSearchResultsAfterMillis) {
myExpireSearchResultsAfterMillis = theExpireSearchResultsAfterMillis;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setExpireSearchResultsAfterMillis
File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
Repository: hapifhir/hapi-fhir
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2021-32053 | MEDIUM | 5 | hapifhir/hapi-fhir | setExpireSearchResultsAfterMillis | hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java | f2934b229c491235ab0e7782dea86b324521082a | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void hideBootMessages() {
mHandler.sendEmptyMessage(MSG_HIDE_BOOT_MESSAGE);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hideBootMessages
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-0812 | MEDIUM | 6.6 | android | hideBootMessages | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 84669ca8de55d38073a0dcb01074233b0a417541 | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected void onPause() {
if (InPlaceEditView.isEditing()) {
AndroidImplementation.stopEditing(true);
}
super.onPause();
AndroidNativeUtil.onPause();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onPause
File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
Repository: codenameone/CodenameOne
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2022-4903 | MEDIUM | 5.1 | codenameone/CodenameOne | onPause | Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | protected InputStream toResourceInputStream(Object restObject) throws JAXBException
{
InputStream resourceStream;
if (restObject instanceof InputStream) {
resourceStream = (InputStream) restObject;
} else if (restObject instanceof byte[]) {
resourceStream = new ByteArrayInputStream((byte[]) restObject);
} else {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
marshaller.marshal(restObject, stream);
resourceStream = new ByteArrayInputStream(stream.toByteArray());
}
return resourceStream;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toResourceInputStream
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 | toResourceInputStream | xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java | 98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263 | 0 |
Analyze the following code function for security vulnerabilities | private static Optional<WebSocket> findSockets(final Set<WebSocket.Definition> sockets,
final String path) {
for (WebSocket.Definition socketDef : sockets) {
Optional<WebSocket> match = socketDef.matches(path);
if (match.isPresent()) {
return match;
}
}
return Optional.empty();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findSockets
File: jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java
Repository: jooby-project/jooby
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2019-15477 | MEDIUM | 4.3 | jooby-project/jooby | findSockets | jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java | 34856a738829d8fedca4ed27bd6ff413af87186f | 0 |
Analyze the following code function for security vulnerabilities | private LogMaker newLogMaker(int category, int saveType) {
return newLogMaker(category).addTaggedData(MetricsEvent.FIELD_AUTOFILL_SAVE_TYPE, saveType);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newLogMaker
File: services/autofill/java/com/android/server/autofill/ui/SaveUi.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other",
"CWE-610"
] | CVE-2023-40133 | MEDIUM | 5.5 | android | newLogMaker | services/autofill/java/com/android/server/autofill/ui/SaveUi.java | 08becc8c600f14c5529115cc1a1e0c97cd503f33 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public HttpServletResponse getHttpServletResponse()
{
return this.response;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHttpServletResponse
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-601"
] | CVE-2022-23618 | MEDIUM | 5.8 | xwiki/xwiki-platform | getHttpServletResponse | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java | 5251c02080466bf9fb55288f04a37671108f8096 | 0 |
Analyze the following code function for security vulnerabilities | public GridSingleSelect<T> asSingleSelect() {
return new GridSingleSelect<>(this);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: asSingleSelect
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 | asSingleSelect | server/src/main/java/com/vaadin/ui/Grid.java | c40bed109c3723b38694ed160ea647fef5b28593 | 0 |
Analyze the following code function for security vulnerabilities | public void addOnNetworkUpdateListener(@NonNull OnNetworkUpdateListener listener) {
if (listener == null) {
Log.wtf(TAG, "addOnNetworkUpdateListener: listener must not be null");
return;
}
mListeners.add(listener);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addOnNetworkUpdateListener
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 | addOnNetworkUpdateListener | service/java/com/android/server/wifi/WifiConfigManager.java | 72e903f258b5040b8f492cf18edd124b5a1ac770 | 0 |
Analyze the following code function for security vulnerabilities | public void setResult(int result) {
mResult.set(result);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setResult
File: services/backup/java/com/android/server/backup/BackupManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2016-3759 | MEDIUM | 5 | android | setResult | services/backup/java/com/android/server/backup/BackupManagerService.java | 9b8c6d2df35455ce9e67907edded1e4a2ecb9e28 | 0 |
Analyze the following code function for security vulnerabilities | public static void copyResourceFolder(String[] resources, String savePath) throws IOException {
for (String resource : resources) {
String aux = resource.substring(resource.lastIndexOf("/") + 1, resource.length());
File b = new File(savePath + File.separator + aux);
b.createNewFile();
copyLocalResource(resource, b);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyResourceFolder
File: src/main/java/widoco/WidocoUtils.java
Repository: dgarijo/Widoco
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2022-4772 | HIGH | 7.8 | dgarijo/Widoco | copyResourceFolder | src/main/java/widoco/WidocoUtils.java | f2279b76827f32190adfa9bd5229b7d5a147fa92 | 0 |
Analyze the following code function for security vulnerabilities | private static boolean isOWS(char ch) {
return ch == ' ' || ch == (char) 0x09;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isOWS
File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
Repository: netty
The code follows secure coding practices. | [
"CWE-444"
] | CVE-2021-43797 | MEDIUM | 4.3 | netty | isOWS | codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java | 07aa6b5938a8b6ed7a6586e066400e2643897323 | 0 |
Analyze the following code function for security vulnerabilities | private URL resolve(final Request req, final String path) throws Throwable {
String target = fn.apply(req, path);
return resolve(target);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resolve
File: jooby/src/main/java/org/jooby/handlers/AssetHandler.java
Repository: jooby-project/jooby
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2020-7647 | MEDIUM | 5 | jooby-project/jooby | resolve | jooby/src/main/java/org/jooby/handlers/AssetHandler.java | 34f526028e6cd0652125baa33936ffb6a8a4a009 | 0 |
Analyze the following code function for security vulnerabilities | public URI getUrl() {
return url;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUrl
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java
Repository: codecentric/spring-boot-admin
The code follows secure coding practices. | [
"CWE-94"
] | CVE-2022-46166 | CRITICAL | 9.8 | codecentric/spring-boot-admin | getUrl | spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java | c14c3ec12533f71f84de9ce3ce5ceb7991975f75 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean getCertifiedText() {
return fCertifiedText;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCertifiedText
File: ext/java/nokogiri/XmlSchema.java
Repository: sparklemotion/nokogiri
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2020-26247 | MEDIUM | 4 | sparklemotion/nokogiri | getCertifiedText | ext/java/nokogiri/XmlSchema.java | 9c87439d9afa14a365ff13e73adc809cb2c3d97b | 0 |
Analyze the following code function for security vulnerabilities | private GameData parseShallow(final InputStream stream) throws GameParseException, EngineVersionException {
final Element root = parseDom(stream);
parseMapProperties(root);
return data;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseShallow
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2018-1000546 | MEDIUM | 6.8 | triplea-game/triplea | parseShallow | game-core/src/main/java/games/strategy/engine/data/GameParser.java | 0f23875a4c6e166218859a63c884995f15c53895 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public List<EPerson> allMembers(Context c, Group g) throws SQLException {
// two queries - first to get all groups which are a member of this group
// second query gets all members of each group in the first query
// Get all groups which are a member of this group
List<Group2GroupCache> group2GroupCaches = group2GroupCacheDAO.findByParent(c, g);
Set<Group> groups = new HashSet<>();
for (Group2GroupCache group2GroupCache : group2GroupCaches) {
groups.add(group2GroupCache.getChild());
}
Set<EPerson> childGroupChildren = new HashSet<>(ePersonService.findByGroups(c, groups));
//Don't forget to add our direct children
childGroupChildren.addAll(g.getMembers());
return new ArrayList<>(childGroupChildren);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: allMembers
File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
Repository: DSpace
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2021-41189 | HIGH | 9 | DSpace | allMembers | dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java | 277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041 | 0 |
Analyze the following code function for security vulnerabilities | public String getPrivateKeyFile() {
return prop.getProperty(TS_PRIVATE_KEY_FILE);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPrivateKeyFile
File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
Repository: pytorch/serve
The code follows secure coding practices. | [
"CWE-918"
] | CVE-2023-43654 | CRITICAL | 9.8 | pytorch/serve | getPrivateKeyFile | frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java | 391bdec3348e30de173fbb7c7277970e0b53c8ad | 0 |
Analyze the following code function for security vulnerabilities | public static File getMetricsDirectory() {
String neo4jHome = apocConfig().getString(GraphDatabaseSettings.neo4j_home.name());
String metricsSetting = apocConfig().getString("dbms.directories.metrics", neo4jHome + File.separator + "metrics");
File metricsDir = metricsSetting.isEmpty() ? new File(neo4jHome, "metrics") : new File(metricsSetting);
if (metricsDir.exists() && metricsDir.canRead() && metricsDir.isDirectory() ) {
return metricsDir;
}
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMetricsDirectory
File: core/src/main/java/apoc/util/FileUtils.java
Repository: neo4j-contrib/neo4j-apoc-procedures
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2022-23532 | MEDIUM | 6.5 | neo4j-contrib/neo4j-apoc-procedures | getMetricsDirectory | core/src/main/java/apoc/util/FileUtils.java | 01e63ed2d187cd2a8aa1d78bf831ef0fdd69b522 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void handleCommand(ChannelUID channelUID, Command command) {
if (command instanceof RefreshType) {
// Placeholder for later refinement
} else {
if (channelUID.getId().equals(RUN)) {
if (command instanceof OnOffType) {
if (command == OnOffType.ON) {
scheduler.schedule(periodicExecutionRunnable, 0, TimeUnit.SECONDS);
}
}
} else if (channelUID.getId().equals(INPUT)) {
if (command instanceof StringType) {
String previousInput = lastInput;
lastInput = command.toString();
if (lastInput != null && !lastInput.equals(previousInput)) {
if (getConfig().get(AUTORUN) != null && ((Boolean) getConfig().get(AUTORUN)).booleanValue()) {
logger.trace("Executing command '{}' after a change of the input channel to '{}'",
getConfig().get(COMMAND), lastInput);
scheduler.schedule(periodicExecutionRunnable, 0, TimeUnit.SECONDS);
}
}
}
}
}
} | Vulnerability Classification:
- CWE: CWE-863
- CVE: CVE-2020-5242
- Severity: HIGH
- CVSS Score: 9.3
Description: Merge pull request from GHSA-w698-693g-23hv
* fix arbitrary code execution vulnerability
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
* Update bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java
Co-Authored-By: Christoph Weitkamp <github@christophweitkamp.de>
* address review comments
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Co-authored-by: Christoph Weitkamp <github@christophweitkamp.de>
Function: handleCommand
File: bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java
Repository: openhab/openhab-addons
Fixed Code:
@Override
public void handleCommand(ChannelUID channelUID, Command command) {
if (command instanceof RefreshType) {
// Placeholder for later refinement
} else {
if (channelUID.getId().equals(RUN)) {
if (command instanceof OnOffType) {
if (command == OnOffType.ON) {
scheduler.schedule(this::execute, 0, TimeUnit.SECONDS);
}
}
} else if (channelUID.getId().equals(INPUT)) {
if (command instanceof StringType) {
String previousInput = lastInput;
lastInput = command.toString();
if (lastInput != null && !lastInput.equals(previousInput)) {
if (getConfig().get(AUTORUN) != null && ((Boolean) getConfig().get(AUTORUN))) {
logger.trace("Executing command '{}' after a change of the input channel to '{}'",
getConfig().get(COMMAND), lastInput);
scheduler.schedule(this::execute, 0, TimeUnit.SECONDS);
}
}
}
}
}
} | [
"CWE-863"
] | CVE-2020-5242 | HIGH | 9.3 | openhab/openhab-addons | handleCommand | bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java | 4c4cb664f2e2c3866aadf117d22fb54aa8dd0031 | 1 |
Analyze the following code function for security vulnerabilities | public static void main (String[] args) throws URISyntaxException, IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
URI uri = WarFileLauncher.class.getProtectionDomain().getCodeSource().getLocation().toURI();
String pathFromUri;
if(uri.getScheme().equals("jar")) {
pathFromUri = new URI(uri.getSchemeSpecificPart()).getSchemeSpecificPart();
int index = pathFromUri.indexOf("!");
if(index >= 0) {
pathFromUri = pathFromUri.substring(0, index);
}
} else {
pathFromUri = uri.toString();
}
File warFile = new File(pathFromUri);
String warPath = warFile.getAbsolutePath();
if(!warFile.exists()) {
System.err.println("Could not determine the path of the running war file: " + warPath);
System.exit(1);
}
int port = 8080;
File tempDir = createTempDir(port);
try(JarFile jarFile = new JarFile(warFile)) {
Enumeration<JarEntry> entries = jarFile.entries();
List<URL> tomcatLibs = new ArrayList<>();
File tomcatLibDir = new File(tempDir, "tomcat-libs");
tomcatLibDir.mkdir();
while(entries.hasMoreElements()) {
JarEntry entry = entries.nextElement();
if(entry.getName().startsWith("WEB-INF/lib-provided") && entry.getName().endsWith(".jar")) {
File outFile = new File(tomcatLibDir, entry.getName().substring("WEB-INF/lib-provided/".length()));
if (!outFile.toPath().normalize().startsWith(tomcatLibDir.toPath())) {
throw new IOException("Bad zip entry: " + entry.getName());
}
try(InputStream in = jarFile.getInputStream(entry);
OutputStream out = new FileOutputStream(outFile)) {
IOUtils.copy(in, out);
}
tomcatLibs.add(outFile.toURI().toURL());
}
}
File pkgFile = tomcatLibDir;
String packageName = TomcatLauncher.class.getPackage().getName();
for(String pkg : packageName.split("\\.")) {
pkgFile = new File(pkgFile, pkg);
}
pkgFile.mkdirs();
File outFile = new File(pkgFile, "TomcatLauncher.class");
try(InputStream in = TomcatLauncher.class.getResourceAsStream("TomcatLauncher.class");
OutputStream out = new FileOutputStream(outFile)) {
IOUtils.copy(in, out);
}
tomcatLibs.add(tomcatLibDir.toURI().toURL());
URLClassLoader tomcatClassLoader = new URLClassLoader(tomcatLibs.toArray(new URL[0]));
Class<?> launcherClass = tomcatClassLoader.loadClass(TomcatLauncher.class.getName());
Method launcherMethod = launcherClass.getMethod("launch", File.class, String.class, Integer.TYPE);
launcherMethod.invoke(null, tempDir, warPath, port);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: main
File: microservices/launcher/src/main/java/com/manydesigns/portofino/microservices/launcher/WarFileLauncher.java
Repository: ManyDesigns/Portofino
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2022-3952 | HIGH | 7.1 | ManyDesigns/Portofino | main | microservices/launcher/src/main/java/com/manydesigns/portofino/microservices/launcher/WarFileLauncher.java | 94653cb357806c9cf24d8d294e6afea33f8f0775 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public XMLBuilder t(String value) {
return text(value);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: t
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 | t | src/main/java/com/jamesmurty/utils/XMLBuilder.java | e6fddca201790abab4f2c274341c0bb8835c3e73 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public String getOffsetLimitSQL(Select select) {
int offset = select.getOffset();
int limit = select.getLimit();
StringBuilder out = new StringBuilder();
if (limit > 0) out.append(" LIMIT ").append(limit);
if (offset > 0) out.append(" OFFSET ").append(offset);
return out.toString();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOffsetLimitSQL
File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
Repository: dashbuilder
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2016-4999 | HIGH | 7.5 | dashbuilder | getOffsetLimitSQL | dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java | 8574899e3b6455547b534f570b2330ff772e524b | 0 |
Analyze the following code function for security vulnerabilities | @Override
public VFSLeaf createChildLeaf(String name) {
File fNewFile = new File(getBasefile(), name);
try {
if(!isInPath(name)) {
log.warn("Could not create a new leaf::{} in container::{} - file out of parent directory", name, getBasefile().getAbsolutePath());
return null;
}
if(!fNewFile.getParentFile().exists()) {
fNewFile.getParentFile().mkdirs();
}
if (!fNewFile.createNewFile()) {
log.warn("Could not create a new leaf::{} in container::{} - file alreay exists", name, getBasefile().getAbsolutePath());
return null;
}
} catch (Exception e) {
log.error("Error while creating child leaf::{} in container::{}", name, getBasefile().getAbsolutePath(), e);
return null;
}
return new LocalFileImpl(fNewFile, this);
} | Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2021-41242
- Severity: HIGH
- CVSS Score: 7.9
Description: OO-5819: clean starting / for backward compatibility
Function: createChildLeaf
File: src/main/java/org/olat/core/util/vfs/LocalFolderImpl.java
Repository: OpenOLAT
Fixed Code:
@Override
public VFSLeaf createChildLeaf(String name) {
name = cleanFilename(name); // backward compatibility
File fNewFile = new File(getBasefile(), name);
try {
if(!isInPath(name)) {
log.warn("Could not create a new leaf::{} in container::{} - file out of parent directory", name, getBasefile().getAbsolutePath());
return null;
}
if(!fNewFile.getParentFile().exists()) {
fNewFile.getParentFile().mkdirs();
}
if (!fNewFile.createNewFile()) {
log.warn("Could not create a new leaf::{} in container::{} - file alreay exists", name, getBasefile().getAbsolutePath());
return null;
}
} catch (Exception e) {
log.error("Error while creating child leaf::{} in container::{}", name, getBasefile().getAbsolutePath(), e);
return null;
}
return new LocalFileImpl(fNewFile, this);
} | [
"CWE-22"
] | CVE-2021-41242 | HIGH | 7.9 | OpenOLAT | createChildLeaf | src/main/java/org/olat/core/util/vfs/LocalFolderImpl.java | 336d5ce80681be61a0bbf4f73d2af5d1ff67e93a | 1 |
Analyze the following code function for security vulnerabilities | private boolean performRollbackManagerRestore(int userId, int token, PackageInstalledInfo res,
PostInstallData data) {
final String packageName = res.mPkg.getPackageName();
final int[] allUsers = mPm.mUserManager.getUserIds();
final int[] installedUsers;
final PackageSetting ps;
int appId = -1;
long ceDataInode = -1;
synchronized (mPm.mLock) {
ps = mPm.mSettings.getPackageLPr(packageName);
if (ps != null) {
appId = ps.getAppId();
ceDataInode = ps.getCeDataInode(userId);
}
// NOTE: We ignore the user specified in the InstallParam because we know this is
// an update, and hence need to restore data for all installed users.
installedUsers = ps.queryInstalledUsers(allUsers, true);
}
boolean doSnapshotOrRestore = data != null && data.args != null
&& ((data.args.mInstallFlags & PackageManager.INSTALL_ENABLE_ROLLBACK) != 0
|| (data.args.mInstallFlags & PackageManager.INSTALL_REQUEST_DOWNGRADE) != 0);
if (ps != null && doSnapshotOrRestore) {
final String seInfo = AndroidPackageUtils.getSeInfo(res.mPkg, ps);
final RollbackManagerInternal rollbackManager =
mInjector.getLocalService(RollbackManagerInternal.class);
rollbackManager.snapshotAndRestoreUserData(packageName,
UserHandle.toUserHandles(installedUsers), appId, ceDataInode, seInfo, token);
return true;
}
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: performRollbackManagerRestore
File: services/core/java/com/android/server/pm/InstallPackageHelper.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21257 | HIGH | 7.8 | android | performRollbackManagerRestore | services/core/java/com/android/server/pm/InstallPackageHelper.java | 1aec7feaf07e6d4568ca75d18158445dbeac10f6 | 0 |
Analyze the following code function for security vulnerabilities | private void startOwnerService(int userId, String actionForLog) {
final ComponentName owner = getOwnerComponent(userId);
if (owner != null) {
mDeviceAdminServiceController.startServiceForAdmin(
owner.getPackageName(), userId, actionForLog);
invalidateBinderCaches();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startOwnerService
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 | startOwnerService | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | @Override
public List<StackInfo> getAllStackInfos() throws RemoteException
{
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
reply.readException();
ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
data.recycle();
reply.recycle();
return list;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllStackInfos
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3832 | HIGH | 8.3 | android | getAllStackInfos | core/java/android/app/ActivityManagerNative.java | e7cf91a198de995c7440b3b64352effd2e309906 | 0 |
Analyze the following code function for security vulnerabilities | public String debugRun(RunDefinitionRequest request, List<MultipartFile> bodyFiles, List<MultipartFile> scenarioFiles) {
return apiScenarioExecuteService.debug(request, bodyFiles, scenarioFiles);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: debugRun
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2021-45789 | MEDIUM | 6.5 | metersphere | debugRun | backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java | d74e02cdff47cdf7524d305d098db6ffb7f61b47 | 0 |
Analyze the following code function for security vulnerabilities | @Contract(pure = false, value = "null -> fail")
public static <T extends AccessibleObject> T openAccess(T object) {
setAccessible(object, true);
return object;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: openAccess
File: api/src/main/java/io/github/karlatemp/unsafeaccessor/Root.java
Repository: Karlatemp/UnsafeAccessor
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2022-31139 | MEDIUM | 4.3 | Karlatemp/UnsafeAccessor | openAccess | api/src/main/java/io/github/karlatemp/unsafeaccessor/Root.java | 4ef83000184e8f13239a1ea2847ee401d81585fd | 0 |
Analyze the following code function for security vulnerabilities | @PUT
@Path("test")
@Operation(summary = "Update a Test Element onto a given course", description = "This attaches a Test Element onto a given course. The element will be\n" +
" inserted underneath the supplied parentNodeId")
@ApiResponse(responseCode = "200", description = "The test node metadatas", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)),
@Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) })
@ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient")
@ApiResponse(responseCode = "404", description = "course, parentNode or test not found")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response attachTest(@PathParam("courseId") Long courseId, @QueryParam("parentNodeId") String parentNodeId,
@QueryParam("position") Integer position, @QueryParam("shortTitle") @DefaultValue("undefined") String shortTitle,
@QueryParam("longTitle") @DefaultValue("undefined") String longTitle, @QueryParam("objectives") @DefaultValue("undefined") String objectives,
@QueryParam("visibilityExpertRules") String visibilityExpertRules, @QueryParam("accessExpertRules") String accessExpertRules,
@QueryParam("testResourceableId") Long testResourceableId, @Context HttpServletRequest request) {
RepositoryManager rm = RepositoryManager.getInstance();
RepositoryEntry testRepoEntry = rm.lookupRepositoryEntry(testResourceableId);
if(testRepoEntry == null) {
return Response.serverError().status(Status.NOT_FOUND).build();
}
CustomConfigDelegate config = CustomConfigFactory.getTestCustomConfig(testRepoEntry);
return attach(courseId, parentNodeId, "iqtest", position, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, config, request);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: attachTest
File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
Repository: OpenOLAT
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2021-41242 | HIGH | 7.9 | OpenOLAT | attachTest | src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java | c450df7d7ffe6afde39ebca6da9136f1caa16ec4 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void requestInterruptionFilterFromListener(INotificationListener token,
int interruptionFilter) throws RemoteException {
final long identity = Binder.clearCallingIdentity();
try {
synchronized (mNotificationList) {
final ManagedServiceInfo info = mListeners.checkServiceTokenLocked(token);
mZenModeHelper.requestFromListener(info.component, interruptionFilter);
updateInterruptionFilterLocked();
}
} finally {
Binder.restoreCallingIdentity(identity);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestInterruptionFilterFromListener
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 | requestInterruptionFilterFromListener | services/core/java/com/android/server/notification/NotificationManagerService.java | 61e9103b5725965568e46657f4781dd8f2e5b623 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public long getProviderIndex() {
return mProviderIndex;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProviderIndex
File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-120"
] | CVE-2023-21243 | MEDIUM | 5.5 | android | getProviderIndex | service/java/com/android/server/wifi/hotspot2/PasspointManager.java | 5b49b8711efaadadf5052ba85288860c2d7ca7a6 | 0 |
Analyze the following code function for security vulnerabilities | public byte[] getPageContent(int pageNum) throws IOException{
RandomAccessFileOrArray rf = getSafeFile();
try {
rf.reOpen();
return getPageContent(pageNum, rf);
}
finally {
try{rf.close();}catch(Exception e){}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPageContent
File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
Repository: pdftk-java/pdftk
The code follows secure coding practices. | [
"CWE-835"
] | CVE-2021-37819 | HIGH | 7.5 | pdftk-java/pdftk | getPageContent | java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java | 9b0cbb76c8434a8505f02ada02a94263dcae9247 | 0 |
Analyze the following code function for security vulnerabilities | public X509Certificate getCaCertificate() {
return mCaCert;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCaCertificate
File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java
Repository: android
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2016-3897 | MEDIUM | 4.3 | android | getCaCertificate | wifi/java/android/net/wifi/WifiEnterpriseConfig.java | 81be4e3aac55305cbb5c9d523cf5c96c66604b39 | 0 |
Analyze the following code function for security vulnerabilities | @Test
public void selectSingle(TestContext context) {
postgresClient = createNumbers(context, 41, 42, 43);
postgresClient.selectSingle("SELECT i FROM numbers WHERE i IN (41, 43, 45) ORDER BY i",
context.asyncAssertSuccess(select -> {
context.assertEquals(41, select.getInteger(0));
}));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectSingle
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2019-15534 | HIGH | 7.5 | folio-org/raml-module-builder | selectSingle | domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java | b7ef741133e57add40aa4cb19430a0065f378a94 | 0 |
Analyze the following code function for security vulnerabilities | private PageReferenceResolver<EntityReference> getCurrentGetPageResolver()
{
if (this.currentgetpageResolver == null) {
this.currentgetpageResolver = Utils.getComponent(PageReferenceResolver.TYPE_REFERENCE, "currentgetpage");
}
return this.currentgetpageResolver;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentGetPageResolver
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2021-32620 | MEDIUM | 4 | xwiki/xwiki-platform | getCurrentGetPageResolver | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java | f9a677408ffb06f309be46ef9d8df1915d9099a4 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public V remove(K key) {
Jedis jedis = jedisPool.getResource();
byte[] byteKey = getKey(key);
V value = valueSerializer.deserialize(jedis.get(byteKey));
jedis.del(byteKey);
jedis.close();
return value;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: remove
File: publiccms-parent/publiccms-cache/src/main/java/com/publiccms/common/redis/RedisCacheEntity.java
Repository: sanluan/PublicCMS
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2023-46990 | CRITICAL | 9.8 | sanluan/PublicCMS | remove | publiccms-parent/publiccms-cache/src/main/java/com/publiccms/common/redis/RedisCacheEntity.java | c7bf58bf07fdc60a71134c6a73a4947c7709abf7 | 0 |
Analyze the following code function for security vulnerabilities | public String getSpaceFilter(Profile authUser, String spaceId) {
if (isAllSpaces(spaceId)) {
if (authUser != null && authUser.hasSpaces()) {
return "(" + authUser.getSpaces().stream().map(s -> "properties.space:\"" + s + "\"").
collect(Collectors.joining(" OR ")) + ")";
} else {
return "properties.space:\"" + DEFAULT_SPACE + "\"";
}
} else if (isDefaultSpace(spaceId) && isMod(authUser)) { // DO NOT MODIFY!
return "*";
} else {
return "properties.space:\"" + spaceId + "\"";
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSpaceFilter
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices. | [
"CWE-130"
] | CVE-2022-1543 | MEDIUM | 6.5 | Erudika/scoold | getSpaceFilter | src/main/java/com/erudika/scoold/utils/ScooldUtils.java | 62a0e92e1486ddc17676a7ead2c07ff653d167ce | 0 |
Analyze the following code function for security vulnerabilities | public static String schedule(String pipelineName) {
return BASE + SCHEDULE_PATH.replaceAll(":pipeline_name", pipelineName);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: schedule
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 | schedule | spark/spark-base/src/main/java/com/thoughtworks/go/spark/Routes.java | 236d4baf92e6607f2841c151c855adcc477238b8 | 0 |
Analyze the following code function for security vulnerabilities | public static String getLineColumnNumber(Location location) {
StringBuilder builder = new StringBuilder("[");
builder.append(location.getLineNumber()).append(",").append(location.getColumnNumber()).append("]");
return builder.toString();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLineColumnNumber
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 | getLineColumnNumber | saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java | 0cb5ba0f6e83162d221681f47b470c3042eef237 | 0 |
Analyze the following code function for security vulnerabilities | @Override
MapConfig getDefault(Config c) {
return c.getMapConfig("default");
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefault
File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
Repository: hazelcast
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2016-10750 | MEDIUM | 6.8 | hazelcast | getDefault | hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java | c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9 | 0 |
Analyze the following code function for security vulnerabilities | final void addProcessToGcListLocked(ProcessRecord proc) {
boolean added = false;
for (int i=mProcessesToGc.size()-1; i>=0; i--) {
if (mProcessesToGc.get(i).lastRequestedGc <
proc.lastRequestedGc) {
added = true;
mProcessesToGc.add(i+1, proc);
break;
}
}
if (!added) {
mProcessesToGc.add(0, proc);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addProcessToGcListLocked
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 | addProcessToGcListLocked | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected void configure() {
memoryStore(binder(), s -> s.maximumSize(1000));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: configure
File: ratpack-session/src/main/java/ratpack/session/SessionModule.java
Repository: ratpack
The code follows secure coding practices. | [
"CWE-338"
] | CVE-2019-11808 | MEDIUM | 4.3 | ratpack | configure | ratpack-session/src/main/java/ratpack/session/SessionModule.java | f2b63eb82dd71194319fd3945f5edf29b8f3a42d | 0 |
Analyze the following code function for security vulnerabilities | public void setSystemServiceManager(SystemServiceManager mgr) {
mSystemServiceManager = mgr;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSystemServiceManager
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 | setSystemServiceManager | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | private void migrate57(File dataDir, Stack<Integer> versions) {
for (File file: dataDir.listFiles()) {
try {
String content = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
content = StringUtils.replace(content,
"io.onedev.server.model.support.inputspec.numberinput.",
"io.onedev.server.model.support.inputspec.integerinput.");
FileUtils.writeStringToFile(file, content, StandardCharsets.UTF_8);
} catch (IOException e) {
throw new RuntimeException(e);
}
if (file.getName().startsWith("BuildParams.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
String type = element.elementText("type").trim();
if (type.equals("Number"))
element.setText("Integer");
else if (type.equals("Pull request"))
element.setText("Pull Request");
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("IssueFields.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
String type = element.elementText("type").trim();
if (type.equals("Number"))
element.setText("Integer");
else if (type.equals("Pull request"))
element.setText("Pull Request");
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("Settings.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
if (element.elementTextTrim("key").equals("ISSUE")) {
Element valueElement = element.element("value");
if (valueElement != null) {
for (Element fieldSpecElement: valueElement.element("fieldSpecs").elements()) {
if (fieldSpecElement.getName().equals("io.onedev.server.model.support.issue.field.spec.NumberField"))
fieldSpecElement.setName("io.onedev.server.model.support.issue.field.spec.IntegerField");
else if (fieldSpecElement.getName().equals("io.onedev.server.model.support.issue.field.spec.TextField"))
fieldSpecElement.addElement("multiline").setText("false");
}
}
}
}
dom.writeToFile(file, false);
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate57
File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
Repository: theonedev/onedev
The code follows secure coding practices. | [
"CWE-338"
] | CVE-2023-24828 | HIGH | 8.8 | theonedev/onedev | migrate57 | server-core/src/main/java/io/onedev/server/migration/DataMigrator.java | d67dd9686897fe5e4ab881d749464aa7c06a68e5 | 0 |
Analyze the following code function for security vulnerabilities | static void logSurface(WindowState w, String msg, RuntimeException where) {
String str = " SURFACE " + msg + ": " + w;
if (where != null) {
Slog.i(TAG, str, where);
} else {
Slog.i(TAG, str);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logSurface
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 | logSurface | services/core/java/com/android/server/wm/WindowManagerService.java | 69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c | 0 |
Analyze the following code function for security vulnerabilities | public void uploadFile(String uploadKey) {
mCurrentUpload = mPendingUploads.get(uploadKey);
if (mCurrentUpload != null) {
/// Check account existence
if (!accountManager.exists(mCurrentUpload.getAccount())) {
Log_OC.w(TAG, "Account " + mCurrentUpload.getAccount().name +
" does not exist anymore -> cancelling all its uploads");
cancelUploadsForAccount(mCurrentUpload.getAccount());
return;
}
/// OK, let's upload
mUploadsStorageManager.updateDatabaseUploadStart(mCurrentUpload);
notifyUploadStart(mCurrentUpload);
sendBroadcastUploadStarted(mCurrentUpload);
RemoteOperationResult uploadResult = null;
try {
/// prepare client object to send the request to the ownCloud server
if (mCurrentAccount == null || !mCurrentAccount.equals(mCurrentUpload.getAccount())) {
mCurrentAccount = mCurrentUpload.getAccount();
mStorageManager = new FileDataStorageManager(getCurrentUser().get(), getContentResolver());
} // else, reuse storage manager from previous operation
// always get client from client manager, to get fresh credentials in case of update
OwnCloudAccount ocAccount = new OwnCloudAccount(mCurrentAccount, this);
mUploadClient = OwnCloudClientManagerFactory.getDefaultSingleton().getClientFor(ocAccount, this);
// // If parent folder is encrypted, upload file encrypted
// OCFile parent = mStorageManager.getFileByPath(mCurrentUpload.getFile().getParentRemotePath());
// if (parent.isEncrypted()) {
// UploadEncryptedFileOperation uploadEncryptedFileOperation =
// new UploadEncryptedFileOperation(parent, mCurrentUpload);
//
// uploadResult = uploadEncryptedFileOperation.execute(mUploadClient, mStorageManager);
// } else {
/// perform the regular upload
uploadResult = mCurrentUpload.execute(mUploadClient);
// }
} catch (Exception e) {
Log_OC.e(TAG, "Error uploading", e);
uploadResult = new RemoteOperationResult(e);
} finally {
Pair<UploadFileOperation, String> removeResult;
if (mCurrentUpload.wasRenamed()) {
removeResult = mPendingUploads.removePayload(
mCurrentAccount.name,
mCurrentUpload.getOldFile().getRemotePath()
);
// TODO: grant that name is also updated for mCurrentUpload.getOCUploadId
} else {
removeResult = mPendingUploads.removePayload(mCurrentAccount.name,
mCurrentUpload.getDecryptedRemotePath());
}
mUploadsStorageManager.updateDatabaseUploadResult(uploadResult, mCurrentUpload);
/// notify result
notifyUploadResult(mCurrentUpload, uploadResult);
sendBroadcastUploadFinished(mCurrentUpload, uploadResult, removeResult.second);
}
// generate new Thumbnail
Optional<User> user = getCurrentUser();
if (user.isPresent()) {
final ThumbnailsCacheManager.ThumbnailGenerationTask task =
new ThumbnailsCacheManager.ThumbnailGenerationTask(mStorageManager, user.get());
File file = new File(mCurrentUpload.getOriginalStoragePath());
String remoteId = mCurrentUpload.getFile().getRemoteId();
task.execute(new ThumbnailsCacheManager.ThumbnailGenerationTaskObject(file, remoteId));
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uploadFile
File: src/main/java/com/owncloud/android/files/services/FileUploader.java
Repository: nextcloud/android
The code follows secure coding practices. | [
"CWE-732"
] | CVE-2022-24886 | LOW | 2.1 | nextcloud/android | uploadFile | src/main/java/com/owncloud/android/files/services/FileUploader.java | c01fa0b17050cdcf77a468cc22f4071eae29d464 | 0 |
Analyze the following code function for security vulnerabilities | private void actionValidate(int currentStackDepth, Element ele, Node parentNode, String tagName, String tagNameLowerCase, Tag tag, boolean masqueradingParam, Tag embedTag, NodeList eleChildNodes) throws ScanException {
/*
* If doing <param> as <embed>, now is the time to convert it.
*/
String nameValue = null;
if (masqueradingParam) {
nameValue = ele.getAttribute("name");
if (nameValue != null && !"".equals(nameValue)) {
String valueValue = ele.getAttribute("value");
ele.setAttribute(nameValue, valueValue);
ele.removeAttribute("name");
ele.removeAttribute("value");
tag = embedTag;
}
}
/*
* Check to see if it's a <style> tag. We have to special case this
* tag so we can hand it off to the custom style sheet validating
* parser.
*/
if ("style".equals(tagNameLowerCase) && policy.getStyleTag() != null) {
if (processStyleTag(ele, parentNode)) return;
}
/*
* Go through the attributes in the tainted tag and validate them
* against the values we have for them.
*
* If we don't have a rule for the attribute we remove the
* attribute.
*/
if (processAttributes(ele, tagName, tag, currentStackDepth)) return; // can't process any more if we
if ("a".equals(tagNameLowerCase)) {
boolean addNofollow = isNofollowAnchors;
boolean addNoopenerAndNoreferrer = false;
if (isNoopenerAndNoreferrerAnchors) {
Node targetAttribute = ele.getAttributes().getNamedItem("target");
if (targetAttribute != null && targetAttribute.getNodeValue().equalsIgnoreCase("_blank")) {
addNoopenerAndNoreferrer = true;
}
}
Node relAttribute = ele.getAttributes().getNamedItem("rel");
String relValue = Attribute.mergeRelValuesInAnchor(addNofollow, addNoopenerAndNoreferrer, relAttribute == null ? "" : relAttribute.getNodeValue());
if (!relValue.isEmpty()){
ele.setAttribute("rel", relValue.trim());
}
}
processChildren(eleChildNodes, currentStackDepth);
/*
* If we have been dealing with a <param> that has been converted to
* an <embed>, convert it back
*/
if (masqueradingParam && nameValue != null && !"".equals(nameValue)) {
String valueValue = ele.getAttribute(nameValue);
ele.setAttribute("name", nameValue);
ele.setAttribute("value", valueValue);
ele.removeAttribute(nameValue);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: actionValidate
File: src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
Repository: nahsra/antisamy
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2022-28367 | MEDIUM | 4.3 | nahsra/antisamy | actionValidate | src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java | 0199e7e194dba5e7d7197703f43ebe22401e61ae | 0 |
Analyze the following code function for security vulnerabilities | public void setMaxSessionCookieSize(int maxSessionCookieSize) {
if (maxSessionCookieSize < 1024 || maxSessionCookieSize > 4096) {
this.maxSessionCookieSize = 2048;
} else {
this.maxSessionCookieSize = maxSessionCookieSize;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMaxSessionCookieSize
File: ratpack-session/src/main/java/ratpack/session/clientside/ClientSideSessionConfig.java
Repository: ratpack
The code follows secure coding practices. | [
"CWE-312"
] | CVE-2021-29481 | MEDIUM | 5 | ratpack | setMaxSessionCookieSize | ratpack-session/src/main/java/ratpack/session/clientside/ClientSideSessionConfig.java | 60302fae7ef26897b9a0ec0def6281a9425344cf | 0 |
Analyze the following code function for security vulnerabilities | @Override
public final int available() throws IOException {
ensureOpen();
final long len = nativeAssetGetRemainingLength(mAssetNativePtr);
return len > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) len;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: available
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 | available | core/java/android/content/res/AssetManager.java | c3bc12c484ef3bbca4cec19234437c45af5e584d | 0 |
Analyze the following code function for security vulnerabilities | public static HttpRequest options(final String destination) {
return new HttpRequest()
.method(HttpMethod.OPTIONS)
.set(destination);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: options
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 | options | src/main/java/jodd/http/HttpRequest.java | e50f573c8f6a39212ade68c6eb1256b2889fa8a6 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void clear()
{
xObjects.clear();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clear
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-74"
] | CVE-2023-29523 | HIGH | 8.8 | xwiki/xwiki-platform | clear | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java | 0d547181389f7941e53291af940966413823f61c | 0 |
Analyze the following code function for security vulnerabilities | private JsonObject readObject(boolean objectWithoutBraces, int depth) throws IOException, ParseException {
if (!objectWithoutBraces) read();
JsonObject object=new JsonObject();
skipWhiteSpace();
while (true) {
if (objectWithoutBraces) {
if (isEndOfText()) break;
} else {
if (isEndOfText()) throw error("End of input while parsing an object (did you forget a closing '}'?)");
if (readIf('}')) break;
}
String name=readName();
skipWhiteSpace();
if (!readIf(':')) {
throw expected("':'");
}
skipWhiteSpace();
object.add(name, readValue(depth));
skipWhiteSpace();
if (readIf(',')) skipWhiteSpace(); // , is optional
}
return object;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readObject
File: src/main/org/hjson/HjsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices. | [
"CWE-787"
] | CVE-2023-34620 | HIGH | 7.5 | hjson/hjson-java | readObject | src/main/org/hjson/HjsonParser.java | 00e3b1325cb6c2b80b347dbec9181fd17ce0a599 | 0 |
Analyze the following code function for security vulnerabilities | private File getCustomLogoFile() {
return new File(Bootstrap.getSiteDir(), "logo.png");
} | Vulnerability Classification:
- CWE: CWE-552
- CVE: CVE-2022-39208
- Severity: HIGH
- CVSS Score: 7.5
Description: Fix security vulnerability issue regarding site/* access
Function: getCustomLogoFile
File: server-core/src/main/java/io/onedev/server/web/component/brandlogo/BrandLogoPanel.java
Repository: theonedev/onedev
Fixed Code:
private File getCustomLogoFile() {
return new File(Bootstrap.getSiteDir(), "assets/logo.png");
} | [
"CWE-552"
] | CVE-2022-39208 | HIGH | 7.5 | theonedev/onedev | getCustomLogoFile | server-core/src/main/java/io/onedev/server/web/component/brandlogo/BrandLogoPanel.java | 8aa94e0daf8447cdf76d4f27bfda0a85a7ea5822 | 1 |
Analyze the following code function for security vulnerabilities | @Override
public void extendPulse() {
mDozeScrimController.extendPulse();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: extendPulse
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 | extendPulse | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java | c574568aaede7f652432deb7707f20ae54bbdf9a | 0 |
Analyze the following code function for security vulnerabilities | void storeMediaPackage(MediaPackage mediaPackage, AccessControlList acl, Date now)
throws SearchServiceDatabaseException, UnauthorizedException; | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: storeMediaPackage
File: modules/search-service-impl/src/main/java/org/opencastproject/search/impl/persistence/SearchServiceDatabase.java
Repository: opencast
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2021-21318 | MEDIUM | 5.5 | opencast | storeMediaPackage | modules/search-service-impl/src/main/java/org/opencastproject/search/impl/persistence/SearchServiceDatabase.java | b18c6a7f81f08ed14884592a6c14c9ab611ad450 | 0 |
Analyze the following code function for security vulnerabilities | private static int getIntProperty(Properties props, String key, int defaultValue) {
String result = props.getProperty(key);
if (result != null) {
try {
return Integer.parseInt(result);
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
return defaultValue;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIntProperty
File: umlet-swing/src/main/java/com/baselet/control/config/handler/ConfigHandler.java
Repository: umlet
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2018-1000548 | MEDIUM | 6.8 | umlet | getIntProperty | umlet-swing/src/main/java/com/baselet/control/config/handler/ConfigHandler.java | e1c4cc6ae692cc8d1c367460dbf79343e996f9bd | 0 |
Analyze the following code function for security vulnerabilities | private boolean isKeyguardShowingAndNotOccluded() {
if (mKeyguardDelegate == null) return false;
return mKeyguardDelegate.isShowing() && !mKeyguardOccluded;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isKeyguardShowingAndNotOccluded
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-0812 | MEDIUM | 6.6 | android | isKeyguardShowingAndNotOccluded | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 84669ca8de55d38073a0dcb01074233b0a417541 | 0 |
Analyze the following code function for security vulnerabilities | public void setWritable(boolean b) {
internal.setWritable(b);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setWritable
File: src/net/sourceforge/plantuml/security/SFile.java
Repository: plantuml
The code follows secure coding practices. | [
"CWE-284"
] | CVE-2023-3431 | MEDIUM | 5.3 | plantuml | setWritable | src/net/sourceforge/plantuml/security/SFile.java | fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e | 0 |
Analyze the following code function for security vulnerabilities | @RequestMapping("check")
@Csrf
@ResponseBody
public boolean check(@RequestAttribute SysSite site, @RequestParam("fileNames[]") String[] fileNames, String path) {
if (null != fileNames) {
for (String fileName : fileNames) {
String filepath = CommonUtils.joinString(path, Constants.SEPARATOR, fileName);
if (CmsFileUtils.exists(siteComponent.getWebFilePath(site.getId(), filepath))) {
return true;
}
}
}
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: check
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/cms/CmsWebFileAdminController.java
Repository: sanluan/PublicCMS
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2023-51252 | MEDIUM | 5.4 | sanluan/PublicCMS | check | publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/cms/CmsWebFileAdminController.java | 2459a3f92c680ae011a369f32306c17df07caaa0 | 0 |
Analyze the following code function for security vulnerabilities | private boolean denyIfQueueLimitReached(SmsTracker tracker) {
if (mPendingTrackerCount >= MO_MSG_QUEUE_LIMIT) {
// Deny sending message when the queue limit is reached.
Rlog.e(TAG, "Denied because queue limit reached");
tracker.onFailed(mContext, RESULT_ERROR_LIMIT_EXCEEDED, 0/*errorCode*/);
return true;
}
mPendingTrackerCount++;
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: denyIfQueueLimitReached
File: src/java/com/android/internal/telephony/SMSDispatcher.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2015-3858 | HIGH | 9.3 | android | denyIfQueueLimitReached | src/java/com/android/internal/telephony/SMSDispatcher.java | df31d37d285dde9911b699837c351aed2320b586 | 0 |
Analyze the following code function for security vulnerabilities | private void startClient(ClientMonitor newClient, boolean initiatedByClient) {
ClientMonitor currentClient = mCurrentClient;
if (currentClient != null) {
if (DEBUG) Slog.v(TAG, "request stop current client " + currentClient.getOwnerString());
currentClient.stop(initiatedByClient);
mPendingClient = newClient;
mHandler.removeCallbacks(mResetClientState);
mHandler.postDelayed(mResetClientState, CANCEL_TIMEOUT_LIMIT);
} else if (newClient != null) {
mCurrentClient = newClient;
if (DEBUG) Slog.v(TAG, "starting client "
+ newClient.getClass().getSuperclass().getSimpleName()
+ "(" + newClient.getOwnerString() + ")"
+ ", initiatedByClient = " + initiatedByClient + ")");
newClient.start();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startClient
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 | startClient | services/core/java/com/android/server/fingerprint/FingerprintService.java | f5334952131afa835dd3f08601fb3bced7b781cd | 0 |
Analyze the following code function for security vulnerabilities | public Builder version(String version) {
if (!ClickHouseChecker.isNullOrEmpty(version)) {
options.put(ClickHouseClientOption.SERVER_VERSION.getKey(), version);
} else {
options.remove(ClickHouseClientOption.SERVER_VERSION.getKey());
}
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: version
File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
Repository: ClickHouse/clickhouse-java
The code follows secure coding practices. | [
"CWE-209"
] | CVE-2024-23689 | HIGH | 8.8 | ClickHouse/clickhouse-java | version | clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java | 4f8d9303eb991b39ec7e7e34825241efa082238a | 0 |
Analyze the following code function for security vulnerabilities | protected static String getCharsetFromContentTypeHeader(String type, StringBuffer remainder) {
if (type == null) {
return null;
}
// Parse type to set encoding if needed
StringTokenizer st = new StringTokenizer(type, ";");
String localEncoding = null;
while (st.hasMoreTokens()) {
String clause = st.nextToken().trim();
if (clause.startsWith("charset="))
localEncoding = clause.substring(8);
else {
if (remainder.length() > 0) {
remainder.append(";");
}
remainder.append(clause);
}
}
if ((localEncoding == null) ||
!localEncoding.startsWith("\"") ||
!localEncoding.endsWith("\"")) {
return localEncoding;
} else {
return localEncoding.substring(1, localEncoding.length() - 1);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCharsetFromContentTypeHeader
File: src/java/winstone/WinstoneResponse.java
Repository: jenkinsci/winstone
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2011-4344 | LOW | 2.6 | jenkinsci/winstone | getCharsetFromContentTypeHeader | src/java/winstone/WinstoneResponse.java | 410ed3001d51c689cf59085b7417466caa2ded7b | 0 |
Analyze the following code function for security vulnerabilities | @Override
public Intent createShowAdminSupportIntent(int userId, boolean useDefaultIfNoAdmin) {
// This method is called from AM with its lock held, so don't take the DPMS lock.
// b/29242568
if (getEnforcingAdminAndUserDetailsInternal(userId, null) != null
|| useDefaultIfNoAdmin) {
return DevicePolicyManagerService.this.createShowAdminSupportIntent(userId);
}
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createShowAdminSupportIntent
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 | createShowAdminSupportIntent | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | private DomNode getFirstChildElement(final DomNode parent) {
DomNode node = parent.getFirstChild();
while (node != null && !isAccepted(node)) {
node = node.getNextSibling();
}
return node;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFirstChildElement
File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
Repository: HtmlUnit/htmlunit
The code follows secure coding practices. | [
"CWE-787"
] | CVE-2023-2798 | HIGH | 7.5 | HtmlUnit/htmlunit | getFirstChildElement | src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java | 940dc7fd | 0 |
Analyze the following code function for security vulnerabilities | static void reduceToContent(final XMLStringBuffer buffer, final String startMarker, final String endMarker) {
int i = 0;
int startContent = -1;
final int l1 = startMarker.length();
final int l2 = endMarker.length();
while (i < buffer.length - l1 - l2) {
final char c = buffer.ch[buffer.offset+i];
if (Character.isWhitespace(c)) {
++i;
}
else if (c == startMarker.charAt(0)
&& startMarker.equals(new String(buffer.ch, buffer.offset+i, l1))) {
startContent = buffer.offset + i + l1;
break;
}
else {
return; // start marker not found
}
}
if (startContent == -1) { // start marker not found
return;
}
i = buffer.length - 1;
while (i > startContent + l2) {
final char c = buffer.ch[buffer.offset+i];
if (Character.isWhitespace(c)) {
--i;
}
else if (c == endMarker.charAt(l2-1)
&& endMarker.equals(new String(buffer.ch, buffer.offset+i-l2+1, l2))) {
buffer.length = buffer.offset + i - startContent - 2;
buffer.offset = startContent;
return;
}
else {
return; // start marker not found
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reduceToContent
File: src/org/cyberneko/html/HTMLScanner.java
Repository: sparklemotion/nekohtml
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2022-24839 | MEDIUM | 5 | sparklemotion/nekohtml | reduceToContent | src/org/cyberneko/html/HTMLScanner.java | a800fce3b079def130ed42a408ff1d09f89e773d | 0 |
Analyze the following code function for security vulnerabilities | protected Map<String, QName> createMap() {
return Collections.synchronizedMap(new HashMap<String, QName>());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createMap
File: src/main/java/org/dom4j/tree/QNameCache.java
Repository: dom4j
The code follows secure coding practices. | [
"CWE-91"
] | CVE-2018-1000632 | MEDIUM | 5 | dom4j | createMap | src/main/java/org/dom4j/tree/QNameCache.java | e598eb43d418744c4dbf62f647dd2381c9ce9387 | 0 |
Analyze the following code function for security vulnerabilities | public Jooby timezone(final ZoneId zoneId) {
this.zoneId = requireNonNull(zoneId, "ZoneId required.");
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: timezone
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 | timezone | jooby/src/main/java/org/jooby/Jooby.java | 34f526028e6cd0652125baa33936ffb6a8a4a009 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void dumpHigh(FileDescriptor fd, PrintWriter pw, String[] args,
boolean asProto) {
dump(fd, pw, new String[] {"-a"}, asProto);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpHigh
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 | dumpHigh | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | public void chooseHeight(CharSequence text, int start, int end,
int spanstartv, int v,
Paint.FontMetricsInt fm) {
// Should not get called, at least not by StaticLayout.
chooseHeight(text, start, end, spanstartv, v, fm, null);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: chooseHeight
File: core/java/android/content/res/StringBlock.java
Repository: android
The code follows secure coding practices. | [
"CWE-415"
] | CVE-2023-40103 | HIGH | 7.8 | android | chooseHeight | core/java/android/content/res/StringBlock.java | c3bc12c484ef3bbca4cec19234437c45af5e584d | 0 |
Analyze the following code function for security vulnerabilities | private void setPendingLock(boolean hasPendingLock) {
mPendingLock = hasPendingLock;
Trace.traceCounter(Trace.TRACE_TAG_APP, "pendingLock", mPendingLock ? 1 : 0);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPendingLock
File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21267 | MEDIUM | 5.5 | android | setPendingLock | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | d18d8b350756b0e89e051736c1f28744ed31e93a | 0 |
Analyze the following code function for security vulnerabilities | private void updateLockTaskFeaturesLocked(int flags, int userId) {
long ident = mInjector.binderClearCallingIdentity();
try {
mInjector.getIActivityTaskManager().updateLockTaskFeatures(userId, flags);
} catch (RemoteException e) {
// Not gonna happen.
} finally {
mInjector.binderRestoreCallingIdentity(ident);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateLockTaskFeaturesLocked
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 | updateLockTaskFeaturesLocked | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | protected boolean isBillingEnabled() {
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isBillingEnabled
File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
Repository: codenameone/CodenameOne
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2022-4903 | MEDIUM | 5.1 | codenameone/CodenameOne | isBillingEnabled | Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | public void removeContentProviderExternal(String name, IBinder token) {
enforceCallingPermission(android.Manifest.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY,
"Do not have permission in call removeContentProviderExternal()");
int userId = UserHandle.getCallingUserId();
long ident = Binder.clearCallingIdentity();
try {
removeContentProviderExternalUnchecked(name, token, userId);
} finally {
Binder.restoreCallingIdentity(ident);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeContentProviderExternal
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 | removeContentProviderExternal | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | public String getTwitterLoginURL() {
return getParaEndpoint() + "/twitter_auth?state=" + getParaAppId();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTwitterLoginURL
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices. | [
"CWE-130"
] | CVE-2022-1543 | MEDIUM | 6.5 | Erudika/scoold | getTwitterLoginURL | src/main/java/com/erudika/scoold/utils/ScooldUtils.java | 62a0e92e1486ddc17676a7ead2c07ff653d167ce | 0 |
Analyze the following code function for security vulnerabilities | private static String method(final String methodParam, final NativeRequest request)
throws Exception {
Optional<String> header = request.header(methodParam);
if (header.isPresent()) {
return header.get();
}
List<String> param = request.params(methodParam);
return param.size() == 0 ? request.method() : param.get(0);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: method
File: jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java
Repository: jooby-project/jooby
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2019-15477 | MEDIUM | 4.3 | jooby-project/jooby | method | jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java | 34856a738829d8fedca4ed27bd6ff413af87186f | 0 |
Analyze the following code function for security vulnerabilities | public static boolean scheduleAsRegularPriority(int tid, boolean suppressLogs) {
try {
Process.setThreadScheduler(tid, Process.SCHED_OTHER, 0);
return true;
} catch (IllegalArgumentException e) {
if (!suppressLogs) {
Slog.w(TAG, "Failed to set scheduling policy, thread does not exist:\n" + e);
}
} catch (SecurityException e) {
if (!suppressLogs) {
Slog.w(TAG, "Failed to set scheduling policy, not allowed:\n" + e);
}
}
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scheduleAsRegularPriority
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 | scheduleAsRegularPriority | services/core/java/com/android/server/am/ActivityManagerService.java | d10b27e539f7bc91c2360d429b9d05f05274670d | 0 |
Analyze the following code function for security vulnerabilities | public void onCancelled(GestureDescription gestureDescription) {
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCancelled
File: core/java/android/accessibilityservice/AccessibilityService.java
Repository: android
The code follows secure coding practices. | [
"CWE-284"
] | CVE-2016-3923 | MEDIUM | 4.3 | android | onCancelled | core/java/android/accessibilityservice/AccessibilityService.java | 5f256310187b4ff2f13a7abb9afed9126facd7bc | 0 |
Analyze the following code function for security vulnerabilities | public List<Delta> getRenderedContentDiff(String fromRev, String toRev, XWikiContext context)
throws XWikiException, DifferentiationFailedException
{
XWikiDocument fromDoc = context.getWiki().getDocument(this, fromRev, context);
XWikiDocument toDoc = context.getWiki().getDocument(this, toRev, context);
return getRenderedContentDiff(fromDoc, toDoc, context);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRenderedContentDiff
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 | getRenderedContentDiff | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java | db3d1c62fc5fb59fefcda3b86065d2d362f55164 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void setTransWrappedSessionKey(String transWrappedSessionKey) {
attributes.put(TRANS_WRAPPED_SESSION_KEY, transWrappedSessionKey);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTransWrappedSessionKey
File: base/common/src/main/java/com/netscape/certsrv/key/SymKeyGenerationRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2022-2414 | HIGH | 7.5 | dogtagpki/pki | setTransWrappedSessionKey | base/common/src/main/java/com/netscape/certsrv/key/SymKeyGenerationRequest.java | 16deffdf7548e305507982e246eb9fd1eac414fd | 0 |
Analyze the following code function for security vulnerabilities | private void parseResourceInitialization(final List<Element> elements) throws GameParseException {
for (final Element current : elements) {
final PlayerId player = getPlayerId(current, "player", true);
final Resource resource = getResource(current, "resource", true);
final int quantity = Integer.parseInt(current.getAttribute("quantity"));
player.getResources().addResource(resource, quantity);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseResourceInitialization
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2018-1000546 | MEDIUM | 6.8 | triplea-game/triplea | parseResourceInitialization | game-core/src/main/java/games/strategy/engine/data/GameParser.java | 0f23875a4c6e166218859a63c884995f15c53895 | 0 |
Analyze the following code function for security vulnerabilities | private void startAppNotificationSettingsActivity(String packageName, final int appUid,
final NotificationChannel channel) {
final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, packageName);
intent.putExtra(Settings.EXTRA_APP_UID, appUid);
if (channel != null) {
intent.putExtra(EXTRA_FRAGMENT_ARG_KEY, channel.getId());
}
startNotificationGutsIntent(intent, appUid);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startAppNotificationSettingsActivity
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 | startAppNotificationSettingsActivity | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java | c574568aaede7f652432deb7707f20ae54bbdf9a | 0 |
Analyze the following code function for security vulnerabilities | public void setAppOpsPolicy(@Nullable CheckOpsDelegate appOpsPolicy) {
mAppOpsService.setAppOpsPolicy(appOpsPolicy);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAppOpsPolicy
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 | setAppOpsPolicy | services/core/java/com/android/server/am/ActivityManagerService.java | d10b27e539f7bc91c2360d429b9d05f05274670d | 0 |
Analyze the following code function for security vulnerabilities | public void sendSMS(final String phoneNumber, final String message, boolean i) throws IOException {
/*if(!checkForPermission(Manifest.permission.SEND_SMS, "This is required to send a SMS")){
return;
}*/
if(!checkForPermission(Manifest.permission.READ_PHONE_STATE, "This is required to send a SMS")){
return;
}
if(i) {
Intent smsIntent = null;
if(android.os.Build.VERSION.SDK_INT < 19){
smsIntent = new Intent(Intent.ACTION_VIEW);
smsIntent.setType("vnd.android-dir/mms-sms");
smsIntent.putExtra("address", phoneNumber);
smsIntent.putExtra("sms_body",message);
}else{
smsIntent = new Intent(Intent.ACTION_SENDTO);
smsIntent.setData(Uri.parse("smsto:" + Uri.encode(phoneNumber)));
smsIntent.putExtra("sms_body", message);
}
getContext().startActivity(smsIntent);
} /*else {
SmsManager sms = SmsManager.getDefault();
ArrayList<String> parts = sms.divideMessage(message);
sms.sendMultipartTextMessage(phoneNumber, null, parts, null, null);
}*/
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendSMS
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 | sendSMS | Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | public static void cursorStringToInsertHelper(Cursor cursor, String field,
InsertHelper inserter, int index) {
inserter.bind(index, cursor.getString(cursor.getColumnIndexOrThrow(field)));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cursorStringToInsertHelper
File: core/java/android/database/DatabaseUtils.java
Repository: android
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2023-40121 | MEDIUM | 5.5 | android | cursorStringToInsertHelper | core/java/android/database/DatabaseUtils.java | 3287ac2d2565dc96bf6177967f8e3aed33954253 | 0 |
Analyze the following code function for security vulnerabilities | public void setProcessForeground(IBinder token, int pid,
boolean isForeground) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeStrongBinder(token);
data.writeInt(pid);
data.writeInt(isForeground ? 1 : 0);
mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
reply.readException();
data.recycle();
reply.recycle();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setProcessForeground
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3832 | HIGH | 8.3 | android | setProcessForeground | core/java/android/app/ActivityManagerNative.java | e7cf91a198de995c7440b3b64352effd2e309906 | 0 |
Analyze the following code function for security vulnerabilities | public static JAXBContext getContextFor(final Class<?> clazz) throws JAXBException {
LOG.trace("Getting context for class {}", clazz);
final JAXBContext context;
if (m_contexts.containsKey(clazz)) {
context = m_contexts.get(clazz);
} else {
final Collection<Class<?>> allRelatedClasses = getAllRelatedClasses(clazz);
LOG.trace("Creating new context for classes: {}", allRelatedClasses);
context = org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(allRelatedClasses.toArray(EMPTY_CLASS_LIST), null);
LOG.trace("Context for {}: {}", allRelatedClasses, context);
m_contexts.put(clazz, context);
}
return context;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContextFor
File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
Repository: OpenNMS/opennms
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2023-0871 | MEDIUM | 6.1 | OpenNMS/opennms | getContextFor | core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java | 3c17231714e3d55809efc580a05734ed530f9ad4 | 0 |
Analyze the following code function for security vulnerabilities | public void createTenant(String tenant) {
StopWatch stopWatch = StopWatch.createStarted();
log.info("START - SETUP:CreateTenant: tenantKey: {}", tenant);
try {
tenantListRepository.addTenant(tenant);
databaseService.create(tenant.toLowerCase());
databaseService.migrate(tenant.toLowerCase());
addUaaSpecification(tenant);
addLoginsSpecification(tenant);
addRoleSpecification(tenant);
addPermissionSpecification(tenant);
addDefaultEmailTemplates(tenant);
log.info("STOP - SETUP:CreateTenant: tenantKey: {}, result: OK, time = {} ms",
tenant, stopWatch.getTime());
} catch (Exception e) {
log.info("STOP - SETUP:CreateTenant: tenantKey: {}, result: FAIL, error: {}, time = {} ms",
tenant, e.getMessage(), stopWatch.getTime());
throw e;
}
} | Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2019-15557
- Severity: HIGH
- CVSS Score: 7.5
Description: fix create schema for new tenant
Function: createTenant
File: src/main/java/com/icthh/xm/uaa/service/tenant/TenantService.java
Repository: xm-online/xm-uaa
Fixed Code:
public void createTenant(String tenant) {
StopWatch stopWatch = StopWatch.createStarted();
log.info("START - SETUP:CreateTenant: tenantKey: {}", tenant);
try {
tenantListRepository.addTenant(tenant);
databaseService.create(tenant);
databaseService.migrate(tenant);
addUaaSpecification(tenant);
addLoginsSpecification(tenant);
addRoleSpecification(tenant);
addPermissionSpecification(tenant);
addDefaultEmailTemplates(tenant);
log.info("STOP - SETUP:CreateTenant: tenantKey: {}, result: OK, time = {} ms",
tenant, stopWatch.getTime());
} catch (Exception e) {
log.info("STOP - SETUP:CreateTenant: tenantKey: {}, result: FAIL, error: {}, time = {} ms",
tenant, e.getMessage(), stopWatch.getTime());
throw e;
}
} | [
"CWE-89"
] | CVE-2019-15557 | HIGH | 7.5 | xm-online/xm-uaa | createTenant | src/main/java/com/icthh/xm/uaa/service/tenant/TenantService.java | bd235434f119c67090952e08fc28abe41aea2e2c | 1 |
Analyze the following code function for security vulnerabilities | private TrustManager getTrustManager() {
TrustManager trust = (TrustManager) mContext.getSystemService(Context.TRUST_SERVICE);
if (trust == null) {
Log.e(TAG, "Can't get TrustManagerService: is it running?",
new IllegalStateException("Stack trace:"));
}
return trust;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTrustManager
File: core/java/com/android/internal/widget/LockPatternUtils.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3908 | MEDIUM | 4.3 | android | getTrustManager | core/java/com/android/internal/widget/LockPatternUtils.java | 96daf7d4893f614714761af2d53dfb93214a32e4 | 0 |
Analyze the following code function for security vulnerabilities | public static String numberToString(Number number) throws JSONException {
if (number == null) {
throw new JSONException("Null pointer");
}
testValidity(number);
// Shave off trailing zeros and decimal point, if possible.
String string = number.toString();
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
&& string.indexOf('E') < 0) {
while (string.endsWith("0")) {
string = string.substring(0, string.length() - 1);
}
if (string.endsWith(".")) {
string = string.substring(0, string.length() - 1);
}
}
return string;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: numberToString
File: src/main/java/org/json/JSONObject.java
Repository: stleary/JSON-java
The code follows secure coding practices. | [
"CWE-770"
] | CVE-2023-5072 | HIGH | 7.5 | stleary/JSON-java | numberToString | src/main/java/org/json/JSONObject.java | 661114c50dcfd53bb041aab66f14bb91e0a87c8a | 0 |
Analyze the following code function for security vulnerabilities | protected Date checkoutDateValue(Cell cell) {
Date date = cell.asDate();
if (date != null) return date;
String date2str = cell.asString();
try {
DateTime dt = DateUtil.parse(date2str);
if (dt != null) date = dt.toJdkDate();
} catch (DateException ignored) {
}
// 2017/11/19 11:07
if (date == null && date2str.contains("/")) {
date = cell.asDate(new String[]{"yyyy/M/d H:m:s", "yyyy/M/d H:m", "yyyy/M/d"});
}
return date;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkoutDateValue
File: src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java
Repository: getrebuild/rebuild
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2023-1495 | MEDIUM | 6.5 | getrebuild/rebuild | checkoutDateValue | src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java | c9474f84e5f376dd2ade2078e3039961a9425da7 | 0 |
Analyze the following code function for security vulnerabilities | private void migrate89(File dataDir, Stack<Integer> versions) {
Map<String, Integer> pullRequestCommentCounts = new HashMap<>();
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("PullRequestComments.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
String pullRequestId = element.elementTextTrim("request");
Integer commentCount = pullRequestCommentCounts.get(pullRequestId);
if (commentCount == null)
commentCount = 0;
commentCount++;
pullRequestCommentCounts.put(pullRequestId, commentCount);
}
} else if (file.getName().startsWith("PullRequestChanges.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
Element dataElement = element.element("data");
String className = dataElement.attributeValue("class");
if (className.contains("PullRequestAssigneeAddData")
|| className.contains("PullRequestAssigneeRemoveData")
|| className.contains("PullRequestReviewerAddData")
|| className.contains("PullRequestReviewerRemoveData")
|| className.contains("PullRequestReviewWithdrawData")) {
element.detach();
}
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("PullRequestReviews.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
Element resultElement = element.element("result");
if (resultElement != null) {
Element approvedElement = resultElement.element("approved");
if (approvedElement != null) {
if (approvedElement.getTextTrim().equals("true"))
element.addElement("status").setText("APPROVED");
else
element.addElement("status").setText("REQUESTED_FOR_CHANGES");
} else {
element.addElement("status").setText("PENDING");
}
resultElement.detach();
} else {
element.addElement("status").setText("PENDING");
}
Element statusDateElement = element.addElement("statusDate");
statusDateElement.addAttribute("class", "sql-timestamp");
statusDateElement.setText("2020-01-22T16:08:49.869000000Z");
}
dom.writeToFile(file, false);
}
}
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("PullRequests.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
Integer commentCount = pullRequestCommentCounts.get(element.elementTextTrim("id"));
if (commentCount == null)
commentCount = 0;
element.element("commentCount").setText(String.valueOf(commentCount));
}
dom.writeToFile(file, false);
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate89
File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
Repository: theonedev/onedev
The code follows secure coding practices. | [
"CWE-338"
] | CVE-2023-24828 | HIGH | 8.8 | theonedev/onedev | migrate89 | server-core/src/main/java/io/onedev/server/migration/DataMigrator.java | d67dd9686897fe5e4ab881d749464aa7c06a68e5 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void fillRect(Object graphics, int x, int y, int w, int h, byte alpha) {
((AndroidGraphics) graphics).fillRect(x, y, w, h, alpha);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fillRect
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 | fillRect | Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | public static File makeNewCacheFile(final URL source, final VersionString version) {
final CacheLRUWrapper lruHandler = CacheLRUWrapper.getInstance();
synchronized (lruHandler) {
File cacheFile = null;
try {
lruHandler.lock();
lruHandler.load();
for (long i = 0; i < Long.MAX_VALUE; i++) {
String path = lruHandler.getCacheDir().getFullPath() + File.separator + i;
File cDir = new File(path);
if (!cDir.exists()) {
// We can use this directory.
try {
cacheFile = urlToPath(source, path);
FileUtils.createParentDir(cacheFile);
File pf = new File(cacheFile.getPath() + CacheDirectory.INFO_SUFFIX);
FileUtils.createRestrictedFile(pf, true); // Create the info file for marking later.
lruHandler.addEntry(lruHandler.generateKey(cacheFile.getPath()), cacheFile.getPath());
} catch (IOException ioe) {
LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, ioe);
}
break;
}
}
lruHandler.store();
} finally {
lruHandler.unlock();
}
return cacheFile;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeNewCacheFile
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 | makeNewCacheFile | core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java | 2ab070cdac087bd208f64fa8138bb709f8d7680c | 0 |
Analyze the following code function for security vulnerabilities | public void addPossiblyUnsafeJavascriptInterface(Object object, String name,
Class<? extends Annotation> requiredAnnotation) {
if (mNativeContentViewCore != 0 && object != null) {
mJavaScriptInterfaces.put(name, object);
nativeAddJavascriptInterface(mNativeContentViewCore, object, name, requiredAnnotation);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addPossiblyUnsafeJavascriptInterface
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2014-3159 | MEDIUM | 6.4 | chromium | addPossiblyUnsafeJavascriptInterface | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java | 98a50b76141f0b14f292f49ce376e6554142d5e2 | 0 |
Analyze the following code function for security vulnerabilities | private void registerForWifiMonitorEvents() {
for (int event : WIFI_MONITOR_EVENTS) {
mWifiMonitor.registerHandler(mInterfaceName, event, getHandler());
}
mWifiMetrics.registerForWifiMonitorEvents(mInterfaceName);
mWifiLastResortWatchdog.registerForWifiMonitorEvents(mInterfaceName);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerForWifiMonitorEvents
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21242 | CRITICAL | 9.8 | android | registerForWifiMonitorEvents | service/java/com/android/server/wifi/ClientModeImpl.java | 72e903f258b5040b8f492cf18edd124b5a1ac770 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.