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
@Override public void onSpecialSymbol(char symbol) { getXHTMLWikiPrinter().printXML(String.valueOf(symbol)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSpecialSymbol File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
onSpecialSymbol
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
public void userActivity() { mPM.userActivity(SystemClock.uptimeMillis(), false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: userActivity File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
userActivity
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
@Override public void acknowledge() throws JMSException { getSession().acknowledgeMessage(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: acknowledge File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
acknowledge
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
@Override public HttpHeaders set(String name, Object value) { headers.setObject(name, value); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: set File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-444" ]
CVE-2021-43797
MEDIUM
4.3
netty
set
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
07aa6b5938a8b6ed7a6586e066400e2643897323
0
Analyze the following code function for security vulnerabilities
@ExceptionHandler(WebApplicationException.class) public ResponseEntity<String> handleWebApplicationException( WebApplicationException e) { return e.toResponseEntity(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleWebApplicationException File: src/main/java/com/unboundid/webapp/ssam/SSAMController.java Repository: pingidentity/ssam The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-25084
MEDIUM
4
pingidentity/ssam
handleWebApplicationException
src/main/java/com/unboundid/webapp/ssam/SSAMController.java
f64b10d63bb19ca2228b0c2d561a1a6e5a3bf251
0
Analyze the following code function for security vulnerabilities
public void handleDeauthImminentEvent(WnmData event, WifiConfiguration config) { if (event == null || config == null) { return; } blockProvider(config.getProfileKey(), event.getBssid(), event.isEss(), event.getDelay()); mWifiMetrics.incrementPasspointDeauthImminentScope(event.isEss()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleDeauthImminentEvent 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
handleDeauthImminentEvent
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings({"checkstyle:npathcomplexity"}) private static void serializationXmlGenerator(XmlGenerator gen, Config config) { SerializationConfig c = config.getSerializationConfig(); if (c == null) { return; } gen.open("serialization") .node("portable-version", c.getPortableVersion()) .node("use-native-byte-order", c.isUseNativeByteOrder()) .node("byte-order", c.getByteOrder()) .node("enable-compression", c.isEnableCompression()) .node("enable-shared-object", c.isEnableSharedObject()) .node("allow-unsafe", c.isAllowUnsafe()); Map<Integer, String> dsfClasses = c.getDataSerializableFactoryClasses(); Map<Integer, DataSerializableFactory> dsfImpls = c.getDataSerializableFactories(); if (!MapUtil.isNullOrEmpty(dsfClasses) || !MapUtil.isNullOrEmpty(dsfImpls)) { gen.open("data-serializable-factories"); appendSerializationFactory(gen, "data-serializable-factory", dsfClasses); appendSerializationFactory(gen, "data-serializable-factory", dsfImpls); gen.close(); } Map<Integer, String> portableClasses = c.getPortableFactoryClasses(); Map<Integer, PortableFactory> portableImpls = c.getPortableFactories(); if (!MapUtil.isNullOrEmpty(portableClasses) || !MapUtil.isNullOrEmpty(portableImpls)) { gen.open("portable-factories"); appendSerializationFactory(gen, "portable-factory", portableClasses); appendSerializationFactory(gen, "portable-factory", portableImpls); gen.close(); } Collection<SerializerConfig> serializers = c.getSerializerConfigs(); GlobalSerializerConfig globalSerializerConfig = c.getGlobalSerializerConfig(); if (CollectionUtil.isNotEmpty(serializers) || globalSerializerConfig != null) { gen.open("serializers"); if (globalSerializerConfig != null) { gen.node("global-serializer", classNameOrImplClass( globalSerializerConfig.getClassName(), globalSerializerConfig.getImplementation()), "override-java-serialization", globalSerializerConfig.isOverrideJavaSerialization()); } if (CollectionUtil.isNotEmpty(serializers)) { for (SerializerConfig serializer : serializers) { gen.node("serializer", null, "type-class", classNameOrClass(serializer.getTypeClassName(), serializer.getTypeClass()), "class-name", classNameOrImplClass(serializer.getClassName(), serializer.getImplementation())); } } gen.close(); } gen.node("check-class-def-errors", c.isCheckClassDefErrors()) .close(); }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2016-10750 - Severity: MEDIUM - CVSS Score: 6.8 Description: Add basic protection against untrusted deserialization. Function: serializationXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast Fixed Code: @SuppressWarnings({"checkstyle:npathcomplexity"}) private static void serializationXmlGenerator(XmlGenerator gen, Config config) { SerializationConfig c = config.getSerializationConfig(); if (c == null) { return; } gen.open("serialization") .node("portable-version", c.getPortableVersion()) .node("use-native-byte-order", c.isUseNativeByteOrder()) .node("byte-order", c.getByteOrder()) .node("enable-compression", c.isEnableCompression()) .node("enable-shared-object", c.isEnableSharedObject()) .node("allow-unsafe", c.isAllowUnsafe()); Map<Integer, String> dsfClasses = c.getDataSerializableFactoryClasses(); Map<Integer, DataSerializableFactory> dsfImpls = c.getDataSerializableFactories(); if (!MapUtil.isNullOrEmpty(dsfClasses) || !MapUtil.isNullOrEmpty(dsfImpls)) { gen.open("data-serializable-factories"); appendSerializationFactory(gen, "data-serializable-factory", dsfClasses); appendSerializationFactory(gen, "data-serializable-factory", dsfImpls); gen.close(); } Map<Integer, String> portableClasses = c.getPortableFactoryClasses(); Map<Integer, PortableFactory> portableImpls = c.getPortableFactories(); if (!MapUtil.isNullOrEmpty(portableClasses) || !MapUtil.isNullOrEmpty(portableImpls)) { gen.open("portable-factories"); appendSerializationFactory(gen, "portable-factory", portableClasses); appendSerializationFactory(gen, "portable-factory", portableImpls); gen.close(); } Collection<SerializerConfig> serializers = c.getSerializerConfigs(); GlobalSerializerConfig globalSerializerConfig = c.getGlobalSerializerConfig(); if (CollectionUtil.isNotEmpty(serializers) || globalSerializerConfig != null) { gen.open("serializers"); if (globalSerializerConfig != null) { gen.node("global-serializer", classNameOrImplClass( globalSerializerConfig.getClassName(), globalSerializerConfig.getImplementation()), "override-java-serialization", globalSerializerConfig.isOverrideJavaSerialization()); } if (CollectionUtil.isNotEmpty(serializers)) { for (SerializerConfig serializer : serializers) { gen.node("serializer", null, "type-class", classNameOrClass(serializer.getTypeClassName(), serializer.getTypeClass()), "class-name", classNameOrImplClass(serializer.getClassName(), serializer.getImplementation())); } } gen.close(); } gen.node("check-class-def-errors", c.isCheckClassDefErrors()); JavaSerializationFilterConfig javaSerializationFilterConfig = c.getJavaSerializationFilterConfig(); if (javaSerializationFilterConfig != null) { gen.open("java-serialization-filter"); appendFilterList(gen, "blacklist", javaSerializationFilterConfig.getBlacklist()); appendFilterList(gen, "whitelist", javaSerializationFilterConfig.getWhitelist()); gen.close(); } gen.close(); }
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
serializationXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
1
Analyze the following code function for security vulnerabilities
@Override public void resumeTopActivities(boolean scheduleIdle) { synchronized (mGlobalLock) { mRootWindowContainer.resumeFocusedTasksTopActivities(); if (scheduleIdle) { mTaskSupervisor.scheduleIdle(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resumeTopActivities File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
resumeTopActivities
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private void updateEmptyShadeView() { boolean showEmptyShadeView = mState != StatusBarState.KEYGUARD && mNotificationData.getActiveNotifications().size() == 0; mNotificationPanel.showEmptyShadeView(showEmptyShadeView); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateEmptyShadeView 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
updateEmptyShadeView
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private int getAesEncryptionHeaderSize(AESExtraDataRecord aesExtraDataRecord) throws ZipException { if (aesExtraDataRecord == null || aesExtraDataRecord.getAesKeyStrength() == null) { throw new ZipException("AesExtraDataRecord not found or invalid for Aes encrypted entry"); } return InternalZipConstants.AES_AUTH_LENGTH + InternalZipConstants.AES_PASSWORD_VERIFIER_LENGTH + aesExtraDataRecord.getAesKeyStrength().getSaltLength(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAesEncryptionHeaderSize File: src/main/java/net/lingala/zip4j/io/inputstream/ZipInputStream.java Repository: srikanth-lingala/zip4j The code follows secure coding practices.
[ "CWE-346" ]
CVE-2023-22899
MEDIUM
5.9
srikanth-lingala/zip4j
getAesEncryptionHeaderSize
src/main/java/net/lingala/zip4j/io/inputstream/ZipInputStream.java
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
0
Analyze the following code function for security vulnerabilities
@Override public TtyExecErrorChannelable<String, OutputStream, PipedInputStream, ExecWatch> writingError(OutputStream err) { return new PodOperationsImpl(getContext().withErr(err)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writingError File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java Repository: fabric8io/kubernetes-client The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-20218
MEDIUM
5.8
fabric8io/kubernetes-client
writingError
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
325d67cc80b73f049a5d0cea4917c1f2709a8d86
0
Analyze the following code function for security vulnerabilities
protected Optional<Object> parseClaim(JwtClaims claims, String claimName) { Object obj = claims.get(claimName); if (obj == null) { if (LOG.isTraceEnabled()) { LOG.trace("{} claim not present", claimName); } return Optional.empty(); } return Optional.of(obj); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseClaim File: security-oauth2/src/main/java/io/micronaut/security/oauth2/client/IdTokenClaimsValidator.java Repository: micronaut-projects/micronaut-security The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-36820
MEDIUM
6.5
micronaut-projects/micronaut-security
parseClaim
security-oauth2/src/main/java/io/micronaut/security/oauth2/client/IdTokenClaimsValidator.java
9728b925221a0d87798ccf250657a3c214b7e980
0
Analyze the following code function for security vulnerabilities
public @NonNull AssetFileDescriptor openNonAssetFd(@NonNull String fileName) throws IOException { return openNonAssetFd(0, fileName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openNonAssetFd 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
openNonAssetFd
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Nonnull private EEOI _readValue () throws JsonParseException { _skipSpaces (); final IJsonParsePosition aStartPos = _getCurrentParsePos (); final int cFirst = _readChar (); switch (cFirst) { case '\'': { _backupChar (cFirst); final TwoStrings aString = _readString (EStringQuoteMode.SINGLE); m_aCallback.onString (aString.m_sOriginal, aString.m_sUnescaped); break; } case '"': { _backupChar (cFirst); final TwoStrings aString = _readString (EStringQuoteMode.DOUBLE); m_aCallback.onString (aString.m_sOriginal, aString.m_sUnescaped); break; } case '-': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': _backupChar (cFirst); _readNumber (); break; case 't': _backupChar (cFirst); _expect (CJson.KEYWORD_TRUE); m_aCallback.onTrue (); break; case 'f': _backupChar (cFirst); _expect (CJson.KEYWORD_FALSE); m_aCallback.onFalse (); break; case 'n': _backupChar (cFirst); _expect (CJson.KEYWORD_NULL); m_aCallback.onNull (); break; case CJson.ARRAY_START: _readArray (); break; case CJson.OBJECT_START: _readObject (); break; case EOI: return EEOI.EOI; default: throw _parseEx (aStartPos, "Syntax error in JSON. Found " + _getPrintableChar (cFirst)); } return EEOI.NOT_EOI; }
Vulnerability Classification: - CWE: CWE-787 - CVE: CVE-2023-34612 - Severity: HIGH - CVSS Score: 7.5 Description: Added maximum nesting level; #35 Function: _readValue File: ph-json/src/main/java/com/helger/json/parser/JsonParser.java Repository: phax/ph-commons Fixed Code: @Nonnull private EEOI _readValue () throws JsonParseException { _skipSpaces (); final IJsonParsePosition aStartPos = _getCurrentParsePos (); final int cFirst = _readChar (); switch (cFirst) { case '\'': { _backupChar (cFirst); final TwoStrings aString = _readString (EStringQuoteMode.SINGLE); m_aCallback.onString (aString.m_sOriginal, aString.m_sUnescaped); break; } case '"': { _backupChar (cFirst); final TwoStrings aString = _readString (EStringQuoteMode.DOUBLE); m_aCallback.onString (aString.m_sOriginal, aString.m_sUnescaped); break; } case '-': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': _backupChar (cFirst); _readNumber (); break; case 't': _backupChar (cFirst); _expect (CJson.KEYWORD_TRUE); m_aCallback.onTrue (); break; case 'f': _backupChar (cFirst); _expect (CJson.KEYWORD_FALSE); m_aCallback.onFalse (); break; case 'n': _backupChar (cFirst); _expect (CJson.KEYWORD_NULL); m_aCallback.onNull (); break; case CJson.ARRAY_START: _incNestingLevel (aStartPos); _readArray (); _decNestingLevel (); break; case CJson.OBJECT_START: _incNestingLevel (aStartPos); _readObject (); _decNestingLevel (); break; case EOI: return EEOI.EOI; default: throw _parseEx (aStartPos, "Syntax error in JSON. Found " + _getPrintableChar (cFirst)); } return EEOI.NOT_EOI; }
[ "CWE-787" ]
CVE-2023-34612
HIGH
7.5
phax/ph-commons
_readValue
ph-json/src/main/java/com/helger/json/parser/JsonParser.java
02a4d034dcfb2b6e1796b25f519bf57a6796edce
1
Analyze the following code function for security vulnerabilities
public String getSkinPreference(String prefname, String defaultValue, XWikiContext context) { for (Skin skin = getInternalSkinManager().getCurrentSkin(true); skin != null; skin = skin.getParent()) { if (skin instanceof WikiSkin) { String value = getWikiSkinUtils().getSkinProperty(skin.getId(), prefname); // TODO: remove the NO_VALUE test when XWIKI-10853 is fixed if (!StringUtils.isEmpty(value) && !NO_VALUE.equals(value)) { return value; } } } return defaultValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSkinPreference 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
getSkinPreference
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
protected abstract String getSxPrefix();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSxPrefix File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/org/xwiki/skinx/internal/AbstractSxExportURLFactoryActionHandler.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-116" ]
CVE-2022-23620
MEDIUM
5.8
xwiki/xwiki-platform
getSxPrefix
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/org/xwiki/skinx/internal/AbstractSxExportURLFactoryActionHandler.java
ab778254fb8f71c774e1c1239368c44fe3b6bba5
0
Analyze the following code function for security vulnerabilities
public void initOrderField() { ServiceUtils.initOrderField(ApiScenarioWithBLOBs.class, ApiScenarioMapper.class, extApiScenarioMapper::selectProjectIds, extApiScenarioMapper::getIdsOrderByUpdateTime); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initOrderField File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2021-45789
MEDIUM
6.5
metersphere
initOrderField
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
d74e02cdff47cdf7524d305d098db6ffb7f61b47
0
Analyze the following code function for security vulnerabilities
public synchronized void deleteRow() throws SQLException { checkUpdateable(); if (onInsertRow) { throw new PSQLException(GT.tr("Cannot call deleteRow() when on the insert row."), PSQLState.INVALID_CURSOR_STATE); } if (isBeforeFirst()) { throw new PSQLException( GT.tr( "Currently positioned before the start of the ResultSet. You cannot call deleteRow() here."), PSQLState.INVALID_CURSOR_STATE); } if (isAfterLast()) { throw new PSQLException( GT.tr( "Currently positioned after the end of the ResultSet. You cannot call deleteRow() here."), PSQLState.INVALID_CURSOR_STATE); } List<Tuple> rows = castNonNull(this.rows, "rows"); if (rows.isEmpty()) { throw new PSQLException(GT.tr("There are no rows in this ResultSet."), PSQLState.INVALID_CURSOR_STATE); } List<PrimaryKey> primaryKeys = castNonNull(this.primaryKeys, "primaryKeys"); int numKeys = primaryKeys.size(); if (deleteStatement == null) { StringBuilder deleteSQL = new StringBuilder("DELETE FROM ").append(onlyTable).append(tableName).append(" where "); for (int i = 0; i < numKeys; i++) { Utils.escapeIdentifier(deleteSQL, primaryKeys.get(i).name); deleteSQL.append(" = ?"); if (i < numKeys - 1) { deleteSQL.append(" and "); } } deleteStatement = connection.prepareStatement(deleteSQL.toString()); } deleteStatement.clearParameters(); for (int i = 0; i < numKeys; i++) { deleteStatement.setObject(i + 1, primaryKeys.get(i).getValue()); } deleteStatement.executeUpdate(); rows.remove(currentRow); currentRow--; moveToCurrentRow(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteRow 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
deleteRow
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public boolean updateNetworkSelectionStatus(int networkId, int reason) { WifiConfiguration config = getInternalConfiguredNetwork(networkId); if (config == null) { return false; } return updateNetworkSelectionStatus(config, reason); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateNetworkSelectionStatus File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
updateNetworkSelectionStatus
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public DocumentReference getDocumentReference() { return this.deletedDoc.getDocumentReference(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDocumentReference File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/DeletedDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-29208
HIGH
7.5
xwiki/xwiki-platform
getDocumentReference
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/DeletedDocument.java
d9e947559077e947315bf700c5703dfc7dd8a8d7
0
Analyze the following code function for security vulnerabilities
public boolean isInputMethodPermittedByAdmin(@NonNull ComponentName admin, @NonNull String packageName, int userHandle) { if (mService != null) { try { return mService.isInputMethodPermittedByAdmin(admin, packageName, userHandle, mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInputMethodPermittedByAdmin 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
isInputMethodPermittedByAdmin
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
boolean _initialized() { return isInitialized(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _initialized File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
_initialized
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public void setShortSupportMessage(@NonNull ComponentName who, CharSequence message) { if (!mHasFeature) { return; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); synchronized (getLockObject()) { ActiveAdmin admin = getActiveAdminForUidLocked(who, caller.getUid()); if (!TextUtils.equals(admin.shortSupportMessage, message)) { admin.shortSupportMessage = message; saveSettingsLocked(caller.getUserId()); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_SHORT_SUPPORT_MESSAGE) .setAdmin(who) .write(); }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2023-21284 - Severity: MEDIUM - CVSS Score: 5.5 Description: Ensure policy has no absurdly long strings The following APIs now enforce limits and throw IllegalArgumentException when limits are violated: * DPM.setTrustAgentConfiguration() limits agent packgage name, component name, and strings within configuration bundle. * DPM.setPermittedAccessibilityServices() limits package names. * DPM.setPermittedInputMethods() limits package names. * DPM.setAccountManagementDisabled() limits account name. * DPM.setLockTaskPackages() limits package names. * DPM.setAffiliationIds() limits id. * DPM.transferOwnership() limits strings inside the bundle. Package names are limited at 223, because they become directory names and it is a filesystem restriction, see FrameworkParsingPackageUtils. All other strings are limited at 65535, because longer ones break binary XML serializer. The following APIs silently truncate strings that are long beyond reason: * DPM.setShortSupportMessage() truncates message at 200. * DPM.setLongSupportMessage() truncates message at 20000. * DPM.setOrganizationName() truncates org name at 200. Bug: 260729089 Test: atest com.android.server.devicepolicy (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5dd3e81347e3c841510094fb5effd51fc0fa995b) Merged-In: Idcf54e408722f164d16bf2f24a00cd1f5b626d23 Change-Id: Idcf54e408722f164d16bf2f24a00cd1f5b626d23 Function: setShortSupportMessage File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android Fixed Code: @Override public void setShortSupportMessage(@NonNull ComponentName who, CharSequence message) { if (!mHasFeature) { return; } Objects.requireNonNull(who, "ComponentName is null"); message = truncateIfLonger(message, MAX_SHORT_SUPPORT_MESSAGE_LENGTH); final CallerIdentity caller = getCallerIdentity(who); synchronized (getLockObject()) { ActiveAdmin admin = getActiveAdminForUidLocked(who, caller.getUid()); if (!TextUtils.equals(admin.shortSupportMessage, message)) { admin.shortSupportMessage = message; saveSettingsLocked(caller.getUserId()); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_SHORT_SUPPORT_MESSAGE) .setAdmin(who) .write(); }
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
setShortSupportMessage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
1
Analyze the following code function for security vulnerabilities
public void sendStatusChangeNotification(Subscription subscription, StatusCode status) { ServiceRequest service = publishQueue.poll(); if (service != null) { subscription.returnStatusChangeNotification(service, status); } else { transferred.add(subscription); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendStatusChangeNotification File: opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java Repository: eclipse/milo The code follows secure coding practices.
[ "CWE-770" ]
CVE-2022-25897
HIGH
7.5
eclipse/milo
sendStatusChangeNotification
opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java
4534381760d7d9f0bf00cbf6a8449bb0d13c6ce5
0
Analyze the following code function for security vulnerabilities
public static void cursorStringToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getString(index)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cursorStringToContentValuesIfPresent File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
cursorStringToContentValuesIfPresent
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
@Override protected Details authenticate(String username, String password) throws AuthenticationException { Details u = loadUserByUsername(username); if (!u.isPasswordCorrect(password)) throw new BadCredentialsException("Failed to login as "+username); return u; }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2014-2064 - Severity: MEDIUM - CVSS Score: 5.0 Description: [FIXED SECURITY-79] Prevent (private security realm) usernames from being guessed. Function: authenticate File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java Repository: jenkinsci/jenkins Fixed Code: @Override protected Details authenticate(String username, String password) throws AuthenticationException { Details u = loadUserByUsername(username); if (!u.isPasswordCorrect(password)) { String message; try { message = ResourceBundle.getBundle("org.acegisecurity.messages").getString("AbstractUserDetailsAuthenticationProvider.badCredentials"); } catch (MissingResourceException x) { message = "Bad credentials"; } throw new BadCredentialsException(message); } return u; }
[ "CWE-200" ]
CVE-2014-2064
MEDIUM
5
jenkinsci/jenkins
authenticate
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
fbf96734470caba9364f04e0b77b0bae7293a1ec
1
Analyze the following code function for security vulnerabilities
boolean isEqual(final String type, final int args, final String text) { return this.type.equals(type) && this.args == args && this.text.equals(text); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEqual File: app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java Repository: mkulesh/microMathematics The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000821
HIGH
7.5
mkulesh/microMathematics
isEqual
app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java
5c05ac8de16c569ff0a1816f20be235090d3dd9d
0
Analyze the following code function for security vulnerabilities
public TlsSecret decrypt(TlsCryptoParameters cryptoParams, byte[] ciphertext) throws IOException { // TODO Keep only the decryption itself here - move error handling outside return safeDecryptPreMasterSecret(cryptoParams, privateKey, ciphertext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decrypt File: tls/src/main/java/org/bouncycastle/tls/crypto/impl/jcajce/JceDefaultTlsCredentialedDecryptor.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-203" ]
CVE-2017-13098
MEDIUM
4.3
bcgit/bc-java
decrypt
tls/src/main/java/org/bouncycastle/tls/crypto/impl/jcajce/JceDefaultTlsCredentialedDecryptor.java
a00b684465b38d722ca9a3543b8af8568e6bad5c
0
Analyze the following code function for security vulnerabilities
public boolean moveFile ( Contentlet fileAssetCont, Host host, User user, boolean respectFrontendRoles ) throws DotStateException, DotDataException, DotSecurityException { return moveFile( fileAssetCont, null, host, user, respectFrontendRoles ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveFile File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
moveFile
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
0
Analyze the following code function for security vulnerabilities
public boolean enableNetwork(int networkId, boolean disableOthers, int uid, @NonNull String packageName) { if (mVerboseLoggingEnabled) { Log.v(TAG, "Enabling network " + networkId + " (disableOthers " + disableOthers + ")"); } if (!mWifiPermissionsUtil.doesUidBelongToCurrentUserOrDeviceOwner(uid)) { Log.e(TAG, "UID " + uid + " not visible to the current user"); return false; } WifiConfiguration config = getInternalConfiguredNetwork(networkId); if (config == null) { return false; } // Set the "last selected" flag even if the app does not have permissions to modify this // network config. Apps are allowed to connect to networks even if they don't have // permission to modify it. if (disableOthers) { setLastSelectedNetwork(networkId); } if (!canModifyNetwork(config, uid, packageName)) { Log.e(TAG, "UID " + uid + " package " + packageName + " does not have permission to update configuration " + config.getProfileKey()); return false; } if (!updateNetworkSelectionStatus( networkId, WifiConfiguration.NetworkSelectionStatus.DISABLED_NONE)) { return false; } saveToStore(true); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enableNetwork File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
enableNetwork
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private void handleReset() { synchronized (KeyguardViewMediator.this) { if (DEBUG) Log.d(TAG, "handleReset"); mKeyguardViewControllerLazy.get().reset(true /* hideBouncerWhenShowing */); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleReset File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
handleReset
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked")// For the Enum.valueOf call private Object readEnum(boolean unshared) throws OptionalDataException, ClassNotFoundException, IOException { // read classdesc for Enum first ObjectStreamClass classDesc = readEnumDesc(); int newHandle = nextHandle(); // read name after class desc String name; byte tc = nextTC(); switch (tc) { case TC_REFERENCE: if (unshared) { readNewHandle(); throw new InvalidObjectException("Unshared read of back reference"); } name = (String) readCyclicReference(); break; case TC_STRING: name = (String) readNewString(unshared); break; default: throw corruptStream(tc); } Enum<?> result; try { result = Enum.valueOf((Class) classDesc.forClass(), name); } catch (IllegalArgumentException e) { throw new InvalidObjectException(e.getMessage()); } registerObjectRead(result, newHandle, unshared); return result; }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2014-7911 - Severity: HIGH - CVSS Score: 7.2 Description: Add additional checks in ObjectInputStream Thanks to Jann Horn for reporting a bug in ObjectInputStream and sending the initial patch. Add some checks that the class of an object being deserialized still conforms to the requirements for serialization. Add some checks that the class being deserialized matches the type information (enum, serializable, externalizable) held in the stream. Delayed static initialization of classes until the type of the class has been validated against the stream content in some cases. Added more tests. Bug: 15874291 Change-Id: I0f0fe68e0d21e041c5160482113ae847c357b8f5 Function: readEnum File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android Fixed Code: @SuppressWarnings("unchecked")// For the Enum.valueOf call private Object readEnum(boolean unshared) throws OptionalDataException, ClassNotFoundException, IOException { // read classdesc for Enum first ObjectStreamClass classDesc = readEnumDesc(); Class enumType = classDesc.checkAndGetTcEnumClass(); int newHandle = nextHandle(); // read name after class desc String name; byte tc = nextTC(); switch (tc) { case TC_REFERENCE: if (unshared) { readNewHandle(); throw new InvalidObjectException("Unshared read of back reference"); } name = (String) readCyclicReference(); break; case TC_STRING: name = (String) readNewString(unshared); break; default: throw corruptStream(tc); } Enum<?> result; try { result = Enum.valueOf(enumType, name); } catch (IllegalArgumentException e) { InvalidObjectException ioe = new InvalidObjectException(e.getMessage()); ioe.initCause(e); throw ioe; } registerObjectRead(result, newHandle, unshared); return result; }
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
readEnum
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
1
Analyze the following code function for security vulnerabilities
private final String _decodeChunkedName() throws IOException { _finishChunkedText(); return _textBuffer.contentsAsString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _decodeChunkedName File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
_decodeChunkedName
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; // also set the date format for model (de)serialization with Date properties this.json.setDateFormat((DateFormat) dateFormat.clone()); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDateFormat File: samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setDateFormat
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public void handleCreateConnectionComplete(String callId, ConnectionRequest request, ParcelableConnection connection, Session.Info sessionInfo) { Log.startSession(sessionInfo, LogUtils.Sessions.CSW_HANDLE_CREATE_CONNECTION_COMPLETE, mPackageAbbreviation); long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { logIncoming("handleCreateConnectionComplete %s", callId); ConnectionServiceWrapper.this .handleCreateConnectionComplete(callId, request, connection); if (mServiceInterface != null) { logOutgoing("createConnectionComplete %s", callId); try { mServiceInterface.createConnectionComplete(callId, Log.getExternalSession()); } catch (RemoteException e) { logOutgoing("createConnectionComplete remote exception=%s", e); } } } } catch (Throwable t) { Log.e(ConnectionServiceWrapper.this, t, ""); throw t; } finally { Binder.restoreCallingIdentity(token); Log.endSession(); } }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21283 - Severity: MEDIUM - CVSS Score: 5.5 Description: [conflict] Resolve StatusHints image exploit across user. am: a853f6ba61 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/23463634 Fixes: 285211549 Fixes: 280797684 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:41042bd0c8e1e47c19dfdb2a378c70d2090b1e15) Merged-In: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Change-Id: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Function: handleCreateConnectionComplete File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android Fixed Code: @Override public void handleCreateConnectionComplete(String callId, ConnectionRequest request, ParcelableConnection connection, Session.Info sessionInfo) { Log.startSession(sessionInfo, LogUtils.Sessions.CSW_HANDLE_CREATE_CONNECTION_COMPLETE, mPackageAbbreviation); UserHandle callingUserHandle = Binder.getCallingUserHandle(); long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { logIncoming("handleCreateConnectionComplete %s", callId); // Check status hints image for cross user access if (connection.getStatusHints() != null) { Icon icon = connection.getStatusHints().getIcon(); connection.getStatusHints().setIcon(StatusHints. validateAccountIconUserBoundary(icon, callingUserHandle)); } ConnectionServiceWrapper.this .handleCreateConnectionComplete(callId, request, connection); if (mServiceInterface != null) { logOutgoing("createConnectionComplete %s", callId); try { mServiceInterface.createConnectionComplete(callId, Log.getExternalSession()); } catch (RemoteException e) { logOutgoing("createConnectionComplete remote exception=%s", e); } } } } catch (Throwable t) { Log.e(ConnectionServiceWrapper.this, t, ""); throw t; } finally { Binder.restoreCallingIdentity(token); Log.endSession(); } }
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
handleCreateConnectionComplete
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
1
Analyze the following code function for security vulnerabilities
@SuppressWarnings({"unchecked", "rawtypes"}) // too late to fix public Descriptor getDescriptor(String id) { // legacy descriptors that are reigstered manually doesn't show up in getExtensionList, so check them explicitly. Iterable<Descriptor> descriptors = Iterators.sequence(getExtensionList(Descriptor.class), DescriptorExtensionList.listLegacyInstances()); for (Descriptor d : descriptors) { if (d.getId().equals(id)) { return d; } } Descriptor candidate = null; for (Descriptor d : descriptors) { String name = d.getId(); if (name.substring(name.lastIndexOf('.') + 1).equals(id)) { if (candidate == null) { candidate = d; } else { throw new IllegalArgumentException(id + " is ambiguous; matches both " + name + " and " + candidate.getId()); } } } return candidate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDescriptor File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getDescriptor
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private PermissionManagerServiceInternal getPermissionManagerInternal() { // Intentionally hold no locks: in case of race conditions, the mPermissionManagerInt will // be set to the same value anyway. if (mPermissionManagerInt == null) { mPermissionManagerInt = LocalServices.getService(PermissionManagerServiceInternal.class); } return mPermissionManagerInt; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermissionManagerInternal 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
getPermissionManagerInternal
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override @JsonProperty(TYPE_FIELD) public abstract String type();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: type File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
type
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
private void updateFontScaleIfNeeded() { final int currentUserId; synchronized(this) { currentUserId = mUserController.getCurrentUserIdLocked(); } final float scaleFactor = Settings.System.getFloatForUser(mContext.getContentResolver(), FONT_SCALE, 1.0f, currentUserId); if (mConfiguration.fontScale != scaleFactor) { final Configuration configuration = mWindowManager.computeNewConfiguration(); configuration.fontScale = scaleFactor; updatePersistentConfiguration(configuration); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateFontScaleIfNeeded File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
updateFontScaleIfNeeded
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
void setAsyncEditMode(boolean async) { asyncEditMode = async; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAsyncEditMode File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
setAsyncEditMode
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void addEnvironment( String name, String value ) { //envVars.add( name + "=" + value ); envVars.put( name, value ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addEnvironment File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
addEnvironment
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
private void processResourceDependencies(ResourceDependenciesType xmlResourceDependenciesType, PackageType xmlPackage, PluginPackages pluginPackageEntity) { if (xmlResourceDependenciesType == null) { return; } List<DockerType> xmlDockerList = xmlResourceDependenciesType.getDocker(); if (xmlDockerList != null) { for (DockerType xmlDocker : xmlDockerList) { PluginPackageRuntimeResourcesDocker dockerEntity = new PluginPackageRuntimeResourcesDocker(); dockerEntity.setId(LocalIdGenerator.generateId()); dockerEntity.setContainerName(xmlDocker.getContainerName()); dockerEntity.setEnvVariables(xmlDocker.getEnvVariables()); dockerEntity.setImageName(xmlDocker.getImageName()); dockerEntity.setPluginPackageId(pluginPackageEntity.getId()); dockerEntity.setPortBindings(xmlDocker.getPortBindings()); dockerEntity.setVolumeBindings(xmlDocker.getVolumeBindings()); pluginPackageRuntimeResourcesDockerMapper.insert(dockerEntity); pluginPackageEntity.getDockers().add(dockerEntity); } } List<MysqlType> xmlMysqlList = xmlResourceDependenciesType.getMysql(); if (xmlMysqlList != null) { for (MysqlType xmlMysql : xmlMysqlList) { PluginPackageRuntimeResourcesMysql mysqlEntity = new PluginPackageRuntimeResourcesMysql(); mysqlEntity.setId(LocalIdGenerator.generateId()); mysqlEntity.setInitFileName(xmlMysql.getInitFileName()); mysqlEntity.setPluginPackageId(pluginPackageEntity.getId()); mysqlEntity.setSchemaName(xmlMysql.getSchema()); mysqlEntity.setUpgradeFileName(xmlMysql.getUpgradeFileName()); pluginPackageRuntimeResourcesMysqlMapper.insert(mysqlEntity); pluginPackageEntity.getMysqls().add(mysqlEntity); } } List<S3Type> xmlS3List = xmlResourceDependenciesType.getS3(); if (xmlS3List != null) { for (S3Type xmlS3 : xmlS3List) { PluginPackageRuntimeResourcesS3 s3Entity = new PluginPackageRuntimeResourcesS3(); s3Entity.setId(LocalIdGenerator.generateId()); s3Entity.setPluginPackageId(pluginPackageEntity.getId()); s3Entity.setBucketName(xmlS3.getBucketName()); String additionalPropsStr = buildXmlAdditionalProperties(xmlS3); if(StringUtils.isNoneBlank(additionalPropsStr)) { s3Entity.setAdditionalProperties(additionalPropsStr); } pluginPackageRuntimeResourcesS3Mapper.insert(s3Entity); pluginPackageEntity.getS3s().add(s3Entity); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processResourceDependencies File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java Repository: WeBankPartners/wecube-platform The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-45746
MEDIUM
5
WeBankPartners/wecube-platform
processResourceDependencies
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
1164dae43c505f8a0233cc049b2689d6ca6d0c37
0
Analyze the following code function for security vulnerabilities
private boolean mutateSystemSetting(String name, String value, int runAsUserId, int operation, boolean overrideableByRestore) { final String callingPackage = getCallingPackage(); if (!hasWriteSecureSettingsPermission()) { // If the caller doesn't hold WRITE_SECURE_SETTINGS, we verify whether this // operation is allowed for the calling package through appops. if (!Settings.checkAndNoteWriteSettingsOperation(getContext(), Binder.getCallingUid(), callingPackage, getCallingAttributionTag(), true)) { Slog.e(LOG_TAG, "Calling package: " + callingPackage + " is not allowed to " + "write system settings: " + name); return false; } } // Resolve the userId on whose behalf the call is made. final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(runAsUserId); if (isSettingRestrictedForUser(name, callingUserId, value, Binder.getCallingUid())) { Slog.e(LOG_TAG, "UserId: " + callingUserId + " is disallowed to change system " + "setting: " + name); return false; } // Enforce what the calling package can mutate the system settings. enforceRestrictedSystemSettingsMutationForCallingPackage(operation, name, callingUserId); // Determine the owning user as some profile settings are cloned from the parent. final int owningUserId = resolveOwningUserIdForSystemSettingLocked(callingUserId, name); // Only the owning user id can change the setting. if (owningUserId != callingUserId) { Slog.e(LOG_TAG, "UserId: " + callingUserId + " is not the owning userId: " + owningUserId); return false; } // Invalidate any relevant cache files String cacheName = null; if (Settings.System.RINGTONE.equals(name)) { cacheName = Settings.System.RINGTONE_CACHE; } else if (Settings.System.NOTIFICATION_SOUND.equals(name)) { cacheName = Settings.System.NOTIFICATION_SOUND_CACHE; } else if (Settings.System.ALARM_ALERT.equals(name)) { cacheName = Settings.System.ALARM_ALERT_CACHE; } if (cacheName != null) { final File cacheFile = new File( getRingtoneCacheDir(owningUserId), cacheName); cacheFile.delete(); } // Mutate the value. synchronized (mLock) { switch (operation) { case MUTATION_OPERATION_INSERT: { validateSystemSettingValue(name, value); return mSettingsRegistry.insertSettingLocked(SETTINGS_TYPE_SYSTEM, owningUserId, name, value, null, false, callingPackage, false, null, overrideableByRestore); } case MUTATION_OPERATION_DELETE: { return mSettingsRegistry.deleteSettingLocked(SETTINGS_TYPE_SYSTEM, owningUserId, name, false, null); } case MUTATION_OPERATION_UPDATE: { validateSystemSettingValue(name, value); return mSettingsRegistry.updateSettingLocked(SETTINGS_TYPE_SYSTEM, owningUserId, name, value, null, false, callingPackage, false, null); } } Slog.e(LOG_TAG, "Unknown operation code: " + operation); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mutateSystemSetting File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
mutateSystemSetting
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
private void setDelegatedScopePreO(ComponentName who, String delegatePackage, String scope) { Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); // Ensure calling process is device/profile owner. Preconditions.checkCallAuthorization( isProfileOwner(caller) || isDefaultDeviceOwner(caller)); synchronized (getLockObject()) { final DevicePolicyData policy = getUserData(caller.getUserId()); if (delegatePackage != null) { // Set package as a delegate for scope if it is not already one. List<String> scopes = policy.mDelegationMap.get(delegatePackage); if (scopes == null) { scopes = new ArrayList<>(); } if (!scopes.contains(scope)) { scopes.add(scope); setDelegatedScopes(who, delegatePackage, scopes); } } // Clear any existing scope delegates. for (int i = 0; i < policy.mDelegationMap.size(); i++) { final String currentPackage = policy.mDelegationMap.keyAt(i); final List<String> currentScopes = policy.mDelegationMap.valueAt(i); if (!currentPackage.equals(delegatePackage) && currentScopes.contains(scope)) { final List<String> newScopes = new ArrayList(currentScopes); newScopes.remove(scope); setDelegatedScopes(who, currentPackage, newScopes); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDelegatedScopePreO 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
setDelegatedScopePreO
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected boolean isRekeyPacketCountsExceeded() { if (maxRekyPackets <= 0L) { return false; // disabled } boolean rekey = (inPacketsCount.get() > maxRekyPackets) || (outPacketsCount.get() > maxRekyPackets); if (rekey) { if (log.isDebugEnabled()) { log.debug("isRekeyPacketCountsExceeded({}) re-keying: in={}, out={}, max={}", this, inPacketsCount, outPacketsCount, maxRekyPackets); } } return rekey; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRekeyPacketCountsExceeded File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
isRekeyPacketCountsExceeded
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
private int jjMoveStringLiteralDfa1_1(long active0) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(0, active0); return 1; } switch(curChar) { case 38: if ((active0 & 0x20000000000L) != 0L) return jjStopAtPos(1, 41); break; case 61: if ((active0 & 0x80000000L) != 0L) return jjStopAtPos(1, 31); else if ((active0 & 0x200000000L) != 0L) return jjStopAtPos(1, 33); else if ((active0 & 0x800000000L) != 0L) return jjStopAtPos(1, 35); else if ((active0 & 0x2000000000L) != 0L) return jjStopAtPos(1, 37); else if ((active0 & 0x80000000000000L) != 0L) return jjStopAtPos(1, 55); break; case 62: if ((active0 & 0x200000000000000L) != 0L) return jjStopAtPos(1, 57); break; case 97: return jjMoveStringLiteralDfa2_1(active0, 0x20000L); case 101: if ((active0 & 0x100000000L) != 0L) return jjStartNfaWithStates_1(1, 32, 6); else if ((active0 & 0x400000000L) != 0L) return jjStartNfaWithStates_1(1, 34, 6); else if ((active0 & 0x4000000000L) != 0L) return jjStartNfaWithStates_1(1, 38, 6); break; case 105: return jjMoveStringLiteralDfa2_1(active0, 0x10000000000000L); case 109: return jjMoveStringLiteralDfa2_1(active0, 0x200000000000L); case 110: return jjMoveStringLiteralDfa2_1(active0, 0x440000000000L); case 111: return jjMoveStringLiteralDfa2_1(active0, 0x40010000000000L); case 113: if ((active0 & 0x1000000000L) != 0L) return jjStartNfaWithStates_1(1, 36, 6); break; case 114: if ((active0 & 0x100000000000L) != 0L) return jjStartNfaWithStates_1(1, 44, 6); return jjMoveStringLiteralDfa2_1(active0, 0x10000L); case 116: if ((active0 & 0x10000000L) != 0L) return jjStartNfaWithStates_1(1, 28, 6); else if ((active0 & 0x40000000L) != 0L) return jjStartNfaWithStates_1(1, 30, 6); break; case 117: return jjMoveStringLiteralDfa2_1(active0, 0x40000L); case 124: if ((active0 & 0x80000000000L) != 0L) return jjStopAtPos(1, 43); break; default : break; } return jjStartNfa_1(0, active0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jjMoveStringLiteralDfa1_1 File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java Repository: jakartaee/expression-language The code follows secure coding practices.
[ "CWE-917" ]
CVE-2021-28170
MEDIUM
5
jakartaee/expression-language
jjMoveStringLiteralDfa1_1
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
b6a3943ac5fba71cbc6719f092e319caa747855b
0
Analyze the following code function for security vulnerabilities
public void save(AsyncResult<SQLConnection> sqlConnection, String table, String id, Object entity, Handler<AsyncResult<String>> replyHandler) { save(sqlConnection, table, id, entity, /* returnId */ true, /* upsert */ false, /* convertEntity */ true, replyHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
save
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public static String unescape(String string) { StringBuilder sb = new StringBuilder(string.length()); for (int i = 0, length = string.length(); i < length; i++) { char c = string.charAt(i); if (c == '&') { final int semic = string.indexOf(';', i); if (semic > i) { final String entity = string.substring(i + 1, semic); sb.append(XMLTokener.unescapeEntity(entity)); // skip past the entity we just parsed. i += entity.length() + 1; } else { // this shouldn't happen in most cases since the parser // errors on unclosed entries. sb.append(c); } } else { // not part of an entity sb.append(c); } } return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unescape File: src/main/java/org/json/XML.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2022-45688
HIGH
7.5
stleary/JSON-java
unescape
src/main/java/org/json/XML.java
f566a1d9ee1f8139357017dc6c7def1da19cd8d4
0
Analyze the following code function for security vulnerabilities
public boolean hasBackupPassword() { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "hasBackupPassword"); return mPasswordHash != null && mPasswordHash.length() > 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasBackupPassword 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
hasBackupPassword
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
private File getOutputMediaFile(boolean isVideo) { // To be safe, you should check that the SDCard is mounted // using Environment.getExternalStorageState() before doing this. if (getActivity() != null) { return GetOutputMediaFile.getOutputMediaFile(isVideo, getActivity()); } else { return GetOutputMediaFile.getOutputMediaFile(isVideo, getContext(), "Video"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOutputMediaFile File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
getOutputMediaFile
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void setNewbadges(String newbadges) { this.newbadges = newbadges; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNewbadges File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
setNewbadges
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public CommandData getCommandData() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCommandData File: src/main/java/de/presti/ree6/commands/impl/community/TwitterNotifier.java Repository: Ree6-Applications/Ree6 The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-39302
MEDIUM
5.4
Ree6-Applications/Ree6
getCommandData
src/main/java/de/presti/ree6/commands/impl/community/TwitterNotifier.java
459b5bc24f0ea27e50031f563373926e94b9aa0a
0
Analyze the following code function for security vulnerabilities
public boolean isNull(int index) { return JSONObject.NULL.equals(opt(index)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNull File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
isNull
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@Override public void onOpChanged(String op, String packageName) { mHandler.post(() -> { if (!mPackageName.equals(packageName)) return; if (!OPSTR_CHANGE_WIFI_STATE.equals(op)) return; // Ensures the uid to package mapping is still correct. try { mAppOps.checkPackage(mUid, mPackageName); } catch (SecurityException e) { Log.wtf(TAG, "Invalid uid/package" + packageName); return; } if (mAppOps.unsafeCheckOpNoThrow(OPSTR_CHANGE_WIFI_STATE, mUid, mPackageName) == AppOpsManager.MODE_IGNORED) { Log.i(TAG, "User disallowed change wifi state for " + packageName); // Removes the profiles installed by the app from database. removePasspointProviderWithPackage(mPackageName); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onOpChanged 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
onOpChanged
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") void removeOomAdjTargetLocked(ProcessRecord app, boolean procDied) { mOomAdjuster.removeOomAdjTargetLocked(app, procDied); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeOomAdjTargetLocked 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
removeOomAdjTargetLocked
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public void batteryStatsReset() { BinderCallsStatsService.reset(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: batteryStatsReset 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
batteryStatsReset
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void waitForCompletion() { synchronized (mDone) { while (mDone.get() == false) { try { mDone.wait(); } catch (InterruptedException e) { } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: waitForCompletion 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
waitForCompletion
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@SneakyThrows public void migrate(String tenantKey) { final StopWatch stopWatch = createStarted(); try { log.info("START - SETUP:CreateTenant:liquibase tenantKey: {}", tenantKey); SpringLiquibase liquibase = new SpringLiquibase(); liquibase.setResourceLoader(resourceLoader); liquibase.setDataSource(dataSource); liquibase.setChangeLog(CHANGE_LOG_PATH); liquibase.setContexts(liquibaseProperties.getContexts()); liquibase.setDefaultSchema(tenantKey); liquibase.setDropFirst(liquibaseProperties.isDropFirst()); liquibase.setChangeLogParameters(DatabaseUtil.defaultParams(tenantKey)); liquibase.setShouldRun(true); liquibase.afterPropertiesSet(); log.info("STOP - SETUP:CreateTenant:liquibase tenantKey: {}, result: OK, time = {} ms", tenantKey, stopWatch.getTime()); } catch (Exception e) { log.info("STOP - SETUP:CreateTenant:liquibase tenantKey: {}, result: FAIL, error: {}, time = {} ms", tenantKey, e.getMessage(), stopWatch.getTime()); throw e; } }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2019-15557 - Severity: HIGH - CVSS Score: 7.5 Description: add assertTenantKeyValid Function: migrate File: src/main/java/com/icthh/xm/uaa/service/tenant/TenantDatabaseService.java Repository: xm-online/xm-uaa Fixed Code: @SneakyThrows public void migrate(String tenantKey) { final StopWatch stopWatch = createStarted(); try { log.info("START - SETUP:CreateTenant:liquibase tenantKey: {}", tenantKey); assertTenantKeyValid(tenantKey); SpringLiquibase liquibase = new SpringLiquibase(); liquibase.setResourceLoader(resourceLoader); liquibase.setDataSource(dataSource); liquibase.setChangeLog(CHANGE_LOG_PATH); liquibase.setContexts(liquibaseProperties.getContexts()); liquibase.setDefaultSchema(tenantKey.toLowerCase()); liquibase.setDropFirst(liquibaseProperties.isDropFirst()); liquibase.setChangeLogParameters(DatabaseUtil.defaultParams(tenantKey)); liquibase.setShouldRun(true); liquibase.afterPropertiesSet(); log.info("STOP - SETUP:CreateTenant:liquibase tenantKey: {}, result: OK, time = {} ms", tenantKey, stopWatch.getTime()); } catch (Exception e) { log.info("STOP - SETUP:CreateTenant:liquibase tenantKey: {}, result: FAIL, error: {}, time = {} ms", tenantKey, e.getMessage(), stopWatch.getTime()); throw e; } }
[ "CWE-89" ]
CVE-2019-15557
HIGH
7.5
xm-online/xm-uaa
migrate
src/main/java/com/icthh/xm/uaa/service/tenant/TenantDatabaseService.java
ffa9609c809c17e7a39ae1d92843c4463e3ca739
1
Analyze the following code function for security vulnerabilities
private void setRefineIcon(boolean invalidateIcon) { if (!invalidateIcon && mRefineIcon != null) return; mRefineIcon = TintedDrawable.constructTintedDrawable( getResources(), R.drawable.btn_suggestion_refine); mRefineIcon.setTint(ApiCompatibilityUtils.getColorStateList(getResources(), mUseDarkColors ? R.color.dark_mode_tint : R.color.light_mode_tint)); mRefineIcon.setBounds( 0, 0, mRefineIcon.getIntrinsicWidth(), mRefineIcon.getIntrinsicHeight()); mRefineIcon.setState(mRefineView.getDrawableState()); mRefineView.postInvalidateOnAnimation(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRefineIcon File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
setRefineIcon
chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
final void set(CharSequence name, String... values) { final AsciiString normalizedName = normalizeName(name); requireNonNull(values, "values"); final int h = normalizedName.hashCode(); final int i = index(h); remove0(h, i, normalizedName); for (String v : values) { requireNonNullElement(values, v); add0(h, i, normalizedName, v); } }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2019-16771 - Severity: MEDIUM - CVSS Score: 5.0 Description: Merge pull request from GHSA-35fr-h7jr-hh86 Motivation: An `HttpService` can produce a malformed HTTP response when a user specified a malformed HTTP header values, such as: ResponseHeaders.of(HttpStatus.OK "my-header", "foo\r\nbad-header: bar"); Modification: - Add strict header value validation to `HttpHeadersBase` - Add strict header name validation to `HttpHeaderNames.of()`, which is used by `HttpHeadersBase`. Result: - It is not possible anymore to send a bad header value which can be misused for sending additional headers or injecting arbitrary content. Function: set File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria Fixed Code: final void set(CharSequence name, String... values) { final AsciiString normalizedName = HttpHeaderNames.of(name); requireNonNull(values, "values"); final int h = normalizedName.hashCode(); final int i = index(h); remove0(h, i, normalizedName); for (String v : values) { requireNonNullElement(values, v); add0(h, i, normalizedName, v); } }
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
set
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
1
Analyze the following code function for security vulnerabilities
private Object readNewArray(boolean unshared) throws OptionalDataException, ClassNotFoundException, IOException { ObjectStreamClass classDesc = readClassDesc(); if (classDesc == null) { throw missingClassDescriptor(); } int newHandle = nextHandle(); // Array size int size = input.readInt(); Class<?> arrayClass = classDesc.forClass(); Class<?> componentType = arrayClass.getComponentType(); Object result = Array.newInstance(componentType, size); registerObjectRead(result, newHandle, unshared); // Now we have code duplication just because Java is typed. We have to // read N elements and assign to array positions, but we must typecast // the array first, and also call different methods depending on the // elements. if (componentType.isPrimitive()) { if (componentType == int.class) { int[] intArray = (int[]) result; for (int i = 0; i < size; i++) { intArray[i] = input.readInt(); } } else if (componentType == byte.class) { byte[] byteArray = (byte[]) result; input.readFully(byteArray, 0, size); } else if (componentType == char.class) { char[] charArray = (char[]) result; for (int i = 0; i < size; i++) { charArray[i] = input.readChar(); } } else if (componentType == short.class) { short[] shortArray = (short[]) result; for (int i = 0; i < size; i++) { shortArray[i] = input.readShort(); } } else if (componentType == boolean.class) { boolean[] booleanArray = (boolean[]) result; for (int i = 0; i < size; i++) { booleanArray[i] = input.readBoolean(); } } else if (componentType == long.class) { long[] longArray = (long[]) result; for (int i = 0; i < size; i++) { longArray[i] = input.readLong(); } } else if (componentType == float.class) { float[] floatArray = (float[]) result; for (int i = 0; i < size; i++) { floatArray[i] = input.readFloat(); } } else if (componentType == double.class) { double[] doubleArray = (double[]) result; for (int i = 0; i < size; i++) { doubleArray[i] = input.readDouble(); } } else { throw new ClassNotFoundException("Wrong base type in " + classDesc.getName()); } } else { // Array of Objects Object[] objectArray = (Object[]) result; for (int i = 0; i < size; i++) { // TODO: This place is the opportunity for enhancement // We can implement writing elements through fast-path, // without setting up the context (see readObject()) for // each element with public API objectArray[i] = readObject(); } } if (enableResolve) { result = resolveObject(result); registerObjectRead(result, newHandle, false); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readNewArray File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
readNewArray
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Override public boolean isActivePasswordSufficient( String callerPackageName, int userHandle, boolean parent) { if (!mHasFeature) { return true; } Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId"); final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle)); enforceUserUnlocked(userHandle, parent); synchronized (getLockObject()) { if (isPermissionCheckFlagEnabled()) { int affectedUser = parent ? getProfileParentId(userHandle) : userHandle; enforcePermission(MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS, callerPackageName, affectedUser); } else { // This API can only be called by an active device admin, // so try to retrieve it to check that the caller is one. getActiveAdminForCallerLocked( null, DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD, parent); } int credentialOwner = getCredentialOwner(userHandle, parent); DevicePolicyData policy = getUserDataUnchecked(credentialOwner); PasswordMetrics metrics = mLockSettingsInternal.getUserPasswordMetrics(credentialOwner); final int userToCheck = getProfileParentUserIfRequested(userHandle, parent); boolean activePasswordSufficientForUserLocked = isActivePasswordSufficientForUserLocked( policy.mPasswordValidAtLastCheckpoint, metrics, userToCheck); return activePasswordSufficientForUserLocked; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isActivePasswordSufficient 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
isActivePasswordSufficient
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public Registration addServiceDestroyListener( ServiceDestroyListener listener) { return Registration.addAndRemove(serviceDestroyListeners, listener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addServiceDestroyListener File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
addServiceDestroyListener
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
private boolean isTopMostModal(Component child) { // null has been checked in calling code before this return !modalComponentStack.isEmpty() && modalComponentStack.peek() == child; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTopMostModal File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
isTopMostModal
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
final void authority(String authority) { requireNonNull(authority, "authority"); set(HttpHeaderNames.AUTHORITY, authority); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: authority File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
authority
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
@Deprecated public static String unescape(Object content) { if (content == null) { return null; } String str = String.valueOf(content); str = APOS_PATTERN.matcher(str).replaceAll("'"); str = QUOT_PATTERN.matcher(str).replaceAll("\""); str = LT_PATTERN.matcher(str).replaceAll("<"); str = GT_PATTERN.matcher(str).replaceAll(">"); str = AMP_PATTERN.matcher(str).replaceAll("&"); str = LCURL_PATTERN.matcher(str).replaceAll("{"); return str; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unescape File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java Repository: xwiki/xwiki-commons The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-24898
MEDIUM
4
xwiki/xwiki-commons
unescape
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java
947e8921ebd95462d5a7928f397dd1b64f77c7d5
0
Analyze the following code function for security vulnerabilities
@Override public Route.Collection get(final String path1, final String path2, final String path3, final Route.Filter filter) { return new Route.Collection( new Route.Definition[]{get(path1, filter), get(path2, filter), get(path3, filter)}); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get 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
get
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private static String normalizeURI(final String uri) { int len = uri.length(); return len > 1 && uri.charAt(len - 1) == '/' ? uri.substring(0, len - 1) : uri; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: normalizeURI File: jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-15477
MEDIUM
4.3
jooby-project/jooby
normalizeURI
jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java
34856a738829d8fedca4ed27bd6ff413af87186f
0
Analyze the following code function for security vulnerabilities
@Override public boolean accountAuthenticated(final Account account) { final int callingUid = Binder.getCallingUid(); if (Log.isLoggable(TAG, Log.VERBOSE)) { String msg = String.format( "accountAuthenticated( account: %s, callerUid: %s)", account, callingUid); Log.v(TAG, msg); } Objects.requireNonNull(account, "account cannot be null"); int userId = UserHandle.getCallingUserId(); if (!isAccountManagedByCaller(account.type, callingUid, userId)) { String msg = String.format( "uid %s cannot notify authentication for accounts of type: %s", callingUid, account.type); throw new SecurityException(msg); } if (!canUserModifyAccounts(userId, callingUid) || !canUserModifyAccountsForType(userId, account.type, callingUid)) { return false; } final long identityToken = clearCallingIdentity(); try { UserAccounts accounts = getUserAccounts(userId); return updateLastAuthenticatedTime(account); } finally { restoreCallingIdentity(identityToken); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: accountAuthenticated 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
accountAuthenticated
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override public String getName() { return name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getName File: core/src/main/java/org/keycloak/KeycloakPrincipal.java Repository: keycloak The code follows secure coding practices.
[ "CWE-20" ]
CVE-2020-1714
MEDIUM
6.5
keycloak
getName
core/src/main/java/org/keycloak/KeycloakPrincipal.java
5821e37eb63ff3ef45c0c0cd2ae2b54a8a242724
0
Analyze the following code function for security vulnerabilities
@Override public Consumer<OutputWriter> jsonWriter(BackupConfig backupConfig) { return outputWriter -> BackupConfigRepresenter.toJSON(outputWriter, backupConfig); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsonWriter File: api/api-backup-config-v1/src/main/java/com/thoughtworks/go/apiv1/backupconfig/BackupConfigControllerV1.java Repository: gocd The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25924
HIGH
9.3
gocd
jsonWriter
api/api-backup-config-v1/src/main/java/com/thoughtworks/go/apiv1/backupconfig/BackupConfigControllerV1.java
7d0baab0d361c377af84994f95ba76c280048548
0
Analyze the following code function for security vulnerabilities
@Override boolean hasContentToDisplay() { if (!mAppFreezing && isDrawn() && (mViewVisibility == View.VISIBLE || (isAnimating(TRANSITION | PARENTS) && !getDisplayContent().mAppTransition.isTransitionSet()))) { return true; } return super.hasContentToDisplay(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasContentToDisplay File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
hasContentToDisplay
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public void handle(final HttpExchange pHttpExchange) throws IOException { try { checkAuthentication(pHttpExchange); Subject subject = (Subject) pHttpExchange.getAttribute(ConfigKey.JAAS_SUBJECT_REQUEST_ATTRIBUTE); if (subject != null) { doHandleAs(subject, pHttpExchange); } else { doHandle(pHttpExchange); } } catch (SecurityException exp) { sendForbidden(pHttpExchange,exp); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handle File: agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java Repository: jolokia The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-1000129
MEDIUM
4.3
jolokia
handle
agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java
5895d5c137c335e6b473e9dcb9baf748851bbc5f
0
Analyze the following code function for security vulnerabilities
@Test public void testPUTAttachmentNoRights() throws Exception { String attachmentName = String.format("%s.txt", UUID.randomUUID()); String attachmentURI = buildURIForThisPage(AttachmentResource.class, attachmentName); String content = "ATTACHMENT CONTENT"; GetMethod getMethod = executeGet(attachmentURI); Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_NOT_FOUND, getMethod.getStatusCode()); PutMethod putMethod = executePut(attachmentURI, content, MediaType.TEXT_PLAIN); Assert.assertEquals(getHttpMethodInfo(putMethod), HttpStatus.SC_UNAUTHORIZED, putMethod.getStatusCode()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testPUTAttachmentNoRights File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-352" ]
CVE-2023-37277
CRITICAL
9.6
xwiki/xwiki-platform
testPUTAttachmentNoRights
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java
4c175405faa0e62437df397811c7526dfc0fbae7
0
Analyze the following code function for security vulnerabilities
@Override public String getCookieValue(String name) { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (Cookie cookie : cookies) { if (cookie != null && name.equals(cookie.getName())) { return cookie.getValue(); } } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCookieValue 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
getCookieValue
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 boolean isMember(Context context, EPerson ePerson, Group group) throws SQLException { if (group == null) { return false; // special, everyone is member of group 0 (anonymous) } else if (StringUtils.equals(group.getName(), Group.ANONYMOUS) || isParentOf(context, group, findByName(context, Group.ANONYMOUS))) { return true; } else { Boolean cachedGroupMembership = context.getCachedGroupMembership(group, ePerson); if (cachedGroupMembership != null) { return cachedGroupMembership; } else { boolean isMember = false; //If we have an ePerson, check we can find membership in the database if (ePerson != null) { //lookup eperson in normal groups and subgroups with 1 query isMember = isEPersonInGroup(context, group, ePerson); } //If we did not find the group membership in the database, check the special groups. //If there are special groups we need to check direct membership or check if the //special group is a subgroup of the provided group. //Note that special groups should only be checked if the current user == the ePerson. //This also works for anonymous users (ePerson == null) if IP authentication used if (!isMember && CollectionUtils.isNotEmpty(context.getSpecialGroups()) && isAuthenticatedUser(context, ePerson)) { Iterator<Group> it = context.getSpecialGroups().iterator(); while (it.hasNext() && !isMember) { Group specialGroup = it.next(); //Check if the special group matches the given group or if it is a subgroup (with 1 query) if (specialGroup.equals(group) || isParentOf(context, group, specialGroup)) { isMember = true; } } } context.cacheGroupMembership(group, ePerson, isMember); return isMember; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMember File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
isMember
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
void removeWindowInnerLocked(WindowState win, boolean performLayout) { if (win.mRemoved) { // Nothing to do. return; } for (int i=win.mChildWindows.size()-1; i>=0; i--) { WindowState cwin = win.mChildWindows.get(i); Slog.w(TAG, "Force-removing child win " + cwin + " from container " + win); removeWindowInnerLocked(cwin); } win.mRemoved = true; if (mInputMethodTarget == win) { moveInputMethodWindowsIfNeededLocked(false); } if (false) { RuntimeException e = new RuntimeException("here"); e.fillInStackTrace(); Slog.w(TAG, "Removing window " + win, e); } mPolicy.removeWindowLw(win); win.removeLocked(); if (DEBUG_ADD_REMOVE) Slog.v(TAG, "removeWindowInnerLocked: " + win); mWindowMap.remove(win.mClient.asBinder()); if (win.mAppOp != AppOpsManager.OP_NONE) { mAppOps.finishOp(win.mAppOp, win.getOwningUid(), win.getOwningPackage()); } mPendingRemove.remove(win); mResizingWindows.remove(win); mWindowsChanged = true; if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Final remove of window: " + win); if (mInputMethodWindow == win) { mInputMethodWindow = null; } else if (win.mAttrs.type == TYPE_INPUT_METHOD_DIALOG) { mInputMethodDialogs.remove(win); } final WindowToken token = win.mToken; final AppWindowToken atoken = win.mAppToken; if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing " + win + " from " + token); token.windows.remove(win); if (atoken != null) { atoken.allAppWindows.remove(win); } if (localLOGV) Slog.v( TAG, "**** Removing window " + win + ": count=" + token.windows.size()); if (token.windows.size() == 0) { if (!token.explicit) { mTokenMap.remove(token.token); } else if (atoken != null) { atoken.firstWindowDrawn = false; } } if (atoken != null) { if (atoken.startingWindow == win) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Notify removed startingWindow " + win); scheduleRemoveStartingWindowLocked(atoken); } else if (atoken.allAppWindows.size() == 0 && atoken.startingData != null) { // If this is the last window and we had requested a starting // transition window, well there is no point now. if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Nulling last startingWindow"); atoken.startingData = null; } else if (atoken.allAppWindows.size() == 1 && atoken.startingView != null) { // If this is the last window except for a starting transition // window, we need to get rid of the starting transition. scheduleRemoveStartingWindowLocked(atoken); } } if (win.mAttrs.type == TYPE_WALLPAPER) { mLastWallpaperTimeoutTime = 0; getDefaultDisplayContentLocked().pendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; } else if ((win.mAttrs.flags&FLAG_SHOW_WALLPAPER) != 0) { getDefaultDisplayContentLocked().pendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; } final WindowList windows = win.getWindowList(); if (windows != null) { windows.remove(win); if (!mInLayout) { assignLayersLocked(windows); final DisplayContent displayContent = win.getDisplayContent(); if (displayContent != null) { displayContent.layoutNeeded = true; } if (performLayout) { performLayoutAndPlaceSurfacesLocked(); } if (win.mAppToken != null) { win.mAppToken.updateReportedVisibilityLocked(); } } } mInputMonitor.updateInputWindowsLw(true /*force*/); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeWindowInnerLocked File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
removeWindowInnerLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public abstract String getLink(String resource, XWikiContext context);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLink File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29206
MEDIUM
5.4
xwiki/xwiki-platform
getLink
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
0
Analyze the following code function for security vulnerabilities
public String getValue(String key) { return fields.get(key); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValue File: src/main/java/org/olat/restapi/support/MultipartReader.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
getValue
src/main/java/org/olat/restapi/support/MultipartReader.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
public void setProperty(String propertyId, Object value) throws XMLConfigurationException { if (propertyId.equals(NAMES_ELEMS)) { fNamesElems = getNamesValue(String.valueOf(value)); return; } if (propertyId.equals(NAMES_ATTRS)) { fNamesAttrs = getNamesValue(String.valueOf(value)); return; } if (propertyId.equals(DEFAULT_ENCODING)) { fDefaultIANAEncoding = String.valueOf(value); return; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProperty File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
setProperty
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
@Override public void close() { // NOOP }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: close File: model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java Repository: keycloak The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-6563
HIGH
7.7
keycloak
close
model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java
11eb952e1df7cbb95b1e2c101dfd4839a2375695
0
Analyze the following code function for security vulnerabilities
protected void handleTopicPolicyException(String methodName, Throwable thr, AsyncResponse asyncResponse) { Throwable cause = thr.getCause(); if (!(cause instanceof WebApplicationException) || !(((WebApplicationException) cause).getResponse().getStatus() == 307)) { log.error("[{}] Failed to perform {} on topic {}", clientAppId(), methodName, topicName, cause); } resumeAsyncResponseExceptionally(asyncResponse, cause); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleTopicPolicyException 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
handleTopicPolicyException
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public <X> X getFirstByXPath(final String xpathExpr, final PrefixResolver resolver) { final List<?> results = getByXPath(xpathExpr, resolver); if (results.isEmpty()) { return null; } return (X) results.get(0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFirstByXPath 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
getFirstByXPath
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") final void setUidTempWhitelistStateLocked(int uid, boolean onWhitelist) { boolean changed = false; final UidRecord uidRec = mActiveUids.get(uid); if (uidRec != null && uidRec.curWhitelist != onWhitelist) { uidRec.curWhitelist = onWhitelist; updateOomAdjLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUidTempWhitelistStateLocked 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
setUidTempWhitelistStateLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void onPackageRemovedLocked(String packageName, int userId) { // Global and secure settings are signature protected. Apps signed // by the platform certificate are generally not uninstalled and // the main exception is tests. We trust components signed // by the platform certificate and do not do a clean up after them. final int systemKey = makeKey(SETTINGS_TYPE_SYSTEM, userId); SettingsState systemSettings = mSettingsStates.get(systemKey); if (systemSettings != null) { systemSettings.onPackageRemovedLocked(packageName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPackageRemovedLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
onPackageRemovedLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
@Override public void onNotificationPosted(final StatusBarNotification sbn, final RankingMap rankingMap) { if (DEBUG) Log.d(TAG, "onNotificationPosted: " + sbn); if (sbn != null) { mHandler.post(new Runnable() { @Override public void run() { processForRemoteInput(sbn.getNotification()); String key = sbn.getKey(); mKeysKeptForRemoteInput.remove(key); boolean isUpdate = mNotificationData.get(key) != null; // In case we don't allow child notifications, we ignore children of // notifications that have a summary, since we're not going to show them // anyway. This is true also when the summary is canceled, // because children are automatically canceled by NoMan in that case. if (!ENABLE_CHILD_NOTIFICATIONS && mGroupManager.isChildInGroupWithSummary(sbn)) { if (DEBUG) { Log.d(TAG, "Ignoring group child due to existing summary: " + sbn); } // Remove existing notification to avoid stale data. if (isUpdate) { removeNotification(key, rankingMap); } else { mNotificationData.updateRanking(rankingMap); } return; } try { if (isUpdate) { updateNotification(sbn, rankingMap); } else { addNotification(sbn, rankingMap); } } catch (InflationException e) { handleInflationException(sbn, e); } } }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onNotificationPosted 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
onNotificationPosted
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void setRequestedOn(Date requestedOn) { this.requestedOn = requestedOn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRequestedOn File: api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java Repository: openmrs/openmrs-module-appointmentscheduling The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4727
MEDIUM
6.1
openmrs/openmrs-module-appointmentscheduling
setRequestedOn
api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
2ccbe39c020809765de41eeb8ee4c70b5ec49cc8
0
Analyze the following code function for security vulnerabilities
private void logUserActionEvents(WifiConfiguration before, WifiConfiguration after) { // Logs changes in meteredOverride. if (before.meteredOverride != after.meteredOverride) { mWifiMetrics.logUserActionEvent( WifiMetrics.convertMeteredOverrideEnumToUserActionEventType( after.meteredOverride), after.networkId); } // Logs changes in macRandomizationSetting. if (before.macRandomizationSetting != after.macRandomizationSetting) { mWifiMetrics.logUserActionEvent( after.macRandomizationSetting == WifiConfiguration.RANDOMIZATION_NONE ? UserActionEvent.EVENT_CONFIGURE_MAC_RANDOMIZATION_OFF : UserActionEvent.EVENT_CONFIGURE_MAC_RANDOMIZATION_ON, after.networkId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logUserActionEvents File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
logUserActionEvents
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public List<DocumentReference> getBackLinkedReferences(XWikiContext context) throws XWikiException { return getStore(context).loadBacklinks(getDocumentReference(), true, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBackLinkedReferences 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
getBackLinkedReferences
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 String uncompressString(byte[] input) throws IOException { try { return uncompressString(input, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("UTF-8 decoder is not found"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: uncompressString File: src/main/java/org/xerial/snappy/Snappy.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-190" ]
CVE-2023-34454
HIGH
7.5
xerial/snappy-java
uncompressString
src/main/java/org/xerial/snappy/Snappy.java
d0042551e4a3509a725038eb9b2ad1f683674d94
0
Analyze the following code function for security vulnerabilities
public long getSpacePreferenceAsLong(String preference, long defaultValue) { return this.xwiki.getSpacePreferenceAsLong(preference, defaultValue, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpacePreferenceAsLong File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getSpacePreferenceAsLong
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public Version getVersion() { return version; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVersion File: web/src/main/java/com/zrlog/web/plugin/UpdateVersionTimerTask.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
getVersion
web/src/main/java/com/zrlog/web/plugin/UpdateVersionTimerTask.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(anyOf = { INTERACT_ACROSS_USERS_FULL, permission.INTERACT_ACROSS_USERS, permission.INTERACT_ACROSS_PROFILES }) public @NonNull Set<String> getAllCrossProfilePackages() { throwIfParentInstance("getAllCrossProfilePackages"); if (mService != null) { try { return new ArraySet<>(mService.getAllCrossProfilePackages(mContext.getUserId())); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return Collections.emptySet(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllCrossProfilePackages 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
getAllCrossProfilePackages
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void initServer() throws SSLException { debug("JSSEngine: initServer()"); // The only time cert and key are strictly required are when we're // creating a server SSLEngine. if (cert == null || key == null) { throw new IllegalArgumentException("JSSEngine: must be initialized with server certificate and key!"); } debug("JSSEngine.initServer(): " + cert); debug("JSSEngine.initServer(): " + key); session.setLocalCertificates(new PK11Cert[]{ cert } ); // Create a small server session cache. // // TODO: Make this configurable. initializeSessionCache(1, 100, null); configureClientAuth(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initServer File: src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java Repository: dogtagpki/jss The code follows secure coding practices.
[ "CWE-401" ]
CVE-2021-4213
HIGH
7.5
dogtagpki/jss
initServer
src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
5922560a78d0dee61af8a33cc9cfbf4cfa291448
0
Analyze the following code function for security vulnerabilities
ComponentName startServiceInPackage(int uid, Intent service, String resolvedType, boolean fgRequired, String callingPackage, int userId) throws TransactionTooLargeException { synchronized(this) { if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "startServiceInPackage: " + service + " type=" + resolvedType); final long origId = Binder.clearCallingIdentity(); ComponentName res; try { res = mServices.startServiceLocked(null, service, resolvedType, -1, uid, fgRequired, callingPackage, userId); } finally { Binder.restoreCallingIdentity(origId); } return res; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startServiceInPackage 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
startServiceInPackage
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public int hashCode() { return value.hashCode(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hashCode File: core/src/main/java/hudson/util/Secret.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-326" ]
CVE-2017-2598
MEDIUM
4
jenkinsci/jenkins
hashCode
core/src/main/java/hudson/util/Secret.java
e6aa166246d1734f4798a9e31f78842f4c85c28b
0
Analyze the following code function for security vulnerabilities
protected Record checkoutRecord(Cell[] row, ID defaultOwning) { Record recordHub = EntityHelper.forNew(rule.getToEntity().getEntityCode(), defaultOwning); // 解析数据 RecordCheckout recordCheckout = new RecordCheckout(rule.getFiledsMapping()); Record checkout = recordCheckout.checkout(recordHub, row); if (recordCheckout.getTraceLogs().isEmpty()) { cellTraces = null; } else { cellTraces = StringUtils.join(recordCheckout.getTraceLogs(), ", "); } // 检查重复 if (rule.getRepeatOpt() < ImportRule.REPEAT_OPT_IGNORE) { final ID repeat = findRepeatedRecordId(rule.getRepeatFields(), recordHub); if (repeat != null && rule.getRepeatOpt() == ImportRule.REPEAT_OPT_SKIP) { return null; } if (repeat != null && rule.getRepeatOpt() == ImportRule.REPEAT_OPT_UPDATE) { // 更新 checkout = EntityHelper.forUpdate(repeat, defaultOwning); for (Iterator<String> iter = recordHub.getAvailableFieldIterator(); iter.hasNext(); ) { String field = iter.next(); if (MetadataHelper.isCommonsField(field)) continue; checkout.setObjectValue(field, recordHub.getObjectValue(field)); } } } // Verify new record // Throws DataSpecificationException if (checkout.getPrimary() == null) { new EntityRecordCreator(rule.getToEntity(), JSONUtils.EMPTY_OBJECT, null) .verify(checkout); } return checkout; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-1613 - Severity: MEDIUM - CVSS Score: 4.0 Description: Fix long request (#599) * fix: `trigger/exec-manual` async * fix: lang * fix: #596 Function: checkoutRecord File: src/main/java/com/rebuild/core/service/dataimport/DataImporter.java Repository: getrebuild/rebuild Fixed Code: protected Record checkoutRecord(Cell[] row, ID defaultOwning) { Record recordHub = EntityHelper.forNew(rule.getToEntity().getEntityCode(), defaultOwning); // 解析数据 RecordCheckout recordCheckout = new RecordCheckout(rule.getFiledsMapping()); Record checkout = recordCheckout.checkout(recordHub, row); if (recordCheckout.getTraceLogs().isEmpty()) { cellTraces = null; } else { cellTraces = StringUtils.join(recordCheckout.getTraceLogs(), ", "); } // 检查重复 if (rule.getRepeatOpt() < ImportRule.REPEAT_OPT_IGNORE) { final ID repeat = findRepeatedRecordId(rule.getRepeatFields(), recordHub); if (repeat != null && rule.getRepeatOpt() == ImportRule.REPEAT_OPT_SKIP) { return null; } if (repeat != null && rule.getRepeatOpt() == ImportRule.REPEAT_OPT_UPDATE) { // 更新 checkout = EntityHelper.forUpdate(repeat, defaultOwning); for (Iterator<String> iter = recordHub.getAvailableFieldIterator(); iter.hasNext(); ) { String field = iter.next(); if (MetadataHelper.isCommonsField(field)) continue; checkout.setObjectValue(field, recordHub.getObjectValue(field)); } } } // Verify new record // Throws DataSpecificationException if (checkout.getPrimary() == null) { new EntityRecordCreator(rule.getToEntity(), JSONUtils.EMPTY_OBJECT, null, Boolean.FALSE) .verify(checkout); } return checkout; }
[ "CWE-79" ]
CVE-2023-1613
MEDIUM
4
getrebuild/rebuild
checkoutRecord
src/main/java/com/rebuild/core/service/dataimport/DataImporter.java
d0de4cc35303168f44ca57712c824b5cb9525e54
1
Analyze the following code function for security vulnerabilities
protected final int _parseIntPrimitive(JsonParser p, DeserializationContext ctxt) throws IOException { String text; switch (p.currentTokenId()) { case JsonTokenId.ID_STRING: text = p.getText(); break; case JsonTokenId.ID_NUMBER_FLOAT: final CoercionAction act = _checkFloatToIntCoercion(p, ctxt, Integer.TYPE); if (act == CoercionAction.AsNull) { return 0; } if (act == CoercionAction.AsEmpty) { return 0; } return p.getValueAsInt(); case JsonTokenId.ID_NUMBER_INT: return p.getIntValue(); case JsonTokenId.ID_NULL: _verifyNullForPrimitive(ctxt); return 0; // 29-Jun-2020, tatu: New! "Scalar from Object" (mostly for XML) case JsonTokenId.ID_START_OBJECT: text = ctxt.extractScalarFromObject(p, this, Integer.TYPE); break; case JsonTokenId.ID_START_ARRAY: if (ctxt.isEnabled(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)) { p.nextToken(); final int parsed = _parseIntPrimitive(p, ctxt); _verifyEndArrayForSingle(p, ctxt); return parsed; } // fall through to fail default: return ((Number) ctxt.handleUnexpectedToken(Integer.TYPE, p)).intValue(); } final CoercionAction act = _checkFromStringCoercion(ctxt, text, LogicalType.Integer, Integer.TYPE); if (act == CoercionAction.AsNull) { // 03-May-2021, tatu: Might not be allowed (should we do "empty" check?) _verifyNullForPrimitive(ctxt); return 0; } if (act == CoercionAction.AsEmpty) { return 0; } text = text.trim(); if (_hasTextualNull(text)) { _verifyNullForPrimitiveCoercion(ctxt, text); return 0; } return _parseIntPrimitive(ctxt, text); }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2022-42003 - Severity: HIGH - CVSS Score: 7.5 Description: Fix #3590 Function: _parseIntPrimitive File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind Fixed Code: protected final int _parseIntPrimitive(JsonParser p, DeserializationContext ctxt) throws IOException { String text; switch (p.currentTokenId()) { case JsonTokenId.ID_STRING: text = p.getText(); break; case JsonTokenId.ID_NUMBER_FLOAT: final CoercionAction act = _checkFloatToIntCoercion(p, ctxt, Integer.TYPE); if (act == CoercionAction.AsNull) { return 0; } if (act == CoercionAction.AsEmpty) { return 0; } return p.getValueAsInt(); case JsonTokenId.ID_NUMBER_INT: return p.getIntValue(); case JsonTokenId.ID_NULL: _verifyNullForPrimitive(ctxt); return 0; // 29-Jun-2020, tatu: New! "Scalar from Object" (mostly for XML) case JsonTokenId.ID_START_OBJECT: text = ctxt.extractScalarFromObject(p, this, Integer.TYPE); break; case JsonTokenId.ID_START_ARRAY: if (ctxt.isEnabled(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)) { if (p.nextToken() == JsonToken.START_ARRAY) { return (int) handleNestedArrayForSingle(p, ctxt); } final int parsed = _parseIntPrimitive(p, ctxt); _verifyEndArrayForSingle(p, ctxt); return parsed; } // fall through to fail default: return ((Number) ctxt.handleUnexpectedToken(Integer.TYPE, p)).intValue(); } final CoercionAction act = _checkFromStringCoercion(ctxt, text, LogicalType.Integer, Integer.TYPE); if (act == CoercionAction.AsNull) { // 03-May-2021, tatu: Might not be allowed (should we do "empty" check?) _verifyNullForPrimitive(ctxt); return 0; } if (act == CoercionAction.AsEmpty) { return 0; } text = text.trim(); if (_hasTextualNull(text)) { _verifyNullForPrimitiveCoercion(ctxt, text); return 0; } return _parseIntPrimitive(ctxt, text); }
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_parseIntPrimitive
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
1
Analyze the following code function for security vulnerabilities
boolean isSecureLocked(WindowState w) { if ((w.mAttrs.flags&WindowManager.LayoutParams.FLAG_SECURE) != 0) { return true; } if (isScreenCaptureDisabledLocked(UserHandle.getUserId(w.mOwnerUid))) { return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSecureLocked File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
isSecureLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private void registerPresenceListener() { // do not register multiple packet listeners if (mPresenceListener != null) mXMPPConnection.removePacketListener(mPresenceListener); mPresenceListener = new PacketListener() { public void processPacket(Packet packet) { try { Presence p = (Presence) packet; switch (p.getType()) { case subscribe: handleIncomingSubscribe(p); break; case subscribed: case unsubscribe: case unsubscribed: subscriptionRequests.remove(p.getFrom()); break; } } catch (Exception e) { // SMACK silently discards exceptions dropped from processPacket :( Log.e(TAG, "failed to process presence:"); e.printStackTrace(); } } }; mXMPPConnection.addPacketListener(mPresenceListener, new PacketTypeFilter(Presence.class)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerPresenceListener File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
registerPresenceListener
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0