instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
private static void outputHighlighting(PrintWriter out,
CRFClassifier<CoreMap> classifier,
String input) {
Set<String> labels = classifier.labels();
String background = classifier.backgroundSymbol();
List<List<CoreMap>> sentences = classifier.classify(input);
Map<String, Color> tagToColorMap =
NERGUI.makeTagToColorMap(labels, background);
StringBuilder result = new StringBuilder();
int lastEndOffset = 0;
for (List<CoreMap> sentence : sentences) {
for (CoreMap word : sentence) {
int beginOffset = word.get(CoreAnnotations.CharacterOffsetBeginAnnotation.class);
int endOffset = word.get(CoreAnnotations.CharacterOffsetEndAnnotation.class);
String answer = word.get(CoreAnnotations.AnswerAnnotation.class);
if (beginOffset > lastEndOffset) {
result.append(StringEscapeUtils.escapeHtml4(input.substring(lastEndOffset, beginOffset)));
}
// Add a color bar for any tagged words
if (!background.equals(answer)) {
Color color = tagToColorMap.get(answer);
result.append("<span style=\"color:#ffffff;background:" +
NERGUI.colorToHTML(color) + "\">");
}
result.append(StringEscapeUtils.escapeHtml4(input.substring(beginOffset, endOffset)));
// Turn off the color bar
if (!background.equals(answer)) {
result.append("</span>");
}
lastEndOffset = endOffset;
}
}
if (lastEndOffset < input.length()) {
result.append(StringEscapeUtils.escapeHtml4(input.substring(lastEndOffset)));
}
result.append("<br><br>");
result.append("Potential tags:");
for (Map.Entry<String, Color> stringColorEntry : tagToColorMap.entrySet()) {
result.append("<br> ");
Color color = stringColorEntry.getValue();
result.append("<span style=\"color:#ffffff;background:" +
NERGUI.colorToHTML(color) + "\">");
result.append(StringEscapeUtils.escapeHtml4(stringColorEntry.getKey()));
result.append("</span>");
}
out.print(result);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: outputHighlighting
File: src/edu/stanford/nlp/ie/ner/webapp/NERServlet.java
Repository: stanfordnlp/CoreNLP
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2021-44550
|
HIGH
| 7.5
|
stanfordnlp/CoreNLP
|
outputHighlighting
|
src/edu/stanford/nlp/ie/ner/webapp/NERServlet.java
|
5ee097dbede547023e88f60ed3f430ff09398b87
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS, conditional = true)
public void setRequiredPasswordComplexity(@PasswordComplexity int passwordComplexity) {
if (mService == null) {
return;
}
try {
mService.setRequiredPasswordComplexity(
mContext.getPackageName(), passwordComplexity, mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRequiredPasswordComplexity
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
|
setRequiredPasswordComplexity
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void bindExpandButton(RemoteViews contentView, StandardTemplateParams p) {
// set default colors
int bgColor = getBackgroundColor(p);
int pillColor = Colors.flattenAlpha(getColors(p).getProtectionColor(), bgColor);
int textColor = Colors.flattenAlpha(getPrimaryTextColor(p), pillColor);
contentView.setInt(R.id.expand_button, "setDefaultTextColor", textColor);
contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor);
// Use different highlighted colors for conversations' unread count
if (p.mHighlightExpander) {
pillColor = Colors.flattenAlpha(getColors(p).getTertiaryAccentColor(), bgColor);
textColor = Colors.flattenAlpha(getColors(p).getOnAccentTextColor(), pillColor);
}
contentView.setInt(R.id.expand_button, "setHighlightTextColor", textColor);
contentView.setInt(R.id.expand_button, "setHighlightPillColor", pillColor);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bindExpandButton
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
bindExpandButton
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void mapIndexConfigXmlGenerator(XmlGenerator gen, List<MapIndexConfig> mapIndexConfigs) {
if (!mapIndexConfigs.isEmpty()) {
gen.open("indexes");
for (MapIndexConfig indexCfg : mapIndexConfigs) {
gen.node("index", indexCfg.getAttribute(), "ordered", indexCfg.isOrdered());
}
gen.close();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: mapIndexConfigXmlGenerator
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
mapIndexConfigXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
private void registerCertificateNotificationReceiver() {
unregisterCertificateNotificationReceiver();
IntentFilter filter = new IntentFilter();
if (useTrustOnFirstUse()) {
filter.addAction(ACTION_CERT_NOTIF_TAP);
} else {
filter.addAction(ACTION_CERT_NOTIF_ACCEPT);
filter.addAction(ACTION_CERT_NOTIF_REJECT);
}
mContext.registerReceiver(mCertNotificationReceiver, filter, null, mHandler);
mIsCertNotificationReceiverRegistered = true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerCertificateNotificationReceiver
File: service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
registerCertificateNotificationReceiver
|
service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public void doSecured( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
if(req.getUserPrincipal()==null) {
// authentication must have failed
rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
return;
}
// the user is now authenticated, so send him back to the target
String path = req.getContextPath()+req.getOriginalRestOfPath();
String q = req.getQueryString();
if(q!=null)
path += '?'+q;
rsp.sendRedirect2(path);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doSecured
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
doSecured
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public String getDefaultBaseSkin(XWikiContext context)
{
return getInternalSkinManager().getDefaultParentSkinId();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefaultBaseSkin
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
getDefaultBaseSkin
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public VFSStatus canWrite() {
VFSContainer inheritingContainer = VFSManager.findInheritingSecurityCallbackContainer(this);
if (inheritingContainer != null && !inheritingContainer.getLocalSecurityCallback().canWrite())
return VFSConstants.NO_SECURITY_DENIED;
return VFSConstants.YES;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canWrite
File: src/main/java/org/olat/core/util/vfs/LocalFolderImpl.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41242
|
HIGH
| 7.9
|
OpenOLAT
|
canWrite
|
src/main/java/org/olat/core/util/vfs/LocalFolderImpl.java
|
336d5ce80681be61a0bbf4f73d2af5d1ff67e93a
| 0
|
Analyze the following code function for security vulnerabilities
|
public String serializeToString(Object obj, Map<String, Object> formParams, String contentType, boolean isBodyNullable) throws ApiException {
try {
if (contentType.startsWith("multipart/form-data")) {
throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)");
} else if (contentType.startsWith("application/x-www-form-urlencoded")) {
String formString = "";
for (Entry<String, Object> param : formParams.entrySet()) {
formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&";
}
if (formString.length() == 0) { // empty string
return formString;
} else {
return formString.substring(0, formString.length() - 1);
}
} else {
if (isBodyNullable) {
return obj == null ? "null" : json.getMapper().writeValueAsString(obj);
} else {
return obj == null ? "" : json.getMapper().writeValueAsString(obj);
}
}
} catch (Exception ex) {
throw new ApiException("Failed to perform serializeToString: " + ex.toString());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: serializeToString
File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
serializeToString
|
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getSessionID() {
return request.sessionId;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSessionID
File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
Repository: orientechnologies/orientdb
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2015-2912
|
MEDIUM
| 6.8
|
orientechnologies/orientdb
|
getSessionID
|
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
|
d5a45e608ba8764fd817c1bdd7cf966564e828e9
| 0
|
Analyze the following code function for security vulnerabilities
|
void reportFullyDrawnLocked(boolean restoredFromBundle) {
final TransitionInfoSnapshot info = mTaskSupervisor
.getActivityMetricsLogger().logAppTransitionReportedDrawn(this, restoredFromBundle);
if (info != null) {
mTaskSupervisor.reportActivityLaunched(false /* timeout */, this,
info.windowsFullyDrawnDelayMs, info.getLaunchState());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reportFullyDrawnLocked
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
reportFullyDrawnLocked
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void clearLastHandledNavigation() {
setLastHandledNavigation(null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearLastHandledNavigation
File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2023-25499
|
MEDIUM
| 6.5
|
vaadin/flow
|
clearLastHandledNavigation
|
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
|
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
| 0
|
Analyze the following code function for security vulnerabilities
|
protected LogHandler getLogHandler() {
return logHandler;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLogHandler
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
|
getLogHandler
|
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
|
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
| 0
|
Analyze the following code function for security vulnerabilities
|
public void getMetadata(int parentStudyId, int studyId, MetaDataVersionBean metadata, String odmVersion) {
if(odmVersion.equalsIgnoreCase("occlinical_data"))odmVersion = "oc1.3";
if("oc1.3".equals(odmVersion)) {
if(metadata.getStudy().getParentStudyId() > 0) {
// this.getOCMetadata(parentStudyId, studyId, metadata, odmVersion);
this.getMetadataOC1_3(parentStudyId, studyId, metadata, odmVersion);
} else {
this.getMetadataOC1_3(parentStudyId, studyId, metadata, odmVersion);
}
} else if("oc1.2".equals(odmVersion)) {
this.getOCMetadata(parentStudyId, studyId, metadata, odmVersion);
} else {
this.getODMMetadata(parentStudyId, studyId, metadata, odmVersion);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMetadata
File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24831
|
HIGH
| 7.5
|
OpenClinica
|
getMetadata
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void getByIdInvalidJson(TestContext context) {
// let the JSON to POJO conversion fail
createInvalidJson(context).getById(
INVALID_JSON, INVALID_JSON_UUID, StringPojo.class, context.asyncAssertFailure());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getByIdInvalidJson
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
getByIdInvalidJson
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getInt(int index) throws JSONException {
Object o = get(index);
return o instanceof Number ?
((Number)o).intValue() : (int)getDouble(index);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInt
File: src/main/java/org/codehaus/jettison/json/JSONArray.java
Repository: jettison-json/jettison
The code follows secure coding practices.
|
[
"CWE-674",
"CWE-787"
] |
CVE-2022-45693
|
HIGH
| 7.5
|
jettison-json/jettison
|
getInt
|
src/main/java/org/codehaus/jettison/json/JSONArray.java
|
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void update(CommandsInterface ci,
Context context, UiccCard ic) {
UiccCardApplication ca = null;
IccRecords ir = null;
if (ic != null) {
/* Since Cat is not tied to any application, but rather is Uicc application
* in itself - just get first FileHandler and IccRecords object
*/
ca = ic.getApplicationIndex(0);
if (ca != null) {
ir = ca.getIccRecords();
}
}
synchronized (sInstanceLock) {
if ((ir != null) && (mIccRecords != ir)) {
if (mIccRecords != null) {
mIccRecords.unregisterForRecordsLoaded(this);
}
CatLog.d(this,
"Reinitialize the Service with SIMRecords and UiccCardApplication");
mIccRecords = ir;
mUiccApplication = ca;
// re-Register for SIM ready event.
mIccRecords.registerForRecordsLoaded(this, MSG_ID_ICC_RECORDS_LOADED, null);
CatLog.d(this, "registerForRecordsLoaded slotid=" + mSlotId + " instance:" + this);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: update
File: src/java/com/android/internal/telephony/cat/CatService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3843
|
HIGH
| 9.3
|
android
|
update
|
src/java/com/android/internal/telephony/cat/CatService.java
|
b48581401259439dc5ef6dcf8b0f303e4cbefbe9
| 0
|
Analyze the following code function for security vulnerabilities
|
private void clearLauncherShortcutOverrides() {
mPolicyCache.setLauncherShortcutOverrides(new ArrayMap<>());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearLauncherShortcutOverrides
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
|
clearLauncherShortcutOverrides
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void networkAddress() {
ipButton.setOnClickListener(view -> {
AlertDialog.Builder builder = new AlertDialog.Builder(ConfigActivity.this);
builder.setTitle(getResources().getString(R.string.socket_address));
LayoutInflater socketLI = LayoutInflater.from(this);
final View socketView = socketLI.inflate(R.layout.config_network, null);
builder.setView(socketView);
EditText address = socketView.findViewById(R.id.socket_title);
address.setText(config.getNetworkAddress());
builder.setCancelable(false);
builder.setPositiveButton(getResources().getString(R.string.btn_save), (dialog, which) -> {
Matcher matcher = SOCKET_ADDRESS.matcher(address.getText().toString());
if (matcher.matches())
config.setNetworkAddress(address.getText().toString());
ipButton.setText(config.getNetworkAddress());
EditorActivity.updateNotification(this);
});
builder.setNegativeButton(getResources().getString(R.string.btn_cancel), (dialog, which) -> dialog.cancel());
AlertDialog saveDialog = builder.create();
Objects.requireNonNull(saveDialog.getWindow()).setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
saveDialog.show();
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: networkAddress
File: app/src/main/java/com/mayank/rucky/activity/ConfigActivity.java
Repository: mayankmetha/Rucky
The code follows secure coding practices.
|
[
"CWE-327"
] |
CVE-2021-41096
|
MEDIUM
| 5
|
mayankmetha/Rucky
|
networkAddress
|
app/src/main/java/com/mayank/rucky/activity/ConfigActivity.java
|
5e3a477365009f488a73efd26a91168502de1b93
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ParceledListSlice getQueue() {
synchronized (mLock) {
return mQueue == null ? null : new ParceledListSlice<>(mQueue);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getQueue
File: services/core/java/com/android/server/media/MediaSessionRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21280
|
MEDIUM
| 5.5
|
android
|
getQueue
|
services/core/java/com/android/server/media/MediaSessionRecord.java
|
06e772e05514af4aa427641784c5eec39a892ed3
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void updateAutoRegistrationFlag(
SipProfile p, SipProfileDb db, boolean isEnabled) {
SipProfile newProfile = new SipProfile.Builder(p).setAutoRegistration(isEnabled).build();
try {
// Note: The profile is updated, but the associated PhoneAccount is left alone since
// the only thing that changed is the auto-registration flag, which is not part of the
// PhoneAccount.
db.deleteProfile(p);
db.saveProfile(newProfile);
} catch (Exception e) {
Log.d(LOG_TAG, "updateAutoRegistrationFlag, exception: " + e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateAutoRegistrationFlag
File: sip/src/com/android/services/telephony/sip/SipUtil.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0847
|
HIGH
| 7.2
|
android
|
updateAutoRegistrationFlag
|
sip/src/com/android/services/telephony/sip/SipUtil.java
|
a294ae5342410431a568126183efe86261668b5d
| 0
|
Analyze the following code function for security vulnerabilities
|
public GetMethod executeGet(EntityReference reference) throws Exception
{
Class<?> resource = getResourceAPI(reference);
return executeGet(resource, reference);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeGet
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
executeGet
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
ActivityStackSupervisor getOuter() {
return ActivityStackSupervisor.this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOuter
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
getOuter
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Properties toProperties() {
Properties props = new Properties();
props.putAll(this);
return props;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toProperties
File: src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java
Repository: KrailOrg/krail-jpa
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-15018
|
MEDIUM
| 5.2
|
KrailOrg/krail-jpa
|
toProperties
|
src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java
|
c1e848665492e21ef6cc9be443205e36b9a1f6be
| 0
|
Analyze the following code function for security vulnerabilities
|
protected PdfReaderInstance getPdfReaderInstance(PdfWriter writer) throws IOException {
return new PdfReaderInstance(this, writer);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPdfReaderInstance
File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
Repository: pdftk-java/pdftk
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2021-37819
|
HIGH
| 7.5
|
pdftk-java/pdftk
|
getPdfReaderInstance
|
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
|
9b0cbb76c8434a8505f02ada02a94263dcae9247
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public MergeResult merge(XWikiDocument previousDocument, XWikiDocument newDocument,
MergeConfiguration configuration, XWikiContext context)
{
MergeManager mergeManager = Utils.getComponent(MergeManager.class);
MergeDocumentResult mergeDocumentResult =
mergeManager.mergeDocument(previousDocument, newDocument, this, configuration);
MergeResult mergeResult = new MergeResult();
mergeResult.getLog().addAll(mergeDocumentResult.getLog());
mergeResult.setModified(mergeResult.isModified() || mergeDocumentResult.isModified());
if (!configuration.isProvidedVersionsModifiables())
{
this.apply((XWikiDocument) mergeDocumentResult.getMergeResult());
}
return mergeResult;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: merge
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
|
merge
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public InetAddress getAddress() {
return _socket.getInetAddress();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAddress
File: src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
getAddress
|
src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
private DomNode getNextDomSibling(final DomNode element) {
DomNode node = element.getNextSibling();
while (node != null && !isAccepted(node)) {
node = node.getNextSibling();
}
return node;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNextDomSibling
File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
Repository: HtmlUnit/htmlunit
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-2798
|
HIGH
| 7.5
|
HtmlUnit/htmlunit
|
getNextDomSibling
|
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
|
940dc7fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public void cancel(User user) {
if (mCurrentUpload != null && mCurrentUpload.getUser().nameEquals(user)) {
mCurrentUpload.cancel(ResultCode.CANCELLED);
}
cancelPendingUploads(user.getAccountName());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cancel
File: app/src/main/java/com/owncloud/android/files/services/FileUploader.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-39210
|
MEDIUM
| 5.5
|
nextcloud/android
|
cancel
|
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
|
cd3bd0845a97e1d43daa0607a122b66b0068c751
| 0
|
Analyze the following code function for security vulnerabilities
|
private void processSystemVaraibles(SystemParametersType xmlSystemParameters, PackageType xmlPackage,
PluginPackages pluginPackageEntity) {
if (xmlSystemParameters == null) {
return;
}
List<SystemParameterType> xmlSystemParameterList = xmlSystemParameters.getSystemParameter();
if (xmlSystemParameterList == null || xmlSystemParameterList.isEmpty()) {
return;
}
for (SystemParameterType xmlSystemParameter : xmlSystemParameterList) {
SystemVariables systemVariableEntity = new SystemVariables();
systemVariableEntity.setId(LocalIdGenerator.generateId());
systemVariableEntity.setName(xmlSystemParameter.getName());
systemVariableEntity.setPackageName(xmlPackage.getName());
String scopeType = xmlSystemParameter.getScopeType();
if (!SystemVariables.SCOPE_GLOBAL.equalsIgnoreCase(scopeType)) {
scopeType = xmlPackage.getName();
}
systemVariableEntity.setScope(scopeType);
systemVariableEntity.setDefaultValue(xmlSystemParameter.getDefaultValue());
systemVariableEntity.setValue(xmlSystemParameter.getValue());
systemVariableEntity.setStatus(SystemVariables.INACTIVE);
systemVariableEntity.setSource(PluginPackages.buildSystemVariableSource(pluginPackageEntity));
systemVariableEntity.setPackageName(xmlPackage.getName());
systemVariablesMapper.insert(systemVariableEntity);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processSystemVaraibles
File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
Repository: WeBankPartners/wecube-platform
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-45746
|
MEDIUM
| 5
|
WeBankPartners/wecube-platform
|
processSystemVaraibles
|
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
|
1164dae43c505f8a0233cc049b2689d6ca6d0c37
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setEndpointIdentificationAlgorithm(String endpointIdentificationAlgorithm) {
this.endpointIdentificationAlgorithm = endpointIdentificationAlgorithm;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setEndpointIdentificationAlgorithm
File: src/main/java/org/conscrypt/SSLParametersImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3840
|
HIGH
| 10
|
android
|
setEndpointIdentificationAlgorithm
|
src/main/java/org/conscrypt/SSLParametersImpl.java
|
5af5e93463f4333187e7e35f3bd2b846654aa214
| 0
|
Analyze the following code function for security vulnerabilities
|
public void login(String username, String password)
{
loginAndGotoPage(username, password, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: login
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
login
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
private void resetGlobalProxyLocked(DevicePolicyData policy) {
final int N = policy.mAdminList.size();
for (int i = 0; i < N; i++) {
ActiveAdmin ap = policy.mAdminList.get(i);
if (ap.specifiesGlobalProxy) {
saveGlobalProxyLocked(ap.globalProxySpec, ap.globalProxyExclusionList);
return;
}
}
// No device admins defining global proxies - reset global proxy settings to none
saveGlobalProxyLocked(null, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resetGlobalProxyLocked
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
|
resetGlobalProxyLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean enableAdminAndSetProfileOwner(
@UserIdInt int userId, @UserIdInt int callingUserId, ComponentName adminComponent) {
enableAndSetActiveAdmin(userId, callingUserId, adminComponent);
return setProfileOwner(adminComponent, userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enableAdminAndSetProfileOwner
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
|
enableAdminAndSetProfileOwner
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
String secret = getSecret();
Key key = new SecretKeySpec(Decoders.BASE64.decode(secret), getSignatureAlgorithm().getJcaName());
Jwt jwt = Jwts.parser().
setSigningKey(key).
parse((String) token.getPrincipal());
Map<String, Serializable> principal = getPrincipal(jwt);
return new SimpleAuthenticationInfo(principal, ((String) token.getCredentials()).toCharArray(), getName());
}
|
Vulnerability Classification:
- CWE: CWE-347
- CVE: CVE-2021-29451
- Severity: MEDIUM
- CVSS Score: 6.4
Description: Fix security vulnerability
Function: doGetAuthenticationInfo
File: dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java
Repository: ManyDesigns/Portofino
Fixed Code:
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
String secret = getSecret();
Key key = new SecretKeySpec(Decoders.BASE64.decode(secret), getSignatureAlgorithm().getJcaName());
Jws<Claims> jwt = Jwts.parser().
setSigningKey(key).
parseClaimsJws((String) token.getPrincipal());
Map<String, Serializable> principal = getPrincipal(jwt);
return new SimpleAuthenticationInfo(principal, ((String) token.getCredentials()).toCharArray(), getName());
}
|
[
"CWE-347"
] |
CVE-2021-29451
|
MEDIUM
| 6.4
|
ManyDesigns/Portofino
|
doGetAuthenticationInfo
|
dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java
|
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
| 1
|
Analyze the following code function for security vulnerabilities
|
@SneakyThrows
private void addUaaSpecification(String tenantName) {
String specificationName = applicationProperties.getTenantPropertiesName();
InputStream in = new ClassPathResource(Constants.DEFAULT_CONFIG_PATH).getInputStream();
String specification = IOUtils.toString(in, UTF_8);
tenantConfigRepository.updateConfig(tenantName, "/" + specificationName, specification);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addUaaSpecification
File: src/main/java/com/icthh/xm/uaa/service/tenant/TenantService.java
Repository: xm-online/xm-uaa
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15557
|
HIGH
| 7.5
|
xm-online/xm-uaa
|
addUaaSpecification
|
src/main/java/com/icthh/xm/uaa/service/tenant/TenantService.java
|
bd235434f119c67090952e08fc28abe41aea2e2c
| 0
|
Analyze the following code function for security vulnerabilities
|
@GetMapping("/project/member/{projectId}")
public List<User> getProjectMembers(@PathVariable String projectId) {
QueryMemberRequest request = new QueryMemberRequest();
request.setProjectId(projectId);
return baseUserService.getProjectMemberList(request);
}
|
Vulnerability Classification:
- CWE: CWE-862
- CVE: CVE-2023-38494
- Severity: HIGH
- CVSS Score: 7.5
Description: fix: 增加用户组接口的权限校验
Function: getProjectMembers
File: framework/sdk-parent/sdk/src/main/java/io/metersphere/controller/BaseUserController.java
Repository: metersphere
Fixed Code:
@GetMapping("/project/member/{projectId}")
public List<User> getProjectMembers(@PathVariable String projectId) {
SessionUser user = SessionUtils.getUser();
Optional<UserGroup> any = user.getUserGroups().stream()
.filter(ug -> (ug.getSourceId().equals(projectId) || ug.getGroupId().equals(UserGroupConstants.SUPER_GROUP)))
.findAny();
if (any.isEmpty()) {
return new ArrayList<>();
}
QueryMemberRequest request = new QueryMemberRequest();
request.setProjectId(projectId);
return baseUserService.getProjectMemberList(request);
}
|
[
"CWE-862"
] |
CVE-2023-38494
|
HIGH
| 7.5
|
metersphere
|
getProjectMembers
|
framework/sdk-parent/sdk/src/main/java/io/metersphere/controller/BaseUserController.java
|
a23f75d93b666901fd148d834df9384f6f24cf28
| 1
|
Analyze the following code function for security vulnerabilities
|
private static boolean impliesTypePerm(Set<IndexPattern> ipatterns, Resolved resolved, User user, String[] requestedActions,
IndexNameExpressionResolver resolver, ClusterService cs) {
Set<String> resolvedRequestedIndices = resolved.getAllIndices();
IndexMatcherAndPermissions[] indexMatcherAndPermissions;
if (resolved.isLocalAll()) {
indexMatcherAndPermissions = ipatterns
.stream()
.filter(indexPattern -> "*".equals(indexPattern.getUnresolvedIndexPattern(user)))
.map(p -> new IndexMatcherAndPermissions(p.attemptResolveIndexNames(user, resolver, cs), p.perms))
.toArray(IndexMatcherAndPermissions[]::new);
} else {
indexMatcherAndPermissions = ipatterns
.stream()
.map(p -> new IndexMatcherAndPermissions(p.attemptResolveIndexNames(user, resolver, cs), p.perms))
.toArray(IndexMatcherAndPermissions[]::new);
}
return resolvedRequestedIndices
.stream()
.allMatch(index ->
Arrays.stream(requestedActions).allMatch(action ->
Arrays.stream(indexMatcherAndPermissions).anyMatch(ipap ->
ipap.matches(index, action)
)
)
);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: impliesTypePerm
File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
Repository: opensearch-project/security
The code follows secure coding practices.
|
[
"CWE-612",
"CWE-863"
] |
CVE-2022-41918
|
MEDIUM
| 6.3
|
opensearch-project/security
|
impliesTypePerm
|
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
|
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
protected void setVarHtmlTemplate(final Template varHtmlTemplate) {
this.varHtmlTemplate = varHtmlTemplate;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setVarHtmlTemplate
File: varexport/src/main/java/com/indeed/util/varexport/servlet/ViewExportedVariablesServlet.java
Repository: indeedeng/util
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-36634
|
MEDIUM
| 5.4
|
indeedeng/util
|
setVarHtmlTemplate
|
varexport/src/main/java/com/indeed/util/varexport/servlet/ViewExportedVariablesServlet.java
|
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String toString() {
return stats ? "stats" : zen ? "zen" : ('\'' + pkgFilter + '\'');
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: services/core/java/com/android/server/notification/NotificationManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3884
|
MEDIUM
| 4.3
|
android
|
toString
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public Configuration getConfiguration() {
Configuration ci;
synchronized (mGlobalLock) {
ci = new Configuration(getGlobalConfigurationForCallingPid());
ci.userSetLocale = false;
}
return ci;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getConfiguration
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
|
getConfiguration
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private Set<String> getFavTagsSubscribers(List<String> tags) {
if (!tags.isEmpty()) {
Set<String> emails = new LinkedHashSet<>();
// find all user objects even if there are more than 10000 users in the system
Pager pager = new Pager(1, "_docid", false, CONF.maxItemsPerPage());
List<Profile> profiles;
do {
profiles = pc.findQuery(Utils.type(Profile.class),
"properties.favtags:(" + tags.stream().
map(t -> "\"".concat(t).concat("\"")).distinct().
collect(Collectors.joining(" ")) + ") AND properties.favtagsEmailsEnabled:true", pager);
if (!profiles.isEmpty()) {
List<User> users = pc.readAll(profiles.stream().map(p -> p.getCreatorid()).
distinct().collect(Collectors.toList()));
users.stream().forEach(u -> emails.add(u.getEmail()));
}
} while (!profiles.isEmpty());
return emails;
}
return Collections.emptySet();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFavTagsSubscribers
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
getFavTagsSubscribers
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(apiKey);
return this;
}
}
throw new RuntimeException("No API key authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setApiKey
File: samples/client/petstore/java/resteasy/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
|
setApiKey
|
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void initializeMimeMappings(final DeploymentImpl deployment, final DeploymentInfo deploymentInfo) {
final Map<String, String> mappings = new HashMap<>(MimeMappings.DEFAULT_MIME_MAPPINGS);
for (MimeMapping mapping : deploymentInfo.getMimeMappings()) {
mappings.put(mapping.getExtension().toLowerCase(Locale.ENGLISH), mapping.getMimeType());
}
deployment.setMimeExtensionMappings(mappings);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initializeMimeMappings
File: servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2019-10184
|
MEDIUM
| 5
|
undertow-io/undertow
|
initializeMimeMappings
|
servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java
|
d2715e3afa13f50deaa19643676816ce391551e9
| 0
|
Analyze the following code function for security vulnerabilities
|
private void calcPollingBaseline(AbstractBuild build, Launcher launcher, TaskListener listener) throws IOException, InterruptedException {
SCMRevisionState baseline = build.getAction(SCMRevisionState.class);
if (baseline==null) {
try {
baseline = getScm()._calcRevisionsFromBuild(build, launcher, listener);
} catch (AbstractMethodError e) {
baseline = SCMRevisionState.NONE; // pre-1.345 SCM implementations, which doesn't use the baseline in polling
}
if (baseline!=null)
build.addAction(baseline);
}
pollingBaseline = baseline;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: calcPollingBaseline
File: core/src/main/java/hudson/model/AbstractProject.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
calcPollingBaseline
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
private JsonObject getDataObject(JsonObject jsonObject, String key) {
if (!jsonObject.hasKey(key)) {
jsonObject.put(key, Json.createObject());
}
return jsonObject.getObject(key);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDataObject
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
getDataObject
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getPropertyDef(InputSpec inputSpec, Map<String, Integer> indexes,
String pattern, DefaultValueProvider defaultValueProvider) {
int index = indexes.get(inputSpec.getName());
StringBuffer buffer = new StringBuffer();
inputSpec.appendField(buffer, index, "String");
inputSpec.appendCommonAnnotations(buffer, index);
if (!inputSpec.isAllowEmpty())
buffer.append(" @NotEmpty\n");
if (pattern != null)
buffer.append(" @Pattern(regexp=\"" + pattern + "\", message=\"Should match regular expression: " + pattern + "\")\n");
inputSpec.appendMethods(buffer, index, "String", null, defaultValueProvider);
return buffer.toString();
}
|
Vulnerability Classification:
- CWE: CWE-94
- CVE: CVE-2021-21248
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Escape pattern field of build job param to prevent security vulnerability
Function: getPropertyDef
File: server-core/src/main/java/io/onedev/server/model/support/inputspec/textinput/TextInput.java
Repository: theonedev/onedev
Fixed Code:
public static String getPropertyDef(InputSpec inputSpec, Map<String, Integer> indexes,
String pattern, DefaultValueProvider defaultValueProvider) {
pattern = InputSpec.escape(pattern);
int index = indexes.get(inputSpec.getName());
StringBuffer buffer = new StringBuffer();
inputSpec.appendField(buffer, index, "String");
inputSpec.appendCommonAnnotations(buffer, index);
if (!inputSpec.isAllowEmpty())
buffer.append(" @NotEmpty\n");
if (pattern != null)
buffer.append(" @Pattern(regexp=\"" + pattern + "\", message=\"Should match regular expression: " + pattern + "\")\n");
inputSpec.appendMethods(buffer, index, "String", null, defaultValueProvider);
return buffer.toString();
}
|
[
"CWE-94"
] |
CVE-2021-21248
|
MEDIUM
| 6.5
|
theonedev/onedev
|
getPropertyDef
|
server-core/src/main/java/io/onedev/server/model/support/inputspec/textinput/TextInput.java
|
39d95ab8122c5d9ed18e69dc024870cae08d2d60
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean requestAutofillData(IAssistDataReceiver receiver, Bundle receiverExtras,
IBinder activityToken, int flags) {
return enqueueAssistContext(ActivityManager.ASSIST_CONTEXT_AUTOFILL, null, null,
receiver, receiverExtras, activityToken, true, true, UserHandle.getCallingUserId(),
null, PENDING_AUTOFILL_ASSIST_STRUCTURE_TIMEOUT, flags) != null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestAutofillData
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2018-9492
|
HIGH
| 7.2
|
android
|
requestAutofillData
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private int jjMoveStringLiteralDfa3_2(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_2(1, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_2(2, active0);
return 3;
}
switch(curChar)
{
case 101:
if ((active0 & 0x10000L) != 0L)
return jjStartNfaWithStates_2(3, 16, 6);
break;
case 108:
if ((active0 & 0x40000L) != 0L)
return jjStartNfaWithStates_2(3, 18, 6);
break;
case 115:
return jjMoveStringLiteralDfa4_2(active0, 0x20000L);
case 116:
return jjMoveStringLiteralDfa4_2(active0, 0x600000000000L);
default :
break;
}
return jjStartNfa_2(2, active0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jjMoveStringLiteralDfa3_2
File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
Repository: jakartaee/expression-language
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2021-28170
|
MEDIUM
| 5
|
jakartaee/expression-language
|
jjMoveStringLiteralDfa3_2
|
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
|
b6a3943ac5fba71cbc6719f092e319caa747855b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
public static Color html2color(@Nullable final String str, final boolean hasAlpha) {
Color result = null;
if (str != null && !str.isEmpty() && str.charAt(0) == '#') {
try {
String color = str.substring(1);
if (color.length() > 6) {
color = color.substring(color.length() - 6);
}
if (color.length() == 6) {
result = new Color(Integer.parseInt(color, 16), hasAlpha);
} else if (color.length() == 3) {
final int r = Integer.parseInt(color.charAt(0) + "0", 16);
final int g = Integer.parseInt(color.charAt(1) + "0", 16);
final int b = Integer.parseInt(color.charAt(2) + "0", 16);
result = new Color(r, g, b);
}
} catch (NumberFormatException ex) {
LOGGER.warn(String.format("Can't convert %s to color", str));
}
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: html2color
File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
Repository: raydac/netbeans-mmd-plugin
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000542
|
MEDIUM
| 6.8
|
raydac/netbeans-mmd-plugin
|
html2color
|
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
|
9fba652bf06e649186b8f9e612d60e9cc15097e9
| 0
|
Analyze the following code function for security vulnerabilities
|
private static List<String> getAllowedLiterals(Element ele) {
List<String> allowedValues = new ArrayList<String>();
for (Element literalNode : getGrandChildrenByTagName(ele, "literal-list", "literal")) {
String value = getAttributeValue(literalNode, "value");
if (value != null && value.length() > 0) {
allowedValues.add(value);
} else if (literalNode.getNodeValue() != null) {
allowedValues.add(literalNode.getNodeValue());
}
}
return allowedValues;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllowedLiterals
File: src/main/java/org/owasp/validator/html/Policy.java
Repository: nahsra/antisamy
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2017-14735
|
MEDIUM
| 4.3
|
nahsra/antisamy
|
getAllowedLiterals
|
src/main/java/org/owasp/validator/html/Policy.java
|
82da009e733a989a57190cd6aa1b6824724f6d36
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getSystemProperty(String key) {
return System.getProperty(key);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSystemProperty
File: core/src/main/java/hudson/Functions.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2014-2061
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
getSystemProperty
|
core/src/main/java/hudson/Functions.java
|
bf539198564a1108b7b71a973bf7de963a6213ef
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean reuseDevServer() {
return reuseDevServer;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reuseDevServer
File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-36321
|
MEDIUM
| 5
|
vaadin/flow
|
reuseDevServer
|
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
|
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
| 0
|
Analyze the following code function for security vulnerabilities
|
public synchronized void endRestoreSession() {
if (DEBUG) Slog.d(TAG, "endRestoreSession");
if (mTimedOut) {
Slog.i(TAG, "Session already timed out");
return;
}
if (mEnded) {
throw new IllegalStateException("Restore session already ended");
}
mBackupHandler.post(new EndRestoreRunnable(BackupManagerService.this, this));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: endRestoreSession
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
|
endRestoreSession
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "2.2M2")
public void setStringValue(String className, String fieldName, String value)
{
setStringValue(
getXClassEntityReferenceResolver().resolve(className, EntityType.DOCUMENT, getDocumentReference()),
fieldName, value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setStringValue
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2023-29523
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
setStringValue
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
private PostgresClient postgresClientNullConnection() {
AsyncSQLClient client = new AsyncSQLClient() {
@Override
public SQLClient getConnection(Handler<AsyncResult<SQLConnection>> handler) {
handler.handle(Future.succeededFuture(null));
return this;
}
@Override
public void close(Handler<AsyncResult<Void>> handler) {
handler.handle(Future.succeededFuture());
}
@Override
public void close() {
// nothing to do
}
};
try {
setRootLevel(Level.FATAL);
PostgresClient postgresClient = new PostgresClient(vertx, TENANT);
postgresClient.setClient(client);
return postgresClient;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: postgresClientNullConnection
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
postgresClientNullConnection
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void repaint(Animation cmp) {
if(myView != null && myView.alwaysRepaintAll()) {
if(cmp instanceof Component) {
Component c = (Component)cmp;
c.setDirtyRegion(null);
if(c.getParent() != null) {
cmp = c.getComponentForm();
} else {
Form f = getCurrentForm();
if(f != null) {
cmp = f;
}
}
} else {
// make sure the form is repainted for standalone anims e.g. in the case
// of replace animation
Form f = getCurrentForm();
if(f != null) {
super.repaint(f);
}
}
}
super.repaint(cmp);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: repaint
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
repaint
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getOffsetToLeftRightOf(int caret, boolean toLeft) {
int line = getLineForOffset(caret);
int lineStart = getLineStart(line);
int lineEnd = getLineEnd(line);
int lineDir = getParagraphDirection(line);
boolean lineChanged = false;
boolean advance = toLeft == (lineDir == DIR_RIGHT_TO_LEFT);
// if walking off line, look at the line we're headed to
if (advance) {
if (caret == lineEnd) {
if (line < getLineCount() - 1) {
lineChanged = true;
++line;
} else {
return caret; // at very end, don't move
}
}
} else {
if (caret == lineStart) {
if (line > 0) {
lineChanged = true;
--line;
} else {
return caret; // at very start, don't move
}
}
}
if (lineChanged) {
lineStart = getLineStart(line);
lineEnd = getLineEnd(line);
int newDir = getParagraphDirection(line);
if (newDir != lineDir) {
// unusual case. we want to walk onto the line, but it runs
// in a different direction than this one, so we fake movement
// in the opposite direction.
toLeft = !toLeft;
lineDir = newDir;
}
}
Directions directions = getLineDirections(line);
TextLine tl = TextLine.obtain();
// XXX: we don't care about tabs
tl.set(mPaint, mText, lineStart, lineEnd, lineDir, directions, false, null);
caret = lineStart + tl.getOffsetToLeftRightOf(caret - lineStart, toLeft);
tl = TextLine.recycle(tl);
return caret;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOffsetToLeftRightOf
File: core/java/android/text/Layout.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-9452
|
MEDIUM
| 4.3
|
android
|
getOffsetToLeftRightOf
|
core/java/android/text/Layout.java
|
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
| 0
|
Analyze the following code function for security vulnerabilities
|
private CommandLine hg(String... arguments) {
return createCommandLine("hg").withArgs(arguments).withNonArgSecrets(secrets).withWorkingDir(workingDir).withEncoding("UTF-8");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hg
File: domain/src/main/java/com/thoughtworks/go/domain/materials/mercurial/HgCommand.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2022-29184
|
MEDIUM
| 6.5
|
gocd
|
hg
|
domain/src/main/java/com/thoughtworks/go/domain/materials/mercurial/HgCommand.java
|
37d35115db2ada2190173f9413cfe1bc6c295ecb
| 0
|
Analyze the following code function for security vulnerabilities
|
public void prepareFromSearch(String packageName, int pid, int uid, String query,
Bundle extras) {
try {
final String reason = TAG + ":prepareFromSearch";
mService.tempAllowlistTargetPkgIfPossible(getUid(), getPackageName(),
pid, uid, packageName, reason);
mCb.onPrepareFromSearch(packageName, pid, uid, query, extras);
} catch (RemoteException e) {
Log.e(TAG, "Remote failure in prepareFromSearch.", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: prepareFromSearch
File: services/core/java/com/android/server/media/MediaSessionRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21280
|
MEDIUM
| 5.5
|
android
|
prepareFromSearch
|
services/core/java/com/android/server/media/MediaSessionRecord.java
|
06e772e05514af4aa427641784c5eec39a892ed3
| 0
|
Analyze the following code function for security vulnerabilities
|
public PendingOperation insertIntoPending(SyncOperation op) {
PendingOperation pop;
synchronized (mAuthorities) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "insertIntoPending: authority=" + op.target
+ " extras=" + op.extras);
}
final EndPoint info = op.target;
AuthorityInfo authority =
getOrCreateAuthorityLocked(info,
-1 /* desired identifier */,
true /* write accounts to storage */);
if (authority == null) {
return null;
}
pop = new PendingOperation(authority, op.reason, op.syncSource, op.extras,
op.isExpedited());
mPendingOperations.add(pop);
appendPendingOperationLocked(pop);
SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident);
status.pending = true;
}
reportChange(ContentResolver.SYNC_OBSERVER_TYPE_PENDING);
return pop;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: insertIntoPending
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
insertIntoPending
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isReadyToDispatchInsetsState() {
final boolean visible = shouldCheckTokenVisibleRequested()
? isVisibleRequested() : isVisible();
return visible && mFrozenInsetsState == null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isReadyToDispatchInsetsState
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
|
isReadyToDispatchInsetsState
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
private JsonArray getArray(JsonArrayBuilder builder) {
while(hasNext()) {
JsonParser.Event e = next();
if (e == JsonParser.Event.END_ARRAY) {
return builder.build();
}
builder.add(getValue());
}
throw parsingException(JsonToken.EOF, "[CURLYOPEN, SQUAREOPEN, STRING, NUMBER, TRUE, FALSE, NULL, SQUARECLOSE]");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getArray
File: impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java
Repository: eclipse-ee4j/parsson
The code follows secure coding practices.
|
[
"CWE-834"
] |
CVE-2023-4043
|
HIGH
| 7.5
|
eclipse-ee4j/parsson
|
getArray
|
impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java
|
ab239fee273cb262910890f1a6fe666ae92cd623
| 0
|
Analyze the following code function for security vulnerabilities
|
abstract String getType();
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getType
File: core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices.
|
[
"CWE-345",
"CWE-94",
"CWE-22"
] |
CVE-2019-10182
|
MEDIUM
| 5.8
|
AdoptOpenJDK/IcedTea-Web
|
getType
|
core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java
|
2ab070cdac087bd208f64fa8138bb709f8d7680c
| 0
|
Analyze the following code function for security vulnerabilities
|
public JSONObject getJSONObject(String key) throws JSONException {
Object o = get(key);
if (o instanceof JSONObject) {
return (JSONObject)o;
}
throw new JSONException("JSONObject[" + quote(key) +
"] is not a JSONObject.");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getJSONObject
File: src/main/java/org/codehaus/jettison/json/JSONObject.java
Repository: jettison-json/jettison
The code follows secure coding practices.
|
[
"CWE-674",
"CWE-787"
] |
CVE-2022-45693
|
HIGH
| 7.5
|
jettison-json/jettison
|
getJSONObject
|
src/main/java/org/codehaus/jettison/json/JSONObject.java
|
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
| 0
|
Analyze the following code function for security vulnerabilities
|
void scheduleAppGcsLocked() {
mH.post(() -> mAmInternal.scheduleAppGcs());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scheduleAppGcsLocked
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
|
scheduleAppGcsLocked
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setOauthPasswordFlow(String username, String password) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).usePasswordFlow(username, password);
return this;
}
}
throw new RuntimeException("No OAuth2 authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOauthPasswordFlow
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
|
setOauthPasswordFlow
|
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
|
protected PutMethod executePut(String uri, InputStream content, String mediaType) throws Exception
{
PutMethod putMethod = new PutMethod(uri);
RequestEntity entity = new InputStreamRequestEntity(content, mediaType);
putMethod.setRequestEntity(entity);
this.httpClient.executeMethod(putMethod);
return putMethod;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executePut
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
executePut
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ParceledListSlice<android.content.UriPermission> getPersistedUriPermissions(
String packageName, boolean incoming) {
enforceNotIsolatedCaller("getPersistedUriPermissions");
Preconditions.checkNotNull(packageName, "packageName");
final int callingUid = Binder.getCallingUid();
final int callingUserId = UserHandle.getUserId(callingUid);
final IPackageManager pm = AppGlobals.getPackageManager();
try {
final int packageUid = pm.getPackageUid(packageName,
MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE, callingUserId);
if (packageUid != callingUid) {
throw new SecurityException(
"Package " + packageName + " does not belong to calling UID " + callingUid);
}
} catch (RemoteException e) {
throw new SecurityException("Failed to verify package name ownership");
}
final ArrayList<android.content.UriPermission> result = Lists.newArrayList();
synchronized (this) {
if (incoming) {
final ArrayMap<GrantUri, UriPermission> perms = mGrantedUriPermissions.get(
callingUid);
if (perms == null) {
Slog.w(TAG, "No permission grants found for " + packageName);
} else {
for (UriPermission perm : perms.values()) {
if (packageName.equals(perm.targetPkg) && perm.persistedModeFlags != 0) {
result.add(perm.buildPersistedPublicApiObject());
}
}
}
} else {
final int size = mGrantedUriPermissions.size();
for (int i = 0; i < size; i++) {
final ArrayMap<GrantUri, UriPermission> perms =
mGrantedUriPermissions.valueAt(i);
for (UriPermission perm : perms.values()) {
if (packageName.equals(perm.sourcePkg) && perm.persistedModeFlags != 0) {
result.add(perm.buildPersistedPublicApiObject());
}
}
}
}
}
return new ParceledListSlice<android.content.UriPermission>(result);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPersistedUriPermissions
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
|
getPersistedUriPermissions
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
public FileResourceManager getFileResourceManager() {
return fileResourceManager;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFileResourceManager
File: src/main/java/org/olat/modules/wiki/WikiManager.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
getFileResourceManager
|
src/main/java/org/olat/modules/wiki/WikiManager.java
|
699490be8e931af0ef1f135c55384db1f4232637
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateCapabilities(NetworkCapabilities networkCapabilities) {
if (mNetworkAgent == null) {
return;
}
mNetworkAgent.sendNetworkCapabilitiesAndCache(networkCapabilities);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateCapabilities
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
|
updateCapabilities
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public void addJavaScriptInvocation(
PendingJavaScriptInvocation invocation) {
session.checkHasLock();
pendingJsInvocations.add(invocation);
}
|
Vulnerability Classification:
- CWE: CWE-200
- CVE: CVE-2023-25499
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Cleanup, and refactoring, in Element, StateNode, UIInternals classes + mvn formatter.
Function: addJavaScriptInvocation
File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
Repository: vaadin/flow
Fixed Code:
public void addJavaScriptInvocation(
PendingJavaScriptInvocation invocation) {
session.checkHasLock();
pendingJsInvocations.add(invocation);
invocation.getOwner()
.addDetachListener(() -> pendingJsInvocations
.removeIf(pendingInvocation -> pendingInvocation
.equals(invocation)));
}
|
[
"CWE-200"
] |
CVE-2023-25499
|
MEDIUM
| 6.5
|
vaadin/flow
|
addJavaScriptInvocation
|
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
|
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void notifyPendingSystemUpdate(@Nullable SystemUpdateInfo info) {
Preconditions.checkCallAuthorization(
hasCallingOrSelfPermission(permission.NOTIFY_PENDING_SYSTEM_UPDATE),
"Only the system update service can broadcast update information");
if (UserHandle.getCallingUserId() != UserHandle.USER_SYSTEM) {
Slogf.w(LOG_TAG, "Only the system update service in the system user can broadcast "
+ "update information.");
return;
}
if (!mOwners.saveSystemUpdateInfo(info)) {
// Pending system update hasn't changed, don't send duplicate notification.
return;
}
final Intent intent = new Intent(DeviceAdminReceiver.ACTION_NOTIFY_PENDING_SYSTEM_UPDATE)
.putExtra(DeviceAdminReceiver.EXTRA_SYSTEM_UPDATE_RECEIVED_TIME,
info == null ? -1 : info.getReceivedTime());
mInjector.binderWithCleanCallingIdentity(() -> {
synchronized (getLockObject()) {
// Broadcast to device owner first if there is one.
if (mOwners.hasDeviceOwner()) {
final UserHandle deviceOwnerUser =
UserHandle.of(mOwners.getDeviceOwnerUserId());
intent.setComponent(mOwners.getDeviceOwnerComponent());
mContext.sendBroadcastAsUser(intent, deviceOwnerUser);
}
}
// Get running users.
final int runningUserIds[];
try {
runningUserIds = mInjector.getIActivityManager().getRunningUserIds();
} catch (RemoteException e) {
// Shouldn't happen.
Slogf.e(LOG_TAG, "Could not retrieve the list of running users", e);
return;
}
// Send broadcasts to corresponding profile owners if any.
for (final int userId : runningUserIds) {
synchronized (getLockObject()) {
final ComponentName profileOwnerPackage =
mOwners.getProfileOwnerComponent(userId);
if (profileOwnerPackage != null) {
intent.setComponent(profileOwnerPackage);
mContext.sendBroadcastAsUser(intent, UserHandle.of(userId));
}
}
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyPendingSystemUpdate
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
|
notifyPendingSystemUpdate
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onUserUnlocking(@NonNull TargetUser user) {
mService.onUnlockUser(user.getUserIdentifier());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUserUnlocking
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
onUserUnlocking
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
public Map<Integer, PortableFactory> getPortableFactories() {
if (portableFactories == null) {
portableFactories = new HashMap<Integer, PortableFactory>();
}
return portableFactories;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPortableFactories
File: hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
getPortableFactories
|
hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public void showEmptyShadeView(boolean emptyShadeViewVisible) {
mShowEmptyShadeView = emptyShadeViewVisible;
updateEmptyShadeView();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showEmptyShadeView
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
|
showEmptyShadeView
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String toString(final Object object, final String tagName, final XMLParserConfiguration config, int indentFactor)
throws JSONException {
return toString(object, tagName, config, indentFactor, 0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: src/main/java/org/json/XML.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2022-45688
|
HIGH
| 7.5
|
stleary/JSON-java
|
toString
|
src/main/java/org/json/XML.java
|
f566a1d9ee1f8139357017dc6c7def1da19cd8d4
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isDeviceAB() {
return "true".equalsIgnoreCase(android.os.SystemProperties
.get(AB_DEVICE_KEY, ""));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDeviceAB
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
|
isDeviceAB
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public Builder addAction(int icon, CharSequence title, PendingIntent intent) {
mActions.add(new Action(icon, safeCharSequence(title), intent));
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addAction
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
addAction
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void clearDeserializers() {
this.deserializers.clear();
this.initDeserializers();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearDeserializers
File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
Repository: alibaba/fastjson
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2022-25845
|
MEDIUM
| 6.8
|
alibaba/fastjson
|
clearDeserializers
|
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
|
8f3410f81cbd437f7c459f8868445d50ad301f15
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isPrivilegedDialerCalling(String callingPackage) {
mAppOpsManager.checkPackage(Binder.getCallingUid(), callingPackage);
// Note: Important to clear the calling identity since the code below calls into RoleManager
// to check who holds the dialer role, and that requires MANAGE_ROLE_HOLDERS permission
// which is a system permission.
long token = Binder.clearCallingIdentity();
try {
return mDefaultDialerCache.isDefaultOrSystemDialer(
callingPackage, Binder.getCallingUserHandle().getIdentifier());
} finally {
Binder.restoreCallingIdentity(token);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPrivilegedDialerCalling
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
|
isPrivilegedDialerCalling
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
68dca62035c49e14ad26a54f614199cb29a3393f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handlePositiveActivityResult(int requestCode, final Intent data) {
switch (requestCode) {
case REQUEST_TRUST_KEYS_TEXT:
sendMessage();
break;
case REQUEST_TRUST_KEYS_ATTACHMENTS:
commitAttachments();
break;
case ATTACHMENT_CHOICE_CHOOSE_IMAGE:
final List<Attachment> imageUris = Attachment.extractAttachments(getActivity(), data, Attachment.Type.IMAGE);
mediaPreviewAdapter.addMediaPreviews(imageUris);
toggleInputMethod();
break;
case ATTACHMENT_CHOICE_TAKE_PHOTO:
final Uri takePhotoUri = pendingTakePhotoUri.pop();
if (takePhotoUri != null) {
mediaPreviewAdapter.addMediaPreviews(Attachment.of(getActivity(), takePhotoUri, Attachment.Type.IMAGE));
toggleInputMethod();
} else {
Log.d(Config.LOGTAG, "lost take photo uri. unable to to attach");
}
break;
case ATTACHMENT_CHOICE_CHOOSE_FILE:
case ATTACHMENT_CHOICE_RECORD_VIDEO:
case ATTACHMENT_CHOICE_RECORD_VOICE:
final Attachment.Type type = requestCode == ATTACHMENT_CHOICE_RECORD_VOICE ? Attachment.Type.RECORDING : Attachment.Type.FILE;
final List<Attachment> fileUris = Attachment.extractAttachments(getActivity(), data, type);
mediaPreviewAdapter.addMediaPreviews(fileUris);
toggleInputMethod();
break;
case ATTACHMENT_CHOICE_LOCATION:
double latitude = data.getDoubleExtra("latitude", 0);
double longitude = data.getDoubleExtra("longitude", 0);
Uri geo = Uri.parse("geo:" + String.valueOf(latitude) + "," + String.valueOf(longitude));
mediaPreviewAdapter.addMediaPreviews(Attachment.of(getActivity(), geo, Attachment.Type.LOCATION));
toggleInputMethod();
break;
case REQUEST_INVITE_TO_CONVERSATION:
XmppActivity.ConferenceInvite invite = XmppActivity.ConferenceInvite.parse(data);
if (invite != null) {
if (invite.execute(activity)) {
activity.mToast = Toast.makeText(activity, R.string.creating_conference, Toast.LENGTH_LONG);
activity.mToast.show();
}
}
break;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handlePositiveActivityResult
File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
handlePositiveActivityResult
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getSyncKey(String projectId) {
return stringRedisTemplate.opsForValue().get(SYNC_THIRD_PARTY_ISSUES_KEY + ":" + projectId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSyncKey
File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
getSyncKey
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
private native void nativeDismissTextHandles(long nativeContentViewCoreImpl);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeDismissTextHandles
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-1021"
] |
CVE-2015-1241
|
MEDIUM
| 4.3
|
chromium
|
nativeDismissTextHandles
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Transactional
@Override
public void delete(Project project) {
for (Project child: project.getChildren())
delete(child);
Usage usage = new Usage();
usage.add(settingManager.onDeleteProject(project.getPath()));
for (LinkSpec link: linkSpecManager.query()) {
for (IssueQueryUpdater updater: link.getQueryUpdaters())
usage.add(updater.onDeleteProject(project.getPath()).prefix("issue setting").prefix("administration"));
}
usage.checkInUse("Project '" + project.getPath() + "'");
for (Project fork: project.getForks()) {
Collection<Project> descendants = fork.getForkChildren();
descendants.add(fork);
for (Project descendant: descendants) {
Query<?> query = getSession().createQuery(String.format("update Issue set %s=:fork where %s=:descendant",
Issue.PROP_NUMBER_SCOPE, Issue.PROP_PROJECT));
query.setParameter("fork", fork);
query.setParameter("descendant", descendant);
query.executeUpdate();
query = getSession().createQuery(String.format("update Build set %s=:fork where %s=:descendant",
Build.PROP_NUMBER_SCOPE, Build.PROP_PROJECT));
query.setParameter("fork", fork);
query.setParameter("descendant", descendant);
query.executeUpdate();
query = getSession().createQuery(String.format("update PullRequest set %s=:fork where %s=:descendant",
PullRequest.PROP_NUMBER_SCOPE, PullRequest.PROP_TARGET_PROJECT));
query.setParameter("fork", fork);
query.setParameter("descendant", descendant);
query.executeUpdate();
}
}
Query<?> query = getSession().createQuery(String.format("update Project set %s=null where %s=:forkedFrom",
Project.PROP_FORKED_FROM, Project.PROP_FORKED_FROM));
query.setParameter("forkedFrom", project);
query.executeUpdate();
query = getSession().createQuery(String.format("update PullRequest set %s=null where %s=:sourceProject",
PullRequest.PROP_SOURCE_PROJECT, PullRequest.PROP_SOURCE_PROJECT));
query.setParameter("sourceProject", project);
query.executeUpdate();
for (Build build: project.getBuilds())
buildManager.delete(build);
dao.remove(project);
synchronized (repositoryCache) {
Repository repository = repositoryCache.remove(project.getId());
if (repository != null)
repository.close();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: delete
File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39205
|
CRITICAL
| 9.8
|
theonedev/onedev
|
delete
|
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getSplashscreenTheme(ActivityOptions options) {
// Find the splash screen theme. User can override the persisted theme by
// ActivityOptions.
String splashScreenThemeResName = options != null
? options.getSplashScreenThemeResName() : null;
if (splashScreenThemeResName == null || splashScreenThemeResName.isEmpty()) {
try {
splashScreenThemeResName = mAtmService.getPackageManager()
.getSplashScreenTheme(packageName, mUserId);
} catch (RemoteException ignore) {
// Just use the default theme
}
}
int splashScreenThemeResId = 0;
if (splashScreenThemeResName != null && !splashScreenThemeResName.isEmpty()) {
try {
final Context packageContext = mAtmService.mContext
.createPackageContext(packageName, 0);
splashScreenThemeResId = packageContext.getResources()
.getIdentifier(splashScreenThemeResName, null, null);
} catch (PackageManager.NameNotFoundException
| Resources.NotFoundException ignore) {
// Just use the default theme
}
}
return splashScreenThemeResId;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSplashscreenTheme
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
getSplashscreenTheme
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
private static ActivityOptions makeThumbnailScaleUpAnimation(View source,
Bitmap thumbnail, int startX, int startY, OnAnimationStartedListener listener) {
return makeThumbnailAnimation(source, thumbnail, startX, startY, listener, true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeThumbnailScaleUpAnimation
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
makeThumbnailScaleUpAnimation
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Analyze the following code function for security vulnerabilities
|
public static PageParameters paramsOf(Project project, Long buildNumber, String path) {
PageParameters params = new PageParameters();
params.set(PARAM_PROJECT, project.getId());
params.set(PARAM_BUILD, buildNumber);
int index = 0;
for (String segment: Splitter.on("/").split(path)) {
params.set(index, segment);
index++;
}
return params;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: paramsOf
File: server-core/src/main/java/io/onedev/server/web/resource/ArtifactResource.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-79",
"CWE-732"
] |
CVE-2022-39207
|
MEDIUM
| 5.4
|
theonedev/onedev
|
paramsOf
|
server-core/src/main/java/io/onedev/server/web/resource/ArtifactResource.java
|
adb6e31476621f824fc3227a695232df830d83ab
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean mutateSecureSetting(String name, String value, int requestingUserId,
int operation, boolean forceNotify) {
// Make sure the caller can change the settings.
enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS);
// Resolve the userId on whose behalf the call is made.
final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
// If this is a setting that is currently restricted for this user, do not allow
// unrestricting changes.
if (isGlobalOrSecureSettingRestrictedForUser(name, callingUserId, value)) {
return false;
}
// Determine the owning user as some profile settings are cloned from the parent.
final int owningUserId = resolveOwningUserIdForSecureSettingLocked(callingUserId, name);
// Only the owning user can change the setting.
if (owningUserId != callingUserId) {
return false;
}
// Special cases for location providers (sigh).
if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) {
return updateLocationProvidersAllowedLocked(value, owningUserId, forceNotify);
}
// Mutate the value.
synchronized (mLock) {
switch (operation) {
case MUTATION_OPERATION_INSERT: {
return mSettingsRegistry.insertSettingLocked(SETTINGS_TYPE_SECURE,
owningUserId, name, value, getCallingPackage(), forceNotify);
}
case MUTATION_OPERATION_DELETE: {
return mSettingsRegistry.deleteSettingLocked(SETTINGS_TYPE_SECURE,
owningUserId, name, forceNotify);
}
case MUTATION_OPERATION_UPDATE: {
return mSettingsRegistry.updateSettingLocked(SETTINGS_TYPE_SECURE,
owningUserId, name, value, getCallingPackage(), forceNotify);
}
}
}
return false;
}
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2016-3887
- Severity: MEDIUM
- CVSS Score: 6.8
Description: Disallow shell to mutate always-on vpn when DISALLOW_CONFIG_VPN user restriction is set
Fix: 29899712
Change-Id: I38cc9d0e584c3f2674c9ff1d91f77a11479d8943
(cherry picked from commit 9c7b706cf4332b4aeea39c166abca04b56685280)
Function: mutateSecureSetting
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
Fixed Code:
private boolean mutateSecureSetting(String name, String value, int requestingUserId,
int operation, boolean forceNotify) {
// Make sure the caller can change the settings.
enforceWritePermission(Manifest.permission.WRITE_SECURE_SETTINGS);
// Resolve the userId on whose behalf the call is made.
final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId);
// If this is a setting that is currently restricted for this user, do not allow
// unrestricting changes.
if (isGlobalOrSecureSettingRestrictedForUser(name, callingUserId, value,
Binder.getCallingUid())) {
return false;
}
// Determine the owning user as some profile settings are cloned from the parent.
final int owningUserId = resolveOwningUserIdForSecureSettingLocked(callingUserId, name);
// Only the owning user can change the setting.
if (owningUserId != callingUserId) {
return false;
}
// Special cases for location providers (sigh).
if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) {
return updateLocationProvidersAllowedLocked(value, owningUserId, forceNotify);
}
// Mutate the value.
synchronized (mLock) {
switch (operation) {
case MUTATION_OPERATION_INSERT: {
return mSettingsRegistry.insertSettingLocked(SETTINGS_TYPE_SECURE,
owningUserId, name, value, getCallingPackage(), forceNotify);
}
case MUTATION_OPERATION_DELETE: {
return mSettingsRegistry.deleteSettingLocked(SETTINGS_TYPE_SECURE,
owningUserId, name, forceNotify);
}
case MUTATION_OPERATION_UPDATE: {
return mSettingsRegistry.updateSettingLocked(SETTINGS_TYPE_SECURE,
owningUserId, name, value, getCallingPackage(), forceNotify);
}
}
}
return false;
}
|
[
"CWE-264"
] |
CVE-2016-3887
|
MEDIUM
| 6.8
|
android
|
mutateSecureSetting
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
335702d106797bce8a88044783fa1fc1d5f751d0
| 1
|
Analyze the following code function for security vulnerabilities
|
public void addContainerStructures(List<ContainerStructure> containerStructures, String containerIdentifier, String containerInode){
cache.put(containerStructureGroup + containerIdentifier + containerInode, containerStructures, containerStructureGroup);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addContainerStructures
File: src/com/dotmarketing/cache/ContentTypeCacheImpl.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-2355
|
HIGH
| 7.5
|
dotCMS/core
|
addContainerStructures
|
src/com/dotmarketing/cache/ContentTypeCacheImpl.java
|
897f3632d7e471b7a73aabed5b19f6f53d4e5562
| 0
|
Analyze the following code function for security vulnerabilities
|
public void connectOtherProfile(BluetoothDevice device, int firstProfileStatus){
if ((mHandler.hasMessages(MESSAGE_CONNECT_OTHER_PROFILES) == false) &&
(isQuietModeEnabled()== false)){
Message m = mHandler.obtainMessage(MESSAGE_CONNECT_OTHER_PROFILES);
m.obj = device;
m.arg1 = (int)firstProfileStatus;
mHandler.sendMessageDelayed(m,CONNECT_OTHER_PROFILES_TIMEOUT);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: connectOtherProfile
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
|
connectOtherProfile
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void clear() {
if (!fPlayback) {
fCleared = true;
fByteBuffer = null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clear
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
|
clear
|
src/org/cyberneko/html/HTMLScanner.java
|
a800fce3b079def130ed42a408ff1d09f89e773d
| 0
|
Analyze the following code function for security vulnerabilities
|
public static List<String> getXMLLabels(Element root, String nodeType,
String attrType) throws IllegalArgumentException {
assert (root != null);
assert (nodeType != null);
assert (attrType != null);
assert (nodeType.length() > 0);
assert (attrType.length() > 0);
List<String> attrValuesList = new ArrayList<String>();
switch (nodeType) {
case "circuit":
inspectCircuitNodes(root, attrType, attrValuesList);
break;
case "comp":
inspectCompNodes(root, attrValuesList);
break;
default:
throw new IllegalArgumentException("Invalid node type requested: "
+ nodeType);
}
return attrValuesList;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getXMLLabels
File: src/com/cburch/logisim/file/XmlReader.java
Repository: logisim-evolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000889
|
MEDIUM
| 6.8
|
logisim-evolution
|
getXMLLabels
|
src/com/cburch/logisim/file/XmlReader.java
|
90aee8f8ceef463884cc400af4f6d1f109fb0972
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getNamespaceURI() {
return doc.getNamespaceURI();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNamespaceURI
File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
Repository: LoboEvolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000540
|
MEDIUM
| 6.8
|
LoboEvolution
|
getNamespaceURI
|
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
|
9b75694cedfa4825d4a2330abf2719d470c654cd
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onReject(@NonNull String ssid, boolean disconnectRequired) {}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onReject
File: service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
onReject
|
service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onFilterComplete(boolean keepMessage) {
Rlog.e(TAG, "Unexpected onFilterComplete call with result: " + keepMessage);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onFilterComplete
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
|
onFilterComplete
|
src/java/com/android/internal/telephony/SMSDispatcher.java
|
df31d37d285dde9911b699837c351aed2320b586
| 0
|
Analyze the following code function for security vulnerabilities
|
private <T extends Route.Definition> T appendDefinition(String method, String pattern,
Route.Filter filter, Throwing.Function4<String, String, Route.Filter, Boolean, T> creator) {
String pathPattern = prefixPath(pattern).orElse(pattern);
T route = creator.apply(method, pathPattern, filter, caseSensitiveRouting);
if (prefix != null) {
route.prefix = prefix;
// reset name will update the name if prefix != null
route.name(route.name());
}
bag.add(route);
return route;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendDefinition
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
appendDefinition
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void disableUnusablePreferencesImpl(final int quality,
boolean hideDisabled) {
final PreferenceScreen entries = getPreferenceScreen();
int adminEnforcedQuality = mDPM.getPasswordQuality(null, mUserId);
EnforcedAdmin enforcedAdmin = RestrictedLockUtils.checkIfPasswordQualityIsSet(
getActivity(), mUserId);
for (ScreenLockType lock : ScreenLockType.values()) {
String key = lock.preferenceKey;
Preference pref = findPreference(key);
if (pref instanceof RestrictedPreference) {
boolean visible = mController.isScreenLockVisible(lock);
boolean enabled = mController.isScreenLockEnabled(lock, quality);
boolean disabledByAdmin =
mController.isScreenLockDisabledByAdmin(lock, adminEnforcedQuality);
if (hideDisabled) {
visible = visible && enabled;
}
if (!visible) {
entries.removePreference(pref);
} else if (disabledByAdmin && enforcedAdmin != null) {
((RestrictedPreference) pref).setDisabledByAdmin(enforcedAdmin);
} else if (!enabled) {
// we need to setDisabledByAdmin to null first to disable the padlock
// in case it was set earlier.
((RestrictedPreference) pref).setDisabledByAdmin(null);
pref.setSummary(R.string.unlock_set_unlock_disabled_summary);
pref.setEnabled(false);
} else {
((RestrictedPreference) pref).setDisabledByAdmin(null);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: disableUnusablePreferencesImpl
File: src/com/android/settings/password/ChooseLockGeneric.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2018-9501
|
HIGH
| 7.2
|
android
|
disableUnusablePreferencesImpl
|
src/com/android/settings/password/ChooseLockGeneric.java
|
5e43341b8c7eddce88f79c9a5068362927c05b54
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseEditableProperty(final Element property, final String name, final String defaultValue)
throws GameParseException {
// what type
final List<Node> children = getNonTextNodes(property);
if (children.size() != 1) {
throw newGameParseException(
"Editable properties must have exactly 1 child specifying the type. Number of children found:"
+ children.size() + " for node:" + property.getNodeName());
}
final Element child = (Element) children.get(0);
final String childName = child.getNodeName();
final IEditableProperty<?> editableProperty;
switch (childName) {
case "boolean":
editableProperty = new BooleanProperty(name, null, Boolean.valueOf(defaultValue));
break;
case "file":
editableProperty = new FileProperty(name, null, defaultValue);
break;
case "list":
case "combo":
final List<String> values = Splitter.on(',')
.omitEmptyStrings()
.splitToList(child.getAttribute("values"));
editableProperty = new ComboProperty<>(name, null, defaultValue, values);
break;
case "number": {
final int max = Integer.valueOf(child.getAttribute("max"));
final int min = Integer.valueOf(child.getAttribute("min"));
final int def = Integer.valueOf(defaultValue);
editableProperty = new NumberProperty(name, null, max, min, def);
break;
}
case "color": {
// Parse the value as a hexadecimal number
final int def = Integer.valueOf(defaultValue, 16);
editableProperty = new ColorProperty(name, null, def);
break;
}
case "string":
editableProperty = new StringProperty(name, null, defaultValue);
break;
default:
throw newGameParseException("Unrecognized property type:" + childName);
}
data.getProperties().addEditableProperty(editableProperty);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseEditableProperty
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000546
|
MEDIUM
| 6.8
|
triplea-game/triplea
|
parseEditableProperty
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isNativeShareSupported() {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isNativeShareSupported
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
isNativeShareSupported
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.