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 void buildAssistBundleLocked(PendingAssistExtras pae, Bundle result) { if (result != null) { pae.extras.putBundle(Intent.EXTRA_ASSIST_CONTEXT, result); } if (pae.hint != null) { pae.extras.putBoolean(pae.hint, true); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildAssistBundleLocked 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
buildAssistBundleLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void updateTo(Revision revision, ConsoleOutputStreamConsumer outputStreamConsumer) { if (!pull(outputStreamConsumer) || !update(revision, outputStreamConsumer)) { bomb(format("Unable to update to revision [%s]", revision)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateTo 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
updateTo
domain/src/main/java/com/thoughtworks/go/domain/materials/mercurial/HgCommand.java
37d35115db2ada2190173f9413cfe1bc6c295ecb
0
Analyze the following code function for security vulnerabilities
public User getUserByEmail(String email) { return this.getOne( new LambdaQueryWrapper<User>() .eq(User::getEmail, email) ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserByEmail File: framework/sdk/backend/src/main/java/com/fit2cloud/base/service/impl/BaseUserServiceImpl.java Repository: CloudExplorer-Dev/CloudExplorer-Lite The code follows secure coding practices.
[ "CWE-521" ]
CVE-2023-3423
HIGH
8.8
CloudExplorer-Dev/CloudExplorer-Lite
getUserByEmail
framework/sdk/backend/src/main/java/com/fit2cloud/base/service/impl/BaseUserServiceImpl.java
7d4dab60352079953b7be120afe9bd14983ae3bc
0
Analyze the following code function for security vulnerabilities
@Override public boolean isAccessibilityServicePermittedByAdmin(ComponentName who, String packageName, int userHandle) { if (!mHasFeature) { return true; } Objects.requireNonNull(who, "ComponentName is null"); Preconditions.checkStringNotEmpty(packageName, "packageName is null"); Preconditions.checkCallAuthorization(isSystemUid(getCallerIdentity()), String.format(NOT_SYSTEM_CALLER_MSG, "query if an accessibility service is disabled by admin")); synchronized (getLockObject()) { ActiveAdmin admin = getActiveAdminUncheckedLocked(who, userHandle); if (admin == null) { return false; } if (admin.permittedAccessiblityServices == null) { return true; } return checkPackagesInPermittedListOrSystem(Collections.singletonList(packageName), admin.permittedAccessiblityServices, userHandle); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAccessibilityServicePermittedByAdmin 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
isAccessibilityServicePermittedByAdmin
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public boolean isDeviceFinanced(String callerPackageName) { CallerIdentity caller = getCallerIdentity(callerPackageName); Preconditions.checkCallAuthorization(isDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller) || isProfileOwnerOnUser0(caller) || isCallerDevicePolicyManagementRoleHolder(caller) || isCallerSystemSupervisionRoleHolder(caller)); return getFinancedDeviceKioskRoleHolderOnAnyUser() != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDeviceFinanced 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
isDeviceFinanced
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public String encodeCharacter( char[] immune, Character c ) { String cStr = String.valueOf(c.charValue()); byte[] bytes; StringBuilder sb; if(UNENCODED_SET.contains(c)) return cStr; bytes = toUtf8Bytes(cStr); sb = new StringBuilder(bytes.length * 3); for(byte b : bytes) appendTwoUpperHex(sb.append('%'), b); return sb.toString(); }
Vulnerability Classification: - CWE: CWE-310 - CVE: CVE-2013-5960 - Severity: MEDIUM - CVSS Score: 5.8 Description: Close #306. Close #359 Function: encodeCharacter File: src/main/java/org/owasp/esapi/codecs/PercentCodec.java Repository: ESAPI/esapi-java-legacy Fixed Code: public String encodeCharacter( char[] immune, Character c ) { String cStr = String.valueOf(c.charValue()); byte[] bytes; StringBuilder sb; // check for user specified immune characters if ( immune != null && containsCharacter( c.charValue(), immune ) ) return cStr; // check for standard characters (e.g., alphanumeric, etc.) if(UNENCODED_SET.contains(c)) return cStr; bytes = toUtf8Bytes(cStr); sb = new StringBuilder(bytes.length * 3); for(byte b : bytes) appendTwoUpperHex(sb.append('%'), b); return sb.toString(); }
[ "CWE-310" ]
CVE-2013-5960
MEDIUM
5.8
ESAPI/esapi-java-legacy
encodeCharacter
src/main/java/org/owasp/esapi/codecs/PercentCodec.java
b7cbc53f9cc967cf1a5a9463d8c6fef9ed6ef4f7
1
Analyze the following code function for security vulnerabilities
@Test public void parseQueryTSUIDType() throws Exception { HttpQuery query = NettyMocks.getQuery(tsdb, "/api/query?start=1h-ago&tsuid=sum:010101"); TSQuery tsq = (TSQuery) parseQuery.invoke(rpc, tsdb, query, expressions); assertNotNull(tsq); assertEquals("1h-ago", tsq.getStart()); assertNotNull(tsq.getQueries()); TSSubQuery sub = tsq.getQueries().get(0); assertNotNull(sub); assertEquals("sum", sub.getAggregator()); assertEquals(1, sub.getTsuids().size()); assertEquals("010101", sub.getTsuids().get(0)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseQueryTSUIDType File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
parseQueryTSUIDType
test/tsd/TestQueryRpc.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
public void reset() { size = 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reset File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java Repository: netty The code follows secure coding practices.
[ "CWE-444" ]
CVE-2019-16869
MEDIUM
5
netty
reset
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
39cafcb05c99f2aa9fce7e6597664c9ed6a63a95
0
Analyze the following code function for security vulnerabilities
private List<Tuple<String, String>> setValues(final IAttachment attachment, final List<Element> values) throws GameParseException { final List<Tuple<String, String>> options = new ArrayList<>(); for (final Element current : values) { // decapitalize the property name for backwards compatibility final String name = decapitalize(current.getAttribute("name")); if (name.isEmpty()) { throw newGameParseException("Option name with zero length"); } final String value = current.getAttribute("value"); final String count = current.getAttribute("count"); final String itemValues = (count.length() > 0 ? count + ":" : "") + value; try { attachment.getProperty(name) .orElseThrow(() -> newGameParseException(String.format( "Missing property definition for option '%s' in attachment '%s'", name, attachment.getName()))) .setValue(itemValues); } catch (final GameParseException e) { throw e; } catch (final Exception e) { throw newGameParseException("Unexpected Exception while setting values for attachment" + attachment, e); } options.add(Tuple.of(name, itemValues)); } return options; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValues 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
setValues
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getAllRequestHeaders(String name) { return request.headers().getAll(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllRequestHeaders File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-0981
MEDIUM
6.5
quarkusio/quarkus
getAllRequestHeaders
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
96c64fd8f09c02a497e2db366c64dd9196582442
0
Analyze the following code function for security vulnerabilities
@Override public void lockNow(Bundle options) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DEVICE_POWER, null); mHandler.removeCallbacks(mScreenLockTimeout); if (options != null) { // In case multiple calls are made to lockNow, we don't wipe out the options // until the runnable actually executes. mScreenLockTimeout.setLockOptions(options); } mHandler.post(mScreenLockTimeout); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lockNow File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
lockNow
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
public long getEndRow() { return endRow; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEndRow File: src/main/java/com/github/pagehelper/Page.java Repository: pagehelper/Mybatis-PageHelper The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-28111
HIGH
7.5
pagehelper/Mybatis-PageHelper
getEndRow
src/main/java/com/github/pagehelper/Page.java
554a524af2d2b30d09505516adc412468a84d8fa
0
Analyze the following code function for security vulnerabilities
@GuardedBy("mProcLock") private void updatePhantomProcessCpuTimeLPr(final long uptimeSince, final boolean doCpuKills, final long checkDur, final int cpuLimit, final ProcessRecord app) { mPhantomProcessList.forEachPhantomProcessOfApp(app, r -> { if (r.mLastCputime > 0) { final long cpuTimeUsed = r.mCurrentCputime - r.mLastCputime; if (checkExcessivePowerUsageLPr(uptimeSince, doCpuKills, cpuTimeUsed, app.processName, r.toString(), cpuLimit, app)) { mHandler.post(() -> { synchronized (ActivityManagerService.this) { mPhantomProcessList.killPhantomProcessGroupLocked(app, r, ApplicationExitInfo.REASON_EXCESSIVE_RESOURCE_USAGE, ApplicationExitInfo.SUBREASON_EXCESSIVE_CPU, "excessive cpu " + cpuTimeUsed + " during " + uptimeSince + " dur=" + checkDur + " limit=" + cpuLimit); } }); return false; } } r.mLastCputime = r.mCurrentCputime; return true; }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updatePhantomProcessCpuTimeLPr File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
updatePhantomProcessCpuTimeLPr
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private static native long nativeThemeCreate(long ptr);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeThemeCreate File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
nativeThemeCreate
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public Path getManifestPath() { return manifestPath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getManifestPath File: src/main/java/org/olat/fileresource/types/ScormCPFileResource.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
getManifestPath
src/main/java/org/olat/fileresource/types/ScormCPFileResource.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
public static String jsFunction_getAuthServerURL(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws APIManagementException { APIManagerConfiguration config = HostObjectComponent.getAPIManagerConfiguration(); String url = config.getFirstProperty(APIConstants.AUTH_MANAGER_URL); if (url == null) { handleException("API key manager URL unspecified"); } return url; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_getAuthServerURL File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_getAuthServerURL
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
int modifyRawOomAdj(int adj) { if (hasAboveClient) { // If this process has bound to any services with BIND_ABOVE_CLIENT, // then we need to drop its adjustment to be lower than the service's // in order to honor the request. We want to drop it by one adjustment // level... but there is special meaning applied to various levels so // we will skip some of them. if (adj < ProcessList.FOREGROUND_APP_ADJ) { // System process will not get dropped, ever } else if (adj < ProcessList.VISIBLE_APP_ADJ) { adj = ProcessList.VISIBLE_APP_ADJ; } else if (adj < ProcessList.PERCEPTIBLE_APP_ADJ) { adj = ProcessList.PERCEPTIBLE_APP_ADJ; } else if (adj < ProcessList.CACHED_APP_MIN_ADJ) { adj = ProcessList.CACHED_APP_MIN_ADJ; } else if (adj < ProcessList.CACHED_APP_MAX_ADJ) { adj++; } } return adj; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: modifyRawOomAdj File: services/core/java/com/android/server/am/ProcessRecord.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
modifyRawOomAdj
services/core/java/com/android/server/am/ProcessRecord.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("resource") protected Object deserializeUsingPropertyBasedWithUnwrapped(JsonParser p, DeserializationContext ctxt) throws IOException { // 01-Dec-2016, tatu: Note: This IS legal to call, but only when unwrapped // value itself is NOT passed via `CreatorProperty` (which isn't supported). // Ok however to pass via setter or field. final PropertyBasedCreator creator = _propertyBasedCreator; PropertyValueBuffer buffer = creator.startBuilding(p, ctxt, _objectIdReader); TokenBuffer tokens = ctxt.bufferForInputBuffering(p); tokens.writeStartObject(); JsonToken t = p.currentToken(); for (; t == JsonToken.FIELD_NAME; t = p.nextToken()) { String propName = p.currentName(); p.nextToken(); // to point to value // creator property? final SettableBeanProperty creatorProp = creator.findCreatorProperty(propName); // Object Id property? if (buffer.readIdProperty(propName) && creatorProp == null) { continue; } if (creatorProp != null) { // Last creator property to set? if (buffer.assignParameter(creatorProp, _deserializeWithErrorWrapping(p, ctxt, creatorProp))) { t = p.nextToken(); // to move to following FIELD_NAME/END_OBJECT Object bean; try { bean = creator.build(ctxt, buffer); } catch (Exception e) { bean = wrapInstantiationProblem(e, ctxt); } // [databind#631]: Assign current value, to be accessible by custom serializers p.setCurrentValue(bean); // if so, need to copy all remaining tokens into buffer while (t == JsonToken.FIELD_NAME) { // NOTE: do NOT skip name as it needs to be copied; `copyCurrentStructure` does that tokens.copyCurrentStructure(p); t = p.nextToken(); } // 28-Aug-2018, tatu: Let's add sanity check here, easier to catch off-by-some // problems if we maintain invariants if (t != JsonToken.END_OBJECT) { ctxt.reportWrongTokenException(this, JsonToken.END_OBJECT, "Attempted to unwrap '%s' value", handledType().getName()); } tokens.writeEndObject(); if (bean.getClass() != _beanType.getRawClass()) { // !!! 08-Jul-2011, tatu: Could probably support; but for now // it's too complicated, so bail out ctxt.reportInputMismatch(creatorProp, "Cannot create polymorphic instances with unwrapped values"); return null; } return _unwrappedPropertyHandler.processUnwrapped(p, ctxt, bean, tokens); } continue; } // regular property? needs buffering SettableBeanProperty prop = _beanProperties.find(propName); if (prop != null) { buffer.bufferProperty(prop, _deserializeWithErrorWrapping(p, ctxt, prop)); continue; } // Things marked as ignorable should not be passed to any setter if (IgnorePropertiesUtil.shouldIgnore(propName, _ignorableProps, _includableProps)) { handleIgnoredProperty(p, ctxt, handledType(), propName); continue; } // 29-Nov-2016, tatu: probably should try to avoid sending content // both to any setter AND buffer... but, for now, the only thing // we can do. // how about any setter? We'll get copies but... if (_anySetter == null) { // but... others should be passed to unwrapped property deserializers tokens.writeFieldName(propName); tokens.copyCurrentStructure(p); } else { // Need to copy to a separate buffer first TokenBuffer b2 = ctxt.bufferAsCopyOfValue(p); tokens.writeFieldName(propName); tokens.append(b2); try { buffer.bufferAnyProperty(_anySetter, propName, _anySetter.deserialize(b2.asParserOnFirstToken(), ctxt)); } catch (Exception e) { wrapAndThrow(e, _beanType.getRawClass(), propName, ctxt); } continue; } } // We hit END_OBJECT, so: Object bean; try { bean = creator.build(ctxt, buffer); } catch (Exception e) { wrapInstantiationProblem(e, ctxt); return null; // never gets here } return _unwrappedPropertyHandler.processUnwrapped(p, ctxt, bean, tokens); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deserializeUsingPropertyBasedWithUnwrapped File: src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42004
HIGH
7.5
FasterXML/jackson-databind
deserializeUsingPropertyBasedWithUnwrapped
src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java
063183589218fec19a9293ed2f17ec53ea80ba88
0
Analyze the following code function for security vulnerabilities
protected SecurityDesc getCodeSourceSecurity(URL source) { SecurityDesc sec = jarLocationSecurityMap.get(source); synchronized (alreadyTried) { if (sec == null && !alreadyTried.contains(source)) { alreadyTried.add(source); //try to load the jar which is requesting the permissions, but was NOT downloaded by standard way LOG.info("Application is trying to get permissions for {}, which was not added by standard way. Trying to download and verify!", source.toString()); try { JARDesc des = new JARDesc(source, null, null, false, false, false, false); addNewJar(des); sec = jarLocationSecurityMap.get(source); } catch (Throwable t) { LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, t); sec = null; } } } if (sec == null) { LOG.info("Error: No security instance for {}. The application may have trouble continuing", source.toString()); } return sec; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCodeSourceSecurity File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.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
getCodeSourceSecurity
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
public boolean isLastNEnabled() { return myLastNEnabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLastNEnabled File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
isLastNEnabled
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
@Override public void moveTaskToStack(int taskId, int stackId, boolean toTop) { enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "moveTaskToStack()"); synchronized (this) { long ident = Binder.clearCallingIdentity(); try { final TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId); if (task == null) { Slog.w(TAG, "moveTaskToStack: No task for id=" + taskId); return; } if (DEBUG_STACK) Slog.d(TAG_STACK, "moveTaskToStack: moving task=" + taskId + " to stackId=" + stackId + " toTop=" + toTop); final ActivityStack stack = mStackSupervisor.getStack(stackId); if (stack == null) { throw new IllegalStateException( "moveTaskToStack: No stack for stackId=" + stackId); } if (!stack.isActivityTypeStandardOrUndefined()) { throw new IllegalArgumentException("moveTaskToStack: Attempt to move task " + taskId + " to stack " + stackId); } if (stack.inSplitScreenPrimaryWindowingMode()) { mWindowManager.setDockedStackCreateState( SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT, null /* initialBounds */); } task.reparent(stack, toTop, REPARENT_KEEP_STACK_AT_FRONT, ANIMATE, !DEFER_RESUME, "moveTaskToStack"); } finally { Binder.restoreCallingIdentity(ident); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveTaskToStack 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
moveTaskToStack
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void ensureServletContextAvailable(ServletRequest request) { if (servletContext == null) { if (servletMajorVersion >= 3) { servletContext = request.getServletContext(); } else { throw new IllegalStateException( "ServletContext is not available (you are using Servlets API <3.0; it might be caused by " + PushHandlerFilter.class.getName() + " in distributed environment)"); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ensureServletContextAvailable File: impl/src/main/java/org/richfaces/webapp/PushHandlerFilter.java Repository: pslegr/core-1 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-0086
MEDIUM
4.3
pslegr/core-1
ensureServletContextAvailable
impl/src/main/java/org/richfaces/webapp/PushHandlerFilter.java
8131f15003f5bec73d475d2b724472e4b87d0757
0
Analyze the following code function for security vulnerabilities
@Override public void isCredentialsUpdateSuggested( IAccountManagerResponse response, final Account account, final String statusToken) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "isCredentialsUpdateSuggested: " + account + ", response " + response + ", caller's uid " + Binder.getCallingUid() + ", pid " + Binder.getCallingPid()); } if (response == null) { throw new IllegalArgumentException("response is null"); } if (account == null) { throw new IllegalArgumentException("account is null"); } if (TextUtils.isEmpty(statusToken)) { throw new IllegalArgumentException("status token is empty"); } int usrId = UserHandle.getCallingUserId(); final long identityToken = clearCallingIdentity(); try { UserAccounts accounts = getUserAccounts(usrId); new Session(accounts, response, account.type, false /* expectActivityLaunch */, false /* stripAuthTokenFromResult */, account.name, false /* authDetailsRequired */) { @Override protected String toDebugString(long now) { return super.toDebugString(now) + ", isCredentialsUpdateSuggested" + ", " + account.toSafeString(); } @Override public void run() throws RemoteException { mAuthenticator.isCredentialsUpdateSuggested(this, account, statusToken); } @Override public void onResult(Bundle result) { Bundle.setDefusable(result, true); IAccountManagerResponse response = getResponseAndClose(); if (response == null) { return; } if (result == null) { sendErrorResponse( response, AccountManager.ERROR_CODE_INVALID_RESPONSE, "null bundle"); return; } if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response " + response); } // Check to see if an error occurred. We know if an error occurred because all // error codes are greater than 0. if ((result.getInt(AccountManager.KEY_ERROR_CODE, -1) > 0)) { sendErrorResponse(response, result.getInt(AccountManager.KEY_ERROR_CODE), result.getString(AccountManager.KEY_ERROR_MESSAGE)); return; } if (!result.containsKey(AccountManager.KEY_BOOLEAN_RESULT)) { sendErrorResponse( response, AccountManager.ERROR_CODE_INVALID_RESPONSE, "no result in response"); return; } final Bundle newResult = new Bundle(); newResult.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT, false)); sendResponse(response, newResult); } }.bind(); } finally { restoreCallingIdentity(identityToken); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCredentialsUpdateSuggested 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
isCredentialsUpdateSuggested
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
private void initAccessibility() { mLockIcon.setAccessibilityDelegate(mAccessibilityDelegate); mLeftAffordanceView.setAccessibilityDelegate(mAccessibilityDelegate); mRightAffordanceView.setAccessibilityDelegate(mAccessibilityDelegate); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initAccessibility File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
initAccessibility
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public String getUrl() { String currDomain = SaManager.getConfig().getCurrDomain(); if( ! SaFoxUtil.isEmpty(currDomain)) { return currDomain + this.getRequestPath(); } return request.getRequestURL().toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUrl File: sa-token-starter/sa-token-jakarta-servlet/src/main/java/cn/dev33/satoken/servlet/model/SaRequestForServlet.java Repository: dromara/Sa-Token The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-44794
CRITICAL
9.8
dromara/Sa-Token
getUrl
sa-token-starter/sa-token-jakarta-servlet/src/main/java/cn/dev33/satoken/servlet/model/SaRequestForServlet.java
954efeb73277f924f836da2a25322ea35ee1bfa3
0
Analyze the following code function for security vulnerabilities
@Override public T addByte(K name, byte value) { return add(name, fromByte(name, value)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addByte File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
addByte
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@Override public void deleteIssue(String id) { IssuesWithBLOBs issuesWithBLOBs = issuesMapper.selectByPrimaryKey(id); super.deleteIssue(id); zentaoClient.deleteIssue(issuesWithBLOBs.getPlatformId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteIssue File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
deleteIssue
test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
@Override public Route.Collection delete(final String path1, final String path2, final String path3, final Route.ZeroArgHandler handler) { return new Route.Collection( new Route.Definition[]{delete(path1, handler), delete(path2, handler), delete(path3, handler)}); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
delete
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private void tieProfileLockToParent(int userId, String password) { if (DEBUG) Slog.v(TAG, "tieProfileLockToParent for user: " + userId); byte[] randomLockSeed = password.getBytes(StandardCharsets.UTF_8); byte[] encryptionResult; byte[] iv; try { KeyGenerator keyGenerator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES); keyGenerator.init(new SecureRandom()); SecretKey secretKey = keyGenerator.generateKey(); java.security.KeyStore keyStore = java.security.KeyStore.getInstance("AndroidKeyStore"); keyStore.load(null); keyStore.setEntry( LockPatternUtils.PROFILE_KEY_NAME_ENCRYPT + userId, new java.security.KeyStore.SecretKeyEntry(secretKey), new KeyProtection.Builder(KeyProperties.PURPOSE_ENCRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_GCM) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE) .build()); keyStore.setEntry( LockPatternUtils.PROFILE_KEY_NAME_DECRYPT + userId, new java.security.KeyStore.SecretKeyEntry(secretKey), new KeyProtection.Builder(KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_GCM) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE) .setUserAuthenticationRequired(true) .setUserAuthenticationValidityDurationSeconds(30) .build()); // Key imported, obtain a reference to it. SecretKey keyStoreEncryptionKey = (SecretKey) keyStore.getKey( LockPatternUtils.PROFILE_KEY_NAME_ENCRYPT + userId, null); // The original key can now be discarded. Cipher cipher = Cipher.getInstance( KeyProperties.KEY_ALGORITHM_AES + "/" + KeyProperties.BLOCK_MODE_GCM + "/" + KeyProperties.ENCRYPTION_PADDING_NONE); cipher.init(Cipher.ENCRYPT_MODE, keyStoreEncryptionKey); encryptionResult = cipher.doFinal(randomLockSeed); iv = cipher.getIV(); } catch (CertificateException | UnrecoverableKeyException | IOException | BadPaddingException | IllegalBlockSizeException | KeyStoreException | NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException e) { throw new RuntimeException("Failed to encrypt key", e); } ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try { if (iv.length != PROFILE_KEY_IV_SIZE) { throw new RuntimeException("Invalid iv length: " + iv.length); } outputStream.write(iv); outputStream.write(encryptionResult); } catch (IOException e) { throw new RuntimeException("Failed to concatenate byte arrays", e); } mStorage.writeChildProfileLock(userId, outputStream.toByteArray()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tieProfileLockToParent File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
tieProfileLockToParent
services/core/java/com/android/server/LockSettingsService.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
@Test public void testSerializationAsTimestamp01Milliseconds() throws Exception { Instant date = Instant.ofEpochSecond(0L); String value = MAPPER.writer() .with(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .without(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS) .writeValueAsString(date); assertEquals("The value is not correct.", "0", value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testSerializationAsTimestamp01Milliseconds File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java Repository: FasterXML/jackson-modules-java8 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testSerializationAsTimestamp01Milliseconds
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0
Analyze the following code function for security vulnerabilities
public static synchronized SslBufferPool getDefaultBufferPool() { if (defaultBufferPool == null) { defaultBufferPool = new SslBufferPool(); } return defaultBufferPool; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultBufferPool File: src/main/java/org/jboss/netty/handler/ssl/SslHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-119" ]
CVE-2014-3488
MEDIUM
5
netty
getDefaultBufferPool
src/main/java/org/jboss/netty/handler/ssl/SslHandler.java
2fa9400a59d0563a66908aba55c41e7285a04994
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder data(byte[] data) { return cdata(data); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: data File: src/main/java/com/jamesmurty/utils/XMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
data
src/main/java/com/jamesmurty/utils/XMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
@Override public void setActivityController(IActivityController controller) { enforceCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER, "setActivityController()"); synchronized (this) { mController = controller; Watchdog.getInstance().setActivityController(controller); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setActivityController File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
setActivityController
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public int getRequestedPasswordQuality(int userId) { return getDevicePolicyManager().getPasswordQuality(null, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRequestedPasswordQuality File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
getRequestedPasswordQuality
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
@Override public String[] getAlias() { return new String[] { "instanotifier", "insta", "instagram" }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAlias File: src/main/java/de/presti/ree6/commands/impl/community/InstagramNotifier.java Repository: Ree6-Applications/Ree6 The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-39302
MEDIUM
5.4
Ree6-Applications/Ree6
getAlias
src/main/java/de/presti/ree6/commands/impl/community/InstagramNotifier.java
459b5bc24f0ea27e50031f563373926e94b9aa0a
0
Analyze the following code function for security vulnerabilities
@Override public ServerHttpResponse setResponseHeader(CharSequence name, CharSequence value) { response.headers().set(name, value); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setResponseHeader File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-0981
MEDIUM
6.5
quarkusio/quarkus
setResponseHeader
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
96c64fd8f09c02a497e2db366c64dd9196582442
0
Analyze the following code function for security vulnerabilities
@Deprecated public void setContentAuthor(String contentAuthor) { setContentAuthorReference(userStringToReference(contentAuthor)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setContentAuthor 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
setContentAuthor
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public List<Task> getActiveTasks(String bareMetalId) { TaskExample e = new TaskExample(); e.createCriteria().andBareMetalIdEqualTo(bareMetalId).andStatusEqualTo(ServiceConstants.TaskStatusEnum.running.name()); return taskMapper.selectByExample(e); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActiveTasks File: rackshift-server/src/main/java/io/rackshift/service/TaskService.java Repository: fit2cloud/rackshift The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-42405
CRITICAL
9.8
fit2cloud/rackshift
getActiveTasks
rackshift-server/src/main/java/io/rackshift/service/TaskService.java
305aea3b20d36591d519f7d04e0a25be05a51e93
0
Analyze the following code function for security vulnerabilities
private static boolean hasAccountFeatures(AccountManager am, Account account, String[] features) { try { return am.hasFeatures(account, features, null, null).getResult(); } catch (Exception e) { Slogf.w(LOG_TAG, "Failed to get account feature", e); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasAccountFeatures 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
hasAccountFeatures
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void setContentUpdateDate(Date date) { if ((date != null) && (!date.equals(this.contentUpdateDate))) { setMetaDataDirty(true); } // Make sure we drop milliseconds for consistency with the database if (date != null) { date.setTime((date.getTime() / 1000) * 1000); } this.contentUpdateDate = date; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setContentUpdateDate 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
setContentUpdateDate
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public static long objectFieldOffset(Field field) { return PlatformDependent0.objectFieldOffset(field); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: objectFieldOffset File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
objectFieldOffset
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
private String getUserAccessCondition( CurrentUserGroupInfo currentUserGroupInfo, String access ) { String userUid = currentUserGroupInfo.getUserUID(); return Stream.of( jsonbFunction( HAS_USER_ID, userUid ), jsonbFunction( CHECK_USER_ACCESS, userUid, access ) ) .collect( joining( " and ", "(", ")" ) ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserAccessCondition File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
getUserAccessCondition
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
0
Analyze the following code function for security vulnerabilities
private native void nativeOnError(int errorCode, String description, String url);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeOnError File: android/src/org/mozilla/firefox/vpn/qt/VPNWebView.java Repository: mozilla-mobile/mozilla-vpn-client The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2021-29978
HIGH
10
mozilla-mobile/mozilla-vpn-client
nativeOnError
android/src/org/mozilla/firefox/vpn/qt/VPNWebView.java
c8440f464a2f5c4e7d4990152ee5850df8b23f42
0
Analyze the following code function for security vulnerabilities
@Override public boolean getAlreadyTrustPublisher() { boolean allPublishersTrusted = appVerifier.hasAlreadyTrustedPublisher( certs, jarSignableEntries); LOG.debug("App already has trusted publisher: {}", allPublishersTrusted); return allPublishersTrusted; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAlreadyTrustPublisher File: core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.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
getAlreadyTrustPublisher
core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java
2fd1e4b769911f2c6f7f3902f7ea21568ddc2f99
0
Analyze the following code function for security vulnerabilities
public void dumpDebug(ProtoOutputStream proto, long fieldId) { long token = proto.start(fieldId); proto.write(NotificationProto.CHANNEL_ID, getChannelId()); proto.write(NotificationProto.HAS_TICKER_TEXT, this.tickerText != null); proto.write(NotificationProto.FLAGS, this.flags); proto.write(NotificationProto.COLOR, this.color); proto.write(NotificationProto.CATEGORY, this.category); proto.write(NotificationProto.GROUP_KEY, this.mGroupKey); proto.write(NotificationProto.SORT_KEY, this.mSortKey); if (this.actions != null) { proto.write(NotificationProto.ACTION_LENGTH, this.actions.length); } if (this.visibility >= VISIBILITY_SECRET && this.visibility <= VISIBILITY_PUBLIC) { proto.write(NotificationProto.VISIBILITY, this.visibility); } if (publicVersion != null) { publicVersion.dumpDebug(proto, NotificationProto.PUBLIC_VERSION); } proto.end(token); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpDebug File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
dumpDebug
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
void handleApplicationCrashInner(String eventType, ProcessRecord r, String processName, ApplicationErrorReport.CrashInfo crashInfo) { EventLog.writeEvent(EventLogTags.AM_CRASH, Binder.getCallingPid(), UserHandle.getUserId(Binder.getCallingUid()), processName, r == null ? -1 : r.info.flags, crashInfo.exceptionClassName, crashInfo.exceptionMessage, crashInfo.throwFileName, crashInfo.throwLineNumber); StatsLog.write(StatsLog.APP_CRASH_OCCURRED, Binder.getCallingUid(), eventType, processName, Binder.getCallingPid(), (r != null && r.info != null) ? r.info.packageName : "", (r != null && r.info != null) ? (r.info.isInstantApp() ? StatsLog.APP_CRASH_OCCURRED__IS_INSTANT_APP__TRUE : StatsLog.APP_CRASH_OCCURRED__IS_INSTANT_APP__FALSE) : StatsLog.APP_CRASH_OCCURRED__IS_INSTANT_APP__UNAVAILABLE, r != null ? (r.isInterestingToUserLocked() ? StatsLog.APP_CRASH_OCCURRED__FOREGROUND_STATE__FOREGROUND : StatsLog.APP_CRASH_OCCURRED__FOREGROUND_STATE__BACKGROUND) : StatsLog.APP_CRASH_OCCURRED__FOREGROUND_STATE__UNKNOWN ); addErrorToDropBox(eventType, r, processName, null, null, null, null, null, crashInfo); mAppErrors.crashApplication(r, crashInfo); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleApplicationCrashInner 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
handleApplicationCrashInner
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting final ResilientAtomicFile getUserFile(@UserIdInt int userId) { File mainFile = new File(injectUserDataPath(userId), FILENAME_USER_PACKAGES); File temporaryBackup = new File(injectUserDataPath(userId), FILENAME_USER_PACKAGES + ".backup"); File reserveCopy = new File(injectUserDataPath(userId), FILENAME_USER_PACKAGES_RESERVE_COPY); int fileMode = FileUtils.S_IRWXU | FileUtils.S_IRWXG | FileUtils.S_IXOTH; return new ResilientAtomicFile(mainFile, temporaryBackup, reserveCopy, fileMode, "user shortcut", null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserFile File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
getUserFile
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public Alarms getAlarm(Integer scopeId, String keyword, int limit, int from, long startTB, long endTB) throws IOException { StringBuilder sql = new StringBuilder(); List<Object> parameters = new ArrayList<>(10); sql.append("from ").append(AlarmRecord.INDEX_NAME).append(" where "); sql.append(" 1=1 "); if (Objects.nonNull(scopeId)) { sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?"); parameters.add(scopeId.intValue()); } if (startTB != 0 && endTB != 0) { sql.append(" and ").append(AlarmRecord.TIME_BUCKET).append(" >= ?"); parameters.add(startTB); sql.append(" and ").append(AlarmRecord.TIME_BUCKET).append(" <= ?"); parameters.add(endTB); } if (!Strings.isNullOrEmpty(keyword)) { sql.append(" and ").append(AlarmRecord.ALARM_MESSAGE).append(" like '%").append(keyword).append("%' "); } sql.append(" order by ").append(AlarmRecord.START_TIME).append(" desc "); Alarms alarms = new Alarms(); try (Connection connection = client.getConnection()) { try (ResultSet resultSet = client.executeQuery(connection, "select count(1) total " + sql.toString(), parameters .toArray(new Object[0]))) { while (resultSet.next()) { alarms.setTotal(resultSet.getInt("total")); } } this.buildLimit(sql, from, limit); try (ResultSet resultSet = client.executeQuery(connection, "select * " + sql.toString(), parameters.toArray(new Object[0]))) { while (resultSet.next()) { AlarmMessage message = new AlarmMessage(); message.setId(resultSet.getString(AlarmRecord.ID0)); message.setMessage(resultSet.getString(AlarmRecord.ALARM_MESSAGE)); message.setStartTime(resultSet.getLong(AlarmRecord.START_TIME)); message.setScope(Scope.Finder.valueOf(resultSet.getInt(AlarmRecord.SCOPE))); message.setScopeId(resultSet.getInt(AlarmRecord.SCOPE)); alarms.getMsgs().add(message); } } } catch (SQLException e) { throw new IOException(e); } return alarms; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2020-13921 - Severity: HIGH - CVSS Score: 7.5 Description: fix fuzzy query sql injection Function: getAlarm File: oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/mysql/MySQLAlarmQueryDAO.java Repository: apache/skywalking Fixed Code: @Override public Alarms getAlarm(Integer scopeId, String keyword, int limit, int from, long startTB, long endTB) throws IOException { StringBuilder sql = new StringBuilder(); List<Object> parameters = new ArrayList<>(10); sql.append("from ").append(AlarmRecord.INDEX_NAME).append(" where "); sql.append(" 1=1 "); if (Objects.nonNull(scopeId)) { sql.append(" and ").append(AlarmRecord.SCOPE).append(" = ?"); parameters.add(scopeId.intValue()); } if (startTB != 0 && endTB != 0) { sql.append(" and ").append(AlarmRecord.TIME_BUCKET).append(" >= ?"); parameters.add(startTB); sql.append(" and ").append(AlarmRecord.TIME_BUCKET).append(" <= ?"); parameters.add(endTB); } if (!Strings.isNullOrEmpty(keyword)) { sql.append(" and ").append(AlarmRecord.ALARM_MESSAGE).append(" like concat('%',?,'%') "); parameters.add(keyword); } sql.append(" order by ").append(AlarmRecord.START_TIME).append(" desc "); Alarms alarms = new Alarms(); try (Connection connection = client.getConnection()) { try (ResultSet resultSet = client.executeQuery(connection, "select count(1) total " + sql.toString(), parameters .toArray(new Object[0]))) { while (resultSet.next()) { alarms.setTotal(resultSet.getInt("total")); } } this.buildLimit(sql, from, limit); try (ResultSet resultSet = client.executeQuery(connection, "select * " + sql.toString(), parameters.toArray(new Object[0]))) { while (resultSet.next()) { AlarmMessage message = new AlarmMessage(); message.setId(resultSet.getString(AlarmRecord.ID0)); message.setMessage(resultSet.getString(AlarmRecord.ALARM_MESSAGE)); message.setStartTime(resultSet.getLong(AlarmRecord.START_TIME)); message.setScope(Scope.Finder.valueOf(resultSet.getInt(AlarmRecord.SCOPE))); message.setScopeId(resultSet.getInt(AlarmRecord.SCOPE)); alarms.getMsgs().add(message); } } } catch (SQLException e) { throw new IOException(e); } return alarms; }
[ "CWE-89" ]
CVE-2020-13921
HIGH
7.5
apache/skywalking
getAlarm
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/mysql/MySQLAlarmQueryDAO.java
ddb6d9a5019a9c1fe31c364485a4e4b5066fefc3
1
Analyze the following code function for security vulnerabilities
private void onLaunchTransitionFadingEnded() { mNotificationPanel.setAlpha(1.0f); mNotificationPanel.onAffordanceLaunchEnded(); releaseGestureWakeLock(); runLaunchTransitionEndRunnable(); mLaunchTransitionFadingAway = false; mScrimController.forceHideScrims(false /* hide */); updateMediaMetaData(true /* metaDataChanged */, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLaunchTransitionFadingEnded File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
onLaunchTransitionFadingEnded
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
default InputStreamWrapper getStream(UUID jobId, String key) throws IOException { throw new UnsupportedOperationException(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStream File: portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/storage/TemporaryPerJobDataStore.java Repository: google/data-transfer-project The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-22572
LOW
2.1
google/data-transfer-project
getStream
portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/storage/TemporaryPerJobDataStore.java
013edb6c2d5a4e472988ea29a7cb5b1fdaf9c635
0
Analyze the following code function for security vulnerabilities
public JobProgress toRestJobProgress(org.xwiki.job.event.status.JobProgress progress) { JobProgress restJobProgress = this.objectFactory.createJobProgress(); restJobProgress.setOffset(progress.getOffset()); restJobProgress.setCurrentLevelOffset(progress.getCurrentLevelOffset()); // TODO: add support for steps return restJobProgress; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toRestJobProgress File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-35151
HIGH
7.5
xwiki/xwiki-platform
toRestJobProgress
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
824cd742ecf5439971247da11bfe7e0ad2b10ede
0
Analyze the following code function for security vulnerabilities
private void resetAffiliationCacheLocked() { mInjector.binderWithCleanCallingIdentity(() -> { for (UserInfo user : mUserManager.getUsers()) { mStateCache.setHasAffiliationWithDevice(user.id, isUserAffiliatedWithDeviceLocked(user.id)); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetAffiliationCacheLocked 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
resetAffiliationCacheLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
static void logError(final HttpQuery query, final String msg) { LOG.error(query.channel().toString() + ' ' + msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logError File: src/tsd/GraphHandler.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2023-25826
CRITICAL
9.8
OpenTSDB/opentsdb
logError
src/tsd/GraphHandler.java
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
0
Analyze the following code function for security vulnerabilities
public @Nullable RowId getRowId(String columnName) throws SQLException { return getRowId(findColumn(columnName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRowId File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
getRowId
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
private void joinRoomAndCall() { callSession = ApplicationWideCurrentRoomHolder.getInstance().getSession(); int apiVersion = ApiUtils.getConversationApiVersion(conversationUser, new int[]{ApiUtils.APIv4, 1}); Log.d(TAG, "joinRoomAndCall"); Log.d(TAG, " baseUrl= " + baseUrl); Log.d(TAG, " roomToken= " + roomToken); Log.d(TAG, " callSession= " + callSession); String url = ApiUtils.getUrlForParticipantsActive(apiVersion, baseUrl, roomToken); Log.d(TAG, " url= " + url); if (TextUtils.isEmpty(callSession)) { ncApi.joinRoom(credentials, url, conversationPassword) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .retry(3) .subscribe(new Observer<RoomOverall>() { @Override public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) { // unused atm } @Override public void onNext(@io.reactivex.annotations.NonNull RoomOverall roomOverall) { callSession = roomOverall.getOcs().getData().getSessionId(); Log.d(TAG, " new callSession by joinRoom= " + callSession); ApplicationWideCurrentRoomHolder.getInstance().setSession(callSession); ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId); ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomToken(roomToken); ApplicationWideCurrentRoomHolder.getInstance().setUserInRoom(conversationUser); callOrJoinRoomViaWebSocket(); } @Override public void onError(@io.reactivex.annotations.NonNull Throwable e) { Log.e(TAG, "joinRoom onError", e); } @Override public void onComplete() { Log.d(TAG, "joinRoom onComplete"); } }); } else { // we are in a room and start a call -> same session needs to be used callOrJoinRoomViaWebSocket(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: joinRoomAndCall File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
joinRoomAndCall
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
private boolean removeHostsAndProvidersForPackageLocked(String pkgName, int userId) { boolean removed = false; int N = mProviders.size(); for (int i = N - 1; i >= 0; i--) { Provider provider = mProviders.get(i); if (pkgName.equals(provider.info.provider.getPackageName()) && provider.getUserId() == userId) { deleteProviderLocked(provider); removed = true; } } // Delete the hosts for this package too // By now, we have removed any AppWidgets that were in any hosts here, // so we don't need to worry about sending DISABLE broadcasts to them. N = mHosts.size(); for (int i = N - 1; i >= 0; i--) { Host host = mHosts.get(i); if (pkgName.equals(host.id.packageName) && host.getUserId() == userId) { deleteHostLocked(host); removed = true; } } return removed; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeHostsAndProvidersForPackageLocked File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
removeHostsAndProvidersForPackageLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
public void updateObject(String columnLabel, @Nullable Object x, java.sql.SQLType targetSqlType, int scaleOrLength) throws SQLException { throw org.postgresql.Driver.notImplemented(this.getClass(), "updateObject"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateObject File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
updateObject
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public Document getTranslatedDocument(String locale) throws XWikiException { return this.doc.getTranslatedDocument(locale, getXWikiContext()).newDocument(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTranslatedDocument File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getTranslatedDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
void onDismissed();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDismissed File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
onDismissed
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
protected SerializationConfig parseSerialization(final Node node) { SerializationConfig serializationConfig = new SerializationConfig(); for (Node child : childElements(node)) { final String name = cleanNodeName(child); if ("portable-version".equals(name)) { String value = getTextContent(child); serializationConfig.setPortableVersion(getIntegerValue(name, value)); } else if ("check-class-def-errors".equals(name)) { String value = getTextContent(child); serializationConfig.setCheckClassDefErrors(getBooleanValue(value)); } else if ("use-native-byte-order".equals(name)) { serializationConfig.setUseNativeByteOrder(getBooleanValue(getTextContent(child))); } else if ("byte-order".equals(name)) { String value = getTextContent(child); ByteOrder byteOrder = null; if (ByteOrder.BIG_ENDIAN.toString().equals(value)) { byteOrder = ByteOrder.BIG_ENDIAN; } else if (ByteOrder.LITTLE_ENDIAN.toString().equals(value)) { byteOrder = ByteOrder.LITTLE_ENDIAN; } serializationConfig.setByteOrder(byteOrder != null ? byteOrder : ByteOrder.BIG_ENDIAN); } else if ("enable-compression".equals(name)) { serializationConfig.setEnableCompression(getBooleanValue(getTextContent(child))); } else if ("enable-shared-object".equals(name)) { serializationConfig.setEnableSharedObject(getBooleanValue(getTextContent(child))); } else if ("allow-unsafe".equals(name)) { serializationConfig.setAllowUnsafe(getBooleanValue(getTextContent(child))); } else if ("data-serializable-factories".equals(name)) { fillDataSerializableFactories(child, serializationConfig); } else if ("portable-factories".equals(name)) { fillPortableFactories(child, serializationConfig); } else if ("serializers".equals(name)) { fillSerializers(child, serializationConfig); } } return serializationConfig; }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2016-10750 - Severity: MEDIUM - CVSS Score: 6.8 Description: Add basic protection against untrusted deserialization. Function: parseSerialization File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java Repository: hazelcast Fixed Code: protected SerializationConfig parseSerialization(final Node node) { SerializationConfig serializationConfig = new SerializationConfig(); for (Node child : childElements(node)) { final String name = cleanNodeName(child); if ("portable-version".equals(name)) { String value = getTextContent(child); serializationConfig.setPortableVersion(getIntegerValue(name, value)); } else if ("check-class-def-errors".equals(name)) { String value = getTextContent(child); serializationConfig.setCheckClassDefErrors(getBooleanValue(value)); } else if ("use-native-byte-order".equals(name)) { serializationConfig.setUseNativeByteOrder(getBooleanValue(getTextContent(child))); } else if ("byte-order".equals(name)) { String value = getTextContent(child); ByteOrder byteOrder = null; if (ByteOrder.BIG_ENDIAN.toString().equals(value)) { byteOrder = ByteOrder.BIG_ENDIAN; } else if (ByteOrder.LITTLE_ENDIAN.toString().equals(value)) { byteOrder = ByteOrder.LITTLE_ENDIAN; } serializationConfig.setByteOrder(byteOrder != null ? byteOrder : ByteOrder.BIG_ENDIAN); } else if ("enable-compression".equals(name)) { serializationConfig.setEnableCompression(getBooleanValue(getTextContent(child))); } else if ("enable-shared-object".equals(name)) { serializationConfig.setEnableSharedObject(getBooleanValue(getTextContent(child))); } else if ("allow-unsafe".equals(name)) { serializationConfig.setAllowUnsafe(getBooleanValue(getTextContent(child))); } else if ("data-serializable-factories".equals(name)) { fillDataSerializableFactories(child, serializationConfig); } else if ("portable-factories".equals(name)) { fillPortableFactories(child, serializationConfig); } else if ("serializers".equals(name)) { fillSerializers(child, serializationConfig); } else if ("java-serialization-filter".equals(name)) { fillJavaSerializationFilter(child, serializationConfig); } } return serializationConfig; }
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
parseSerialization
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
1
Analyze the following code function for security vulnerabilities
@RequiresPermission(value = MANAGE_DEVICE_POLICY_DEFAULT_SMS, conditional = true) public void setDefaultSmsApplication(@Nullable ComponentName admin, @NonNull String packageName) { if (mService != null) { try { mService.setDefaultSmsApplication(admin, mContext.getPackageName(), packageName, mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDefaultSmsApplication 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
setDefaultSmsApplication
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void setThemeColor(String themeColor) { this.themeColor = parser.parseExpression(themeColor, ParserContext.TEMPLATE_EXPRESSION); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setThemeColor File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
setThemeColor
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
public void goForward() { if (mWebContents != null) mWebContents.getNavigationController().goForward(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: goForward File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
goForward
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public void postCredential(String url, final UserProvidedCredential upc, PrintWriter logWriter) throws SVNException, IOException { SVNRepository repository = null; try { // the way it works with SVNKit is that // 1) svnkit calls AuthenticationManager asking for a credential. // this is when we can see the 'realm', which identifies the user domain. // 2) DefaultSVNAuthenticationManager returns the username and password we set below // 3) if the authentication is successful, svnkit calls back acknowledgeAuthentication // (so we store the password info here) repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url)); repository.setTunnelProvider( createDefaultSVNOptions() ); AuthenticationManagerImpl authManager = upc.new AuthenticationManagerImpl(logWriter) { @Override protected void onSuccess(String realm, Credential cred) { LOGGER.info("Persisted "+cred+" for "+realm); credentials.put(realm, cred); save(); if (upc.inContextOf!=null) new PerJobCredentialStore(upc.inContextOf).acknowledgeAuthentication(realm,cred); } }; authManager.setAuthenticationForced(true); repository.setAuthenticationManager(authManager); repository.testConnection(); authManager.checkIfProtocolCompleted(); } finally { if (repository != null) repository.closeSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: postCredential File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
postCredential
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
private void sslConfigXmlGenerator(XmlGenerator gen, NetworkConfig netCfg) { SSLConfig ssl = netCfg.getSSLConfig(); gen.open("ssl", "enabled", ssl != null && ssl.isEnabled()); if (ssl != null) { Properties props = new Properties(); props.putAll(ssl.getProperties()); if (maskSensitiveFields && props.containsKey("trustStorePassword")) { props.setProperty("trustStorePassword", MASK_FOR_SENSITIVE_DATA); } if (maskSensitiveFields && props.containsKey("keyStorePassword")) { props.setProperty("keyStorePassword", MASK_FOR_SENSITIVE_DATA); } gen.node("factory-class-name", classNameOrImplClass(ssl.getFactoryClassName(), ssl.getFactoryImplementation())) .appendProperties(props); } gen.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sslConfigXmlGenerator 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
sslConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public String asNormalizedText() { final HtmlSerializerNormalizedText ser = new HtmlSerializerNormalizedText(); return ser.asText(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asNormalizedText 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
asNormalizedText
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
protected void setOCItemDataAuditLogs(StudyBean study, OdmClinicalDataBean data, String idataIds, HashMap<Integer, String> idataOidPoses) { this.setOCItemDataAuditsTypesExpected(); logger.debug("Begin to execute GetOCItemDataAuditsSql"); logger.debug("getOCItemDataAuditsSql= " + this.getOCItemDataAuditsSql(idataIds)); ArrayList rows = select(this.getOCItemDataAuditsSql(idataIds)); Iterator iter = rows.iterator(); while (iter.hasNext()) { HashMap row = (HashMap) iter.next(); Integer idataId = (Integer) row.get("item_data_id"); Integer auditId = (Integer) row.get("audit_id"); String type = (String) row.get("name"); Integer userId = (Integer) row.get("user_id"); Date auditDate = (Date) row.get("audit_date"); String auditReason = (String) row.get("reason_for_change"); String oldValue = (String) row.get("old_value"); String newValue = (String) row.get("new_value"); Integer typeId = (Integer) row.get("audit_log_event_type_id"); if (idataOidPoses.containsKey(idataId)) { String[] poses = idataOidPoses.get(idataId).split("---"); ImportItemDataBean idata = data.getExportSubjectData().get(Integer.parseInt(poses[0])).getExportStudyEventData().get(Integer.parseInt(poses[1])).getExportFormData() .get(Integer.parseInt(poses[2])).getItemGroupData().get(Integer.parseInt(poses[3])).getItemData().get(Integer.parseInt(poses[4])); AuditLogBean auditLog = new AuditLogBean(); auditLog.setOid("AL_" + auditId); auditLog.setUserId("USR_" + userId); auditLog.setDatetimeStamp(auditDate); auditLog.setType(type); auditLog.setReasonForChange(auditReason); if (typeId == 12) { if ("0".equals(newValue)) { auditLog.setOldValue(Status.INVALID.getName()); } else { auditLog.setNewValue(Status.getFromMap(Integer.parseInt(newValue)).getName()); } if ("0".equals(oldValue)) { auditLog.setOldValue(Status.INVALID.getName()); } else { auditLog.setOldValue(Status.getFromMap(Integer.parseInt(oldValue)).getName()); } } else { auditLog.setNewValue(newValue); auditLog.setOldValue(oldValue); } AuditLogsBean logs = idata.getAuditLogs(); if (logs.getEntityID() == null || logs.getEntityID().length() <= 0) { logs.setEntityID(idata.getItemOID()); } logs.getAuditLogs().add(auditLog); idata.setAuditLogs(logs); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOCItemDataAuditLogs 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
setOCItemDataAuditLogs
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public String getNamespaceUri(int pos) throws XmlPullParserException { throw new XmlPullParserException("getNamespaceUri() not supported"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNamespaceUri File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getNamespaceUri
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public void setTsConfigFile(String tsConfigFile) { this.tsConfigFile = tsConfigFile; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTsConfigFile File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
setTsConfigFile
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
public static Set<AccessControlledResource.Priviledge> expand(Iterable<AccessControlledResource.Priviledge> privs) { Set<AccessControlledResource.Priviledge> set = new HashSet<AccessControlledResource.Priviledge>(); _expand(privs, set); return set; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: expand File: milton-api/src/main/java/io/milton/http/AclUtils.java Repository: miltonio/milton2 The code follows secure coding practices.
[ "CWE-611" ]
CVE-2015-7326
HIGH
7.5
miltonio/milton2
expand
milton-api/src/main/java/io/milton/http/AclUtils.java
b5851c1
0
Analyze the following code function for security vulnerabilities
public void buildInstanceWithDiscontinuedState(Stage instance) { final JobInstance first = instance.getJobInstances().get(0); final JobInstance second = instance.getJobInstances().get(1); first.completing(JobResult.Passed); second.changeState(JobState.Discontinued); second.setResult(JobResult.Passed); first.completed(new Date()); jobInstanceDao.updateStateAndResult(first); jobInstanceDao.updateStateAndResult(second); updateResultInTransaction(instance, StageResult.Passed); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildInstanceWithDiscontinuedState File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
buildInstanceWithDiscontinuedState
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
private Map<String, String> getWorkflowConfig(MultivaluedMap<String, String> formData) { Map<String, String> wfConfig = new HashMap<>(); for (String key : formData.keySet()) { if (!"mediaPackage".equals(key)) { wfConfig.put(key, formData.getFirst(key)); } } return wfConfig; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWorkflowConfig File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java Repository: opencast The code follows secure coding practices.
[ "CWE-74" ]
CVE-2020-5230
MEDIUM
5
opencast
getWorkflowConfig
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java
bbb473f34ab95497d6c432c81285efb0c739f317
0
Analyze the following code function for security vulnerabilities
public void setTitlePic(String titlePic) { this.titlePic = titlePic; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTitlePic File: src/main/java/cn/luischen/model/ContentDomain.java Repository: WinterChenS/my-site The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29638
MEDIUM
5.4
WinterChenS/my-site
setTitlePic
src/main/java/cn/luischen/model/ContentDomain.java
d104f38aaae2f1b76c33fadfcf6b1ef1c6c340ed
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") protected T _deserializeFromString(JsonParser p, DeserializationContext ctxt) throws IOException { final ValueInstantiator inst = getValueInstantiator(); final Class<?> rawTargetType = handledType(); String value = p.getValueAsString(); if ((inst != null) && inst.canCreateFromString()) { return (T) inst.createFromString(ctxt, value); } if (value.isEmpty()) { final CoercionAction act = ctxt.findCoercionAction(logicalType(), rawTargetType, CoercionInputShape.EmptyString); return (T) _deserializeFromEmptyString(p, ctxt, act, rawTargetType, "empty String (\"\")"); } if (_isBlank(value)) { final CoercionAction act = ctxt.findCoercionFromBlankString(logicalType(), rawTargetType, CoercionAction.Fail); return (T) _deserializeFromEmptyString(p, ctxt, act, rawTargetType, "blank String (all whitespace)"); } // 28-Sep-2011, tatu: Ok this is not clean at all; but since there are legacy // systems that expect conversions in some cases, let's just add a minimal // patch (note: same could conceivably be used for numbers too). if (inst != null) { value = value.trim(); // mostly to avoid problems wrt XML indentation if (inst.canCreateFromInt()) { if (ctxt.findCoercionAction(LogicalType.Integer, Integer.class, CoercionInputShape.String) == CoercionAction.TryConvert) { return (T) inst.createFromInt(ctxt, _parseIntPrimitive(ctxt, value)); } } if (inst.canCreateFromLong()) { if (ctxt.findCoercionAction(LogicalType.Integer, Long.class, CoercionInputShape.String) == CoercionAction.TryConvert) { return (T) inst.createFromLong(ctxt, _parseLongPrimitive(ctxt, value)); } } if (inst.canCreateFromBoolean()) { // 29-May-2020, tatu: With 2.12 can and should use CoercionConfig so: if (ctxt.findCoercionAction(LogicalType.Boolean, Boolean.class, CoercionInputShape.String) == CoercionAction.TryConvert) { String str = value.trim(); if ("true".equals(str)) { return (T) inst.createFromBoolean(ctxt, true); } if ("false".equals(str)) { return (T) inst.createFromBoolean(ctxt, false); } } } } return (T) ctxt.handleMissingInstantiator(rawTargetType, inst, ctxt.getParser(), "no String-argument constructor/factory method to deserialize from String value ('%s')", value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _deserializeFromString File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_deserializeFromString
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
public ContentMode getCellDescriptionContentMode() { return getState(false).cellTooltipContentMode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCellDescriptionContentMode 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
getCellDescriptionContentMode
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public org.apache.lucene.search.Query getSubtreeQuery(String fieldName, Project project) { cacheLock.readLock().lock(); try { return Criteria.forManyValues(fieldName, getSubtreeIds(project.getId()), cache.keySet()); } finally { cacheLock.readLock().unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSubtreeQuery 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
getSubtreeQuery
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
public void setIgnoringElementContentWhitespace(final boolean ignoringWhite) { this.ignoringWhite = ignoringWhite; engine = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIgnoringElementContentWhitespace File: core/src/java/org/jdom2/input/SAXBuilder.java Repository: hunterhacker/jdom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-33813
MEDIUM
5
hunterhacker/jdom
setIgnoringElementContentWhitespace
core/src/java/org/jdom2/input/SAXBuilder.java
bd3ab78370098491911d7fe9d7a43b97144a234e
0
Analyze the following code function for security vulnerabilities
public Column<T, V> setEditorBinding(Binding<T, ?> binding) { Objects.requireNonNull(binding, "null is not a valid editor field"); if (!(binding.getField() instanceof Component)) { throw new IllegalArgumentException( "Binding target must be a component."); } this.editorBinding = binding; return setEditable(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEditorBinding 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
setEditorBinding
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
private User _getUser(final String name) { return m_users.get(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _getUser File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
_getUser
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
private void initExit() { Runtime.getRuntime().addShutdownHook(new Thread(() -> { instance.stop = true; try { Thread.sleep(3000); } catch (Exception ignored) { } })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initExit File: src/main/java/com/chaitin/xray/form/MainForm.java Repository: 4ra1n/super-xray The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-41958
HIGH
7.8
4ra1n/super-xray
initExit
src/main/java/com/chaitin/xray/form/MainForm.java
4d0d59663596db03f39d7edd2be251d48b52dcfc
0
Analyze the following code function for security vulnerabilities
protected CompletableFuture<Integer> internalGetMaxUnackedMessagesOnSubscription(boolean applied) { return getTopicPoliciesAsyncWithRetry(topicName) .thenApply(op -> op.map(TopicPolicies::getMaxUnackedMessagesOnSubscription) .orElseGet(() -> { if (applied) { Integer maxUnackedNum = getNamespacePolicies(namespaceName) .max_unacked_messages_per_subscription; return maxUnackedNum == null ? config().getMaxUnackedMessagesPerSubscription() : maxUnackedNum; } return null; })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalGetMaxUnackedMessagesOnSubscription File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalGetMaxUnackedMessagesOnSubscription
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Override public SerializationServiceBuilder setVersion(byte version) { byte maxVersion = BuildInfoProvider.getBuildInfo().getSerializationVersion(); if (version > maxVersion) { throw new IllegalArgumentException( "Configured serialization version is higher than the max supported version: " + maxVersion); } this.version = version; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setVersion File: hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/DefaultSerializationServiceBuilder.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
setVersion
hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/DefaultSerializationServiceBuilder.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
InputStream attemptMasterKeyDecryption(String algorithm, byte[] userSalt, byte[] ckSalt, int rounds, String userIvHex, String masterKeyBlobHex, InputStream rawInStream, boolean doLog) { InputStream result = null; try { Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding"); SecretKey userKey = buildPasswordKey(algorithm, mDecryptPassword, userSalt, rounds); byte[] IV = hexToByteArray(userIvHex); IvParameterSpec ivSpec = new IvParameterSpec(IV); c.init(Cipher.DECRYPT_MODE, new SecretKeySpec(userKey.getEncoded(), "AES"), ivSpec); byte[] mkCipher = hexToByteArray(masterKeyBlobHex); byte[] mkBlob = c.doFinal(mkCipher); // first, the master key IV int offset = 0; int len = mkBlob[offset++]; IV = Arrays.copyOfRange(mkBlob, offset, offset + len); offset += len; // then the master key itself len = mkBlob[offset++]; byte[] mk = Arrays.copyOfRange(mkBlob, offset, offset + len); offset += len; // and finally the master key checksum hash len = mkBlob[offset++]; byte[] mkChecksum = Arrays.copyOfRange(mkBlob, offset, offset + len); // now validate the decrypted master key against the checksum byte[] calculatedCk = makeKeyChecksum(algorithm, mk, ckSalt, rounds); if (Arrays.equals(calculatedCk, mkChecksum)) { ivSpec = new IvParameterSpec(IV); c.init(Cipher.DECRYPT_MODE, new SecretKeySpec(mk, "AES"), ivSpec); // Only if all of the above worked properly will 'result' be assigned result = new CipherInputStream(rawInStream, c); } else if (doLog) Slog.w(TAG, "Incorrect password"); } catch (InvalidAlgorithmParameterException e) { if (doLog) Slog.e(TAG, "Needed parameter spec unavailable!", e); } catch (BadPaddingException e) { // This case frequently occurs when the wrong password is used to decrypt // the master key. Use the identical "incorrect password" log text as is // used in the checksum failure log in order to avoid providing additional // information to an attacker. if (doLog) Slog.w(TAG, "Incorrect password"); } catch (IllegalBlockSizeException e) { if (doLog) Slog.w(TAG, "Invalid block size in master key"); } catch (NoSuchAlgorithmException e) { if (doLog) Slog.e(TAG, "Needed decryption algorithm unavailable!"); } catch (NoSuchPaddingException e) { if (doLog) Slog.e(TAG, "Needed padding mechanism unavailable!"); } catch (InvalidKeyException e) { if (doLog) Slog.w(TAG, "Illegal password; aborting"); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attemptMasterKeyDecryption 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
attemptMasterKeyDecryption
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
private void commit() { try { solrInstance.commit(); } catch (Exception e) { this.logger.error("Failed to commit index changes to the Solr server. Rolling back.", e); try { solrInstance.rollback(); } catch (Exception ex) { // Just log the failure. this.logger.error("Failed to rollback index changes.", ex); } } this.batchSize = 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: commit File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/DefaultSolrIndexer.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-312", "CWE-200" ]
CVE-2023-50719
HIGH
7.5
xwiki/xwiki-platform
commit
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/DefaultSolrIndexer.java
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
0
Analyze the following code function for security vulnerabilities
public Locale getLocalePreference(XWikiContext context) { Locale defaultLocale = this.getDefaultLocale(context); Set<Locale> availableLocales = new HashSet<>(this.getAvailableLocales(context)); boolean forceSupported = getConfiguration().getProperty("xwiki.language.forceSupported", "1").equals("1"); // First we try to get the language from the XWiki Context. This is the current language // being used. Locale locale = context.getLocale(); if (locale != null) { return locale; } // If the wiki is non multilingual then the language is the default language. if (!isMultiLingual(context)) { locale = defaultLocale; context.setLocale(locale); return locale; } // As the wiki is multilingual try to find the language to use from the request by looking // for a language parameter. If the language value is "default" use the default language // from the XWiki preferences settings. Otherwise set a cookie to remember the language // in use. try { String language = Util.normalizeLanguage(context.getRequest().getParameter("language")); if (language != null) { if ("default".equals(language)) { // forgetting language cookie Cookie cookie = new Cookie("language", ""); cookie.setMaxAge(0); cookie.setPath("/"); context.getResponse().addCookie(cookie); context.setLocale(defaultLocale); return defaultLocale; } else { locale = setLocale(LocaleUtils.toLocale(language), context, availableLocales, forceSupported); if (LocaleUtils.isAvailableLocale(locale)) { // setting language cookie Cookie cookie = new Cookie("language", context.getLocale().toString()); cookie.setMaxAge(60 * 60 * 24 * 365 * 10); cookie.setPath("/"); context.getResponse().addCookie(cookie); return locale; } } } } catch (Exception e) { } // As no language parameter was passed in the request, try to get the language to use from a cookie. try { // First we get the language from the cookie String language = Util.normalizeLanguage(getUserPreferenceFromCookie("language", context)); if (StringUtils.isNotEmpty(language)) { locale = setLocale(LocaleUtils.toLocale(language), context, availableLocales, forceSupported); if (LocaleUtils.isAvailableLocale(locale)) { return locale; } } } catch (Exception e) { } // If the default language is preferred, and since the user didn't explicitly ask for a // language already, then use the default wiki language. if (getConfiguration().getProperty("xwiki.language.preferDefault", "0").equals("1") || getSpacePreference("preferDefaultLanguage", "0", context).equals("1")) { locale = defaultLocale; context.setLocale(locale); return locale; } // Then from the navigator language setting if (context.getRequest() != null && context.getRequest().getLocales() != null) { for (Locale acceptedLocale : Collections.list(context.getRequest().getLocales())) { locale = setLocale(acceptedLocale, context, availableLocales, forceSupported); if (LocaleUtils.isAvailableLocale(locale)) { return locale; } } // If none of the languages requested by the client is acceptable, skip to next // phase (use default language). } // Finally, use the default language from the global preferences. context.setLocale(defaultLocale); return defaultLocale; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocalePreference 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
getLocalePreference
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 void stop(BundleContext context) throws Exception { //Nothing to do. The bundle-activator interface only allows to load this extension as a stand-alone plugin. }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stop File: _ext/eclipse-wtp/src/main/java/com/diffplug/spotless/extra/eclipse/wtp/PreventExternalURIResolverExtension.java Repository: diffplug/spotless The code follows secure coding practices.
[ "CWE-611" ]
CVE-2019-9843
MEDIUM
5.1
diffplug/spotless
stop
_ext/eclipse-wtp/src/main/java/com/diffplug/spotless/extra/eclipse/wtp/PreventExternalURIResolverExtension.java
451251ff6a8534173e0db7cbd9dd7cbc26522cf7
0
Analyze the following code function for security vulnerabilities
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; } return super.onOptionsItemSelected(item); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onOptionsItemSelected File: News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/SettingsActivity.java Repository: nextcloud/news-android The code follows secure coding practices.
[ "CWE-829" ]
CVE-2021-41256
MEDIUM
5.8
nextcloud/news-android
onOptionsItemSelected
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/SettingsActivity.java
05449cb666059af7de2302df9d5c02997a23df85
0
Analyze the following code function for security vulnerabilities
public boolean removeProvider(int callingUid, boolean privileged, String uniqueId, String fqdn) { if (uniqueId == null && fqdn == null) { mWifiMetrics.incrementNumPasspointProviderUninstallation(); Log.e(TAG, "Cannot remove provider, both FQDN and unique ID are null"); return false; } if (uniqueId != null) { // Unique identifier provided mWifiMetrics.incrementNumPasspointProviderUninstallation(); PasspointProvider provider = mProviders.get(uniqueId); if (provider == null) { Log.e(TAG, "Config doesn't exist"); return false; } return removeProviderInternal(provider, callingUid, privileged); } // FQDN provided, loop through all profiles with matching FQDN ArrayList<PasspointProvider> passpointProviders = new ArrayList<>(mProviders.values()); int removedProviders = 0; int numOfUninstallations = 0; for (PasspointProvider provider : passpointProviders) { if (!TextUtils.equals(provider.getConfig().getHomeSp().getFqdn(), fqdn)) { continue; } mWifiMetrics.incrementNumPasspointProviderUninstallation(); numOfUninstallations++; if (removeProviderInternal(provider, callingUid, privileged)) { removedProviders++; } } if (numOfUninstallations == 0) { // Update uninstallation requests metrics here to cover the corner case of trying to // uninstall a non-existent provider. mWifiMetrics.incrementNumPasspointProviderUninstallation(); } return removedProviders > 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeProvider File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
removeProvider
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
private boolean isOnBgOffloadQueue(int flags) { return (mEnableOffloadQueue && ((flags & Intent.FLAG_RECEIVER_OFFLOAD) != 0)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isOnBgOffloadQueue File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
isOnBgOffloadQueue
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private byte[] getDstMacForKeepalive(KeepalivePacketData packetData) throws InvalidPacketException { try { InetAddress gateway = NetUtils.selectBestRoute( mLinkProperties.getRoutes(), packetData.getDstAddress()).getGateway(); String dstMacStr = macAddressFromRoute(gateway.getHostAddress()); return NativeUtil.macAddressToByteArray(dstMacStr); } catch (NullPointerException | IllegalArgumentException e) { throw new InvalidPacketException(InvalidPacketException.ERROR_INVALID_IP_ADDRESS); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDstMacForKeepalive 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
getDstMacForKeepalive
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public Object parse(SerializerHandler serializerHandler, InputStream response, boolean debugMode) throws XMLRPCException { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); Document dom = builder.parse(response); if (debugMode ){ printDocument(dom, System.out); } Element e = dom.getDocumentElement(); // Check for root tag if(!e.getNodeName().equals(XMLRPCClient.METHOD_RESPONSE)) { throw new XMLRPCException("MethodResponse root tag is missing."); } e = XMLUtil.getOnlyChildElement(e.getChildNodes()); if(e.getNodeName().equals(XMLRPCClient.PARAMS)) { e = XMLUtil.getOnlyChildElement(e.getChildNodes()); if(!e.getNodeName().equals(XMLRPCClient.PARAM)) { throw new XMLRPCException("The params tag must contain a param tag."); } return getReturnValueFromElement(serializerHandler, e); } else if(e.getNodeName().equals(XMLRPCClient.FAULT)) { @SuppressWarnings("unchecked") Map<String,Object> o = (Map<String,Object>)getReturnValueFromElement(serializerHandler, e); throw new XMLRPCServerException((String)o.get(FAULT_STRING), (Integer)o.get(FAULT_CODE)); } throw new XMLRPCException("The methodResponse tag must contain a fault or params tag."); } catch(XMLRPCServerException e) { throw e; } catch (Exception ex) { throw new XMLRPCException("Error getting result from server.", ex); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2020-36641 - Severity: MEDIUM - CVSS Score: 4.9 Description: Fix CWE-611 This commit fixes the issue described on https://cwe.mitre.org/data/definitions/611.html Nb: it's mostly the same as ad6615b3ec41353e614f6ea5fdd5b046442a832b but with an added reference to org.apache.xerces in order to avoid the AbstractMethodError that was experienced by users back then. Nb2: writting down the payload with which I tested this patch, in case I need to run this test again in the future: <?xml version="1.0"?> <!DOCTYPE replace [<!ENTITY ent SYSTEM "http://localhost/malware"> ]> <methodResponse> <params> <param> <value><string>&ent;</string></value> </param> </params> </methodResponse> Function: parse File: src/main/java/de/timroes/axmlrpc/ResponseParser.java Repository: gturri/aXMLRPC Fixed Code: public Object parse(SerializerHandler serializerHandler, InputStream response, boolean debugMode) throws XMLRPCException { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); // Ensure the xml parser won't allow exploitation of the vuln CWE-611 // (described on https://cwe.mitre.org/data/definitions/611.html ) factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); factory.setExpandEntityReferences(false); factory.setNamespaceAware(true); factory.setXIncludeAware(false); factory.setExpandEntityReferences(false); // End of the configuration of the parser for CWE-611 DocumentBuilder builder = factory.newDocumentBuilder(); Document dom = builder.parse(response); if (debugMode ){ printDocument(dom, System.out); } Element e = dom.getDocumentElement(); // Check for root tag if(!e.getNodeName().equals(XMLRPCClient.METHOD_RESPONSE)) { throw new XMLRPCException("MethodResponse root tag is missing."); } e = XMLUtil.getOnlyChildElement(e.getChildNodes()); if(e.getNodeName().equals(XMLRPCClient.PARAMS)) { e = XMLUtil.getOnlyChildElement(e.getChildNodes()); if(!e.getNodeName().equals(XMLRPCClient.PARAM)) { throw new XMLRPCException("The params tag must contain a param tag."); } return getReturnValueFromElement(serializerHandler, e); } else if(e.getNodeName().equals(XMLRPCClient.FAULT)) { @SuppressWarnings("unchecked") Map<String,Object> o = (Map<String,Object>)getReturnValueFromElement(serializerHandler, e); throw new XMLRPCServerException((String)o.get(FAULT_STRING), (Integer)o.get(FAULT_CODE)); } throw new XMLRPCException("The methodResponse tag must contain a fault or params tag."); } catch(XMLRPCServerException e) { throw e; } catch (Exception ex) { throw new XMLRPCException("Error getting result from server.", ex); } }
[ "CWE-611" ]
CVE-2020-36641
MEDIUM
4.9
gturri/aXMLRPC
parse
src/main/java/de/timroes/axmlrpc/ResponseParser.java
456752ebc1ef4c0db980cb5b01a0b3cd0a9e0bae
1
Analyze the following code function for security vulnerabilities
protected Map<String, List<String>> buildResponseHeaders(Response response) { Map<String, List<String>> responseHeaders = new HashMap<String, List<String>>(); for (Entry<String, List<Object>> entry: response.getHeaders().entrySet()) { List<Object> values = entry.getValue(); List<String> headers = new ArrayList<String>(); for (Object o : values) { headers.add(String.valueOf(o)); } responseHeaders.put(entry.getKey(), headers); } return responseHeaders; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildResponseHeaders 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
buildResponseHeaders
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public CharSequence getBadgeContentDescription() { return mBadgeContentDescription; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBadgeContentDescription File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
getBadgeContentDescription
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
void onAnimationStarted(long elapsedRealTime);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAnimationStarted File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
onAnimationStarted
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public HttpRequest monitor(final HttpProgressListener httpProgressListener) { this.httpProgressListener = httpProgressListener; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: monitor File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
monitor
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
@Override public void setPersonalAppsSuspended(ComponentName who, boolean suspended) { Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isProfileOwnerOfOrganizationOwnedDevice(caller)); Preconditions.checkState(canHandleCheckPolicyComplianceIntent(caller)); final int callingUserId = caller.getUserId(); synchronized (getLockObject()) { final ActiveAdmin admin = getProfileOwnerLocked(caller); boolean shouldSaveSettings = false; if (admin.mSuspendPersonalApps != suspended) { admin.mSuspendPersonalApps = suspended; shouldSaveSettings = true; } if (admin.mProfileOffDeadline != 0) { admin.mProfileOffDeadline = 0; shouldSaveSettings = true; } if (shouldSaveSettings) { saveSettingsLocked(callingUserId); } } mInjector.binderWithCleanCallingIdentity(() -> updatePersonalAppsSuspension( callingUserId, mUserManager.isUserUnlocked(callingUserId))); DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_PERSONAL_APPS_SUSPENDED) .setAdmin(caller.getComponentName()) .setBoolean(suspended) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPersonalAppsSuspended 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
setPersonalAppsSuspended
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public String render(TemplateEngineTypeEnum engineType, String templateContent, Map<String, Object> context) { if (StrUtil.isEmpty(templateContent)) { return StrUtil.EMPTY; } TemplateEngine templateEngine = templateEngineMap.get(engineType); Assert.notNull(templateEngine, "未找到对应的模板引擎:{}", engineType); return templateEngine.render(templateContent, context); }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2022-24881 - Severity: HIGH - CVSS Score: 7.5 Description: :lock: 修改模板引擎的默认安全策略,以防止RCE Function: render File: ballcat-codegen-backend/src/main/java/com/hccake/ballcat/codegen/engine/TemplateEngineDelegator.java Repository: ballcat-projects/ballcat-codegen Fixed Code: public String render(TemplateEngineTypeEnum engineType, String templateContent, Map<String, Object> context) throws TemplateRenderException { if (StrUtil.isEmpty(templateContent)) { return StrUtil.EMPTY; } TemplateEngine templateEngine = templateEngineMap.get(engineType); Assert.notNull(templateEngine, "未找到对应的模板引擎:{}", engineType); return templateEngine.render(templateContent, context); }
[ "CWE-20" ]
CVE-2022-24881
HIGH
7.5
ballcat-projects/ballcat-codegen
render
ballcat-codegen-backend/src/main/java/com/hccake/ballcat/codegen/engine/TemplateEngineDelegator.java
84a7cb38daf0295b93aba21d562ec627e4eb463b
1
Analyze the following code function for security vulnerabilities
private boolean checkReadContactsPermission(String packageName, int userId) { return isPermittedForPackage(packageName, userId, Manifest.permission.READ_CONTACTS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkReadContactsPermission 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
checkReadContactsPermission
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override protected void displayProgress(boolean flag) { super.displayProgress(flag); // indicate we are busy. mDataBusy = flag; // make sure we don't allow calls to save when we're // not ready for them. mButton.setClickable(!mDataBusy); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayProgress File: src/com/android/phone/settings/fdn/EditFdnContactScreen.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
displayProgress
src/com/android/phone/settings/fdn/EditFdnContactScreen.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
private int getMessagingLayoutResource() { return R.layout.notification_template_material_messaging; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMessagingLayoutResource File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getMessagingLayoutResource
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0