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
|
void dumpActivityStarterLocked(PrintWriter pw, String dumpPackage) {
pw.println("ACTIVITY MANAGER STARTER (dumpsys activity starter)");
getActivityStartController().dump(pw, "", dumpPackage);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpActivityStarterLocked
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
dumpActivityStarterLocked
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
void updateMenuLayout(Rect bounds) {
mPipMenuIconsAlgorithm.onBoundsChanged(bounds);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateMenuLayout
File: libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40123
|
MEDIUM
| 5.5
|
android
|
updateMenuLayout
|
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
|
7212a4bec2d2f1a74fa54a12a04255d6a183baa9
| 0
|
Analyze the following code function for security vulnerabilities
|
public AbstractSessionContext getSessionContext() {
return client_mode ? clientSessionContext : serverSessionContext;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSessionContext
File: src/main/java/org/conscrypt/SSLParametersImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3840
|
HIGH
| 10
|
android
|
getSessionContext
|
src/main/java/org/conscrypt/SSLParametersImpl.java
|
5af5e93463f4333187e7e35f3bd2b846654aa214
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String escapeHtml(String str) {
return str.replace("<", "<").replace(">", ">").replace("\n", "<br/>");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: escapeHtml
File: src/main/java/com/openkm/util/FormatUtil.java
Repository: openkm/document-management-system
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-40317
|
MEDIUM
| 5.4
|
openkm/document-management-system
|
escapeHtml
|
src/main/java/com/openkm/util/FormatUtil.java
|
870d518f7de349c3fa4c7b9883789fdca4590c4e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void toLogisimFile(Element elt,Project proj) {
// determine the version producing this file
String versionString = elt.getAttribute("source");
if (versionString.equals("")) {
sourceVersion = Main.VERSION;
} else {
sourceVersion = LogisimVersion.parse(versionString);
}
// If we are opening a pre-logisim-evolution file, there might be
// some components
// (such as the RAM or the counters), that have changed their shape
// and other details.
// We have therefore to warn the user that things might be a little
// strange in their
// circuits...
if (sourceVersion.compareTo(LogisimVersion.get(2, 7, 2)) < 0) {
JOptionPane
.showMessageDialog(
null,
"You are opening a file created with original Logisim code.\n"
+ "You might encounter some problems in the execution, since some components evolved since then.\n"
+ "Moreover, labels will be converted to match VHDL limitations for variable names.",
"Old file format -- compatibility mode",
JOptionPane.WARNING_MESSAGE);
}
if (versionString.contains("t") && !Main.VERSION.hasTracker()) {
JOptionPane
.showMessageDialog(
null,
"The file you have opened contains tracked components.\nYou might encounter some problems in the execution.",
"No tracking system available",
JOptionPane.WARNING_MESSAGE);
}
// first, load the sublibraries
for (Element o : XmlIterator.forChildElements(elt, "lib")) {
Library lib = toLibrary(o);
if (lib != null)
file.addLibrary(lib);
}
// second, create the circuits - empty for now
List<CircuitData> circuitsData = new ArrayList<CircuitData>();
for (Element circElt : XmlIterator.forChildElements(elt, "circuit")) {
String name = circElt.getAttribute("name");
if (name == null || name.equals("")) {
addError(Strings.get("circNameMissingError"), "C??");
}
CircuitData circData = new CircuitData(circElt, new Circuit(
name, file,proj));
file.addCircuit(circData.circuit);
circData.knownComponents = loadKnownComponents(circElt);
for (Element appearElt : XmlIterator.forChildElements(circElt,
"appear")) {
loadAppearance(appearElt, circData, name + ".appear");
}
circuitsData.add(circData);
}
// third, process the other child elements
for (Element sub_elt : XmlIterator.forChildElements(elt)) {
String name = sub_elt.getTagName();
switch (name) {
case "circuit":
case "lib":
// Nothing to do: Done earlier.
break;
case "options":
try {
initAttributeSet(sub_elt, file.getOptions()
.getAttributeSet(), null);
} catch (XmlReaderException e) {
addErrors(e, "options");
}
break;
case "mappings":
initMouseMappings(sub_elt);
break;
case "toolbar":
initToolbarData(sub_elt);
break;
case "main":
String main = sub_elt.getAttribute("name");
Circuit circ = file.getCircuit(main);
if (circ != null) {
file.setMainCircuit(circ);
}
break;
case "message":
file.addMessage(sub_elt.getAttribute("value"));
break;
default:
throw new IllegalArgumentException(
"Invalid node in logisim file: " + name);
}
}
// fourth, execute a transaction that initializes all the circuits
XmlCircuitReader builder;
builder = new XmlCircuitReader(this, circuitsData);
builder.execute();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toLogisimFile
File: src/com/cburch/logisim/file/XmlReader.java
Repository: logisim-evolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000889
|
MEDIUM
| 6.8
|
logisim-evolution
|
toLogisimFile
|
src/com/cburch/logisim/file/XmlReader.java
|
90aee8f8ceef463884cc400af4f6d1f109fb0972
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void removeRun(R run) {
this.builds.remove(run);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeRun
File: core/src/main/java/hudson/model/AbstractProject.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
removeRun
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setScrollPosition(ScrollState scrollPosition, String lastMessageUuid) {
if (scrollPosition != null) {
this.lastMessageUuid = lastMessageUuid;
if (lastMessageUuid != null) {
binding.unreadCountCustomView.setUnreadCount(conversation.getReceivedMessagesCountSinceUuid(lastMessageUuid));
}
//TODO maybe this needs a 'post'
this.binding.messagesView.setSelectionFromTop(scrollPosition.position, scrollPosition.offset);
toggleScrollDownButton();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setScrollPosition
File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
setScrollPosition
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
public Builder setProgress(int max, int progress, boolean indeterminate) {
mN.extras.putInt(EXTRA_PROGRESS, progress);
mN.extras.putInt(EXTRA_PROGRESS_MAX, max);
mN.extras.putBoolean(EXTRA_PROGRESS_INDETERMINATE, indeterminate);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setProgress
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
setProgress
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void engineSetMode(String mode)
throws NoSuchAlgorithmException
{
String modeName = Strings.toUpperCase(mode);
if (modeName.equals("NONE"))
{
dhaesMode = false;
}
else if (modeName.equals("DHAES"))
{
dhaesMode = true;
}
else
{
throw new IllegalArgumentException("can't support mode " + mode);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: engineSetMode
File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/IESCipher.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-361"
] |
CVE-2016-1000345
|
MEDIUM
| 4.3
|
bcgit/bc-java
|
engineSetMode
|
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/IESCipher.java
|
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean checkPort() {
if (checkWebpackConnection()) {
getLogger().info("Reusing webpack-dev-server running at {}:{}",
WEBPACK_HOST, port);
// Save running port for next usage
saveRunningDevServerPort();
watchDog.set(null);
return false;
}
throw new IllegalStateException(format(
"%s webpack-dev-server port '%d' is defined but it's not working properly",
START_FAILURE, port));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkPort
File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-36321
|
MEDIUM
| 5
|
vaadin/flow
|
checkPort
|
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
|
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
| 0
|
Analyze the following code function for security vulnerabilities
|
public void loadAttachmentsContent(XWikiContext context) throws XWikiException
{
for (XWikiAttachment attachment : getAttachmentList()) {
attachment.loadAttachmentContent(context);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadAttachmentsContent
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
|
loadAttachmentsContent
|
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 setOverwrite(final boolean b) {
overwrite = b;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOverwrite
File: src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
Repository: codehaus-plexus/plexus-archiver
The code follows secure coding practices.
|
[
"CWE-22",
"CWE-61"
] |
CVE-2023-37460
|
CRITICAL
| 9.8
|
codehaus-plexus/plexus-archiver
|
setOverwrite
|
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
|
54759839fbdf85caf8442076f001d5fd64e0dcb2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onNetworkEapSimUmtsAuthRequest(NetworkRequestEapSimUmtsAuthParams params) {
synchronized (mLock) {
mNetworkHal.logCallback("onNetworkEapSimUmtsAuthRequest");
String randHex = NativeUtil.hexStringFromByteArray(params.rand);
String autnHex = NativeUtil.hexStringFromByteArray(params.autn);
String[] data = {randHex, autnHex};
mWifiMonitor.broadcastNetworkUmtsAuthRequestEvent(
mIfaceName, mFrameworkNetworkId, mSsid, data);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onNetworkEapSimUmtsAuthRequest
File: service/java/com/android/server/wifi/SupplicantStaNetworkCallbackAidlImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
onNetworkEapSimUmtsAuthRequest
|
service/java/com/android/server/wifi/SupplicantStaNetworkCallbackAidlImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public void selectPopupMenuItems(int[] indices) {
if (mNativeContentViewCore != 0) {
nativeSelectPopupMenuItems(mNativeContentViewCore, indices);
}
mSelectPopup = null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectPopupMenuItems
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
|
selectPopupMenuItems
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Future<?> _connect(boolean forceReconnect) {
return Futures.precomputed(null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _connect
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
_connect
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<BaseObject> get(Object key)
{
return xObjects.get(key);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: get
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
|
get
|
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 void inflateShelf() {
mNotificationShelf =
(NotificationShelf) LayoutInflater.from(mContext).inflate(
R.layout.status_bar_notification_shelf, mStackScroller, false);
mNotificationShelf.setOnActivatedListener(this);
mStackScroller.setShelf(mNotificationShelf);
mNotificationShelf.setOnClickListener(mGoToLockedShadeListener);
mNotificationShelf.setStatusBarState(mState);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: inflateShelf
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
|
inflateShelf
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getOpacity() {
return PixelFormat.OPAQUE;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOpacity
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
|
getOpacity
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ClientModel createClient(KeycloakSession session, RealmModel realm, ClientRepresentation rep, boolean addDefaultRoles) {
ClientModel client = RepresentationToModel.createClient(session, realm, rep, addDefaultRoles);
if (rep.getProtocol() != null) {
LoginProtocolFactory providerFactory = (LoginProtocolFactory) session.getKeycloakSessionFactory().getProviderFactory(LoginProtocol.class, rep.getProtocol());
providerFactory.setupClientDefaults(rep, client);
}
// remove default mappers if there is a template
if (rep.getProtocolMappers() == null && rep.getClientTemplate() != null) {
Set<ProtocolMapperModel> mappers = client.getProtocolMappers();
for (ProtocolMapperModel mapper : mappers) client.removeProtocolMapper(mapper);
}
return client;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createClient
File: services/src/main/java/org/keycloak/services/managers/ClientManager.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-798"
] |
CVE-2019-14837
|
MEDIUM
| 6.4
|
keycloak
|
createClient
|
services/src/main/java/org/keycloak/services/managers/ClientManager.java
|
9a7c1a91a59ab85e7f8889a505be04a71580777f
| 0
|
Analyze the following code function for security vulnerabilities
|
protected QItemType convertType(AssessmentItem assessmentItem) {
QTI21QuestionType qti21Type = QTI21QuestionType.getType(assessmentItem);
switch(qti21Type) {
case sc: return qItemTypeDao.loadByType(QuestionType.SC.name());
case mc: return qItemTypeDao.loadByType(QuestionType.MC.name());
case kprim: return qItemTypeDao.loadByType(QuestionType.KPRIM.name());
case match: return qItemTypeDao.loadByType(QuestionType.MATCH.name());
case matchdraganddrop: return qItemTypeDao.loadByType(QuestionType.MATCHDRAGANDDROP.name());
case matchtruefalse: return qItemTypeDao.loadByType(QuestionType.MATCHTRUEFALSE.name());
case fib: return qItemTypeDao.loadByType(QuestionType.FIB.name());
case numerical: return qItemTypeDao.loadByType(QuestionType.NUMERICAL.name());
case hotspot: return qItemTypeDao.loadByType(QuestionType.HOTSPOT.name());
case hottext: return qItemTypeDao.loadByType(QuestionType.HOTTEXT.name());
case essay: return qItemTypeDao.loadByType(QuestionType.ESSAY.name());
case upload: return qItemTypeDao.loadByType(QuestionType.UPLOAD.name());
case drawing: return qItemTypeDao.loadByType(QuestionType.DRAWING.name());
case order: return qItemTypeDao.loadByType(QuestionType.ORDER.name());
default: return qItemTypeDao.loadByType(QuestionType.UNKOWN.name());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertType
File: src/main/java/org/olat/ims/qti21/pool/QTI21ImportProcessor.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
convertType
|
src/main/java/org/olat/ims/qti21/pool/QTI21ImportProcessor.java
|
5668a41ab3f1753102a89757be013487544279d5
| 0
|
Analyze the following code function for security vulnerabilities
|
private ByteBuffer[] singleSrcBuffer(ByteBuffer src) {
singleSrcBuffer[0] = src;
return singleSrcBuffer;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: singleSrcBuffer
File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2016-4970
|
HIGH
| 7.8
|
netty
|
singleSrcBuffer
|
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
|
bc8291c80912a39fbd2303e18476d15751af0bf1
| 0
|
Analyze the following code function for security vulnerabilities
|
private void appendPath(StringBuilder breadcrumb) {
List<BrowseBarElement> elements = getElements();
if (!elements.isEmpty()) {
for (BrowseBarElement element : elements) {
appendElement(breadcrumb, element);
}
} else if (StringUtil.isDefined(getPath())) {
if (breadcrumb.length() > 0) {
breadcrumb.append(CONNECTOR);
}
span span = new span(getPath());
span.setClass("path");
breadcrumb.append(span.toString());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendPath
File: core-web/src/main/java/org/silverpeas/core/web/util/viewgenerator/html/browsebars/BrowseBarComplete.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
appendPath
|
core-web/src/main/java/org/silverpeas/core/web/util/viewgenerator/html/browsebars/BrowseBarComplete.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setServers(List<ServerConfiguration> servers) {
this.servers = servers;
updateBasePath();
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setServers
File: samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setServers
|
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public synchronized SSLEngineResult unwrap(ByteBuffer src, ByteBuffer dst) throws SSLException {
try {
return unwrap(singleSrcBuffer(src), singleDstBuffer(dst));
} finally {
resetSingleSrcBuffer();
resetSingleDstBuffer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unwrap
File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2016-4970
|
HIGH
| 7.8
|
netty
|
unwrap
|
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
|
bc8291c80912a39fbd2303e18476d15751af0bf1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public PageResult getNewBeeMallGoodsPage(PageQueryUtil pageUtil) {
List<NewBeeMallGoods> goodsList = goodsMapper.findNewBeeMallGoodsList(pageUtil);
int total = goodsMapper.getTotalNewBeeMallGoods(pageUtil);
PageResult pageResult = new PageResult(goodsList, total, pageUtil.getLimit(), pageUtil.getPage());
return pageResult;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNewBeeMallGoodsPage
File: src/main/java/ltd/newbee/mall/service/impl/NewBeeMallGoodsServiceImpl.java
Repository: newbee-ltd/newbee-mall
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-27476
|
MEDIUM
| 4.3
|
newbee-ltd/newbee-mall
|
getNewBeeMallGoodsPage
|
src/main/java/ltd/newbee/mall/service/impl/NewBeeMallGoodsServiceImpl.java
|
0d1ff1b9f4aedc0ccdac5d22014a351554dfb81e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public File getContentMetadataFile(String inode) {
return new File(getRealAssetsRootPath()+File.separator+
inode.charAt(0)+File.separator+inode.charAt(1)+File.separator+inode+File.separator+
"metaData"+File.separator+"content");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContentMetadataFile
File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-434"
] |
CVE-2017-11466
|
HIGH
| 9
|
dotCMS/core
|
getContentMetadataFile
|
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
|
ab2bb2e00b841d131b8734227f9106e3ac31bb99
| 0
|
Analyze the following code function for security vulnerabilities
|
void stopFreezingScreen(boolean unfreezeSurfaceNow, boolean force) {
if (!mFreezingScreen) {
return;
}
ProtoLog.v(WM_DEBUG_ORIENTATION,
"Clear freezing of %s force=%b", this, force);
final int count = mChildren.size();
boolean unfrozeWindows = false;
for (int i = 0; i < count; i++) {
final WindowState w = mChildren.get(i);
unfrozeWindows |= w.onStopFreezingScreen();
}
if (force || unfrozeWindows) {
ProtoLog.v(WM_DEBUG_ORIENTATION, "No longer freezing: %s", this);
mFreezingScreen = false;
mWmService.unregisterAppFreezeListener(this);
mWmService.mAppsFreezingScreen--;
mWmService.mLastFinishedFreezeSource = this;
}
if (unfreezeSurfaceNow) {
if (unfrozeWindows) {
mWmService.mWindowPlacerLocked.performSurfacePlacement();
}
mWmService.stopFreezingDisplayLocked();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stopFreezingScreen
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
stopFreezingScreen
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void removeEphemeralCarrierNetworks(Set<String> carrierPrivilegedPackages) {
if (mVerboseLoggingEnabled) localLog("removeEphemeralCarrierNetwork");
WifiConfiguration[] copiedConfigs =
mConfiguredNetworks.valuesForAllUsers().toArray(new WifiConfiguration[0]);
for (WifiConfiguration config : copiedConfigs) {
if (!config.ephemeral
|| config.subscriptionId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
continue;
}
if (carrierPrivilegedPackages.contains(config.creatorName)) {
continue;
}
removeNetwork(config.networkId, config.creatorUid, config.creatorName);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeEphemeralCarrierNetworks
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
|
removeEphemeralCarrierNetworks
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public Comparator<T> getInMemorySorting() {
return inMemorySorting;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInMemorySorting
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
|
getInMemorySorting
|
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
|
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void stop() throws ServletException {
try {
deployment.createThreadSetupAction(new ThreadSetupHandler.Action<Void, Object>() {
@Override
public Void call(HttpServerExchange exchange, Object ignore) throws ServletException {
for (Lifecycle object : deployment.getLifecycleObjects()) {
try {
object.stop();
} catch (Throwable t) {
UndertowServletLogger.ROOT_LOGGER.failedToDestroy(object, t);
}
}
deployment.getSessionManager().stop();
state = State.DEPLOYED;
return null;
}
}).call(null, null);
} catch (ServletException|RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stop
File: servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2019-10184
|
MEDIUM
| 5
|
undertow-io/undertow
|
stop
|
servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java
|
d2715e3afa13f50deaa19643676816ce391551e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
updateResources();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onConfigurationChanged
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3886
|
HIGH
| 7.2
|
android
|
onConfigurationChanged
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
|
6ca6cd5a50311d58a1b7bf8fbef3f9aa29eadcd5
| 0
|
Analyze the following code function for security vulnerabilities
|
@BeforeClass()
public void setUp() throws IOException, BallerinaTestException {
tempHomeDirectory = Files.createTempDirectory("bal-test-integration-packaging-home-");
tempProjectDirectory = Files.createTempDirectory("bal-test-integration-packaging-project-");
moduleName = moduleName + PackerinaTestUtils.randomModuleName(10);
PackerinaTestUtils.createSettingToml(tempHomeDirectory);
envVariables = addEnvVariables(PackerinaTestUtils.getEnvVariables());
balClient = new BMainInstance(balServer);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUp
File: tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PackagingTestCase.java
Repository: ballerina-platform/ballerina-lang
The code follows secure coding practices.
|
[
"CWE-306"
] |
CVE-2021-32700
|
MEDIUM
| 5.8
|
ballerina-platform/ballerina-lang
|
setUp
|
tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PackagingTestCase.java
|
4609ffee1744ecd16aac09303b1783bf0a525816
| 0
|
Analyze the following code function for security vulnerabilities
|
public Writer write(Writer writer) throws JSONException {
return this.write(writer, 0, 0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: write
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
|
write
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void backup(File targetDir, DataSource dataSource, DbProperties dbProperties) throws Exception {
ProcessResult processResult = createProcessExecutor(targetDir, dbProperties).execute();
if (processResult.getExitValue() == 0) {
log.info("PostgreSQL backup finished successfully.");
} else {
log.warn("There was an error backing up the database using `pg_dump`. The `pg_dump` process exited with status code {}.", processResult.getExitValue());
throw new RuntimeException("There was an error backing up the database using `pg_dump`. The `pg_dump` process exited with status code " + processResult.getExitValue() +
". Please see the server logs for more errors.");
}
}
|
Vulnerability Classification:
- CWE: CWE-532
- CVE: CVE-2023-28630
- Severity: MEDIUM
- CVSS Score: 4.4
Description: Improve error messages on failure to launch backup process
ztexec can include env vars in the error message which we don't want in this case.
Function: backup
File: db-support/db-support-postgresql/src/main/java/com/thoughtworks/go/server/database/pg/PostgresqlBackupProcessor.java
Repository: gocd
Fixed Code:
@Override
public void backup(File targetDir, DataSource dataSource, DbProperties dbProperties) throws Exception {
try {
ProcessResult processResult = createProcessExecutor(targetDir, dbProperties).execute();
if (processResult.getExitValue() == 0) {
log.info("PostgreSQL backup finished successfully.");
} else {
throwBackupError(COMMAND, processResult.getExitValue());
}
} catch (ProcessInitException e) {
throwBackupError(COMMAND, e.getErrorCode(), e.getCause());
}
}
|
[
"CWE-532"
] |
CVE-2023-28630
|
MEDIUM
| 4.4
|
gocd
|
backup
|
db-support/db-support-postgresql/src/main/java/com/thoughtworks/go/server/database/pg/PostgresqlBackupProcessor.java
|
6545481e7b36817dd6033bf614585a8db242070d
| 1
|
Analyze the following code function for security vulnerabilities
|
@Test
public void saveConnectionNullConnection(TestContext context) {
String uuid = randomUuid();
postgresClientNullConnection().save(FOO, uuid, xPojo, context.asyncAssertFailure());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveConnectionNullConnection
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
|
saveConnectionNullConnection
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public DocumentReference getTemplateDocumentReference()
{
return this.templateDocumentReference;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTemplateDocumentReference
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
|
getTemplateDocumentReference
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isSsoAuthentication(HttpServletRequest request) {
return request.getRequestURI().contains(getApplicationURL() + "/sso");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSsoAuthentication
File: core-war/src/main/java/org/silverpeas/web/token/SessionSynchronizerTokenValidator.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
isSsoAuthentication
|
core-war/src/main/java/org/silverpeas/web/token/SessionSynchronizerTokenValidator.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setChannel(final SeekableReadOnlyByteChannel channel, final long length) throws IOException, RarException {
this.totalPackedSize = 0L;
this.totalPackedRead = 0L;
close();
this.channel = channel;
try {
readHeaders(length);
} catch (UnsupportedRarEncryptedException | UnsupportedRarV5Exception | CorruptHeaderException | BadRarArchiveException e) {
logger.warn("exception in archive constructor maybe file is encrypted, corrupt or support not yet implemented", e);
throw e;
} catch (final Exception e) {
logger.warn("exception in archive constructor maybe file is encrypted, corrupt or support not yet implemented", e);
// ignore exceptions to allow extraction of working files in corrupt archive
}
// Calculate size of packed data
for (final BaseBlock block : this.headers) {
if (block.getHeaderType() == UnrarHeadertype.FileHeader) {
this.totalPackedSize += ((FileHeader) block).getFullPackSize();
}
}
if (this.unrarCallback != null) {
this.unrarCallback.volumeProgressChanged(this.totalPackedRead,
this.totalPackedSize);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setChannel
File: src/main/java/com/github/junrar/Archive.java
Repository: junrar
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2022-23596
|
MEDIUM
| 5
|
junrar
|
setChannel
|
src/main/java/com/github/junrar/Archive.java
|
7b16b3d90b91445fd6af0adfed22c07413d4fab7
| 0
|
Analyze the following code function for security vulnerabilities
|
@PutMapping(value = "/log")
public String setLogLevel(@RequestParam String logName, @RequestParam String logLevel) {
LogUtil.setLogLevel(logName, logLevel);
return HttpServletResponse.SC_OK + "";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLogLevel
File: config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java
Repository: alibaba/nacos
The code follows secure coding practices.
|
[
"CWE-306"
] |
CVE-2021-29442
|
MEDIUM
| 5
|
alibaba/nacos
|
setLogLevel
|
config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java
|
bffd440297618d189a7c8cac26191147d763cc6f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void initialize(PatternConstraint constraintAnnotation) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initialize
File: browserup-proxy-rest/src/main/java/com/browserup/bup/rest/validation/PatternConstraint.java
Repository: browserup/browserup-proxy
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2020-26282
|
HIGH
| 7.5
|
browserup/browserup-proxy
|
initialize
|
browserup-proxy-rest/src/main/java/com/browserup/bup/rest/validation/PatternConstraint.java
|
4b38e7a3e20917e5c3329d0d4e9590bed9d578ab
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isFinish() {
return finish;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isFinish
File: web/src/main/java/com/zrlog/web/plugin/ZipUpdateVersionThread.java
Repository: 94fzb/zrlog
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-16643
|
LOW
| 3.5
|
94fzb/zrlog
|
isFinish
|
web/src/main/java/com/zrlog/web/plugin/ZipUpdateVersionThread.java
|
4a91c83af669e31a22297c14f089d8911d353fa1
| 0
|
Analyze the following code function for security vulnerabilities
|
private static native @Nullable String[] nativeList(long ptr, @NonNull String path)
throws IOException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeList
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
|
nativeList
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
private static DataStoreFactory buildFileDatastoreFactory() throws IOException {
var datastoreDirectory = new File(Constants.CREDENTIAL_DATASTORE_FOLDER);
//noinspection ResultOfMethodCallIgnored
datastoreDirectory.mkdir();
return new FileDataStoreFactory(datastoreDirectory);
}
|
Vulnerability Classification:
- CWE: CWE-276
- CVE: CVE-2021-22571
- Severity: LOW
- CVSS Score: 2.1
Description: setting file permissions on datastore directory
Function: buildFileDatastoreFactory
File: src/main/java/dswebquerytobigquery/Authorizer.java
Repository: google/sa360-webquery-bigquery
Fixed Code:
private static DataStoreFactory buildFileDatastoreFactory() throws IOException {
var datastoreDirectory = new File(Constants.CREDENTIAL_DATASTORE_FOLDER);
//noinspection ResultOfMethodCallIgnored
datastoreDirectory.mkdir();
datastoreDirectory.setWritable(true, true);
datastoreDirectory.setReadable(true, true);
return new FileDataStoreFactory(datastoreDirectory);
}
|
[
"CWE-276"
] |
CVE-2021-22571
|
LOW
| 2.1
|
google/sa360-webquery-bigquery
|
buildFileDatastoreFactory
|
src/main/java/dswebquerytobigquery/Authorizer.java
|
a5d6b6265d4599282216cfad2ba670e95cbbae20
| 1
|
Analyze the following code function for security vulnerabilities
|
private void applyAdjustmentLocked(Adjustment adjustment) {
maybeClearAutobundleSummaryLocked(adjustment);
NotificationRecord n = mNotificationsByKey.get(adjustment.getKey());
if (n == null) {
return;
}
if (adjustment.getImportance() != IMPORTANCE_NONE) {
n.setImportance(adjustment.getImportance(), adjustment.getExplanation());
}
if (adjustment.getSignals() != null) {
Bundle.setDefusable(adjustment.getSignals(), true);
final String autoGroupKey = adjustment.getSignals().getString(
Adjustment.GROUP_KEY_OVERRIDE_KEY, null);
if (autoGroupKey == null) {
EventLogTags.writeNotificationUnautogrouped(adjustment.getKey());
} else {
EventLogTags.writeNotificationAutogrouped(adjustment.getKey());
}
n.sbn.setOverrideGroupKey(autoGroupKey);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: applyAdjustmentLocked
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
|
applyAdjustmentLocked
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
@Sessional
@Override
public Project find(Project parent, String name) {
cacheLock.readLock().lock();
try {
Long projectId = null;
for (ProjectFacade facade: cache.values()) {
if (facade.getName().equalsIgnoreCase(name) && Objects.equals(Project.idOf(parent), facade.getParentId())) {
projectId = facade.getId();
break;
}
}
if (projectId != null)
return load(projectId);
else
return null;
} finally {
cacheLock.readLock().unlock();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: find
File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39205
|
CRITICAL
| 9.8
|
theonedev/onedev
|
find
|
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
public int connectionTimeout() {
return connectTimeout;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: connectionTimeout
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
|
connectionTimeout
|
src/main/java/jodd/http/HttpRequest.java
|
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
| 0
|
Analyze the following code function for security vulnerabilities
|
public abstract BaseXMLBuilder up();
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: up
File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
up
|
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
public String selectHeaderAccept(String[] accepts) {
if (accepts.length == 0) {
return null;
}
for (String accept : accepts) {
if (isJsonMime(accept)) {
return accept;
}
}
return StringUtil.join(accepts, ",");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectHeaderAccept
File: samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
selectHeaderAccept
|
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private String checkNotSet(String value) {
return sNotSet.equals(value) ? null : value;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkNotSet
File: src/com/android/settings/network/apn/ApnEditor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40125
|
HIGH
| 7.8
|
android
|
checkNotSet
|
src/com/android/settings/network/apn/ApnEditor.java
|
63d464c3fa5c7b9900448fef3844790756e557eb
| 0
|
Analyze the following code function for security vulnerabilities
|
int getLockTaskModeState() {
return mLockTaskModeState;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLockTaskModeState
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
getLockTaskModeState
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final void notifyEnterAnimationComplete(IBinder token) {
mHandler.sendMessage(mHandler.obtainMessage(ENTER_ANIMATION_COMPLETE_MSG, token));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyEnterAnimationComplete
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
|
notifyEnterAnimationComplete
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void handleApplicationStrictModeViolation(
IBinder app,
int violationMask,
StrictMode.ViolationInfo info) {
ProcessRecord r = findAppProcess(app, "StrictMode");
if (r == null) {
return;
}
if ((violationMask & StrictMode.PENALTY_DROPBOX) != 0) {
Integer stackFingerprint = info.hashCode();
boolean logIt = true;
synchronized (mAlreadyLoggedViolatedStacks) {
if (mAlreadyLoggedViolatedStacks.contains(stackFingerprint)) {
logIt = false;
// TODO: sub-sample into EventLog for these, with
// the info.durationMillis? Then we'd get
// the relative pain numbers, without logging all
// the stack traces repeatedly. We'd want to do
// likewise in the client code, which also does
// dup suppression, before the Binder call.
} else {
if (mAlreadyLoggedViolatedStacks.size() >= MAX_DUP_SUPPRESSED_STACKS) {
mAlreadyLoggedViolatedStacks.clear();
}
mAlreadyLoggedViolatedStacks.add(stackFingerprint);
}
}
if (logIt) {
logStrictModeViolationToDropBox(r, info);
}
}
if ((violationMask & StrictMode.PENALTY_DIALOG) != 0) {
AppErrorResult result = new AppErrorResult();
synchronized (this) {
final long origId = Binder.clearCallingIdentity();
Message msg = Message.obtain();
msg.what = SHOW_STRICT_MODE_VIOLATION_MSG;
HashMap<String, Object> data = new HashMap<String, Object>();
data.put("result", result);
data.put("app", r);
data.put("violationMask", violationMask);
data.put("info", info);
msg.obj = data;
mHandler.sendMessage(msg);
Binder.restoreCallingIdentity(origId);
}
int res = result.get();
Slog.w(TAG, "handleApplicationStrictModeViolation; res=" + res);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleApplicationStrictModeViolation
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
handleApplicationStrictModeViolation
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handleUninitializedServlet(Lookup lookup, Servlet servlet) {
ServletContext ctx = servlet.getServletConfig().getServletContext();
if (new VaadinServletContext(ctx)
.getAttribute(Lookup.class) != lookup) {
return;
}
try {
servlet.init(servlet.getServletConfig());
} catch (ServletException e) {
LoggerFactory.getLogger(OSGiVaadinInitialization.class).error(
"Couldn't initialize {} {}",
VaadinServlet.class.getSimpleName(),
servlet.getClass().getName(), e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleUninitializedServlet
File: flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java
Repository: vaadin/osgi
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-31407
|
MEDIUM
| 5
|
vaadin/osgi
|
handleUninitializedServlet
|
flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java
|
3e17674c2e3f88b6e682872c42b7d0ad7d9c4ad8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setUrl(String hudsonUrl) {
String url = Util.nullify(hudsonUrl);
if(url!=null && !url.endsWith("/"))
url += '/';
this.jenkinsUrl = url;
save();
updateSecureSessionFlag();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUrl
File: core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2014-9634
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
setUrl
|
core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java
|
582128b9ac179a788d43c1478be8a5224dc19710
| 0
|
Analyze the following code function for security vulnerabilities
|
private Object transform(final Node source) {
try {
final DomNode sourceDomNode = source.getDomNodeOrDie();
Source xmlSource = new DOMSource(sourceDomNode);
final DomNode xsltDomNode = style_.getDomNodeOrDie();
final Source xsltSource = new DOMSource(xsltDomNode);
final TransformerFactory transformerFactory = TransformerFactory.newInstance();
final SgmlPage page = sourceDomNode.getPage();
if (page != null && page.getWebClient().getBrowserVersion()
.hasFeature(JS_XSLT_TRANSFORM_INDENT)) {
final DomNode outputNode = findOutputNode(xsltDomNode);
if (outputNode != null) {
final org.w3c.dom.Node indentNode = outputNode.getAttributes().getNamedItem("indent");
if (indentNode != null && "yes".equalsIgnoreCase(indentNode.getNodeValue())) {
try {
transformerFactory.setAttribute("indent-number", new Integer(2));
}
catch (final IllegalArgumentException e) {
// ignore
}
final Transformer transformer = transformerFactory.newTransformer(xsltSource);
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
try {
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
}
catch (final IllegalArgumentException e) {
// ignore
}
for (final Map.Entry<String, Object> entry : parameters_.entrySet()) {
transformer.setParameter(entry.getKey(), entry.getValue());
}
// hack to preserve indention
// the transformer only accepts the OutputKeys.INDENT setting if
// the StreamResult is used
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
transformer.transform(xmlSource, new StreamResult(out));
final WebResponseData data =
new WebResponseData(out.toByteArray(), 200, null, Collections.emptyList());
final WebResponse response = new WebResponse(data, null, 0);
return XmlUtils.buildDocument(response);
}
}
}
}
final Transformer transformer = transformerFactory.newTransformer(xsltSource);
for (final Map.Entry<String, Object> entry : parameters_.entrySet()) {
transformer.setParameter(entry.getKey(), entry.getValue());
}
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final org.w3c.dom.Document containerDocument = factory.newDocumentBuilder().newDocument();
final org.w3c.dom.Element containerElement = containerDocument.createElement("container");
containerDocument.appendChild(containerElement);
final DOMResult result = new DOMResult(containerElement);
transformer.transform(xmlSource, result);
final org.w3c.dom.Node transformedNode = result.getNode();
final org.w3c.dom.Node transformedFirstChild = transformedNode.getFirstChild();
if (transformedFirstChild != null && transformedFirstChild.getNodeType() == Node.ELEMENT_NODE) {
return transformedNode;
}
// output is not DOM (text)
xmlSource = new DOMSource(source.getDomNodeOrDie());
final StringWriter writer = new StringWriter();
final Result streamResult = new StreamResult(writer);
transformer.transform(xmlSource, streamResult);
return writer.toString();
}
catch (final Exception e) {
throw Context.reportRuntimeError("Exception: " + e);
}
}
|
Vulnerability Classification:
- CWE: CWE-94
- CVE: CVE-2023-26119
- Severity: CRITICAL
- CVSS Score: 9.8
Description: enable FEATURE_SECURE_PROCESSING for the XSLT processor
Function: transform
File: src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XSLTProcessor.java
Repository: HtmlUnit/htmlunit
Fixed Code:
private Object transform(final Node source) {
try {
final DomNode sourceDomNode = source.getDomNodeOrDie();
Source xmlSource = new DOMSource(sourceDomNode);
final DomNode xsltDomNode = style_.getDomNodeOrDie();
final Source xsltSource = new DOMSource(xsltDomNode);
final TransformerFactory transformerFactory = TransformerFactory.newInstance();
// By default, the JDK turns on FSP for DOM and SAX parsers and XML schema validators,
// which sets a number of processing limits on the processors. Conversely, by default,
// the JDK turns off FSP for transformers and XPath, which enables extension functions for XSLT and XPath.
transformerFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
final SgmlPage page = sourceDomNode.getPage();
if (page != null && page.getWebClient().getBrowserVersion()
.hasFeature(JS_XSLT_TRANSFORM_INDENT)) {
final DomNode outputNode = findOutputNode(xsltDomNode);
if (outputNode != null) {
final org.w3c.dom.Node indentNode = outputNode.getAttributes().getNamedItem("indent");
if (indentNode != null && "yes".equalsIgnoreCase(indentNode.getNodeValue())) {
try {
transformerFactory.setAttribute("indent-number", new Integer(2));
}
catch (final IllegalArgumentException e) {
// ignore
}
final Transformer transformer = transformerFactory.newTransformer(xsltSource);
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
try {
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
}
catch (final IllegalArgumentException e) {
// ignore
}
for (final Map.Entry<String, Object> entry : parameters_.entrySet()) {
transformer.setParameter(entry.getKey(), entry.getValue());
}
// hack to preserve indention
// the transformer only accepts the OutputKeys.INDENT setting if
// the StreamResult is used
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
transformer.transform(xmlSource, new StreamResult(out));
final WebResponseData data =
new WebResponseData(out.toByteArray(), 200, null, Collections.emptyList());
final WebResponse response = new WebResponse(data, null, 0);
return XmlUtils.buildDocument(response);
}
}
}
}
final Transformer transformer = transformerFactory.newTransformer(xsltSource);
for (final Map.Entry<String, Object> entry : parameters_.entrySet()) {
transformer.setParameter(entry.getKey(), entry.getValue());
}
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final org.w3c.dom.Document containerDocument = factory.newDocumentBuilder().newDocument();
final org.w3c.dom.Element containerElement = containerDocument.createElement("container");
containerDocument.appendChild(containerElement);
final DOMResult result = new DOMResult(containerElement);
transformer.transform(xmlSource, result);
final org.w3c.dom.Node transformedNode = result.getNode();
final org.w3c.dom.Node transformedFirstChild = transformedNode.getFirstChild();
if (transformedFirstChild != null && transformedFirstChild.getNodeType() == Node.ELEMENT_NODE) {
return transformedNode;
}
// output is not DOM (text)
xmlSource = new DOMSource(source.getDomNodeOrDie());
final StringWriter writer = new StringWriter();
final Result streamResult = new StreamResult(writer);
transformer.transform(xmlSource, streamResult);
return writer.toString();
}
catch (final Exception e) {
throw Context.reportRuntimeError("Exception: " + e);
}
}
|
[
"CWE-94"
] |
CVE-2023-26119
|
CRITICAL
| 9.8
|
HtmlUnit/htmlunit
|
transform
|
src/main/java/com/gargoylesoftware/htmlunit/javascript/host/xml/XSLTProcessor.java
|
641325bbc84702dc9800ec7037aec061ce21956b
| 1
|
Analyze the following code function for security vulnerabilities
|
public static long usedDirectMemory() {
return DIRECT_MEMORY_COUNTER != null ? DIRECT_MEMORY_COUNTER.get() : -1;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: usedDirectMemory
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
usedDirectMemory
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
private void start() {
mBatteryStatsService.publish();
mAppOpsService.publish();
mProcessStats.publish();
Slog.d("AppOps", "AppOpsService published");
LocalServices.addService(ActivityManagerInternal.class, mInternal);
LocalManagerRegistry.addManager(ActivityManagerLocal.class,
(ActivityManagerLocal) mInternal);
mActivityTaskManager.onActivityManagerInternalAdded();
mPendingIntentController.onActivityManagerInternalAdded();
mAppProfiler.onActivityManagerInternalAdded();
CriticalEventLog.init();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: start
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
|
start
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private void listenForCallState() {
TelephonyManager.from(getContext()).listen(new PhoneStateListener() {
@Override
public void onCallStateChanged(int state, String incomingNumber) {
if (mCallState == state) return;
if (DBG) Slog.d(TAG, "Call state changed: " + callStateToString(state));
mCallState = state;
}
}, PhoneStateListener.LISTEN_CALL_STATE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: listenForCallState
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
|
listenForCallState
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public BaseObject getFirstObject(String fieldname)
{
// Keeping this function with context null for compatibility reasons.
// It should not be used, since it would miss properties which are only defined in the class
// and not present in the object because the object was not updated
return getFirstObject(fieldname, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFirstObject
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getFirstObject
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
char getArgumentQuoteDelimiter()
{
return argQuoteDelimiter;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getArgumentQuoteDelimiter
File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
Repository: apache/maven-shared-utils
The code follows secure coding practices.
|
[
"CWE-116"
] |
CVE-2022-29599
|
HIGH
| 7.5
|
apache/maven-shared-utils
|
getArgumentQuoteDelimiter
|
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
|
2735facbbbc2e13546328cb02dbb401b3776eea3
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void decompressTarGzipFile(InputStream is, File dest) throws IOException {
try (GzipCompressorInputStream gzi = new GzipCompressorInputStream(is);
TarArchiveInputStream tis = new TarArchiveInputStream(gzi)) {
ArchiveEntry entry;
while ((entry = tis.getNextEntry()) != null) {
String name = entry.getName().substring(entry.getName().indexOf('/') + 1);
File file = new File(dest, name);
if (entry.isDirectory()) {
FileUtils.forceMkdir(file);
} else {
File parentFile = file.getParentFile();
FileUtils.forceMkdir(parentFile);
try (OutputStream os = Files.newOutputStream(file.toPath())) {
IOUtils.copy(tis, os);
}
}
}
}
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2023-48299
- Severity: MEDIUM
- CVSS Score: 5.3
Description: fix zip slip error (#2634)
Function: decompressTarGzipFile
File: frontend/archive/src/main/java/org/pytorch/serve/archive/utils/ZipUtils.java
Repository: pytorch/serve
Fixed Code:
public static void decompressTarGzipFile(InputStream is, File dest) throws IOException {
try (GzipCompressorInputStream gzi = new GzipCompressorInputStream(is);
TarArchiveInputStream tis = new TarArchiveInputStream(gzi)) {
ArchiveEntry entry;
while ((entry = tis.getNextEntry()) != null) {
String name = entry.getName().substring(entry.getName().indexOf('/') + 1);
File file = new File(dest, name);
File canonicalDestDir = dest.getCanonicalFile();
File canonicalFile = file.getCanonicalFile();
// Check for Zip Slip vulnerability
if (!canonicalFile.getPath().startsWith(canonicalDestDir.getPath())) {
throw new IOException("Detected Zip Slip vulnerability: " + entry.getName());
}
if (entry.isDirectory()) {
FileUtils.forceMkdir(file);
} else {
File parentFile = file.getParentFile();
FileUtils.forceMkdir(parentFile);
try (OutputStream os = Files.newOutputStream(file.toPath())) {
IOUtils.copy(tis, os);
}
}
}
}
}
|
[
"CWE-22"
] |
CVE-2023-48299
|
MEDIUM
| 5.3
|
pytorch/serve
|
decompressTarGzipFile
|
frontend/archive/src/main/java/org/pytorch/serve/archive/utils/ZipUtils.java
|
bfb3d42396727614aef625143b4381e64142f9bb
| 1
|
Analyze the following code function for security vulnerabilities
|
public static ProfileData fromXML(String xml) throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xml)));
Element profileDataElement = document.getDocumentElement();
return fromDOM(profileDataElement);
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2022-2414
- Severity: HIGH
- CVSS Score: 7.5
Description: Disable access to external entities when parsing XML
This reduces the vulnerability of XML parsers to XXE (XML external
entity) injection.
The best way to prevent XXE is to stop using XML altogether, which we do
plan to do. Until that happens I consider it worthwhile to tighten the
security here though.
Function: fromXML
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
Repository: dogtagpki/pki
Fixed Code:
public static ProfileData fromXML(String xml) throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xml)));
Element profileDataElement = document.getDocumentElement();
return fromDOM(profileDataElement);
}
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
fromXML
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 1
|
Analyze the following code function for security vulnerabilities
|
private String zentao2MsDescription(String ztDescription) {
String imgRegex = "<img src.*?/>";
Pattern pattern = Pattern.compile(imgRegex);
Matcher matcher = pattern.matcher(ztDescription);
while (matcher.find()) {
if (StringUtils.isNotEmpty(matcher.group())) {
// img标签内容
String imgPath = matcher.group();
// 解析标签内容为图片超链接格式,进行替换,
String src = getMatcherResultForImg("src\\s*=\\s*\"?(.*?)(\"|>|\\s+)", imgPath);
String alt = getMatcherResultForImg("alt\\s*=\\s*\"?(.*?)(\"|>|\\s+)", imgPath);
String hyperLinkPath = packageDescriptionByPathAndName(src, alt);
imgPath = transferSpecialCharacter(imgPath);
ztDescription = ztDescription.replaceAll(imgPath, hyperLinkPath);
}
}
return ztDescription;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: zentao2MsDescription
File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
zentao2MsDescription
|
test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public WorkflowInstance ingest(MediaPackage mp, String workflowDefinitionId, Map<String, String> properties,
Long workflowInstanceId) throws IngestException, NotFoundException, UnauthorizedException {
// Check for legacy media package id
mp = checkForLegacyMediaPackageId(mp, properties);
try {
mp = createSmil(mp);
} catch (IOException e) {
throw new IngestException("Unable to add SMIL Catalog", e);
}
// Done, update the job status and return the created workflow instance
if (workflowInstanceId != null) {
logger.warn(
"Resuming workflow {} with ingested mediapackage {} is deprecated, skip resuming and start new workflow",
workflowInstanceId, mp);
}
if (workflowDefinitionId == null) {
logger.info("Starting a new workflow with ingested mediapackage {} based on the default workflow definition '{}'",
mp, defaultWorkflowDefinionId);
} else {
logger.info("Starting a new workflow with ingested mediapackage {} based on workflow definition '{}'", mp,
workflowDefinitionId);
}
try {
// Determine the workflow definition
WorkflowDefinition workflowDef = getWorkflowDefinition(workflowDefinitionId, mp);
// Get the final set of workflow properties
properties = mergeWorkflowConfiguration(properties, mp.getIdentifier().toString());
// Remove potential workflow configuration prefixes from the workflow properties
properties = removePrefixFromProperties(properties);
// Merge scheduled mediapackage with ingested
mp = mergeScheduledMediaPackage(mp);
ingestStatistics.successful();
if (workflowDef != null) {
logger.info("Starting new workflow with ingested mediapackage '{}' using the specified template '{}'",
mp.getIdentifier().toString(), workflowDefinitionId);
} else {
logger.info("Starting new workflow with ingested mediapackage '{}' using the default template '{}'",
mp.getIdentifier().toString(), defaultWorkflowDefinionId);
}
return workflowService.start(workflowDef, mp, properties);
} catch (WorkflowException e) {
ingestStatistics.failed();
throw new IngestException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: ingest
File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-29237
|
MEDIUM
| 5.5
|
opencast
|
ingest
|
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
|
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getSize() {
return delegate.getSize();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSize
File: src/main/java/org/apache/ibatis/cache/decorators/SerializedCache.java
Repository: mybatis/mybatis-3
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2020-26945
|
MEDIUM
| 5.1
|
mybatis/mybatis-3
|
getSize
|
src/main/java/org/apache/ibatis/cache/decorators/SerializedCache.java
|
9caf480e05c389548c9889362c2cb080d728b5d8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int decryptData(byte[] buff, int start, int len) throws ZipException {
for (int j = start; j < (start + len); j += AES_BLOCK_SIZE) {
int loopCount = (j + AES_BLOCK_SIZE <= (start + len)) ?
AES_BLOCK_SIZE : ((start + len) - j);
mac.update(buff, j, loopCount);
prepareBuffAESIVBytes(iv, nonce);
aesEngine.processBlock(iv, counterBlock);
for (int k = 0; k < loopCount; k++) {
buff[j + k] = (byte) (buff[j + k] ^ counterBlock[k]);
}
nonce++;
}
return len;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: decryptData
File: src/main/java/net/lingala/zip4j/crypto/AESDecrypter.java
Repository: srikanth-lingala/zip4j
The code follows secure coding practices.
|
[
"CWE-346"
] |
CVE-2023-22899
|
MEDIUM
| 5.9
|
srikanth-lingala/zip4j
|
decryptData
|
src/main/java/net/lingala/zip4j/crypto/AESDecrypter.java
|
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void removeNamedQuery(String projectName, String name, AsyncMethodCallback resultHandler) {
unimplemented(resultHandler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeNamedQuery
File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
Repository: line/centraldogma
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2021-38388
|
MEDIUM
| 6.5
|
line/centraldogma
|
removeNamedQuery
|
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
|
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isNoHistory() {
return (intent.getFlags() & FLAG_ACTIVITY_NO_HISTORY) != 0
|| (info.flags & FLAG_NO_HISTORY) != 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isNoHistory
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
isNoHistory
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Procedure
@Description("apoc.load.xml('http://example.com/test.xml', 'xPath',config, false) YIELD value as doc CREATE (p:Person) SET p.name = doc.name load from XML URL (e.g. web-api) to import XML as single nested map with attributes and _type, _text and _childrenx fields.")
public Stream<MapResult> xml(@Name("url") String url, @Name(value = "path", defaultValue = "/") String path, @Name(value = "config",defaultValue = "{}") Map<String, Object> config, @Name(value = "simple", defaultValue = "false") boolean simpleMode) throws Exception {
return xmlXpathToMapResult(url, simpleMode, path ,config);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: xml
File: src/main/java/apoc/load/Xml.java
Repository: neo4j-contrib/neo4j-apoc-procedures
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000820
|
HIGH
| 7.5
|
neo4j-contrib/neo4j-apoc-procedures
|
xml
|
src/main/java/apoc/load/Xml.java
|
45bc09c8bd7f17283e2a7e85ce3f02cb4be4fd1a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onActivityResult(int requestCode, int resultCode, final Intent data) {
super.onActivityResult(requestCode, resultCode, data);
ActivityResult activityResult = ActivityResult.of(requestCode, resultCode, data);
if (activity != null && activity.xmppConnectionService != null) {
handleActivityResult(activityResult);
} else {
this.postponedActivityResult.push(activityResult);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onActivityResult
File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
onActivityResult
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
if (request.getParameter("path") != null) {
writeFile(ioService.get(new URI(request.getParameter("path"))), getFileItem(request));
writeResponse(response, "OK");
} else if (request.getParameter("folder") != null) {
writeFile(
ioService.get(new URI(request.getParameter("folder") + "/" + request.getParameter("fileName"))),
getFileItem(request));
writeResponse(response, "OK");
}
} catch (FileUploadException e) {
logError(e);
writeResponse(response, "FAIL");
} catch (URISyntaxException e) {
logError(e);
writeResponse(response, "FAIL");
}
}
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2014-8114
- Severity: MEDIUM
- CVSS Score: 6.8
Description: BZ(1169544,1169556, 1169557,1169559,1169560): improvements on security related to file access
Function: doPost
File: uberfire-server/src/main/java/org/uberfire/server/FileUploadServlet.java
Repository: AppFormer/uberfire
Fixed Code:
@Override
protected void doPost( HttpServletRequest request,
HttpServletResponse response ) throws ServletException, IOException {
try {
if ( request.getParameter( "path" ) != null ) {
final URI uri = new URI( request.getParameter( "path" ) );
if ( !validateAccess( uri, response ) ) {
return;
}
writeFile( ioService.get( uri ), getFileItem( request ) );
writeResponse( response, "OK" );
} else if ( request.getParameter( "folder" ) != null ) {
final URI uri = new URI( request.getParameter( "folder" ) + "/" + request.getParameter( "fileName" ) );
if ( !validateAccess( uri, response ) ) {
return;
}
writeFile(
ioService.get( uri ),
getFileItem( request ) );
writeResponse( response, "OK" );
}
} catch ( FileUploadException e ) {
logError( e );
writeResponse( response, "FAIL" );
} catch ( URISyntaxException e ) {
logError( e );
writeResponse( response, "FAIL" );
}
}
|
[
"CWE-264"
] |
CVE-2014-8114
|
MEDIUM
| 6.8
|
AppFormer/uberfire
|
doPost
|
uberfire-server/src/main/java/org/uberfire/server/FileUploadServlet.java
|
21ec50eb15
| 1
|
Analyze the following code function for security vulnerabilities
|
public static void unzip(String zipFilePath, String targetPath, boolean overwrite) throws IOException {
ZipFile zipFile = new ZipFile(zipFilePath, ENCODING);
Enumeration<? extends ZipEntry> entryEnum = zipFile.getEntries();
if (null != entryEnum) {
while (entryEnum.hasMoreElements()) {
ZipEntry zipEntry = entryEnum.nextElement();
if (zipEntry.isDirectory()) {
File dir = new File(targetPath + File.separator + zipEntry.getName());
dir.mkdirs();
} else {
File targetFile = new File(targetPath + File.separator + zipEntry.getName());
if (!targetFile.exists() || overwrite) {
targetFile.getParentFile().mkdirs();
try (InputStream inputStream = zipFile.getInputStream(zipEntry);
FileOutputStream outputStream = new FileOutputStream(targetFile);
FileLock fileLock = outputStream.getChannel().tryLock();) {
if (null != fileLock) {
StreamUtils.copy(inputStream, outputStream);
}
}
}
}
}
}
zipFile.close();
}
|
Vulnerability Classification:
- CWE: CWE-434
- CVE: CVE-2018-12914
- Severity: HIGH
- CVSS Score: 7.5
Description: https://github.com/sanluan/PublicCMS/issues/13
bugfix
Function: unzip
File: publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/ZipUtils.java
Repository: sanluan/PublicCMS
Fixed Code:
public static void unzip(String zipFilePath, String targetPath, boolean overwrite) throws IOException {
ZipFile zipFile = new ZipFile(zipFilePath, ENCODING);
Enumeration<? extends ZipEntry> entryEnum = zipFile.getEntries();
if (null != entryEnum) {
while (entryEnum.hasMoreElements()) {
ZipEntry zipEntry = entryEnum.nextElement();
String filePath = zipEntry.getName();
if (filePath.contains("..")) {
filePath = filePath.replace("..", Constants.BLANK);
}
if (zipEntry.isDirectory()) {
File dir = new File(targetPath + File.separator + filePath);
dir.mkdirs();
} else {
File targetFile = new File(targetPath + File.separator + filePath);
if (!targetFile.exists() || overwrite) {
targetFile.getParentFile().mkdirs();
try (InputStream inputStream = zipFile.getInputStream(zipEntry);
FileOutputStream outputStream = new FileOutputStream(targetFile);
FileLock fileLock = outputStream.getChannel().tryLock();) {
if (null != fileLock) {
StreamUtils.copy(inputStream, outputStream);
}
}
}
}
}
}
zipFile.close();
}
|
[
"CWE-434"
] |
CVE-2018-12914
|
HIGH
| 7.5
|
sanluan/PublicCMS
|
unzip
|
publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/ZipUtils.java
|
6f177df490cdd8fe658602b24a809474a79d1899
| 1
|
Analyze the following code function for security vulnerabilities
|
public static void clearAppArg() {
if (instance != null) {
instance.setAppArg(null);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearAppArg
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
|
clearAppArg
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private void migrate84(File dataDir, Stack<Integer> versions) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate84
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
|
migrate84
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onInitialize() {
super.onInitialize();
container = new WebMarkupContainer("container");
container.setOutputMarkupId(true);
add(container);
WebMarkupContainer editLink = new WebMarkupContainer("editLink");
WebMarkupContainer splitLink = new WebMarkupContainer("splitLink");
WebMarkupContainer preview = new WebMarkupContainer("preview");
WebMarkupContainer edit = new WebMarkupContainer("edit");
container.add(editLink);
container.add(splitLink);
container.add(preview);
container.add(edit);
container.add(AttributeAppender.append("class", compactMode?"compact-mode":"normal-mode"));
container.add(new DropdownLink("doReference") {
@Override
protected Component newContent(String id, FloatingPanel dropdown) {
return new Fragment(id, "referenceMenuFrag", MarkdownEditor.this) {
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
String script = String.format("onedev.server.markdown.setupActionMenu($('#%s'), $('#%s'));",
container.getMarkupId(), getMarkupId());
response.render(OnDomReadyHeaderItem.forScript(script));
}
}.setOutputMarkupId(true);
}
}.setVisible(getReferenceSupport() != null));
container.add(new DropdownLink("actionMenuTrigger") {
@Override
protected Component newContent(String id, FloatingPanel dropdown) {
return new Fragment(id, "actionMenuFrag", MarkdownEditor.this) {
@Override
protected void onInitialize() {
super.onInitialize();
add(new WebMarkupContainer("doMention").setVisible(getUserMentionSupport() != null));
if (getReferenceSupport() != null)
add(new Fragment("doReference", "referenceMenuFrag", MarkdownEditor.this));
else
add(new WebMarkupContainer("doReference").setVisible(false));
}
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
String script = String.format("onedev.server.markdown.setupActionMenu($('#%s'), $('#%s'));",
container.getMarkupId(), getMarkupId());
response.render(OnDomReadyHeaderItem.forScript(script));
}
}.setOutputMarkupId(true);
}
});
container.add(new WebMarkupContainer("doMention").setVisible(getUserMentionSupport() != null));
edit.add(input = new TextArea<String>("input", Model.of(getModelObject())));
for (AttributeModifier modifier: getInputModifiers())
input.add(modifier);
if (initialSplit) {
container.add(AttributeAppender.append("class", "split-mode"));
preview.add(new Label("rendered", new LoadableDetachableModel<String>() {
@Override
protected String load() {
return renderInput(input.getConvertedInput());
}
}) {
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
String script = String.format(
"onedev.server.markdown.initRendered($('#%s>.body>.preview>.markdown-rendered'));",
container.getMarkupId());
response.render(OnDomReadyHeaderItem.forScript(script));
}
}.setEscapeModelStrings(false));
splitLink.add(AttributeAppender.append("class", "active"));
} else {
container.add(AttributeAppender.append("class", "edit-mode"));
preview.add(new WebMarkupContainer("rendered"));
editLink.add(AttributeAppender.append("class", "active"));
}
container.add(new WebMarkupContainer("canAttachFile").setVisible(getAttachmentSupport()!=null));
container.add(actionBehavior = new AbstractPostAjaxBehavior() {
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setChannel(new AjaxChannel("markdown-preview", AjaxChannel.Type.DROP));
}
@Override
protected void respond(AjaxRequestTarget target) {
IRequestParameters params = RequestCycle.get().getRequest().getPostParameters();
String action = params.getParameterValue("action").toString("");
switch (action) {
case "render":
String markdown = params.getParameterValue("param1").toString();
String rendered = renderInput(markdown);
String script = String.format("onedev.server.markdown.onRendered('%s', '%s');",
container.getMarkupId(), JavaScriptEscape.escapeJavaScript(rendered));
target.appendJavaScript(script);
break;
case "emojiQuery":
List<String> emojiNames = new ArrayList<>();
String emojiQuery = params.getParameterValue("param1").toOptionalString();
if (StringUtils.isNotBlank(emojiQuery)) {
emojiQuery = emojiQuery.toLowerCase();
for (String emojiName: EmojiOnes.getInstance().all().keySet()) {
if (emojiName.toLowerCase().contains(emojiQuery))
emojiNames.add(emojiName);
}
emojiNames.sort((name1, name2) -> name1.length() - name2.length());
} else {
emojiNames.add("smile");
emojiNames.add("worried");
emojiNames.add("blush");
emojiNames.add("+1");
emojiNames.add("-1");
}
List<Map<String, String>> emojis = new ArrayList<>();
for (String emojiName: emojiNames) {
if (emojis.size() < ATWHO_LIMIT) {
String emojiCode = EmojiOnes.getInstance().all().get(emojiName);
CharSequence url = RequestCycle.get().urlFor(new PackageResourceReference(
EmojiOnes.class, "icon/" + emojiCode + ".png"), new PageParameters());
Map<String, String> emoji = new HashMap<>();
emoji.put("name", emojiName);
emoji.put("url", url.toString());
emojis.add(emoji);
}
}
String json;
try {
json = AppLoader.getInstance(ObjectMapper.class).writeValueAsString(emojis);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
script = String.format("$('#%s').data('atWhoEmojiRenderCallback')(%s);", container.getMarkupId(), json);
target.appendJavaScript(script);
break;
case "loadEmojis":
emojis = new ArrayList<>();
String urlPattern = RequestCycle.get().urlFor(new PackageResourceReference(EmojiOnes.class,
"icon/FILENAME.png"), new PageParameters()).toString();
for (Map.Entry<String, String> entry: EmojiOnes.getInstance().all().entrySet()) {
Map<String, String> emoji = new HashMap<>();
emoji.put("name", entry.getKey());
emoji.put("url", urlPattern.replace("FILENAME", entry.getValue()));
emojis.add(emoji);
}
try {
json = AppLoader.getInstance(ObjectMapper.class).writeValueAsString(emojis);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
script = String.format("onedev.server.markdown.onEmojisLoaded('%s', %s);", container.getMarkupId(), json);
target.appendJavaScript(script);
break;
case "userQuery":
String userQuery = params.getParameterValue("param1").toOptionalString();
AvatarManager avatarManager = OneDev.getInstance(AvatarManager.class);
List<Map<String, String>> userList = new ArrayList<>();
for (User user: getUserMentionSupport().findUsers(userQuery, ATWHO_LIMIT)) {
Map<String, String> userMap = new HashMap<>();
userMap.put("name", user.getName());
if (user.getFullName() != null)
userMap.put("fullName", user.getFullName());
String noSpaceName = StringUtils.deleteWhitespace(user.getName());
if (user.getFullName() != null) {
String noSpaceFullName = StringUtils.deleteWhitespace(user.getFullName());
userMap.put("searchKey", noSpaceName + " " + noSpaceFullName);
} else {
userMap.put("searchKey", noSpaceName);
}
String avatarUrl = avatarManager.getAvatarUrl(user);
userMap.put("avatarUrl", avatarUrl);
userList.add(userMap);
}
try {
json = OneDev.getInstance(ObjectMapper.class).writeValueAsString(userList);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
script = String.format("$('#%s').data('atWhoUserRenderCallback')(%s);", container.getMarkupId(), json);
target.appendJavaScript(script);
break;
case "referenceQuery":
String referenceQuery = params.getParameterValue("param1").toOptionalString();
String referenceQueryType = params.getParameterValue("param2").toOptionalString();
String referenceProjectName = params.getParameterValue("param3").toOptionalString();
List<Map<String, String>> referenceList = new ArrayList<>();
Project referenceProject;
if (StringUtils.isNotBlank(referenceProjectName))
referenceProject = OneDev.getInstance(ProjectManager.class).find(referenceProjectName);
else
referenceProject = null;
if (referenceProject != null || StringUtils.isBlank(referenceProjectName)) {
if ("issue".equals(referenceQueryType)) {
for (Issue issue: getReferenceSupport().findIssues(referenceProject, referenceQuery, ATWHO_LIMIT)) {
Map<String, String> referenceMap = new HashMap<>();
referenceMap.put("referenceType", "issue");
referenceMap.put("referenceNumber", String.valueOf(issue.getNumber()));
referenceMap.put("referenceTitle", issue.getTitle());
referenceMap.put("searchKey", issue.getNumber() + " " + StringUtils.deleteWhitespace(issue.getTitle()));
referenceList.add(referenceMap);
}
} else if ("pullrequest".equals(referenceQueryType)) {
for (PullRequest request: getReferenceSupport().findPullRequests(referenceProject, referenceQuery, ATWHO_LIMIT)) {
Map<String, String> referenceMap = new HashMap<>();
referenceMap.put("referenceType", "pull request");
referenceMap.put("referenceNumber", String.valueOf(request.getNumber()));
referenceMap.put("referenceTitle", request.getTitle());
referenceMap.put("searchKey", request.getNumber() + " " + StringUtils.deleteWhitespace(request.getTitle()));
referenceList.add(referenceMap);
}
} else if ("build".equals(referenceQueryType)) {
for (Build build: getReferenceSupport().findBuilds(referenceProject, referenceQuery, ATWHO_LIMIT)) {
Map<String, String> referenceMap = new HashMap<>();
referenceMap.put("referenceType", "build");
referenceMap.put("referenceNumber", String.valueOf(build.getNumber()));
String title;
if (build.getVersion() != null)
title = "(" + build.getVersion() + ") " + build.getJobName();
else
title = build.getJobName();
referenceMap.put("referenceTitle", title);
referenceMap.put("searchKey", build.getNumber() + " " + StringUtils.deleteWhitespace(title));
referenceList.add(referenceMap);
}
}
}
try {
json = OneDev.getInstance(ObjectMapper.class).writeValueAsString(referenceList);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
script = String.format("$('#%s').data('atWhoReferenceRenderCallback')(%s);", container.getMarkupId(), json);
target.appendJavaScript(script);
break;
case "selectImage":
case "selectLink":
new ModalPanel(target) {
@Override
protected Component newContent(String id) {
return new InsertUrlPanel(id, MarkdownEditor.this, action.equals("selectImage")) {
@Override
protected void onClose(AjaxRequestTarget target) {
close();
}
};
}
@Override
protected void onClosed() {
super.onClosed();
AjaxRequestTarget target =
Preconditions.checkNotNull(RequestCycle.get().find(AjaxRequestTarget.class));
target.appendJavaScript(String.format("$('#%s textarea').focus();", container.getMarkupId()));
}
};
break;
case "insertUrl":
String name;
try {
name = URLDecoder.decode(params.getParameterValue("param1").toString(), StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
String replaceMessage = params.getParameterValue("param2").toString();
String url = getAttachmentSupport().getAttachmentUrl(name);
insertUrl(target, isWebSafeImage(name), url, name, replaceMessage);
break;
default:
throw new IllegalStateException("Unknown action: " + action);
}
}
});
container.add(attachmentUploadBehavior = new AbstractPostAjaxBehavior() {
@Override
protected void respond(AjaxRequestTarget target) {
Preconditions.checkNotNull(getAttachmentSupport(), "Unexpected attachment upload request");
HttpServletRequest request = (HttpServletRequest) RequestCycle.get().getRequest().getContainerRequest();
HttpServletResponse response = (HttpServletResponse) RequestCycle.get().getResponse().getContainerResponse();
try {
String fileName = URLDecoder.decode(request.getHeader("File-Name"), StandardCharsets.UTF_8.name());
String attachmentName = getAttachmentSupport().saveAttachment(fileName, request.getInputStream());
response.getWriter().print(URLEncoder.encode(attachmentName, StandardCharsets.UTF_8.name()));
response.setStatus(HttpServletResponse.SC_OK);
} catch (Exception e) {
logger.error("Error uploading attachment.", e);
try {
if (e.getMessage() != null)
response.getWriter().print(e.getMessage());
else
response.getWriter().print("Internal server error");
} catch (IOException e2) {
throw new RuntimeException(e2);
}
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}
});
}
|
Vulnerability Classification:
- CWE: CWE-434
- CVE: CVE-2021-21245
- Severity: HIGH
- CVSS Score: 7.5
Description: Fix the issue that uploaded file can be stored anywhere OneDev has write
permissions over
Function: onInitialize
File: server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
Repository: theonedev/onedev
Fixed Code:
@Override
protected void onInitialize() {
super.onInitialize();
container = new WebMarkupContainer("container");
container.setOutputMarkupId(true);
add(container);
WebMarkupContainer editLink = new WebMarkupContainer("editLink");
WebMarkupContainer splitLink = new WebMarkupContainer("splitLink");
WebMarkupContainer preview = new WebMarkupContainer("preview");
WebMarkupContainer edit = new WebMarkupContainer("edit");
container.add(editLink);
container.add(splitLink);
container.add(preview);
container.add(edit);
container.add(AttributeAppender.append("class", compactMode?"compact-mode":"normal-mode"));
container.add(new DropdownLink("doReference") {
@Override
protected Component newContent(String id, FloatingPanel dropdown) {
return new Fragment(id, "referenceMenuFrag", MarkdownEditor.this) {
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
String script = String.format("onedev.server.markdown.setupActionMenu($('#%s'), $('#%s'));",
container.getMarkupId(), getMarkupId());
response.render(OnDomReadyHeaderItem.forScript(script));
}
}.setOutputMarkupId(true);
}
}.setVisible(getReferenceSupport() != null));
container.add(new DropdownLink("actionMenuTrigger") {
@Override
protected Component newContent(String id, FloatingPanel dropdown) {
return new Fragment(id, "actionMenuFrag", MarkdownEditor.this) {
@Override
protected void onInitialize() {
super.onInitialize();
add(new WebMarkupContainer("doMention").setVisible(getUserMentionSupport() != null));
if (getReferenceSupport() != null)
add(new Fragment("doReference", "referenceMenuFrag", MarkdownEditor.this));
else
add(new WebMarkupContainer("doReference").setVisible(false));
}
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
String script = String.format("onedev.server.markdown.setupActionMenu($('#%s'), $('#%s'));",
container.getMarkupId(), getMarkupId());
response.render(OnDomReadyHeaderItem.forScript(script));
}
}.setOutputMarkupId(true);
}
});
container.add(new WebMarkupContainer("doMention").setVisible(getUserMentionSupport() != null));
edit.add(input = new TextArea<String>("input", Model.of(getModelObject())));
for (AttributeModifier modifier: getInputModifiers())
input.add(modifier);
if (initialSplit) {
container.add(AttributeAppender.append("class", "split-mode"));
preview.add(new Label("rendered", new LoadableDetachableModel<String>() {
@Override
protected String load() {
return renderInput(input.getConvertedInput());
}
}) {
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
String script = String.format(
"onedev.server.markdown.initRendered($('#%s>.body>.preview>.markdown-rendered'));",
container.getMarkupId());
response.render(OnDomReadyHeaderItem.forScript(script));
}
}.setEscapeModelStrings(false));
splitLink.add(AttributeAppender.append("class", "active"));
} else {
container.add(AttributeAppender.append("class", "edit-mode"));
preview.add(new WebMarkupContainer("rendered"));
editLink.add(AttributeAppender.append("class", "active"));
}
container.add(new WebMarkupContainer("canAttachFile").setVisible(getAttachmentSupport()!=null));
container.add(actionBehavior = new AbstractPostAjaxBehavior() {
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
attributes.setChannel(new AjaxChannel("markdown-preview", AjaxChannel.Type.DROP));
}
@Override
protected void respond(AjaxRequestTarget target) {
IRequestParameters params = RequestCycle.get().getRequest().getPostParameters();
String action = params.getParameterValue("action").toString("");
switch (action) {
case "render":
String markdown = params.getParameterValue("param1").toString();
String rendered = renderInput(markdown);
String script = String.format("onedev.server.markdown.onRendered('%s', '%s');",
container.getMarkupId(), JavaScriptEscape.escapeJavaScript(rendered));
target.appendJavaScript(script);
break;
case "emojiQuery":
List<String> emojiNames = new ArrayList<>();
String emojiQuery = params.getParameterValue("param1").toOptionalString();
if (StringUtils.isNotBlank(emojiQuery)) {
emojiQuery = emojiQuery.toLowerCase();
for (String emojiName: EmojiOnes.getInstance().all().keySet()) {
if (emojiName.toLowerCase().contains(emojiQuery))
emojiNames.add(emojiName);
}
emojiNames.sort((name1, name2) -> name1.length() - name2.length());
} else {
emojiNames.add("smile");
emojiNames.add("worried");
emojiNames.add("blush");
emojiNames.add("+1");
emojiNames.add("-1");
}
List<Map<String, String>> emojis = new ArrayList<>();
for (String emojiName: emojiNames) {
if (emojis.size() < ATWHO_LIMIT) {
String emojiCode = EmojiOnes.getInstance().all().get(emojiName);
CharSequence url = RequestCycle.get().urlFor(new PackageResourceReference(
EmojiOnes.class, "icon/" + emojiCode + ".png"), new PageParameters());
Map<String, String> emoji = new HashMap<>();
emoji.put("name", emojiName);
emoji.put("url", url.toString());
emojis.add(emoji);
}
}
String json;
try {
json = AppLoader.getInstance(ObjectMapper.class).writeValueAsString(emojis);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
script = String.format("$('#%s').data('atWhoEmojiRenderCallback')(%s);", container.getMarkupId(), json);
target.appendJavaScript(script);
break;
case "loadEmojis":
emojis = new ArrayList<>();
String urlPattern = RequestCycle.get().urlFor(new PackageResourceReference(EmojiOnes.class,
"icon/FILENAME.png"), new PageParameters()).toString();
for (Map.Entry<String, String> entry: EmojiOnes.getInstance().all().entrySet()) {
Map<String, String> emoji = new HashMap<>();
emoji.put("name", entry.getKey());
emoji.put("url", urlPattern.replace("FILENAME", entry.getValue()));
emojis.add(emoji);
}
try {
json = AppLoader.getInstance(ObjectMapper.class).writeValueAsString(emojis);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
script = String.format("onedev.server.markdown.onEmojisLoaded('%s', %s);", container.getMarkupId(), json);
target.appendJavaScript(script);
break;
case "userQuery":
String userQuery = params.getParameterValue("param1").toOptionalString();
AvatarManager avatarManager = OneDev.getInstance(AvatarManager.class);
List<Map<String, String>> userList = new ArrayList<>();
for (User user: getUserMentionSupport().findUsers(userQuery, ATWHO_LIMIT)) {
Map<String, String> userMap = new HashMap<>();
userMap.put("name", user.getName());
if (user.getFullName() != null)
userMap.put("fullName", user.getFullName());
String noSpaceName = StringUtils.deleteWhitespace(user.getName());
if (user.getFullName() != null) {
String noSpaceFullName = StringUtils.deleteWhitespace(user.getFullName());
userMap.put("searchKey", noSpaceName + " " + noSpaceFullName);
} else {
userMap.put("searchKey", noSpaceName);
}
String avatarUrl = avatarManager.getAvatarUrl(user);
userMap.put("avatarUrl", avatarUrl);
userList.add(userMap);
}
try {
json = OneDev.getInstance(ObjectMapper.class).writeValueAsString(userList);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
script = String.format("$('#%s').data('atWhoUserRenderCallback')(%s);", container.getMarkupId(), json);
target.appendJavaScript(script);
break;
case "referenceQuery":
String referenceQuery = params.getParameterValue("param1").toOptionalString();
String referenceQueryType = params.getParameterValue("param2").toOptionalString();
String referenceProjectName = params.getParameterValue("param3").toOptionalString();
List<Map<String, String>> referenceList = new ArrayList<>();
Project referenceProject;
if (StringUtils.isNotBlank(referenceProjectName))
referenceProject = OneDev.getInstance(ProjectManager.class).find(referenceProjectName);
else
referenceProject = null;
if (referenceProject != null || StringUtils.isBlank(referenceProjectName)) {
if ("issue".equals(referenceQueryType)) {
for (Issue issue: getReferenceSupport().findIssues(referenceProject, referenceQuery, ATWHO_LIMIT)) {
Map<String, String> referenceMap = new HashMap<>();
referenceMap.put("referenceType", "issue");
referenceMap.put("referenceNumber", String.valueOf(issue.getNumber()));
referenceMap.put("referenceTitle", issue.getTitle());
referenceMap.put("searchKey", issue.getNumber() + " " + StringUtils.deleteWhitespace(issue.getTitle()));
referenceList.add(referenceMap);
}
} else if ("pullrequest".equals(referenceQueryType)) {
for (PullRequest request: getReferenceSupport().findPullRequests(referenceProject, referenceQuery, ATWHO_LIMIT)) {
Map<String, String> referenceMap = new HashMap<>();
referenceMap.put("referenceType", "pull request");
referenceMap.put("referenceNumber", String.valueOf(request.getNumber()));
referenceMap.put("referenceTitle", request.getTitle());
referenceMap.put("searchKey", request.getNumber() + " " + StringUtils.deleteWhitespace(request.getTitle()));
referenceList.add(referenceMap);
}
} else if ("build".equals(referenceQueryType)) {
for (Build build: getReferenceSupport().findBuilds(referenceProject, referenceQuery, ATWHO_LIMIT)) {
Map<String, String> referenceMap = new HashMap<>();
referenceMap.put("referenceType", "build");
referenceMap.put("referenceNumber", String.valueOf(build.getNumber()));
String title;
if (build.getVersion() != null)
title = "(" + build.getVersion() + ") " + build.getJobName();
else
title = build.getJobName();
referenceMap.put("referenceTitle", title);
referenceMap.put("searchKey", build.getNumber() + " " + StringUtils.deleteWhitespace(title));
referenceList.add(referenceMap);
}
}
}
try {
json = OneDev.getInstance(ObjectMapper.class).writeValueAsString(referenceList);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
script = String.format("$('#%s').data('atWhoReferenceRenderCallback')(%s);", container.getMarkupId(), json);
target.appendJavaScript(script);
break;
case "selectImage":
case "selectLink":
new ModalPanel(target) {
@Override
protected Component newContent(String id) {
return new InsertUrlPanel(id, MarkdownEditor.this, action.equals("selectImage")) {
@Override
protected void onClose(AjaxRequestTarget target) {
close();
}
};
}
@Override
protected void onClosed() {
super.onClosed();
AjaxRequestTarget target =
Preconditions.checkNotNull(RequestCycle.get().find(AjaxRequestTarget.class));
target.appendJavaScript(String.format("$('#%s textarea').focus();", container.getMarkupId()));
}
};
break;
case "insertUrl":
String name;
try {
name = URLDecoder.decode(params.getParameterValue("param1").toString(), StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
String replaceMessage = params.getParameterValue("param2").toString();
String url = getAttachmentSupport().getAttachmentUrl(name);
insertUrl(target, isWebSafeImage(name), url, name, replaceMessage);
break;
default:
throw new IllegalStateException("Unknown action: " + action);
}
}
});
container.add(attachmentUploadBehavior = new AbstractPostAjaxBehavior() {
@Override
protected void respond(AjaxRequestTarget target) {
Preconditions.checkNotNull(getAttachmentSupport(), "Unexpected attachment upload request");
HttpServletRequest request = (HttpServletRequest) RequestCycle.get().getRequest().getContainerRequest();
HttpServletResponse response = (HttpServletResponse) RequestCycle.get().getResponse().getContainerResponse();
try {
String fileName = FilenameUtils.sanitizeFilename(
URLDecoder.decode(request.getHeader("File-Name"), StandardCharsets.UTF_8.name()));
String attachmentName = getAttachmentSupport().saveAttachment(fileName, request.getInputStream());
response.getWriter().print(URLEncoder.encode(attachmentName, StandardCharsets.UTF_8.name()));
response.setStatus(HttpServletResponse.SC_OK);
} catch (Exception e) {
logger.error("Error uploading attachment.", e);
try {
if (e.getMessage() != null)
response.getWriter().print(e.getMessage());
else
response.getWriter().print("Internal server error");
} catch (IOException e2) {
throw new RuntimeException(e2);
}
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}
});
}
|
[
"CWE-434"
] |
CVE-2021-21245
|
HIGH
| 7.5
|
theonedev/onedev
|
onInitialize
|
server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
|
0c060153fb97c0288a1917efdb17cc426934dacb
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getPriority(String pkg, int uid) {
checkCallerIsSystem();
return mRankingHelper.getPriority(pkg, uid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPriority
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
|
getPriority
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public static com.sun.identity.saml.assertion.Subject examAssertions(
List assertions) throws IOException {
if (assertions == null) {
return null;
}
boolean validation = false;
com.sun.identity.saml.assertion.Subject subject = null;
Iterator iter = assertions.iterator();
while (iter.hasNext()) {
Assertion assertion = (Assertion)iter.next();
if (!checkCondition(assertion)) {
return null;
}
debug.message("Passed checking Conditions!");
// exam the Statement inside the Assertion
Set statements = new HashSet();
statements = assertion.getStatement();
if (statements == null || statements.isEmpty()) {
debug.error(bundle.getString("noStatement"));
return null;
}
Iterator iterator = statements.iterator();
while (iterator.hasNext()) {
Statement statement = (Statement) iterator.next();
subject = ((SubjectStatement)statement).getSubject();
SubjectConfirmation sc = subject.getSubjectConfirmation();
Set cm = new HashSet();
cm = sc.getConfirmationMethod();
if (cm == null || cm.isEmpty()) {
debug.error("Subject confirmation method is null");
return null;
}
String conMethod = (String) cm.iterator().next();
// add checking artifact confirmation method identifier based
// on Assertion version number
if ((conMethod != null) && (assertion.getMajorVersion() ==
SAMLConstants.ASSERTION_MAJOR_VERSION) &&
(((assertion.getMinorVersion() ==
SAMLConstants.ASSERTION_MINOR_VERSION_ONE) &&
conMethod.equals(SAMLConstants.CONFIRMATION_METHOD_ARTIFACT))
||
((assertion.getMinorVersion() ==
SAMLConstants.ASSERTION_MINOR_VERSION_ZERO) &&
(conMethod.equals(
SAMLConstants.DEPRECATED_CONFIRMATION_METHOD_ARTIFACT))))) {
if (debug.messageEnabled()) {
debug.message("Correct Confirmation method");
}
} else {
debug.error("Wrong Confirmation Method.");
return null;
}
if (statement instanceof AuthenticationStatement) {
//found an SSO Assertion
validation = true;
}
} // end of while (iterator.hasNext()) for Statements
} // end of while (iter.hasNext()) for Assertions
if (!validation) {
debug.error(bundle.getString("noSSOAssertion"));
return null;
}
return subject;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: examAssertions
File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
Repository: OpenIdentityPlatform/OpenAM
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2023-37471
|
CRITICAL
| 9.8
|
OpenIdentityPlatform/OpenAM
|
examAssertions
|
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
|
7c18543d126e8a567b83bb4535631825aaa9d742
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void checkGoodName(String name) throws Failure {
if(name==null || name.length()==0)
throw new Failure(Messages.Hudson_NoName());
if("..".equals(name.trim()))
throw new Failure(Messages.Jenkins_NotAllowedName(".."));
for( int i=0; i<name.length(); i++ ) {
char ch = name.charAt(i);
if(Character.isISOControl(ch)) {
throw new Failure(Messages.Hudson_ControlCodeNotAllowed(toPrintableName(name)));
}
if("?*/\\%!@#$^&|<>[]:;".indexOf(ch)!=-1)
throw new Failure(Messages.Hudson_UnsafeChar(ch));
}
// looks good
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkGoodName
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
checkGoodName
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isInvalid() {
return user==null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isInvalid
File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2014-2064
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
isInvalid
|
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
|
fbf96734470caba9364f04e0b77b0bae7293a1ec
| 0
|
Analyze the following code function for security vulnerabilities
|
public void registerApiKey(String jti, String jwt) {
if (StringUtils.isBlank(jti) || StringUtils.isBlank(jwt)) {
return;
}
API_KEYS.put(jti, jwt);
saveApiKeysObject();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerApiKey
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
|
registerApiKey
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int allocateAppWidgetId(String callingPackage, int hostId) {
final int userId = UserHandle.getCallingUserId();
if (DEBUG) {
Slog.i(TAG, "allocateAppWidgetId() " + userId);
}
// Make sure the package runs under the caller uid.
mSecurityPolicy.enforceCallFromPackage(callingPackage);
synchronized (mLock) {
ensureGroupStateLoadedLocked(userId);
if (mNextAppWidgetIds.indexOfKey(userId) < 0) {
mNextAppWidgetIds.put(userId, AppWidgetManager.INVALID_APPWIDGET_ID + 1);
}
final int appWidgetId = incrementAndGetAppWidgetIdLocked(userId);
// NOTE: The lookup is enforcing security across users by making
// sure the caller can only access hosts it owns.
HostId id = new HostId(Binder.getCallingUid(), hostId, callingPackage);
Host host = lookupOrAddHostLocked(id);
Widget widget = new Widget();
widget.appWidgetId = appWidgetId;
widget.host = host;
host.widgets.add(widget);
mWidgets.add(widget);
saveGroupStateAsync(userId);
if (DEBUG) {
Slog.i(TAG, "Allocated widget id " + appWidgetId
+ " for host " + host.id);
}
return appWidgetId;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: allocateAppWidgetId
File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-1541
|
MEDIUM
| 4.3
|
android
|
allocateAppWidgetId
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addCompletionHandler(Media media, Runnable onCompletion) {
super.addCompletionHandler(media, onCompletion);
if (media instanceof Video) {
((Video)media).addCompletionHandler(onCompletion);
} else if (media instanceof Audio) {
((Audio)media).addCompletionHandler(onCompletion);
} else if (media instanceof MediaProxy) {
((MediaProxy)media).addCompletionHandler(onCompletion);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addCompletionHandler
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
|
addCompletionHandler
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onTaskStackChanged() {
// Debounce any task stack changes
mHandler.removeCallbacks(this);
mHandler.post(this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onTaskStackChanged
File: packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0813
|
MEDIUM
| 6.6
|
android
|
onTaskStackChanged
|
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
|
16a76dadcc23a13223e9c2216dad1fe5cad7d6e1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setTimeout(int timeoutMs)
throws SocketException
{
_socket.setSoTimeout(timeoutMs);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTimeout
File: src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
setTimeout
|
src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
void updateCpuStatsNow() {
synchronized (mProcessCpuTracker) {
mProcessCpuMutexFree.set(false);
final long now = SystemClock.uptimeMillis();
boolean haveNewCpuStats = false;
if (MONITOR_CPU_USAGE &&
mLastCpuTime.get() < (now-MONITOR_CPU_MIN_TIME)) {
mLastCpuTime.set(now);
mProcessCpuTracker.update();
if (mProcessCpuTracker.hasGoodLastStats()) {
haveNewCpuStats = true;
//Slog.i(TAG, mProcessCpu.printCurrentState());
//Slog.i(TAG, "Total CPU usage: "
// + mProcessCpu.getTotalCpuPercent() + "%");
// Slog the cpu usage if the property is set.
if ("true".equals(SystemProperties.get("events.cpu"))) {
int user = mProcessCpuTracker.getLastUserTime();
int system = mProcessCpuTracker.getLastSystemTime();
int iowait = mProcessCpuTracker.getLastIoWaitTime();
int irq = mProcessCpuTracker.getLastIrqTime();
int softIrq = mProcessCpuTracker.getLastSoftIrqTime();
int idle = mProcessCpuTracker.getLastIdleTime();
int total = user + system + iowait + irq + softIrq + idle;
if (total == 0) total = 1;
EventLog.writeEvent(EventLogTags.CPU,
((user+system+iowait+irq+softIrq) * 100) / total,
(user * 100) / total,
(system * 100) / total,
(iowait * 100) / total,
(irq * 100) / total,
(softIrq * 100) / total);
}
}
}
final BatteryStatsImpl bstats = mBatteryStatsService.getActiveStatistics();
synchronized(bstats) {
synchronized(mPidsSelfLocked) {
if (haveNewCpuStats) {
if (bstats.startAddingCpuLocked()) {
int totalUTime = 0;
int totalSTime = 0;
final int N = mProcessCpuTracker.countStats();
for (int i=0; i<N; i++) {
ProcessCpuTracker.Stats st = mProcessCpuTracker.getStats(i);
if (!st.working) {
continue;
}
ProcessRecord pr = mPidsSelfLocked.get(st.pid);
totalUTime += st.rel_utime;
totalSTime += st.rel_stime;
if (pr != null) {
BatteryStatsImpl.Uid.Proc ps = pr.curProcBatteryStats;
if (ps == null || !ps.isActive()) {
pr.curProcBatteryStats = ps = bstats.getProcessStatsLocked(
pr.info.uid, pr.processName);
}
ps.addCpuTimeLocked(st.rel_utime, st.rel_stime);
pr.curCpuTime += st.rel_utime + st.rel_stime;
} else {
BatteryStatsImpl.Uid.Proc ps = st.batteryStats;
if (ps == null || !ps.isActive()) {
st.batteryStats = ps = bstats.getProcessStatsLocked(
bstats.mapUid(st.uid), st.name);
}
ps.addCpuTimeLocked(st.rel_utime, st.rel_stime);
}
}
final int userTime = mProcessCpuTracker.getLastUserTime();
final int systemTime = mProcessCpuTracker.getLastSystemTime();
final int iowaitTime = mProcessCpuTracker.getLastIoWaitTime();
final int irqTime = mProcessCpuTracker.getLastIrqTime();
final int softIrqTime = mProcessCpuTracker.getLastSoftIrqTime();
final int idleTime = mProcessCpuTracker.getLastIdleTime();
bstats.finishAddingCpuLocked(totalUTime, totalSTime, userTime,
systemTime, iowaitTime, irqTime, softIrqTime, idleTime);
}
}
}
if (mLastWriteTime < (now-BATTERY_STATS_TIME)) {
mLastWriteTime = now;
mBatteryStatsService.scheduleWriteToDisk();
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateCpuStatsNow
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
updateCpuStatsNow
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void registerForSubscriptionInfoReady(Handler h, int what, Object obj) {
Registrant r = new Registrant(h, what, obj);
mCdmaForSubscriptionInfoReadyRegistrants.add(r);
if (isMinInfoReady()) {
r.notifyRegistrant();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerForSubscriptionInfoReady
File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3831
|
MEDIUM
| 5
|
android
|
registerForSubscriptionInfoReady
|
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
public static CertRetrievalRequest fromDOM(Element requestElement) {
CertRetrievalRequest request = new CertRetrievalRequest();
NodeList certIdList = requestElement.getElementsByTagName("certId");
if (certIdList.getLength() > 0) {
String value = certIdList.item(0).getTextContent();
request.setCertId(new CertId(value));
}
NodeList requestIdList = requestElement.getElementsByTagName("requestId");
if (requestIdList.getLength() > 0) {
String value = requestIdList.item(0).getTextContent();
request.setRequestId(new RequestId(value));
}
return request;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fromDOM
File: base/common/src/main/java/com/netscape/certsrv/cert/CertRetrievalRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
fromDOM
|
base/common/src/main/java/com/netscape/certsrv/cert/CertRetrievalRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<String> getAll(String name) {
return getAll((CharSequence) name);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAll
File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2021-43797
|
MEDIUM
| 4.3
|
netty
|
getAll
|
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
|
07aa6b5938a8b6ed7a6586e066400e2643897323
| 0
|
Analyze the following code function for security vulnerabilities
|
default boolean isEmpty() {
return this == ConvertibleValues.EMPTY || names().isEmpty();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isEmpty
File: core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java
Repository: micronaut-projects/micronaut-core
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
isEmpty
|
core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setPersistentVrThread(int tid) {
mActivityTaskManager.setPersistentVrThread(tid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPersistentVrThread
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
|
setPersistentVrThread
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseResultTerm(String key, List<Element> elements, XmlSerializer serializer) throws Exception
{
final Element last = XmlUtils.removeLast(elements);
ExpressionProperties p = new ExpressionProperties(last);
addTextTag(key, p.isOperand() ? p.text : "", serializer);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseResultTerm
File: app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java
Repository: mkulesh/microMathematics
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000821
|
HIGH
| 7.5
|
mkulesh/microMathematics
|
parseResultTerm
|
app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java
|
5c05ac8de16c569ff0a1816f20be235090d3dd9d
| 0
|
Analyze the following code function for security vulnerabilities
|
protected View.OnTouchListener getStatusBarWindowTouchListener() {
return (v, event) -> {
checkUserAutohide(v, event);
checkRemoteInputOutside(event);
if (event.getAction() == MotionEvent.ACTION_DOWN) {
if (mExpandedVisible) {
animateCollapsePanels();
}
}
return mStatusBarWindow.onTouchEvent(event);
};
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStatusBarWindowTouchListener
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
|
getStatusBarWindowTouchListener
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public SystemMessagesProvider getSystemMessagesProvider() {
return systemMessagesProvider;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSystemMessagesProvider
File: server/src/main/java/com/vaadin/server/VaadinService.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31403
|
LOW
| 1.9
|
vaadin/framework
|
getSystemMessagesProvider
|
server/src/main/java/com/vaadin/server/VaadinService.java
|
d852126ab6f0c43f937239305bd0e9594834fe34
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("deprecation")
@Override
public BiomeType getBiome(BlockVector3 position) {
if (HAS_3D_BIOMES) {
return BukkitAdapter.adapt(getWorld().getBiome(position.getBlockX(), position.getBlockY(), position.getBlockZ()));
} else {
return BukkitAdapter.adapt(getWorld().getBiome(position.getBlockX(), position.getBlockZ()));
}
}
|
Vulnerability Classification:
- CWE: CWE-400
- CVE: CVE-2023-35925
- Severity: MEDIUM
- CVSS Score: 5.5
Description: feat: prevent edits outside +/- 30,000,000 blocks
Function: getBiome
File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
Repository: IntellectualSites/FastAsyncWorldEdit
Fixed Code:
@SuppressWarnings("deprecation")
@Override
public BiomeType getBiome(BlockVector3 position) {
//FAWE start - safe edit region
testCoords(position);
//FAWE end
if (HAS_3D_BIOMES) {
return BukkitAdapter.adapt(getWorld().getBiome(position.getBlockX(), position.getBlockY(), position.getBlockZ()));
} else {
return BukkitAdapter.adapt(getWorld().getBiome(position.getBlockX(), position.getBlockZ()));
}
}
|
[
"CWE-400"
] |
CVE-2023-35925
|
MEDIUM
| 5.5
|
IntellectualSites/FastAsyncWorldEdit
|
getBiome
|
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
|
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
| 1
|
Analyze the following code function for security vulnerabilities
|
private boolean isUnattendedManagedKioskUnchecked() {
try {
return isManagedKioskInternal()
&& getPowerManagerInternal().wasDeviceIdleFor(UNATTENDED_MANAGED_KIOSK_MS);
} catch (RemoteException e) {
throw new IllegalStateException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isUnattendedManagedKioskUnchecked
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
|
isUnattendedManagedKioskUnchecked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public XWikiAttachment addAttachment(String fileName, byte[] content, XWikiContext context) throws XWikiException
{
try {
return setAttachment(fileName, new ByteArrayInputStream(content != null ? content : new byte[0]), context);
} catch (IOException e) {
throw new XWikiException(XWikiException.MODULE_XWIKI_DOC, XWikiException.ERROR_XWIKI_UNKNOWN,
"Failed to set Attachment content", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addAttachment
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
|
addAttachment
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<String> getUrlAllowList() {
final String env = SecurityUtils.getenv(SecurityUtils.ALLOWLIST_URL);
if (env == null)
return Collections.emptyList();
return Arrays.asList(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(env).split(";"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUrlAllowList
File: src/net/sourceforge/plantuml/security/SURL.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
getUrlAllowList
|
src/net/sourceforge/plantuml/security/SURL.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isPluginPackageExists(String name, String version, String edition) {
return (pluginPackagesMapper.countByNameAndVersion(name, version, edition) > 0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPluginPackageExists
File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
Repository: WeBankPartners/wecube-platform
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-45746
|
MEDIUM
| 5
|
WeBankPartners/wecube-platform
|
isPluginPackageExists
|
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
|
1164dae43c505f8a0233cc049b2689d6ca6d0c37
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void handleTapOutsideFocusInsideSelf() {
final DisplayContent displayContent = getDisplayContent();
if (!displayContent.isOnTop()) {
displayContent.getParent().positionChildAt(WindowContainer.POSITION_TOP, displayContent,
true /* includingParents */);
}
mWmService.handleTaskFocusChange(getTask(), mActivityRecord);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleTapOutsideFocusInsideSelf
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
handleTapOutsideFocusInsideSelf
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@MediumTest
@Test
public void testPullNonExternalCall() throws Exception {
// TODO: Revisit this unit test once telecom support for filtering external calls from
// InCall services is implemented.
IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
assertEquals(Call.STATE_ACTIVE, mInCallServiceFixtureX.getCall(ids.mCallId).getState());
// Attempt to pull the call and verify the API call makes it through
mInCallServiceFixtureX.mInCallAdapter.pullExternalCall(ids.mCallId);
Thread.sleep(TEST_TIMEOUT);
verify(mConnectionServiceFixtureA.getTestDouble(), never())
.pullExternalCall(eq(ids.mCallId), any());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testPullNonExternalCall
File: tests/src/com/android/server/telecom/tests/BasicCallTests.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
testPullNonExternalCall
|
tests/src/com/android/server/telecom/tests/BasicCallTests.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.