instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
public Map<String, Object> getAttrs() {
return super._getAttrs();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAttrs
File: data/src/main/java/com/zrlog/model/Log.java
Repository: 94fzb/zrlog
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2018-17420
|
MEDIUM
| 6.5
|
94fzb/zrlog
|
getAttrs
|
data/src/main/java/com/zrlog/model/Log.java
|
157b8fbbb64eb22ddb52e7c5754e88180b7c3d4f
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void factoryWithPropertiesXmlGenerator(XmlGenerator gen, String elementName,
AbstractFactoryWithPropertiesConfig<?> factoryWithProps) {
gen.open(elementName, "enabled", factoryWithProps != null && factoryWithProps.isEnabled());
if (factoryWithProps != null) {
gen.node("factory-class-name", factoryWithProps.getFactoryClassName())
.appendProperties(factoryWithProps.getProperties());
}
gen.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: factoryWithPropertiesXmlGenerator
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-522"
] |
CVE-2023-33264
|
MEDIUM
| 4.3
|
hazelcast
|
factoryWithPropertiesXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
80a502d53cc48bf895711ab55f95e3a51e344ac1
| 0
|
Analyze the following code function for security vulnerabilities
|
public long toLong(boolean truncateIfOverflow) {
// NOTE: Call sites should be guarded by fitsInLong(), like this:
// if (dq.fitsInLong()) { /* use dq.toLong() */ } else { /* use some fallback */ }
// Fallback behavior upon truncateIfOverflow is to truncate at 17 digits.
assert(truncateIfOverflow || fitsInLong());
long result = 0L;
int upperMagnitude = Math.min(scale + precision, lOptPos) - 1;
if (truncateIfOverflow) {
upperMagnitude = Math.min(upperMagnitude, 17);
}
for (int magnitude = upperMagnitude; magnitude >= 0; magnitude--) {
result = result * 10 + getDigitPos(magnitude - scale);
}
if (isNegative()) {
result = -result;
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toLong
File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
Repository: unicode-org/icu
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2018-18928
|
HIGH
| 7.5
|
unicode-org/icu
|
toLong
|
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
|
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setTags(String tags) {
this.tags = tags;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTags
File: src/main/java/cn/luischen/model/ContentDomain.java
Repository: WinterChenS/my-site
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29638
|
MEDIUM
| 5.4
|
WinterChenS/my-site
|
setTags
|
src/main/java/cn/luischen/model/ContentDomain.java
|
d104f38aaae2f1b76c33fadfcf6b1ef1c6c340ed
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void clearOrganizationIdForUser(int userHandle) {
Preconditions.checkCallAuthorization(
hasCallingOrSelfPermission(MANAGE_PROFILE_AND_DEVICE_OWNERS));
synchronized (getLockObject()) {
final ActiveAdmin owner = getDeviceOrProfileOwnerAdminLocked(userHandle);
owner.mOrganizationId = null;
owner.mEnrollmentSpecificId = null;
saveSettingsLocked(userHandle);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearOrganizationIdForUser
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
clearOrganizationIdForUser
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void finishKex() throws IOException
{
if (sessionId == null)
sessionId = kxs.H;
establishKeyMaterial();
/* Tell the other side that we start using the new material */
PacketNewKeys ign = new PacketNewKeys();
tm.sendKexMessage(ign.getPayload());
BlockCipher cbc;
MAC mac;
ICompressor comp;
try
{
cbc = BlockCipherFactory.createCipher(kxs.np.enc_algo_client_to_server, true, km.enc_key_client_to_server,
km.initial_iv_client_to_server);
mac = new HMAC(kxs.np.mac_algo_client_to_server, km.integrity_key_client_to_server);
comp = CompressionFactory.createCompressor(kxs.np.comp_algo_client_to_server);
}
catch (IllegalArgumentException e1)
{
throw new IOException("Fatal error during MAC startup!");
}
tm.changeSendCipher(cbc, mac);
tm.changeSendCompression(comp);
tm.kexFinished();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishKex
File: src/main/java/com/trilead/ssh2/transport/KexManager.java
Repository: connectbot/sshlib
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
connectbot/sshlib
|
finishKex
|
src/main/java/com/trilead/ssh2/transport/KexManager.java
|
5c8b534f6e97db7ac0e0e579331213aa25c173ab
| 0
|
Analyze the following code function for security vulnerabilities
|
public String toScientificString() {
StringBuilder sb = new StringBuilder();
toScientificString(sb);
return sb.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toScientificString
File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
Repository: unicode-org/icu
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2018-18928
|
HIGH
| 7.5
|
unicode-org/icu
|
toScientificString
|
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
|
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
| 0
|
Analyze the following code function for security vulnerabilities
|
protected final void pointNeighborsToThis() {
before.after = this;
after.before = this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pointNeighborsToThis
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-436",
"CWE-113"
] |
CVE-2022-41915
|
MEDIUM
| 6.5
|
netty
|
pointNeighborsToThis
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean useItem(BlockVector3 position, BaseItem item, Direction face) {
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
if (adapter != null) {
return adapter.simulateItemUse(getWorld(), position, item, face);
}
return false;
}
|
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: useItem
File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
Repository: IntellectualSites/FastAsyncWorldEdit
Fixed Code:
@Override
public boolean useItem(BlockVector3 position, BaseItem item, Direction face) {
//FAWE start - safe edit region
testCoords(position);
//FAWE end
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
if (adapter != null) {
return adapter.simulateItemUse(getWorld(), position, item, face);
}
return false;
}
|
[
"CWE-400"
] |
CVE-2023-35925
|
MEDIUM
| 5.5
|
IntellectualSites/FastAsyncWorldEdit
|
useItem
|
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
|
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
| 1
|
Analyze the following code function for security vulnerabilities
|
public void marshal(Object obj, HierarchicalStreamWriter writer) {
marshal(obj, writer, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: marshal
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
marshal
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (DBG) {
log("onActivityResult: requestCode: " + requestCode
+ ", resultCode: " + resultCode
+ ", data: " + data);
}
// there are cases where the contact picker may end up sending us more than one
// request. We want to ignore the request if we're not in the correct state.
if (requestCode == VOICEMAIL_PROVIDER_CFG_ID) {
boolean failure = false;
// No matter how the processing of result goes lets clear the flag
if (DBG) log("mVMProviderSettingsForced: " + mVMProviderSettingsForced);
final boolean isVMProviderSettingsForced = mVMProviderSettingsForced;
mVMProviderSettingsForced = false;
String vmNum = null;
if (resultCode != RESULT_OK) {
if (DBG) log("onActivityResult: vm provider cfg result not OK.");
failure = true;
} else {
if (data == null) {
if (DBG) log("onActivityResult: vm provider cfg result has no data");
failure = true;
} else {
if (data.getBooleanExtra(SIGNOUT_EXTRA, false)) {
if (DBG) log("Provider requested signout");
if (isVMProviderSettingsForced) {
if (DBG) log("Going back to previous provider on signout");
switchToPreviousVoicemailProvider();
} else {
final String victim = mVoicemailProviders.getKey();
if (DBG) log("Relaunching activity and ignoring " + victim);
Intent i = new Intent(ACTION_ADD_VOICEMAIL);
i.putExtra(IGNORE_PROVIDER_EXTRA, victim);
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
this.startActivity(i);
}
return;
}
vmNum = data.getStringExtra(VM_NUMBER_EXTRA);
if (vmNum == null || vmNum.length() == 0) {
if (DBG) log("onActivityResult: vm provider cfg result has no vmnum");
failure = true;
}
}
}
if (failure) {
if (DBG) log("Failure in return from voicemail provider.");
if (isVMProviderSettingsForced) {
switchToPreviousVoicemailProvider();
}
return;
}
mChangingVMorFwdDueToProviderChange = isVMProviderSettingsForced;
final String fwdNum = data.getStringExtra(FWD_NUMBER_EXTRA);
// TODO: It would be nice to load the current network setting for this and
// send it to the provider when it's config is invoked so it can use this as default
final int fwdNumTime = data.getIntExtra(FWD_NUMBER_TIME_EXTRA, 20);
if (DBG) log("onActivityResult: cfg result has forwarding number " + fwdNum);
saveVoiceMailAndForwardingNumber(mVoicemailProviders.getKey(),
new VoicemailProviderSettings(vmNum, fwdNum, fwdNumTime));
return;
}
if (requestCode == VOICEMAIL_PREF_ID) {
if (resultCode != RESULT_OK) {
if (DBG) log("onActivityResult: contact picker result not OK.");
return;
}
Cursor cursor = null;
try {
cursor = getContentResolver().query(data.getData(),
new String[] { CommonDataKinds.Phone.NUMBER }, null, null, null);
if ((cursor == null) || (!cursor.moveToFirst())) {
if (DBG) log("onActivityResult: bad contact data, no results found.");
return;
}
if (mSubMenuVoicemailSettings != null) {
mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0));
} else {
Log.w(LOG_TAG, "VoicemailSettingsActivity destroyed while setting contacts.");
}
return;
} finally {
if (cursor != null) {
cursor.close();
}
}
}
super.onActivityResult(requestCode, resultCode, data);
}
|
Vulnerability Classification:
- CWE: CWE-Other, CWE-862
- CVE: CVE-2023-35665
- Severity: HIGH
- CVSS Score: 7.8
Description: Fixed leak of cross user data in multiple settings.
- Any app is allowed to receive GET_CONTENT intent. Using this, an user puts back in the intent an uri with data of another user.
- Telephony service has INTERACT_ACROSS_USER permission. Using this, it reads and shows the deta to the evil user.
Fix: When telephony service gets the intent result, it checks if the uri is from the current user or not.
Bug: b/256591023 , b/256819787
Test: The malicious behaviour was not being reproduced. Unable to import contact from other users data.
Test2: Able to import contact from the primary user or uri with no user id
(These settings are not available for secondary users)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ab593467e900d4a6d25a34024a06195ae863f6dc)
Merged-In: I1e3a643f17948153aecc1d0df9ffd9619ad678c1
Change-Id: I1e3a643f17948153aecc1d0df9ffd9619ad678c1
Function: onActivityResult
File: src/com/android/phone/settings/VoicemailSettingsActivity.java
Repository: android
Fixed Code:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (DBG) {
log("onActivityResult: requestCode: " + requestCode
+ ", resultCode: " + resultCode
+ ", data: " + data);
}
// there are cases where the contact picker may end up sending us more than one
// request. We want to ignore the request if we're not in the correct state.
if (requestCode == VOICEMAIL_PROVIDER_CFG_ID) {
boolean failure = false;
// No matter how the processing of result goes lets clear the flag
if (DBG) log("mVMProviderSettingsForced: " + mVMProviderSettingsForced);
final boolean isVMProviderSettingsForced = mVMProviderSettingsForced;
mVMProviderSettingsForced = false;
String vmNum = null;
if (resultCode != RESULT_OK) {
if (DBG) log("onActivityResult: vm provider cfg result not OK.");
failure = true;
} else {
if (data == null) {
if (DBG) log("onActivityResult: vm provider cfg result has no data");
failure = true;
} else {
if (data.getBooleanExtra(SIGNOUT_EXTRA, false)) {
if (DBG) log("Provider requested signout");
if (isVMProviderSettingsForced) {
if (DBG) log("Going back to previous provider on signout");
switchToPreviousVoicemailProvider();
} else {
final String victim = mVoicemailProviders.getKey();
if (DBG) log("Relaunching activity and ignoring " + victim);
Intent i = new Intent(ACTION_ADD_VOICEMAIL);
i.putExtra(IGNORE_PROVIDER_EXTRA, victim);
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
this.startActivity(i);
}
return;
}
vmNum = data.getStringExtra(VM_NUMBER_EXTRA);
if (vmNum == null || vmNum.length() == 0) {
if (DBG) log("onActivityResult: vm provider cfg result has no vmnum");
failure = true;
}
}
}
if (failure) {
if (DBG) log("Failure in return from voicemail provider.");
if (isVMProviderSettingsForced) {
switchToPreviousVoicemailProvider();
}
return;
}
mChangingVMorFwdDueToProviderChange = isVMProviderSettingsForced;
final String fwdNum = data.getStringExtra(FWD_NUMBER_EXTRA);
// TODO: It would be nice to load the current network setting for this and
// send it to the provider when it's config is invoked so it can use this as default
final int fwdNumTime = data.getIntExtra(FWD_NUMBER_TIME_EXTRA, 20);
if (DBG) log("onActivityResult: cfg result has forwarding number " + fwdNum);
saveVoiceMailAndForwardingNumber(mVoicemailProviders.getKey(),
new VoicemailProviderSettings(vmNum, fwdNum, fwdNumTime));
return;
}
if (requestCode == VOICEMAIL_PREF_ID) {
if (resultCode != RESULT_OK) {
if (DBG) log("onActivityResult: contact picker result not OK.");
return;
}
Cursor cursor = null;
try {
// check if the URI returned by the user belongs to the user
final int currentUser = UserHandle.getUserId(Process.myUid());
if (currentUser
!= ContentProvider.getUserIdFromUri(data.getData(), currentUser)) {
if (DBG) {
log("onActivityResult: Contact data of different user, "
+ "cannot access");
}
return;
}
cursor = getContentResolver().query(data.getData(),
new String[] { CommonDataKinds.Phone.NUMBER }, null, null, null);
if ((cursor == null) || (!cursor.moveToFirst())) {
if (DBG) log("onActivityResult: bad contact data, no results found.");
return;
}
if (mSubMenuVoicemailSettings != null) {
mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0));
} else {
Log.w(LOG_TAG, "VoicemailSettingsActivity destroyed while setting contacts.");
}
return;
} finally {
if (cursor != null) {
cursor.close();
}
}
}
super.onActivityResult(requestCode, resultCode, data);
}
|
[
"CWE-Other",
"CWE-862"
] |
CVE-2023-35665
|
HIGH
| 7.8
|
android
|
onActivityResult
|
src/com/android/phone/settings/VoicemailSettingsActivity.java
|
674039e70e1c5bf29b808899ac80c709acc82290
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void loge(String s) {
Rlog.e(LOG_TAG, "[GsmSST] " + s);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loge
File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3831
|
MEDIUM
| 5
|
android
|
loge
|
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void requestScrollerTopPaddingUpdate(boolean animate) {
mNotificationStackScroller.updateTopPadding(calculateQsTopPadding(),
mAnimateNextTopPaddingChange || animate,
mKeyguardShowing
&& (mQsExpandImmediate || mIsExpanding && mQsExpandedWhenExpandingStarted));
mAnimateNextTopPaddingChange = false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestScrollerTopPaddingUpdate
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
requestScrollerTopPaddingUpdate
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void close(Throwable cause, boolean useDisconnectPacket)
{
if (!useDisconnectPacket)
{
/* OK, hard shutdown - do not aquire the semaphore,
* perhaps somebody is inside (and waits until the remote
* side is ready to accept new data). */
try
{
if (sock != null)
sock.close();
}
catch (IOException ignore)
{
}
/* OK, whoever tried to send data, should now agree that
* there is no point in further waiting =)
* It is safe now to aquire the semaphore.
*/
}
synchronized (connectionSemaphore)
{
if (!connectionClosed)
{
if (useDisconnectPacket)
{
try
{
byte[] msg = new PacketDisconnect(Packets.SSH_DISCONNECT_BY_APPLICATION, cause.getMessage(), "")
.getPayload();
if (tc != null)
tc.sendMessage(msg);
}
catch (IOException ignore)
{
}
try
{
if (sock != null)
sock.close();
}
catch (IOException ignore)
{
}
}
connectionClosed = true;
reasonClosedCause = cause; /* may be null */
}
connectionSemaphore.notifyAll();
}
/* No check if we need to inform the monitors */
Vector monitors = null;
synchronized (this)
{
/* Short term lock to protect "connectionMonitors"
* and "monitorsWereInformed"
* (they may be modified concurrently)
*/
if (!monitorsWereInformed)
{
monitorsWereInformed = true;
monitors = (Vector) connectionMonitors.clone();
}
}
if (monitors != null)
{
for (int i = 0; i < monitors.size(); i++)
{
try
{
ConnectionMonitor cmon = (ConnectionMonitor) monitors.elementAt(i);
cmon.connectionLost(reasonClosedCause);
}
catch (Exception ignore)
{
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: close
File: src/main/java/com/trilead/ssh2/transport/TransportManager.java
Repository: connectbot/sshlib
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
connectbot/sshlib
|
close
|
src/main/java/com/trilead/ssh2/transport/TransportManager.java
|
5c8b534f6e97db7ac0e0e579331213aa25c173ab
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean convertToTranslucent(IBinder token, ActivityOptions options) {
final long origId = Binder.clearCallingIdentity();
try {
synchronized (this) {
final ActivityRecord r = ActivityRecord.isInStackLocked(token);
if (r == null) {
return false;
}
int index = r.task.mActivities.lastIndexOf(r);
if (index > 0) {
ActivityRecord under = r.task.mActivities.get(index - 1);
under.returningOptions = options;
}
final boolean translucentChanged = r.changeWindowTranslucency(false);
if (translucentChanged) {
r.task.stack.convertActivityToTranslucent(r);
}
mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
mWindowManager.setAppFullscreen(token, false);
return translucentChanged;
}
} finally {
Binder.restoreCallingIdentity(origId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertToTranslucent
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
convertToTranslucent
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<HeaderBlock> getFilteredHeaders()
{
List<HeaderBlock> filteredHeaders = new ArrayList<HeaderBlock>();
// Get the maximum header level
int sectionDepth = 2;
XWikiContext context = getXWikiContext();
if (context != null) {
sectionDepth = (int) context.getWiki().getSectionEditingDepth();
}
// Get the headers.
//
// Note that we need to only take into account SectionBlock that are children of other SectionBlocks so that
// we are in sync with the section editing buttons added in xwiki.js. Being able to section edit any heading is
// too complex. For example if you have (in XWiki Syntax 2.0):
// = Heading1 =
// para1
// == Heading2 ==
// para2
// (((
// == Heading3 ==
// para3
// (((
// == Heading4 ==
// para4
// )))
// )))
// == Heading5 ==
// para5
//
// Then if we were to support editing "Heading4", its content would be:
// para4
// )))
// )))
//
// Which obviously is not correct...
final XDOM xdom = getXDOM();
if (!xdom.getChildren().isEmpty()) {
Block currentBlock = xdom.getChildren().get(0);
while (currentBlock != null) {
if (currentBlock instanceof SectionBlock) {
// The next children block is a HeaderBlock but we check to be on the safe side...
Block nextChildrenBlock = currentBlock.getChildren().get(0);
if (nextChildrenBlock instanceof HeaderBlock) {
HeaderBlock headerBlock = (HeaderBlock) nextChildrenBlock;
if (headerBlock.getLevel().getAsInt() <= sectionDepth) {
filteredHeaders.add(headerBlock);
}
}
currentBlock = nextChildrenBlock;
} else {
Block nextSibling = currentBlock.getNextSibling();
if (nextSibling == null) {
currentBlock = currentBlock.getParent();
while (currentBlock != null) {
if (currentBlock.getNextSibling() != null) {
currentBlock = currentBlock.getNextSibling();
break;
}
currentBlock = currentBlock.getParent();
}
} else {
currentBlock = nextSibling;
}
}
}
}
return filteredHeaders;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFilteredHeaders
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
|
getFilteredHeaders
|
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
|
@Nullable
public String getUsername() {
return username;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUsername
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/SlackNotifier.java
Repository: codecentric/spring-boot-admin
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2022-46166
|
CRITICAL
| 9.8
|
codecentric/spring-boot-admin
|
getUsername
|
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/SlackNotifier.java
|
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setZoomControlsDelegate(ZoomControlsDelegate zoomControlsDelegate) {
mZoomControlsDelegate = zoomControlsDelegate;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setZoomControlsDelegate
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
|
setZoomControlsDelegate
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setMountPath(String mountPath) {
final File mountFile = new File(mountPath);
final File monolithicFile = new File(mountFile, RES_FILE_NAME);
if (monolithicFile.exists()) {
packagePath = monolithicFile.getAbsolutePath();
if (isFwdLocked()) {
resourcePath = new File(mountFile, PUBLIC_RES_FILE_NAME).getAbsolutePath();
} else {
resourcePath = packagePath;
}
} else {
packagePath = mountFile.getAbsolutePath();
resourcePath = packagePath;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMountPath
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
setMountPath
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Mono<Tuple2<Set<String>, Set<String>>> getHintMessages(ActionConfiguration actionConfiguration,
DatasourceConfiguration datasourceConfiguration) {
return Mono.zip(Mono.just(getDatasourceHintMessages(datasourceConfiguration)),
Mono.just(getActionHintMessages(actionConfiguration, datasourceConfiguration)));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHintMessages
File: app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
Repository: appsmithorg/appsmith
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-38298
|
HIGH
| 8.8
|
appsmithorg/appsmith
|
getHintMessages
|
app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
|
c59351ef94f9780c2a1ffc991e29b9272ab9fe64
| 0
|
Analyze the following code function for security vulnerabilities
|
public Context getContext() {
return mContext;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContext
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
|
getContext
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public void startIncludeBuffer() {
this.outputStream.startIncludeBuffer();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startIncludeBuffer
File: src/java/winstone/WinstoneResponse.java
Repository: jenkinsci/winstone
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2011-4344
|
LOW
| 2.6
|
jenkinsci/winstone
|
startIncludeBuffer
|
src/java/winstone/WinstoneResponse.java
|
410ed3001d51c689cf59085b7417466caa2ded7b
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isEnabled() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
return mAdapterProperties.getState() == BluetoothAdapter.STATE_ON;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isEnabled
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
isEnabled
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
Rect getCompatFrame() {
return mWindowFrames.mCompatFrame;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCompatFrame
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
|
getCompatFrame
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
static int runGnuplot(final HttpQuery query,
final String basepath,
final Plot plot) throws IOException {
final int nplotted = plot.dumpToFiles(basepath);
final long start_time = System.nanoTime();
final Process gnuplot = new ProcessBuilder(GNUPLOT,
basepath + ".out", basepath + ".err", basepath + ".gnuplot").start();
final int rv;
try {
rv = gnuplot.waitFor(); // Couldn't find how to do this asynchronously.
} catch (InterruptedException e) {
Thread.currentThread().interrupt(); // Restore the interrupted status.
throw new IOException("interrupted", e); // I hate checked exceptions.
} finally {
// We need to always destroy() the Process, otherwise we "leak" file
// descriptors and pipes. Unless I'm blind, this isn't actually
// documented in the Javadoc of the !@#$%^ JDK, and in Java 6 there's no
// way to ask the stupid-ass ProcessBuilder to not create fucking pipes.
// I think when the GC kicks in the JVM may run some kind of a finalizer
// that closes the pipes, because I've never seen this issue on long
// running TSDs, except where ulimit -n was low (the default, 1024).
gnuplot.destroy();
}
gnuplotlatency.add((int) ((System.nanoTime() - start_time) / 1000000));
if (rv != 0) {
final byte[] stderr = readFile(query, new File(basepath + ".err"),
4096);
// Sometimes Gnuplot will error out but still create the file.
new File(basepath + ".png").delete();
if (stderr == null) {
throw new GnuplotException(rv);
}
throw new GnuplotException(new String(stderr));
}
// Remove the files for stderr/stdout if they're empty.
deleteFileIfEmpty(basepath + ".out");
deleteFileIfEmpty(basepath + ".err");
return nplotted;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: runGnuplot
File: src/tsd/GraphHandler.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2023-25826
|
CRITICAL
| 9.8
|
OpenTSDB/opentsdb
|
runGnuplot
|
src/tsd/GraphHandler.java
|
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN)
@RequiresPermission(value = MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS, conditional = true)
public void setPasswordExpirationTimeout(@Nullable ComponentName admin, long timeout) {
if (mService != null) {
try {
mService.setPasswordExpirationTimeout(
admin, mContext.getPackageName(), timeout, mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPasswordExpirationTimeout
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
setPasswordExpirationTimeout
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean storageManagerIsFileBasedEncryptionEnabled() {
return mInjector.storageManagerIsFileBasedEncryptionEnabled();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: storageManagerIsFileBasedEncryptionEnabled
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
|
storageManagerIsFileBasedEncryptionEnabled
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getProtocol() {
String protocol = this.protocol;
if (protocol == null) {
synchronized (OpenSslEngine.this) {
if (!isDestroyed()) {
protocol = SSL.getVersion(ssl);
} else {
protocol = StringUtil.EMPTY_STRING;
}
}
}
return protocol;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProtocol
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
|
getProtocol
|
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
|
bc8291c80912a39fbd2303e18476d15751af0bf1
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setClassLoader(ClassLoader classLoader) {
if (classLoader == null) {
throw new IllegalArgumentException(
"Can not set class loader to null");
}
this.classLoader = classLoader;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setClassLoader
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
|
setClassLoader
|
server/src/main/java/com/vaadin/server/VaadinService.java
|
d852126ab6f0c43f937239305bd0e9594834fe34
| 0
|
Analyze the following code function for security vulnerabilities
|
public CodeChallengeMethod findPkceMethod() {
init();
if (isDisablePkce()) {
return null;
}
if (getPkceMethod() == null) {
if (getProviderMetadata() == null) {
return null;
}
var methods = getProviderMetadata().getCodeChallengeMethods();
if (methods == null || methods.isEmpty()) {
return null;
}
if (methods.contains(CodeChallengeMethod.S256)) {
return CodeChallengeMethod.S256;
}
return methods.get(0);
}
return getPkceMethod();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findPkceMethod
File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
Repository: pac4j
The code follows secure coding practices.
|
[
"CWE-347"
] |
CVE-2021-44878
|
MEDIUM
| 5
|
pac4j
|
findPkceMethod
|
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
|
22b82ffd702a132d9f09da60362fc6264fc281ae
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setOverScrolling(boolean overscrolling) {
mStackScrollerOverscrolling = overscrolling;
if (mQs == null) return;
mQs.setOverscrolling(overscrolling);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOverScrolling
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
setOverScrolling
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void killAllBackgroundProcesses() {
if (checkCallingPermission(android.Manifest.permission.KILL_BACKGROUND_PROCESSES)
!= PackageManager.PERMISSION_GRANTED) {
final String msg = "Permission Denial: killAllBackgroundProcesses() from pid="
+ Binder.getCallingPid() + ", uid=" + Binder.getCallingUid()
+ " requires " + android.Manifest.permission.KILL_BACKGROUND_PROCESSES;
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
final long callingId = Binder.clearCallingIdentity();
try {
synchronized (this) {
// Allow memory level to go down (the flag needs to be set before updating oom adj)
// because this method is also used to simulate low memory.
mAppProfiler.setAllowLowerMemLevelLocked(true);
synchronized (mProcLock) {
mProcessList.killPackageProcessesLSP(null /* packageName */, -1 /* appId */,
UserHandle.USER_ALL, ProcessList.CACHED_APP_MIN_ADJ,
ApplicationExitInfo.REASON_USER_REQUESTED,
ApplicationExitInfo.SUBREASON_KILL_BACKGROUND,
"kill all background");
}
mAppProfiler.doLowMemReportIfNeededLocked(null);
}
} finally {
Binder.restoreCallingIdentity(callingId);
}
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-21266
- Severity: HIGH
- CVSS Score: 7.8
Description: DO NOT MERGE: ActivityManager#killBackgroundProcesses can kill caller's own app only
unless it's a system app.
Bug: 239423414
Bug: 223376078
Test: atest CtsAppTestCases:ActivityManagerTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:fa94ce5c7738e449cb6bd68c77af4858018e49e0)
Merged-In: Iac6baa889965b8ffecd9a43179a4c96632ad1d02
Change-Id: Iac6baa889965b8ffecd9a43179a4c96632ad1d02
Function: killAllBackgroundProcesses
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
Fixed Code:
@Override
public void killAllBackgroundProcesses() {
if (checkCallingPermission(android.Manifest.permission.KILL_BACKGROUND_PROCESSES)
!= PackageManager.PERMISSION_GRANTED) {
final String msg = "Permission Denial: killAllBackgroundProcesses() from pid="
+ Binder.getCallingPid() + ", uid=" + Binder.getCallingUid()
+ " requires " + android.Manifest.permission.KILL_BACKGROUND_PROCESSES;
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
final int callingUid = Binder.getCallingUid();
final int callingPid = Binder.getCallingPid();
ProcessRecord proc;
synchronized (mPidsSelfLocked) {
proc = mPidsSelfLocked.get(callingPid);
}
if (callingUid >= FIRST_APPLICATION_UID
&& (proc == null || !proc.info.isSystemApp())) {
final String msg = "Permission Denial: killAllBackgroundProcesses() from pid="
+ callingPid + ", uid=" + callingUid + " is not allowed";
Slog.w(TAG, msg);
// Silently return to avoid existing apps from crashing.
return;
}
final long callingId = Binder.clearCallingIdentity();
try {
synchronized (this) {
// Allow memory level to go down (the flag needs to be set before updating oom adj)
// because this method is also used to simulate low memory.
mAppProfiler.setAllowLowerMemLevelLocked(true);
synchronized (mProcLock) {
mProcessList.killPackageProcessesLSP(null /* packageName */, -1 /* appId */,
UserHandle.USER_ALL, ProcessList.CACHED_APP_MIN_ADJ,
ApplicationExitInfo.REASON_USER_REQUESTED,
ApplicationExitInfo.SUBREASON_KILL_BACKGROUND,
"kill all background");
}
mAppProfiler.doLowMemReportIfNeededLocked(null);
}
} finally {
Binder.restoreCallingIdentity(callingId);
}
}
|
[
"CWE-Other"
] |
CVE-2023-21266
|
HIGH
| 7.8
|
android
|
killAllBackgroundProcesses
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
5b7edbf2ba076b04000eb5d27101927eeb609c26
| 1
|
Analyze the following code function for security vulnerabilities
|
public boolean markGuestForDeletion(int userHandle) {
checkManageUsersPermission("Only the system can remove users");
if (getUserRestrictions(UserHandle.getCallingUserId()).getBoolean(
UserManager.DISALLOW_REMOVE_USER, false)) {
Log.w(LOG_TAG, "Cannot remove user. DISALLOW_REMOVE_USER is enabled.");
return false;
}
long ident = Binder.clearCallingIdentity();
try {
final UserInfo user;
synchronized (mPackagesLock) {
user = mUsers.get(userHandle);
if (userHandle == 0 || user == null || mRemovingUserIds.get(userHandle)) {
return false;
}
if (!user.isGuest()) {
return false;
}
// We set this to a guest user that is to be removed. This is a temporary state
// where we are allowed to add new Guest users, even if this one is still not
// removed. This user will still show up in getUserInfo() calls.
// If we don't get around to removing this Guest user, it will be purged on next
// startup.
user.guestToRemove = true;
// Mark it as disabled, so that it isn't returned any more when
// profiles are queried.
user.flags |= UserInfo.FLAG_DISABLED;
writeUserLocked(user);
}
} finally {
Binder.restoreCallingIdentity(ident);
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: markGuestForDeletion
File: services/core/java/com/android/server/pm/UserManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2457
|
LOW
| 2.1
|
android
|
markGuestForDeletion
|
services/core/java/com/android/server/pm/UserManagerService.java
|
12332e05f632794e18ea8c4ac52c98e82532e5db
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void reportKeyguardSecured(int userHandle) {
Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId");
final CallerIdentity caller = getCallerIdentity();
Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle));
Preconditions.checkCallAuthorization(hasCallingOrSelfPermission(BIND_DEVICE_ADMIN));
if (mInjector.securityLogIsLoggingEnabled()) {
SecurityLog.writeEvent(SecurityLog.TAG_KEYGUARD_SECURED);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reportKeyguardSecured
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
|
reportKeyguardSecured
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean process(byte value) throws Exception {
char nextByte = (char) (value & 0xFF);
if (nextByte == HttpConstants.CR) {
return true;
}
if (nextByte == HttpConstants.LF) {
return false;
}
if (++ size > maxLength) {
// TODO: Respond with Bad Request and discard the traffic
// or close the connection.
// No need to notify the upstream handlers - just log.
// If decoding a response, just throw an exception.
throw newException(maxLength);
}
seq.append(nextByte);
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: process
File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2019-16869
|
MEDIUM
| 5
|
netty
|
process
|
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
|
39cafcb05c99f2aa9fce7e6597664c9ed6a63a95
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean validateAzp(@NonNull JwtClaims claims,
@NonNull String clientId,
@NonNull List<String> audiences) {
if (audiences.size() < 2) {
if (LOG.isTraceEnabled()) {
LOG.trace("{} claim is not required for single audiences", AUTHORIZED_PARTY);
}
return true;
}
Optional<String> azpOptional = parseAzpClaim(claims);
if (!azpOptional.isPresent()) {
return false;
}
String azp = azpOptional.get();
boolean result = azp.equalsIgnoreCase(clientId);
if (!result && LOG.isTraceEnabled()) {
LOG.trace("{} claim does not match client id {}", AUTHORIZED_PARTY, clientId);
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateAzp
File: security-oauth2/src/main/java/io/micronaut/security/oauth2/client/IdTokenClaimsValidator.java
Repository: micronaut-projects/micronaut-security
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-36820
|
MEDIUM
| 6.5
|
micronaut-projects/micronaut-security
|
validateAzp
|
security-oauth2/src/main/java/io/micronaut/security/oauth2/client/IdTokenClaimsValidator.java
|
9728b925221a0d87798ccf250657a3c214b7e980
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void writeAttributeValue(Object value, ObjectDataOutput out) throws IOException {
Class<?> type = value.getClass();
if (type.equals(Boolean.class)) {
out.writeByte(PRIMITIVE_TYPE_BOOLEAN);
out.writeBoolean((Boolean) value);
} else if (type.equals(Byte.class)) {
out.writeByte(PRIMITIVE_TYPE_BYTE);
out.writeByte((Byte) value);
} else if (type.equals(Short.class)) {
out.writeByte(PRIMITIVE_TYPE_SHORT);
out.writeShort((Short) value);
} else if (type.equals(Integer.class)) {
out.writeByte(PRIMITIVE_TYPE_INTEGER);
out.writeInt((Integer) value);
} else if (type.equals(Long.class)) {
out.writeByte(PRIMITIVE_TYPE_LONG);
out.writeLong((Long) value);
} else if (type.equals(Float.class)) {
out.writeByte(PRIMITIVE_TYPE_FLOAT);
out.writeFloat((Float) value);
} else if (type.equals(Double.class)) {
out.writeByte(PRIMITIVE_TYPE_DOUBLE);
out.writeDouble((Double) value);
} else if (type.equals(String.class)) {
out.writeByte(PRIMITIVE_TYPE_UTF);
out.writeUTF((String) value);
} else {
throw new IllegalStateException("Illegal attribute type ID found");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeAttributeValue
File: hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
writeAttributeValue
|
hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public static byte[] shuffle(double[] input) throws IOException {
byte[] output = new byte[input.length * 8];
int numProcessed = impl.shuffle(input, 0, 8, input.length * 8, output, 0);
assert(numProcessed == input.length * 8);
return output;
}
|
Vulnerability Classification:
- CWE: CWE-190
- CVE: CVE-2023-34453
- Severity: HIGH
- CVSS Score: 7.5
Description: Merge pull request from GHSA-pqr6-cmr2-h8hf
* Fixed integer overflow by checking if multiplication result is smaller than original value
* Fixed integer overflow by checking if multiplication result is smaller than original value
* Fixed integer overflow by checking if multiplication result is smaller than original value
* imporved error messages and added happy and sad cases for unit test in SnappyTest.java
* switched SnappyError into ILLEGAL_ARGUMENT in SnappyErrorCode.java and Snappy.java
* wrote new and updated unit test methods
* updated comments in SnappyTest.java
* Fixed and updated unit tests in SnappyTest.java
Function: shuffle
File: src/main/java/org/xerial/snappy/BitShuffle.java
Repository: xerial/snappy-java
Fixed Code:
public static byte[] shuffle(double[] input) throws IOException {
if (input.length * 8 < input.length) {
throw new SnappyError(SnappyErrorCode.TOO_LARGE_INPUT, "input array size is too large: " + input.length);
}
byte[] output = new byte[input.length * 8];
int numProcessed = impl.shuffle(input, 0, 8, input.length * 8, output, 0);
assert(numProcessed == input.length * 8);
return output;
}
|
[
"CWE-190"
] |
CVE-2023-34453
|
HIGH
| 7.5
|
xerial/snappy-java
|
shuffle
|
src/main/java/org/xerial/snappy/BitShuffle.java
|
820e2e074c58748b41dbd547f4edba9e108ad905
| 1
|
Analyze the following code function for security vulnerabilities
|
public void agentConnected(String packageName, IBinder agentBinder) {
synchronized(mAgentConnectLock) {
if (Binder.getCallingUid() == Process.SYSTEM_UID) {
Slog.d(TAG, "agentConnected pkg=" + packageName + " agent=" + agentBinder);
IBackupAgent agent = IBackupAgent.Stub.asInterface(agentBinder);
mConnectedAgent = agent;
mConnecting = false;
} else {
Slog.w(TAG, "Non-system process uid=" + Binder.getCallingUid()
+ " claiming agent connected");
}
mAgentConnectLock.notifyAll();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: agentConnected
File: services/backup/java/com/android/server/backup/BackupManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3759
|
MEDIUM
| 5
|
android
|
agentConnected
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(
value = android.Manifest.permission.READ_NEARBY_STREAMING_POLICY,
conditional = true)
public @NearbyStreamingPolicy int getNearbyNotificationStreamingPolicy() {
return getNearbyNotificationStreamingPolicy(myUserId());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNearbyNotificationStreamingPolicy
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getNearbyNotificationStreamingPolicy
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void updatePermissionFlagsForAllApps(int flagMask, int flagValues, int userId) {
if (!sUserManager.exists(userId)) {
return;
}
enforceGrantRevokeRuntimePermissionPermissions("updatePermissionFlagsForAllApps");
enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false,
"updatePermissionFlagsForAllApps");
// Only the system can change system fixed flags.
if (getCallingUid() != Process.SYSTEM_UID) {
flagMask &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED;
flagValues &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED;
}
synchronized (mPackages) {
boolean changed = false;
final int packageCount = mPackages.size();
for (int pkgIndex = 0; pkgIndex < packageCount; pkgIndex++) {
final PackageParser.Package pkg = mPackages.valueAt(pkgIndex);
SettingBase sb = (SettingBase) pkg.mExtras;
if (sb == null) {
continue;
}
PermissionsState permissionsState = sb.getPermissionsState();
changed |= permissionsState.updatePermissionFlagsForAllPermissions(
userId, flagMask, flagValues);
}
if (changed) {
mSettings.writeRuntimePermissionsForUserLPr(userId, false);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updatePermissionFlagsForAllApps
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
updatePermissionFlagsForAllApps
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
private ApplicationErrorReport createAppErrorReportLocked(ProcessRecord r,
long timeMillis, ApplicationErrorReport.CrashInfo crashInfo) {
if (r.errorReportReceiver == null) {
return null;
}
if (!r.crashing && !r.notResponding && !r.forceCrashReport) {
return null;
}
ApplicationErrorReport report = new ApplicationErrorReport();
report.packageName = r.info.packageName;
report.installerPackageName = r.errorReportReceiver.getPackageName();
report.processName = r.processName;
report.time = timeMillis;
report.systemApp = (r.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
if (r.crashing || r.forceCrashReport) {
report.type = ApplicationErrorReport.TYPE_CRASH;
report.crashInfo = crashInfo;
} else if (r.notResponding) {
report.type = ApplicationErrorReport.TYPE_ANR;
report.anrInfo = new ApplicationErrorReport.AnrInfo();
report.anrInfo.activity = r.notRespondingReport.tag;
report.anrInfo.cause = r.notRespondingReport.shortMsg;
report.anrInfo.info = r.notRespondingReport.longMsg;
}
return report;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createAppErrorReportLocked
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
|
createAppErrorReportLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void initClassMethod(Set<Class<?>> classesList) {
for (Class clazz : classesList) {
initClassMethod(clazz);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initClassMethod
File: core/src/main/java/com/alibaba/nacos/core/code/ControllerMethodsCache.java
Repository: alibaba/nacos
The code follows secure coding practices.
|
[
"CWE-290"
] |
CVE-2021-29441
|
HIGH
| 7.5
|
alibaba/nacos
|
initClassMethod
|
core/src/main/java/com/alibaba/nacos/core/code/ControllerMethodsCache.java
|
91d16023d91ea21a5e58722c751485a0b9bbeeb3
| 0
|
Analyze the following code function for security vulnerabilities
|
public String expandRefSpec() {
return RefSpecHelper.expandRefSpec(branch);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: expandRefSpec
File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
expandRefSpec
|
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public XMLBuilder2 importXMLBuilder(BaseXMLBuilder builder) {
super.importXMLBuilderImpl(builder);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: importXMLBuilder
File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
importXMLBuilder
|
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
static int computeResolveFilterUid(int customCallingUid, int actualCallingUid,
int filterCallingUid) {
return filterCallingUid != UserHandle.USER_NULL
? filterCallingUid
: (customCallingUid >= 0 ? customCallingUid : actualCallingUid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: computeResolveFilterUid
File: services/core/java/com/android/server/wm/ActivityStarter.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-269"
] |
CVE-2023-21269
|
HIGH
| 7.8
|
android
|
computeResolveFilterUid
|
services/core/java/com/android/server/wm/ActivityStarter.java
|
70ec64dc5a2a816d6aa324190a726a85fd749b30
| 0
|
Analyze the following code function for security vulnerabilities
|
public Class toRestClass(URI baseUri, com.xpn.xwiki.api.Class xwikiClass)
{
Class clazz = this.objectFactory.createClass();
clazz.setId(xwikiClass.getName());
clazz.setName(xwikiClass.getName());
DocumentReference reference = xwikiClass.getReference();
String wikiName = reference.getWikiReference().getName();
for (java.lang.Object xwikiPropertyClassObject : xwikiClass.getProperties()) {
PropertyClass xwikiPropertyClass = (PropertyClass) xwikiPropertyClassObject;
Property property = this.objectFactory.createProperty();
property.setName(xwikiPropertyClass.getName());
property.setType(xwikiPropertyClass.getxWikiClass().getName());
for (java.lang.Object xwikiPropertyObject : xwikiPropertyClass.getProperties()) {
com.xpn.xwiki.api.Property xwikiProperty = (com.xpn.xwiki.api.Property) xwikiPropertyObject;
java.lang.Object value = xwikiProperty.getValue();
Attribute attribute = this.objectFactory.createAttribute();
attribute.setName(xwikiProperty.getName());
if (value != null) {
attribute.setValue(value.toString());
} else {
attribute.setValue("");
}
property.getAttributes().add(attribute);
}
String propertyUri = Utils.createURI(baseUri, ClassPropertyResource.class, wikiName, xwikiClass.getName(),
xwikiPropertyClass.getName()).toString();
Link propertyLink = this.objectFactory.createLink();
propertyLink.setHref(propertyUri);
propertyLink.setRel(Relations.SELF);
property.getLinks().add(propertyLink);
clazz.getProperties().add(property);
}
String classUri = Utils.createURI(baseUri, ClassResource.class, wikiName, xwikiClass.getName()).toString();
Link classLink = this.objectFactory.createLink();
classLink.setHref(classUri);
classLink.setRel(Relations.SELF);
clazz.getLinks().add(classLink);
String propertiesUri =
Utils.createURI(baseUri, ClassPropertiesResource.class, wikiName, xwikiClass.getName()).toString();
Link propertyLink = this.objectFactory.createLink();
propertyLink.setHref(propertiesUri);
propertyLink.setRel(Relations.PROPERTIES);
clazz.getLinks().add(propertyLink);
String objectsUri =
Utils.createURI(baseUri, AllObjectsForClassNameResource.class, wikiName, xwikiClass.getName()).toString();
Link objectsLink = this.objectFactory.createLink();
objectsLink.setHref(objectsUri);
objectsLink.setRel(Relations.OBJECTS);
clazz.getLinks().add(objectsLink);
return clazz;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toRestClass
File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-35151
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
toRestClass
|
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
|
824cd742ecf5439971247da11bfe7e0ad2b10ede
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void cacheResult(KBTemplate kbTemplate) {
entityCache.putResult(KBTemplateModelImpl.ENTITY_CACHE_ENABLED,
KBTemplateImpl.class, kbTemplate.getPrimaryKey(), kbTemplate);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
new Object[] { kbTemplate.getUuid(), kbTemplate.getGroupId() },
kbTemplate);
kbTemplate.resetOriginalValues();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cacheResult
File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
Repository: brianchandotcom/liferay-portal
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2017-12647
|
MEDIUM
| 4.3
|
brianchandotcom/liferay-portal
|
cacheResult
|
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
|
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_CERTIFICATES, conditional = true)
public boolean installKeyPair(@Nullable ComponentName admin, @NonNull PrivateKey privKey,
@NonNull Certificate[] certs, @NonNull String alias, boolean requestAccess) {
int flags = INSTALLKEY_SET_USER_SELECTABLE;
if (requestAccess) {
flags |= INSTALLKEY_REQUEST_CREDENTIALS_ACCESS;
}
return installKeyPair(admin, privKey, certs, alias, flags);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: installKeyPair
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
installKeyPair
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private CompletableFuture<Void> updatePartitionedTopic(TopicName topicName, int numPartitions) {
final String path = ZkAdminPaths.partitionedTopicPath(topicName);
CompletableFuture<Void> updatePartition = new CompletableFuture<>();
createSubscriptions(topicName, numPartitions).thenAccept(res -> {
try {
namespaceResources().getPartitionedTopicResources().set(path,
p -> new PartitionedTopicMetadata(numPartitions));
updatePartition.complete(null);
} catch (Exception e) {
getPartitionedTopicMetadataAsync(topicName, false, false).thenAccept(metadata -> {
int oldPartition = metadata.partitions;
for (int i = oldPartition; i < numPartitions; i++) {
String managedLedgerPath = ZkAdminPaths.managedLedgerPath(topicName.getPartition(i));
namespaceResources().getPartitionedTopicResources()
.deleteAsync(managedLedgerPath).exceptionally(ex1 -> {
log.warn("[{}] Failed to clean up managedLedger znode {}", clientAppId(),
managedLedgerPath, ex1.getCause());
return null;
});
}
}).exceptionally(ex -> {
log.warn("[{}] Failed to clean up managedLedger znode", clientAppId(), ex.getCause());
return null;
});
updatePartition.completeExceptionally(e);
}
}).exceptionally(ex -> {
updatePartition.completeExceptionally(ex);
return null;
});
return updatePartition;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updatePartitionedTopic
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
updatePartitionedTopic
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void openConversationForBookmark(int position) {
Bookmark bookmark = (Bookmark) conferences.get(position);
openConversationsForBookmark(bookmark);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: openConversationForBookmark
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
openConversationForBookmark
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public JavaType getContentType() { return null; }
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContentType
File: src/main/java/com/fasterxml/jackson/databind/JavaType.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
getContentType
|
src/main/java/com/fasterxml/jackson/databind/JavaType.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String decodePassword(String password) throws Exception {
String key = AES.getSecretKey();
if(key != null){
SecretKey sk = AES.getSecretKeyObject(key);
String decoded = AES.decryptPassword(password, sk);
return decoded;
}
/* no key , so nothing to decode */
return password;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: decodePassword
File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
decodePassword
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public Set<String> getRestrictedVariables() {
return Collections.emptySet();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRestrictedVariables
File: portal-impl/src/com/liferay/portal/template/TemplateContextHelper.java
Repository: samuelkong/liferay-portal
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2963
|
MEDIUM
| 4.3
|
samuelkong/liferay-portal
|
getRestrictedVariables
|
portal-impl/src/com/liferay/portal/template/TemplateContextHelper.java
|
5db1f7622e8e2c9a559ef0145a0f04c5854a1e8b
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isDeviceOwnerAppOnAnyUserInner(String packageName, boolean callingUserOnly) {
if (packageName == null) {
return false;
}
final ComponentName deviceOwner = getDeviceOwnerComponentInner(callingUserOnly);
if (deviceOwner == null) {
return false;
}
return packageName.equals(deviceOwner.getPackageName());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDeviceOwnerAppOnAnyUserInner
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
isDeviceOwnerAppOnAnyUserInner
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public Intent getDataManagementIntent(String transportName) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"getDataManagementIntent");
synchronized (mTransports) {
final IBackupTransport transport = mTransports.get(transportName);
if (transport != null) {
try {
final Intent intent = transport.dataManagementIntent();
if (MORE_DEBUG) Slog.d(TAG, "getDataManagementIntent() returning intent "
+ intent);
return intent;
} catch (RemoteException e) {
/* fall through to return null */
}
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDataManagementIntent
File: services/backup/java/com/android/server/backup/BackupManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3759
|
MEDIUM
| 5
|
android
|
getDataManagementIntent
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isSelectActionBarShowing() {
return mActionMode != null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSelectActionBarShowing
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
|
isSelectActionBarShowing
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@GetMapping("/register")
public String register() {
User user = getUser();
if (user != null) return redirect("/");
return render("register");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: register
File: src/main/java/co/yiiu/pybbs/controller/front/IndexController.java
Repository: atjiu/pybbs
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-23391
|
MEDIUM
| 4.3
|
atjiu/pybbs
|
register
|
src/main/java/co/yiiu/pybbs/controller/front/IndexController.java
|
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void dispatchMockRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException {
final DefaultByteBufferPool bufferPool = new DefaultByteBufferPool(false, 1024, 0, 0);
MockServerConnection connection = new MockServerConnection(bufferPool);
HttpServerExchange exchange = new HttpServerExchange(connection);
exchange.setRequestScheme(request.getScheme());
exchange.setRequestMethod(new HttpString(request.getMethod()));
exchange.setProtocol(Protocols.HTTP_1_0);
exchange.setResolvedPath(request.getContextPath());
String relative;
if (request.getPathInfo() == null) {
relative = request.getServletPath();
} else {
relative = request.getServletPath() + request.getPathInfo();
}
exchange.setRelativePath(relative);
final ServletPathMatch info = paths.getServletHandlerByPath(request.getServletPath());
final HttpServletResponseImpl oResponse = new HttpServletResponseImpl(exchange, servletContext);
final HttpServletRequestImpl oRequest = new HttpServletRequestImpl(exchange, servletContext);
final ServletRequestContext servletRequestContext = new ServletRequestContext(servletContext.getDeployment(), oRequest, oResponse, info);
servletRequestContext.setServletRequest(request);
servletRequestContext.setServletResponse(response);
//set the max request size if applicable
if (info.getServletChain().getManagedServlet().getMaxRequestSize() > 0) {
exchange.setMaxEntitySize(info.getServletChain().getManagedServlet().getMaxRequestSize());
}
exchange.putAttachment(ServletRequestContext.ATTACHMENT_KEY, servletRequestContext);
exchange.startBlocking(new ServletBlockingHttpExchange(exchange));
servletRequestContext.setServletPathMatch(info);
try {
dispatchRequest(exchange, servletRequestContext, info.getServletChain(), DispatcherType.REQUEST);
} catch (Exception e) {
if (e instanceof RuntimeException) {
throw (RuntimeException) e;
}
throw new ServletException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dispatchMockRequest
File: servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2019-10184
|
MEDIUM
| 5
|
undertow-io/undertow
|
dispatchMockRequest
|
servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
|
d2715e3afa13f50deaa19643676816ce391551e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CertDataInfo other = (CertDataInfo) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (issuedBy == null) {
if (other.issuedBy != null)
return false;
} else if (!issuedBy.equals(other.issuedBy))
return false;
if (issuedOn == null) {
if (other.issuedOn != null)
return false;
} else if (!issuedOn.equals(other.issuedOn))
return false;
if (keyAlgorithmOID == null) {
if (other.keyAlgorithmOID != null)
return false;
} else if (!keyAlgorithmOID.equals(other.keyAlgorithmOID))
return false;
if (keyLength == null) {
if (other.keyLength != null)
return false;
} else if (!keyLength.equals(other.keyLength))
return false;
if (notValidAfter == null) {
if (other.notValidAfter != null)
return false;
} else if (!notValidAfter.equals(other.notValidAfter))
return false;
if (notValidBefore == null) {
if (other.notValidBefore != null)
return false;
} else if (!notValidBefore.equals(other.notValidBefore))
return false;
if (status == null) {
if (other.status != null)
return false;
} else if (!status.equals(other.status))
return false;
if (subjectDN == null) {
if (other.subjectDN != null)
return false;
} else if (!subjectDN.equals(other.subjectDN))
return false;
if (issuerDN == null) {
if (other.issuerDN != null) return false;
} else if (!issuerDN.equals(other.issuerDN)) {
return false;
}
if (type == null) {
if (other.type != null)
return false;
} else if (!type.equals(other.type))
return false;
if (version == null) {
if (other.version != null)
return false;
} else if (!version.equals(other.version))
return false;
if (revokedOn == null) {
if (other.revokedOn != null)
return false;
} else if (!revokedOn.equals(other.revokedOn))
return false;
if (revokedBy == null) {
if (other.revokedBy != null)
return false;
} else if (!revokedBy.equals(other.revokedBy))
return false;
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: equals
File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
equals
|
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public String displayPrettyName(String fieldname, boolean showMandatory, boolean before, BaseObject obj,
XWikiContext context)
{
try {
PropertyClass pclass = (PropertyClass) obj.getXClass(context).get(fieldname);
String dprettyName = "";
if (showMandatory) {
dprettyName = context.getWiki().addMandatory(context);
}
if (before) {
return dprettyName + pclass.getPrettyName(context);
} else {
return pclass.getPrettyName(context) + dprettyName;
}
} catch (Exception e) {
return "";
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: displayPrettyName
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
|
displayPrettyName
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
public static char[] uncompressCharArray(byte[] input, int offset, int length)
throws IOException
{
int uncompressedLength = Snappy.uncompressedLength(input, offset, length);
char[] result = new char[uncompressedLength / 2];
impl.rawUncompress(input, offset, length, result, 0);
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uncompressCharArray
File: src/main/java/org/xerial/snappy/Snappy.java
Repository: xerial/snappy-java
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2023-34454
|
HIGH
| 7.5
|
xerial/snappy-java
|
uncompressCharArray
|
src/main/java/org/xerial/snappy/Snappy.java
|
d0042551e4a3509a725038eb9b2ad1f683674d94
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean scanAttribute(XMLAttributesImpl attributes,
boolean[] empty)
throws IOException {
return scanAttribute(attributes,empty,'/');
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scanAttribute
File: src/org/cyberneko/html/HTMLScanner.java
Repository: sparklemotion/nekohtml
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-24839
|
MEDIUM
| 5
|
sparklemotion/nekohtml
|
scanAttribute
|
src/org/cyberneko/html/HTMLScanner.java
|
a800fce3b079def130ed42a408ff1d09f89e773d
| 0
|
Analyze the following code function for security vulnerabilities
|
public HashMap<String, String> getFields() {
return mFields;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFields
File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3897
|
MEDIUM
| 4.3
|
android
|
getFields
|
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
|
81be4e3aac55305cbb5c9d523cf5c96c66604b39
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void closeSystemDialogs(String reason) {
enforceNotIsolatedCaller("closeSystemDialogs");
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
if (!checkCanCloseSystemDialogs(pid, uid, null)) {
return;
}
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
// Only allow this from foreground processes, so that background
// applications can't abuse it to prevent system UI from being shown.
if (uid >= FIRST_APPLICATION_UID) {
final WindowProcessController proc = mProcessMap.getProcess(pid);
if (!proc.isPerceptible()) {
Slog.w(TAG, "Ignoring closeSystemDialogs " + reason
+ " from background process " + proc);
return;
}
}
mWindowManager.closeSystemDialogs(reason);
mRootWindowContainer.closeSystemDialogActivities(reason);
}
// Call into AM outside the synchronized block.
mAmInternal.broadcastCloseSystemDialogs(reason);
} finally {
Binder.restoreCallingIdentity(origId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: closeSystemDialogs
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
|
closeSystemDialogs
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getIccSerialNumber() {
return getIccSerialNumberForSubscriber(getDefaultSubscription());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIccSerialNumber
File: src/java/com/android/internal/telephony/PhoneSubInfoController.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-0831
|
MEDIUM
| 4.3
|
android
|
getIccSerialNumber
|
src/java/com/android/internal/telephony/PhoneSubInfoController.java
|
79eecef63f3ea99688333c19e22813f54d4a31b1
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void updateRolesOfUser(String serverURL, String adminUsername,
String adminPassword, String userName, String role) throws Exception {
String url = serverURL + "UserAdmin";
UserAdminStub userAdminStub = new UserAdminStub(url);
CarbonUtils.setBasicAccessSecurityHeaders(adminUsername, adminPassword, userAdminStub._getServiceClient());
FlaggedName[] flaggedNames = userAdminStub.getRolesOfUser(userName, "*", -1);
List<String> roles = new ArrayList<String>();
if (flaggedNames != null) {
for (int i = 0; i < flaggedNames.length; i++) {
if (flaggedNames[i].getSelected()) {
roles.add(flaggedNames[i].getItemName());
}
}
}
roles.add(role);
userAdminStub.updateRolesOfUser(userName, roles.toArray(new String[roles.size()]));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateRolesOfUser
File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
Repository: wso2/carbon-apimgt
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2018-20736
|
LOW
| 3.5
|
wso2/carbon-apimgt
|
updateRolesOfUser
|
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
|
490f2860822f89d745b7c04fa9570bd86bef4236
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<OraclePackage> getAllPackages(OBridgeConfiguration c) {
List<OraclePackage> allPackage = getAllRealOraclePackage(c);
allPackage.add(getAllStandaloneProcedureAndFunction());
return allPackage;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllPackages
File: obridge-main/src/main/java/org/obridge/dao/ProcedureDao.java
Repository: karsany/obridge
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2018-25075
|
MEDIUM
| 4
|
karsany/obridge
|
getAllPackages
|
obridge-main/src/main/java/org/obridge/dao/ProcedureDao.java
|
52eca4ad05f3c292aed3178b2f58977686ffa376
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean updateLastConnectUid(int networkId, int uid) {
if (mVerboseLoggingEnabled) {
Log.v(TAG, "Update network last connect UID for " + networkId);
}
if (!mWifiPermissionsUtil.doesUidBelongToCurrentUserOrDeviceOwner(uid)) {
Log.e(TAG, "UID " + uid + " not visible to the current user");
return false;
}
WifiConfiguration config = getInternalConfiguredNetwork(networkId);
if (config == null) {
return false;
}
config.lastConnectUid = uid;
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateLastConnectUid
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
|
updateLastConnectUid
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setAppCallback(IAppCallback callback) {
NfcPermissions.enforceUserPermissions(mContext);
// don't allow Beam for managed profiles, or devices with a device owner or policy owner
UserInfo userInfo = mUserManager.getUserInfo(UserHandle.getCallingUserId());
if(!mUserManager.hasUserRestriction(
UserManager.DISALLOW_OUTGOING_BEAM, userInfo.getUserHandle())) {
mP2pLinkManager.setNdefCallback(callback, Binder.getCallingUid());
} else if (DBG) {
Log.d(TAG, "Disabling default Beam behavior");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAppCallback
File: src/com/android/nfc/NfcService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3761
|
LOW
| 2.1
|
android
|
setAppCallback
|
src/com/android/nfc/NfcService.java
|
9ea802b5456a36f1115549b645b65c791eff3c2c
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean enableCompressedPackage(AndroidPackage stubPkg,
@NonNull PackageSetting stubPkgSetting) {
final int parseFlags = mPm.getDefParseFlags() | ParsingPackageUtils.PARSE_CHATTY
| ParsingPackageUtils.PARSE_ENFORCE_CODE;
synchronized (mPm.mInstallLock) {
final AndroidPackage pkg;
try (PackageFreezer freezer =
mPm.freezePackage(stubPkg.getPackageName(), "setEnabledSetting")) {
pkg = installStubPackageLI(stubPkg, parseFlags, 0 /*scanFlags*/);
mAppDataHelper.prepareAppDataAfterInstallLIF(pkg);
synchronized (mPm.mLock) {
try {
mSharedLibraries.updateSharedLibrariesLPw(
pkg, stubPkgSetting, null, null,
Collections.unmodifiableMap(mPm.mPackages));
} catch (PackageManagerException e) {
Slog.w(TAG, "updateAllSharedLibrariesLPw failed: ", e);
}
mPm.mPermissionManager.onPackageInstalled(pkg,
Process.INVALID_UID /* previousAppId */,
PermissionManagerServiceInternal.PackageInstalledParams.DEFAULT,
UserHandle.USER_ALL);
mPm.writeSettingsLPrTEMP();
// Since compressed package can be system app only, we do not need to
// set restricted settings on it.
}
} catch (PackageManagerException e) {
// Whoops! Something went very wrong; roll back to the stub and disable the package
try (PackageFreezer freezer =
mPm.freezePackage(stubPkg.getPackageName(), "setEnabledSetting")) {
synchronized (mPm.mLock) {
// NOTE: Ensure the system package is enabled; even for a compressed stub.
// If we don't, installing the system package fails during scan
mPm.mSettings.enableSystemPackageLPw(stubPkg.getPackageName());
}
installPackageFromSystemLIF(stubPkg.getPath(),
mPm.mUserManager.getUserIds() /*allUserHandles*/,
null /*origUserHandles*/,
true /*writeSettings*/);
} catch (PackageManagerException pme) {
// Serious WTF; we have to be able to install the stub
Slog.wtf(TAG, "Failed to restore system package:" + stubPkg.getPackageName(),
pme);
} finally {
// Disable the package; the stub by itself is not runnable
synchronized (mPm.mLock) {
final PackageSetting stubPs = mPm.mSettings.getPackageLPr(
stubPkg.getPackageName());
if (stubPs != null) {
stubPs.setEnabled(COMPONENT_ENABLED_STATE_DISABLED,
UserHandle.USER_SYSTEM, "android");
}
mPm.writeSettingsLPrTEMP();
}
}
return false;
}
mAppDataHelper.clearAppDataLIF(pkg, UserHandle.USER_ALL,
FLAG_STORAGE_DE | FLAG_STORAGE_CE | FLAG_STORAGE_EXTERNAL
| Installer.FLAG_CLEAR_CODE_CACHE_ONLY);
mDexManager.notifyPackageUpdated(pkg.getPackageName(),
pkg.getBaseApkPath(), pkg.getSplitCodePaths());
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enableCompressedPackage
File: services/core/java/com/android/server/pm/InstallPackageHelper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21257
|
HIGH
| 7.8
|
android
|
enableCompressedPackage
|
services/core/java/com/android/server/pm/InstallPackageHelper.java
|
1aec7feaf07e6d4568ca75d18158445dbeac10f6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void acceptRingingCall(String packageName) {
try {
Log.startSession("TSI.aRC", Log.getPackageAbbreviation(packageName));
synchronized (mLock) {
if (!enforceAnswerCallPermission(packageName, Binder.getCallingUid())) return;
long token = Binder.clearCallingIdentity();
try {
acceptRingingCallInternal(DEFAULT_VIDEO_STATE, packageName);
} finally {
Binder.restoreCallingIdentity(token);
}
}
} finally {
Log.endSession();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: acceptRingingCall
File: src/com/android/server/telecom/TelecomServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21394
|
MEDIUM
| 5.5
|
android
|
acceptRingingCall
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
68dca62035c49e14ad26a54f614199cb29a3393f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateAgentUrl(String pRequestUrl, String pServletPath, boolean pIsAuthenticated) {
String url = getBaseUrl(pRequestUrl, pServletPath);
backendManager.getAgentDetails().updateAgentParameters(url,pIsAuthenticated);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateAgentUrl
File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java
Repository: jolokia
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2014-0168
|
MEDIUM
| 6.8
|
jolokia
|
updateAgentUrl
|
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
|
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean canGrantPermission(CallerIdentity caller, String permission,
String targetPackageName) {
boolean isPostQAdmin = getTargetSdk(caller.getPackageName(), caller.getUserId())
>= android.os.Build.VERSION_CODES.Q;
if (!isPostQAdmin) {
// Legacy admins assume that they cannot control pre-M apps
if (getTargetSdk(targetPackageName, caller.getUserId())
< android.os.Build.VERSION_CODES.M) {
return false;
}
}
if (!isRuntimePermission(permission)) {
return false;
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canGrantPermission
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
canGrantPermission
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private Object readCyclicReference() throws InvalidObjectException, IOException {
return registeredObjectRead(readNewHandle());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readCyclicReference
File: luni/src/main/java/java/io/ObjectInputStream.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
readCyclicReference
|
luni/src/main/java/java/io/ObjectInputStream.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public String resolveDriverClassName(File driverFile) {
JarFile jarFile = null;
try {
jarFile = new JarFile(driverFile);
} catch (IOException e) {
log.error("resolve driver class name error", e);
throw DomainErrors.DRIVER_CLASS_NOT_FOUND.exception(e.getMessage());
}
final JarFile driverJar = jarFile;
String driverClassName = jarFile.stream()
.filter(entry -> entry.getName().contains("META-INF/services/java.sql.Driver"))
.findFirst()
.map(entry -> {
InputStream stream = null;
BufferedReader reader = null;
try {
stream = driverJar.getInputStream(entry);
reader = new BufferedReader(new InputStreamReader(stream));
return reader.readLine();
} catch (IOException e) {
log.error("resolve driver class name error", e);
throw DomainErrors.DRIVER_CLASS_NOT_FOUND.exception(e.getMessage());
} finally {
IOUtils.closeQuietly(reader, ex -> log.error("close reader error", ex));
}
})
.orElseThrow(DomainErrors.DRIVER_CLASS_NOT_FOUND::exception);
IOUtils.closeQuietly(jarFile, ex -> log.error("close jar file error", ex));
return driverClassName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resolveDriverClassName
File: core/src/main/java/com/databasir/core/infrastructure/driver/DriverResources.java
Repository: vran-dev/databasir
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-31196
|
HIGH
| 7.5
|
vran-dev/databasir
|
resolveDriverClassName
|
core/src/main/java/com/databasir/core/infrastructure/driver/DriverResources.java
|
226c20e0c9124037671a91d6b3e5083bd2462058
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getHeadsUpBaseLayoutResource() {
return R.layout.notification_template_material_heads_up_base;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHeadsUpBaseLayoutResource
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
getHeadsUpBaseLayoutResource
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void closeQuietly(@Nullable FileDescriptor fd) {
if (fd == null) return;
try {
Os.close(fd);
} catch (ErrnoException ignored) {
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: closeQuietly
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
closeQuietly
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Analyze the following code function for security vulnerabilities
|
protected PersistentTopicInternalStats internalGetInternalStats(boolean authoritative, boolean metadata) {
if (topicName.isGlobal()) {
validateGlobalNamespaceOwnership(namespaceName);
}
validateTopicOwnership(topicName, authoritative);
validateTopicOperation(topicName, TopicOperation.GET_STATS);
Topic topic = getTopicReference(topicName);
try {
if (metadata) {
validateTopicOperation(topicName, TopicOperation.GET_METADATA);
}
return topic.getInternalStats(metadata).get();
} catch (Exception e) {
log.error("[{}] Failed to get internal stats for {}", clientAppId(), topicName, e);
throw new RestException(Status.INTERNAL_SERVER_ERROR,
(e instanceof ExecutionException) ? e.getCause().getMessage() : e.getMessage());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalGetInternalStats
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalGetInternalStats
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateSearchViewHint() {
if (binding == null || mSearchEditText == null) {
return;
}
if (binding.startConversationViewPager.getCurrentItem() == 0) {
mSearchEditText.setHint(R.string.search_contacts);
} else {
mSearchEditText.setHint(R.string.search_groups);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateSearchViewHint
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
updateSearchViewHint
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public Client getHttpClient() {
return httpClient;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHttpClient
File: samples/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
|
getHttpClient
|
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getMimeType(String filename) {
if (filename != null) {
filename = filename.toLowerCase();
}
String mimeType;
try {
mimeType = Config.CONTEXT.getMimeType(filename);
if(!UtilMethods.isSet(mimeType))
mimeType = FileAsset.UNKNOWN_MIME_TYPE;
}
catch(Exception ex) {
mimeType = FileAsset.UNKNOWN_MIME_TYPE;
Logger.warn(this,"Error looking for mimetype on file: "+filename,ex);
}
return mimeType;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMimeType
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
|
getMimeType
|
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
|
ab2bb2e00b841d131b8734227f9106e3ac31bb99
| 0
|
Analyze the following code function for security vulnerabilities
|
private void enforceResetThrottlingPermission() {
if (isCallerSystem()) {
return;
}
enforceCallingOrSelfPermission(
android.Manifest.permission.RESET_SHORTCUT_MANAGER_THROTTLING, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enforceResetThrottlingPermission
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40079
|
HIGH
| 7.8
|
android
|
enforceResetThrottlingPermission
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
private UserDTO loginSsoMode(String userId, String authType) {
return getLoginUser(userId, Collections.singletonList(authType));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loginSsoMode
File: framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-32699
|
MEDIUM
| 6.5
|
metersphere
|
loginSsoMode
|
framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
|
c59e381d368990214813085a1a4877c5ef865411
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getScheme() {
return "http";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getScheme
File: h2/src/test/org/h2/test/server/TestWeb.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
getScheme
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getInterfaceHash() {
return ISupplicantStaNetworkCallback.HASH;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInterfaceHash
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
|
getInterfaceHash
|
service/java/com/android/server/wifi/SupplicantStaNetworkCallbackAidlImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public final void startAppWidgetConfigureActivityForResult(@NonNull Activity activity,
int appWidgetId, int intentFlags, int requestCode, @Nullable Bundle options) {
try {
IntentSender intentSender = sService.createAppWidgetConfigIntentSender(
mContextOpPackageName, appWidgetId, intentFlags);
if (intentSender != null) {
activity.startIntentSenderForResult(intentSender, requestCode, null, 0, 0, 0,
options);
} else {
throw new ActivityNotFoundException();
}
} catch (IntentSender.SendIntentException e) {
throw new ActivityNotFoundException();
} catch (RemoteException e) {
throw new RuntimeException("system server dead?", e);
}
}
|
Vulnerability Classification:
- CWE: CWE-284
- CVE: CVE-2015-1541
- Severity: MEDIUM
- CVSS Score: 4.3
Description: DO NOT MERGE Don't take flags when creating app widget config activity.
bug:19618745
Change-Id: I7973ebfc67ebf52f14890dda9eb891a7b8a5a095
Function: startAppWidgetConfigureActivityForResult
File: core/java/android/appwidget/AppWidgetHost.java
Repository: android
Fixed Code:
public final void startAppWidgetConfigureActivityForResult(@NonNull Activity activity,
int appWidgetId, int intentFlags, int requestCode, @Nullable Bundle options) {
try {
IntentSender intentSender = sService.createAppWidgetConfigIntentSender(
mContextOpPackageName, appWidgetId);
if (intentSender != null) {
activity.startIntentSenderForResult(intentSender, requestCode, null, 0,
intentFlags, intentFlags, options);
} else {
throw new ActivityNotFoundException();
}
} catch (IntentSender.SendIntentException e) {
throw new ActivityNotFoundException();
} catch (RemoteException e) {
throw new RuntimeException("system server dead?", e);
}
}
|
[
"CWE-284"
] |
CVE-2015-1541
|
MEDIUM
| 4.3
|
android
|
startAppWidgetConfigureActivityForResult
|
core/java/android/appwidget/AppWidgetHost.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 1
|
Analyze the following code function for security vulnerabilities
|
public WifiLinkLayerStats getWifiLinkLayerStats() {
if (mInterfaceName == null) {
loge("getWifiLinkLayerStats called without an interface");
return null;
}
mLastLinkLayerStatsUpdate = mClock.getWallClockMillis();
WifiLinkLayerStats stats = null;
if (isPrimary()) {
stats = mWifiNative.getWifiLinkLayerStats(mInterfaceName);
} else {
if (mVerboseLoggingEnabled) {
Log.w(getTag(), "Can't getWifiLinkLayerStats on secondary iface");
}
}
if (stats != null) {
mOnTime = stats.on_time;
mTxTime = stats.tx_time;
mRxTime = stats.rx_time;
mRunningBeaconCount = stats.beacon_rx;
mWifiInfo.updatePacketRates(stats, mLastLinkLayerStatsUpdate);
} else {
long mTxPkts = mFacade.getTxPackets(mInterfaceName);
long mRxPkts = mFacade.getRxPackets(mInterfaceName);
mWifiInfo.updatePacketRates(mTxPkts, mRxPkts, mLastLinkLayerStatsUpdate);
}
mWifiMetrics.incrementWifiLinkLayerUsageStats(mInterfaceName, stats);
return stats;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWifiLinkLayerStats
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
getWifiLinkLayerStats
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApplicationInfo getApplicationInfo(String packageName, UserHandle user, int flags) {
try {
ApplicationInfo info = mLauncherApps.getApplicationInfo(packageName, flags, user);
return (info.flags & ApplicationInfo.FLAG_INSTALLED) == 0 || !info.enabled
? null : info;
} catch (PackageManager.NameNotFoundException e) {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getApplicationInfo
File: src/com/android/launcher3/util/PackageManagerHelper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-40097
|
HIGH
| 7.8
|
android
|
getApplicationInfo
|
src/com/android/launcher3/util/PackageManagerHelper.java
|
6c9a41117d5a9365cf34e770bbb00138f6bf997e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onReset(ExpandableView view) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onReset
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
onReset
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void mergeSecurityParamsListWithInternalWifiConfiguration(
WifiConfiguration internalConfig, WifiConfiguration externalConfig) {
// If not set, just copy over all list.
if (internalConfig.getSecurityParamsList().isEmpty()) {
internalConfig.setSecurityParams(externalConfig.getSecurityParamsList());
return;
}
WifiConfigurationUtil.addUpgradableSecurityTypeIfNecessary(externalConfig);
// An external caller is only allowed to set one type manually.
// As a result, only default type matters.
// There might be 3 cases:
// 1. Existing config with new upgradable type config,
// ex. PSK/SAE config with SAE config.
// 2. Existing configuration with downgradable type config,
// ex. SAE config with PSK config.
// 3. The new type is not a compatible type of existing config.
// ex. Open config with PSK config.
// This might happen when updating a config via network ID directly.
int oldType = internalConfig.getDefaultSecurityParams().getSecurityType();
int newType = externalConfig.getDefaultSecurityParams().getSecurityType();
if (oldType != newType) {
if (internalConfig.isSecurityType(newType)) {
internalConfig.setSecurityParamsIsAddedByAutoUpgrade(newType, false);
} else if (externalConfig.isSecurityType(oldType)) {
internalConfig.setSecurityParams(newType);
internalConfig.addSecurityParams(oldType);
} else {
internalConfig.setSecurityParams(externalConfig.getSecurityParamsList());
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: mergeSecurityParamsListWithInternalWifiConfiguration
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
|
mergeSecurityParamsListWithInternalWifiConfiguration
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
private void finishKeyguardDrawn() {
synchronized (mLock) {
if (!mAwake || mKeyguardDrawComplete) {
return; // spurious
}
mKeyguardDrawComplete = true;
if (mKeyguardDelegate != null) {
mHandler.removeMessages(MSG_KEYGUARD_DRAWN_TIMEOUT);
}
}
finishScreenTurningOn();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishKeyguardDrawn
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
finishKeyguardDrawn
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
List<ShareTargetInfo> getAllShareTargetsForTest() {
synchronized (mLock) {
return new ArrayList<>(mShareTargets);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllShareTargetsForTest
File: services/core/java/com/android/server/pm/ShortcutPackage.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40075
|
MEDIUM
| 5.5
|
android
|
getAllShareTargetsForTest
|
services/core/java/com/android/server/pm/ShortcutPackage.java
|
ae768fbb9975fdab267f525831cb52f485ab0ecc
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setPassword(String password) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setPassword(password);
return this;
}
}
throw new RuntimeException("No HTTP basic authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPassword
File: samples/openapi3/client/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
|
setPassword
|
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
|
public boolean optBoolean(String key) {
return this.optBoolean(key, false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: optBoolean
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
|
optBoolean
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handleOtherRequest(String pathInfo, HttpServletResponse response) throws IOException {
String[] parts = pathInfo.split("/");
// Image request must be in correct format.
if (parts.length < 3) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
String contextPath = "";
int index = pathInfo.indexOf(parts[1]);
if (index != -1) {
contextPath = pathInfo.substring(index + parts[1].length());
}
File pluginDirectory = new File(JiveGlobals.getHomeDirectory(), "plugins");
File file = new File(pluginDirectory, parts[1] + File.separator + "web" + contextPath);
// When using dev environment, the images dir may be under something other that web.
Plugin plugin = pluginManager.getPlugin(parts[1]);
PluginDevEnvironment environment = pluginManager.getDevEnvironment(plugin);
if (environment != null) {
file = new File(environment.getWebRoot(), contextPath);
}
if (!file.exists()) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
String contentType = getServletContext().getMimeType(pathInfo);
if (contentType == null) {
contentType = "text/plain";
}
response.setContentType(contentType);
// Write out the resource to the user.
try (InputStream in = new BufferedInputStream(new FileInputStream(file))) {
try (ServletOutputStream out = response.getOutputStream()) {
// Set the size of the file.
response.setContentLength((int) file.length());
// Use a 1K buffer.
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) != -1) {
out.write(buf, 0, len);
}
}
}
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2019-18393
- Severity: MEDIUM
- CVSS Score: 5.0
Description: OF-1886: Plugin Servlet shouldn't provide access to any file on the host
Function: handleOtherRequest
File: xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java
Repository: igniterealtime/Openfire
Fixed Code:
private void handleOtherRequest(String pathInfo, HttpServletResponse response) throws IOException {
String[] parts = pathInfo.split("/");
// Image request must be in correct format.
if (parts.length < 3) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
String contextPath = "";
int index = pathInfo.indexOf(parts[1]);
if (index != -1) {
contextPath = pathInfo.substring(index + parts[1].length());
}
File pluginDirectory = new File(JiveGlobals.getHomeDirectory(), "plugins");
File file = new File(pluginDirectory, parts[1] + File.separator + "web" + contextPath);
// When using dev environment, the images dir may be under something other that web.
Plugin plugin = pluginManager.getPlugin(parts[1]);
PluginDevEnvironment environment = pluginManager.getDevEnvironment(plugin);
if (environment != null) {
file = new File(environment.getWebRoot(), contextPath);
} else {
if ( !ALLOW_LOCAL_FILE_READING.getValue() ) {
// If _not_ in a DEV environment, ensure that the file that's being served is a
// file that is part of Openfire. This guards against accessing files from the
// operating system, or other files that shouldn't be accessible via the web (OF-1886).
final Path absoluteHome = new File( JiveGlobals.getHomeDirectory() ).toPath().normalize().toAbsolutePath();
final Path absoluteLookup = file.toPath().normalize().toAbsolutePath();
if ( !absoluteLookup.startsWith( absoluteHome ) )
{
response.setStatus( HttpServletResponse.SC_FORBIDDEN );
return;
}
}
}
if (!file.exists()) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
String contentType = getServletContext().getMimeType(pathInfo);
if (contentType == null) {
contentType = "text/plain";
}
response.setContentType(contentType);
// Write out the resource to the user.
try (InputStream in = new BufferedInputStream(new FileInputStream(file))) {
try (ServletOutputStream out = response.getOutputStream()) {
// Set the size of the file.
response.setContentLength((int) file.length());
// Use a 1K buffer.
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) != -1) {
out.write(buf, 0, len);
}
}
}
}
|
[
"CWE-22"
] |
CVE-2019-18393
|
MEDIUM
| 5
|
igniterealtime/Openfire
|
handleOtherRequest
|
xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java
|
5af6e03c25b121d01e752927c401124a4da569f7
| 1
|
Analyze the following code function for security vulnerabilities
|
protected int getSubId() {
return SubscriptionController.getInstance().getSubIdUsingPhoneId(mPhone.getPhoneId());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSubId
File: src/java/com/android/internal/telephony/SMSDispatcher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3883
|
MEDIUM
| 4.3
|
android
|
getSubId
|
src/java/com/android/internal/telephony/SMSDispatcher.java
|
b2c89e6f8962dc7aff88cb38aa3ee67d751edda9
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeStrongBinder(sender.asBinder());
mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
reply.readException();
boolean res = reply.readInt() != 0;
data.recycle();
reply.recycle();
return res;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isIntentSenderAnActivity
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
isIntentSenderAnActivity
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onChange(boolean selfChange) {
mPremiumSmsRule.set(Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.SMS_SHORT_CODE_RULE, PREMIUM_RULE_USE_SIM));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onChange
File: src/java/com/android/internal/telephony/SMSDispatcher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3858
|
HIGH
| 9.3
|
android
|
onChange
|
src/java/com/android/internal/telephony/SMSDispatcher.java
|
df31d37d285dde9911b699837c351aed2320b586
| 0
|
Analyze the following code function for security vulnerabilities
|
public static File toFuseFile(File file) {
return new File(file.getPath().replaceFirst(LOWER_FS_PREFIX, FUSE_FS_PREFIX));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toFuseFile
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
toFuseFile
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.