instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public static String toUnicodeLiteral(String s) { StringBuffer result = new StringBuffer(); char[] carr = s.toCharArray(); String unicode; for (int i = 0; i < carr.length; i++) { result.append("\\u"); // append leading zeros unicode = Integer.toHexString(carr[i]).toUpperCase(); for (int j = 4 - unicode.length(); j > 0; j--) { result.append("0"); } result.append(unicode); } return result.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toUnicodeLiteral File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
toUnicodeLiteral
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
@Override public void unregisterListener(INotificationListener token, int userid) { mListeners.unregisterService(token, userid); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterListener File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
unregisterListener
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public double dumpPerc() { int total = 0; for (int k = 0; k < xrefObj.size(); ++k) { if (xrefObj.get(k) != null) ++total; } return (total * 100.0 / xrefObj.size()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpPerc File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
dumpPerc
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
public void validateNotSubdirectoryOf(String otherSCMMaterialFolder) { String myDirPath = this.getFolder(); if (myDirPath == null || otherSCMMaterialFolder == null) { return; } if (FilenameUtil.isNormalizedDirectoryPathInsideNormalizedParentDirectory(myDirPath, otherSCMMaterialFolder)) { addError(FOLDER, "Invalid Destination Directory. Every material needs a different destination directory and the directories should not be nested."); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateNotSubdirectoryOf File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
validateNotSubdirectoryOf
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
public BigInteger[] generateSignature( byte[] message) { DSAParameters params = key.getParameters(); BigInteger q = params.getQ(); BigInteger m = calculateE(q, message); BigInteger x = ((DSAPrivateKeyParameters)key).getX(); if (kCalculator.isDeterministic()) { kCalculator.init(q, x, message); } else { kCalculator.init(q, random); } BigInteger k = kCalculator.nextK(); BigInteger r = params.getG().modPow(k, params.getP()).mod(q); k = k.modInverse(q).multiply(m.add(x.multiply(r))); BigInteger s = k.mod(q); return new BigInteger[]{ r, s }; }
Vulnerability Classification: - CWE: CWE-361 - CVE: CVE-2016-1000341 - Severity: MEDIUM - CVSS Score: 4.3 Description: added randomizer to DSA signature generation Function: generateSignature File: core/src/main/java/org/bouncycastle/crypto/signers/DSASigner.java Repository: bcgit/bc-java Fixed Code: public BigInteger[] generateSignature( byte[] message) { DSAParameters params = key.getParameters(); BigInteger q = params.getQ(); BigInteger m = calculateE(q, message); BigInteger x = ((DSAPrivateKeyParameters)key).getX(); if (kCalculator.isDeterministic()) { kCalculator.init(q, x, message); } else { kCalculator.init(q, random); } BigInteger k = kCalculator.nextK(); // the randomizer is to conceal timing information related to k and x. BigInteger r = params.getG().modPow(k.add(getRandomizer(q, random)), params.getP()).mod(q); k = k.modInverse(q).multiply(m.add(x.multiply(r))); BigInteger s = k.mod(q); return new BigInteger[]{ r, s }; }
[ "CWE-361" ]
CVE-2016-1000341
MEDIUM
4.3
bcgit/bc-java
generateSignature
core/src/main/java/org/bouncycastle/crypto/signers/DSASigner.java
acaac81f96fec91ab45bd0412beaf9c3acd8defa
1
Analyze the following code function for security vulnerabilities
public void setAccountType(String accountType) { this.accountType = accountType; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAccountType File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/trade/TradeOrder.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
setAccountType
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/trade/TradeOrder.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
@Override public List<IssuesDao> getIssue(IssuesRequest request) { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIssue File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getIssue
test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "5.4.6") public void setTranslation(int translation) { // Do nothing }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTranslation File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
setTranslation
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
public Structure getStructureByVelocityVarName(String variableName) { Structure st = null; try{ st = (Structure) cache.get(primaryGroup + variableName,primaryGroup); }catch (DotCacheException e) { Logger.debug(ContentTypeCacheImpl.class,"Cache Entry not found", e); } if (st == null) { st = StructureFactory.getStructureByVelocityVarName(variableName); add(st); } return st; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2016-2355 - Severity: HIGH - CVSS Score: 7.5 Description: fixes #8848 Function: getStructureByVelocityVarName File: src/com/dotmarketing/cache/ContentTypeCacheImpl.java Repository: dotCMS/core Fixed Code: public Structure getStructureByVelocityVarName(String variableName) { Structure st = null; try{ st = (Structure) cache.get(primaryGroup + variableName,primaryGroup); }catch (DotCacheException e) { Logger.debug(ContentTypeCacheImpl.class,"Cache Entry not found", e); } if (st == null) { st = StructureFactory.getStructureByVelocityVarName(variableName); add(st); } return st; }
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
getStructureByVelocityVarName
src/com/dotmarketing/cache/ContentTypeCacheImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
1
Analyze the following code function for security vulnerabilities
private void notifyWifiSsidPolicyChanged(WifiSsidPolicy policy) { if (policy == null) { // If policy doesn't limit SSIDs, no need to disconnect anything. return; } mInjector.binderWithCleanCallingIdentity( () -> mInjector.getWifiManager().notifyWifiSsidPolicyChanged(policy)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyWifiSsidPolicyChanged 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
notifyWifiSsidPolicyChanged
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public PeerComponent createBrowserComponent(final Object parent) { if (getActivity() == null) { return null; } final AndroidImplementation.AndroidBrowserComponent[] bc = new AndroidImplementation.AndroidBrowserComponent[1]; final Throwable[] error = new Throwable[1]; final Object lock = new Object(); getActivity().runOnUiThread(new Runnable() { @Override public void run() { synchronized (lock) { try { WebView wv = new WebView(getActivity()) { @Override public boolean dispatchKeyEvent(KeyEvent event) { int keycode = event.getKeyCode(); keycode = CodenameOneView.internalKeyCodeTranslate(keycode); if (keycode == AndroidImplementation.DROID_IMPL_KEY_BACK || (keycode == KeyEvent.KEYCODE_MENU && Display.getInstance().getCommandBehavior() != Display.COMMAND_BEHAVIOR_NATIVE)) { switch (event.getAction()) { case KeyEvent.ACTION_DOWN: Display.getInstance().keyPressed(keycode); break; case KeyEvent.ACTION_UP: Display.getInstance().keyReleased(keycode); break; } return true; } else { if(Display.getInstance().getProperty( "android.propogateKeyEvents", "false"). equalsIgnoreCase("true") && myView instanceof AndroidAsyncView) { switch (event.getAction()) { case KeyEvent.ACTION_DOWN: Display.getInstance().keyPressed(keycode); break; case KeyEvent.ACTION_UP: Display.getInstance().keyReleased(keycode); break; } return true; } return super.dispatchKeyEvent(event); } } }; wv.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_UP: if (!v.hasFocus()) { v.requestFocus(); } break; } return false; } }); if (android.os.Build.VERSION.SDK_INT >= 19) { if ("true".equals(Display.getInstance().getProperty("android.webContentsDebuggingEnabled", "false"))) { wv.setWebContentsDebuggingEnabled(true); } } wv.getSettings().setDomStorageEnabled(true); wv.getSettings().setAllowFileAccess(true); wv.getSettings().setAllowContentAccess(true); wv.requestFocus(View.FOCUS_DOWN); wv.setFocusableInTouchMode(true); if (android.os.Build.VERSION.SDK_INT >= 17) { wv.getSettings().setMediaPlaybackRequiresUserGesture(false); } bc[0] = new AndroidImplementation.AndroidBrowserComponent(wv, getActivity(), parent); lock.notify(); } catch (Throwable t) { error[0] = t; lock.notify(); } } } }); while (bc[0] == null && error[0] == null) { Display.getInstance().invokeAndBlock(new Runnable() { public void run() { synchronized (lock) { if (bc[0] == null && error[0] == null) { try { lock.wait(20); } catch (InterruptedException ex) { ex.printStackTrace(); } } } } }); } if (error[0] != null) { throw new RuntimeException(error[0]); } return bc[0]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createBrowserComponent 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
createBrowserComponent
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public void init(ServletConfig config) throws ServletException { super.init(config); servletConfig = config; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java Repository: igniterealtime/Openfire The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18393
MEDIUM
5
igniterealtime/Openfire
init
xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java
5af6e03c25b121d01e752927c401124a4da569f7
0
Analyze the following code function for security vulnerabilities
public int getFrozenColumnCount() { return getState(false).frozenColumnCount; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFrozenColumnCount File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getFrozenColumnCount
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
private void notifyWindowsChanged() { WindowChangeListener[] windowChangeListeners; synchronized(mWindowMap) { if(mWindowChangeListeners.isEmpty()) { return; } windowChangeListeners = new WindowChangeListener[mWindowChangeListeners.size()]; windowChangeListeners = mWindowChangeListeners.toArray(windowChangeListeners); } int N = windowChangeListeners.length; for(int i = 0; i < N; i++) { windowChangeListeners[i].windowsChanged(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyWindowsChanged 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
notifyWindowsChanged
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Override public PhoneAccountHandle getSimCallManager() { long token = Binder.clearCallingIdentity(); int user; try { user = ActivityManager.getCurrentUser(); } finally { Binder.restoreCallingIdentity(token); } return getSimCallManagerForUser(user); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSimCallManager File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
getSimCallManager
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
protected abstract Future<T> lookup(ChannelHandlerContext ctx, ByteBuf clientHello) throws Exception;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lookup File: handler/src/main/java/io/netty/handler/ssl/SslClientHelloHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-34462
MEDIUM
6.5
netty
lookup
handler/src/main/java/io/netty/handler/ssl/SslClientHelloHandler.java
535da17e45201ae4278c0479e6162bb4127d4c32
0
Analyze the following code function for security vulnerabilities
public void setWorkingDirectory( File workingDirectory ) { if ( workingDirectory != null ) { this.workingDir = workingDirectory.getAbsolutePath(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWorkingDirectory File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java Repository: apache/maven-shared-utils The code follows secure coding practices.
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
setWorkingDirectory
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
2735facbbbc2e13546328cb02dbb401b3776eea3
0
Analyze the following code function for security vulnerabilities
@Deprecated public List<Region> parseRegionMetadata(final InputStream input, final boolean endpointVerification) throws IOException { return internalParse(input, endpointVerification); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseRegionMetadata File: aws-android-sdk-core/src/main/java/com/amazonaws/regions/RegionMetadataParser.java Repository: aws-amplify/aws-sdk-android The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-4725
CRITICAL
9.8
aws-amplify/aws-sdk-android
parseRegionMetadata
aws-android-sdk-core/src/main/java/com/amazonaws/regions/RegionMetadataParser.java
c3e6d69422e1f0c80fe53f2d757b8df97619af2b
0
Analyze the following code function for security vulnerabilities
public boolean isLogoutEnabled() { throwIfParentInstance("isLogoutEnabled"); try { return mService.isLogoutEnabled(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLogoutEnabled 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
isLogoutEnabled
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void setRestrictionsProvider(ComponentName who, ComponentName permissionProvider) { Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization( isProfileOwner(caller) || isDefaultDeviceOwner(caller)); checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_SET_RESTRICTIONS_PROVIDER); synchronized (getLockObject()) { int userHandle = caller.getUserId(); DevicePolicyData userData = getUserData(userHandle); userData.mRestrictionsProvider = permissionProvider; saveSettingsLocked(userHandle); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRestrictionsProvider 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
setRestrictionsProvider
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void draw(Canvas canvas, Path highlight, Paint highlightPaint, int cursorOffsetVertical) { final long lineRange = getLineRangeForDraw(canvas); int firstLine = TextUtils.unpackRangeStartFromLong(lineRange); int lastLine = TextUtils.unpackRangeEndFromLong(lineRange); if (lastLine < 0) return; drawBackground(canvas, highlight, highlightPaint, cursorOffsetVertical, firstLine, lastLine); drawText(canvas, firstLine, lastLine); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: draw File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
draw
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
protected void updateComputerList() throws IOException { updateComputerList(AUTOMATIC_SLAVE_LAUNCH); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateComputerList 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
updateComputerList
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@Override public void cancelRecentsAnimation(boolean restoreHomeStackPosition) { ActivityManagerService.this.cancelRecentsAnimation(restoreHomeStackPosition); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelRecentsAnimation 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
cancelRecentsAnimation
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void update(AsyncResult<SQLConnection> conn, String table, Object entity, CQLWrapper filter, boolean returnUpdatedIds, Handler<AsyncResult<UpdateResult>> replyHandler) { String where = ""; try { if (filter != null) { where = filter.toString(); } update(conn, table, entity, DEFAULT_JSONB_FIELD_NAME, where, returnUpdatedIds, replyHandler); } catch (Exception e) { replyHandler.handle(Future.failedFuture(e)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: update 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
update
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public String getHtml() { if (cellState.type != GridStaticCellType.HTML) { throw new IllegalStateException( "Cannot fetch HTML from a cell with type " + cellState.type); } return cellState.html; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHtml File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getHtml
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public String getAuthenticationUrl(Endpoint endpoint, Association association) { StringBuilder sb = new StringBuilder(1024); sb.append(endpoint.getUrl()) .append(endpoint.getUrl().contains("?") ? '&' : '?') .append(getAuthQuery(endpoint.getAlias())) .append("&openid.return_to=") .append(returnToUrlEncode) .append("&openid.assoc_handle=") .append(association.getAssociationHandle()); if (realm!=null) sb.append("&openid.realm=").append(realm); return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthenticationUrl File: JOpenId/src/org/expressme/openid/OpenIdManager.java Repository: michaelliao/jopenid The code follows secure coding practices.
[ "CWE-208" ]
CVE-2010-10006
LOW
1.4
michaelliao/jopenid
getAuthenticationUrl
JOpenId/src/org/expressme/openid/OpenIdManager.java
c9baaa976b684637f0d5a50268e91846a7a719ab
0
Analyze the following code function for security vulnerabilities
@Override protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) { String files = selection.renderAsHtml(); uifactory.addStaticExampleText("zip.confirm", files, formLayout); textElement = uifactory.addTextElement("fileName", "zip.name", 20, "", formLayout); textElement.setMandatory(true); uifactory.addStaticTextElement("extension", null, translate("zip.extension"), formLayout); FormLayoutContainer formButtons = FormLayoutContainer.createButtonLayout("formButton", getTranslator()); formLayout.add(formButtons); uifactory.addFormSubmitButton("submit","zip.button", formButtons); uifactory.addFormCancelButton("cancel", formButtons, ureq, getWindowControl()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initForm File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
initForm
src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
@Override public void setCharacterStream(Reader charStream) { fCharStream = charStream; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCharacterStream File: ext/java/nokogiri/XmlSchema.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-611" ]
CVE-2020-26247
MEDIUM
4
sparklemotion/nokogiri
setCharacterStream
ext/java/nokogiri/XmlSchema.java
9c87439d9afa14a365ff13e73adc809cb2c3d97b
0
Analyze the following code function for security vulnerabilities
private void sendStreamingResponse(HttpServletResponse pResp, String pCallback, JSONStreamAware pJson) throws IOException { Writer writer = new OutputStreamWriter(pResp.getOutputStream(), "UTF-8"); IoUtil.streamResponseAndClose(writer, pJson, pCallback); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendStreamingResponse File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-1000129
MEDIUM
4.3
jolokia
sendStreamingResponse
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
5895d5c137c335e6b473e9dcb9baf748851bbc5f
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getDefaultCrossProfilePackages() { Set<String> crossProfilePackages = new HashSet<>(); Collections.addAll(crossProfilePackages, mContext.getResources() .getStringArray(R.array.cross_profile_apps)); Collections.addAll(crossProfilePackages, mContext.getResources() .getStringArray(R.array.vendor_cross_profile_apps)); return new ArrayList<>(crossProfilePackages); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultCrossProfilePackages 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
getDefaultCrossProfilePackages
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setDeleteEnabled(boolean theDeleteEnabled) { myDeleteEnabled = theDeleteEnabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDeleteEnabled File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
setDeleteEnabled
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
public boolean shouldSetAccessibilityFocusOnPageLoad() { return mShouldSetAccessibilityFocusOnPageLoad; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldSetAccessibilityFocusOnPageLoad File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-1021" ]
CVE-2015-1241
MEDIUM
4.3
chromium
shouldSetAccessibilityFocusOnPageLoad
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
@Override public void onOverscrollTopChanged(float amount, boolean isRubberbanded) { if (!mQsOverscrollExpansionEnabled) { return; } cancelQsAnimation(); if (!mQsExpansionEnabled) { amount = 0f; } float rounded = amount >= 1f ? amount : 0f; setOverScrolling(rounded != 0f && isRubberbanded); mQsExpansionFromOverscroll = rounded != 0f; mLastOverscroll = rounded; updateQsState(); setQsExpansion(mQsMinExpansionHeight + rounded); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onOverscrollTopChanged File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
onOverscrollTopChanged
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void sendActiveAdminCommand(String action, Bundle extras, @UserIdInt int userId, ComponentName receiverComponent, boolean inForeground) { final Intent intent = new Intent(action); intent.setComponent(receiverComponent); if (extras != null) { intent.putExtras(extras); } if (inForeground) { intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); } if (VERBOSE_LOG) { Slogf.v(LOG_TAG, "sendActiveAdminCommand(): broadcasting " + action + " to " + receiverComponent.flattenToShortString() + " on user " + userId); } mContext.sendBroadcastAsUser(intent, UserHandle.of(userId)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendActiveAdminCommand 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
sendActiveAdminCommand
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
int injectGetPackageUid(@NonNull String packageName, @UserIdInt int userId) { final long token = injectClearCallingIdentity(); try { return mIPackageManager.getPackageUid(packageName, PACKAGE_MATCH_FLAGS, userId); } catch (RemoteException e) { // Shouldn't happen. Slog.wtf(TAG, "RemoteException", e); return -1; } finally { injectRestoreCallingIdentity(token); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: injectGetPackageUid File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
injectGetPackageUid
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public void updateNClob(@Positive int columnIndex, @Nullable NClob nClob) throws SQLException { throw org.postgresql.Driver.notImplemented(this.getClass(), "updateNClob(int, NClob)"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateNClob 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
updateNClob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public Locator getLocator() { return this.locator; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocator File: drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java Repository: apache/incubator-kie-drools The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2014-8125
HIGH
7.5
apache/incubator-kie-drools
getLocator
drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java
c48464c3b246e6ef0d4cd0dbf67e83ccd532c6d3
0
Analyze the following code function for security vulnerabilities
public static CloseResponseHandle getContext(String uri, String method, HttpServletRequest request, boolean disableRedirect) throws IOException, InstantiationException { String pluginServerHttp = Constants.pluginServer; CloseableHttpResponse httpResponse; CloseResponseHandle handle = new CloseResponseHandle(); HttpUtil httpUtil = disableRedirect ? HttpUtil.getDisableRedirectInstance() : HttpUtil.getInstance(); //GET请求不关心request.getInputStream() 的数据 if (method.equals(request.getMethod()) && "GET".equalsIgnoreCase(method)) { httpResponse = httpUtil.sendGetRequest(pluginServerHttp + uri, request.getParameterMap(), handle, PluginHelper.genHeaderMapByRequest(request)).getT(); } else { //如果是表单数据提交不关心请求头,反之将所有请求头都发到插件服务 if ("application/x-www-form-urlencoded".equals(request.getContentType())) { httpResponse = httpUtil.sendPostRequest(pluginServerHttp + uri, request.getParameterMap(), handle, PluginHelper.genHeaderMapByRequest(request)).getT(); } else { httpResponse = httpUtil.sendPostRequest(pluginServerHttp + uri + "?" + request.getQueryString(), IOUtil.getByteByInputStream(request.getInputStream()), handle, PluginHelper.genHeaderMapByRequest(request)).getT(); } } //添加插件服务的HTTP响应头到调用者响应头里面 if (httpResponse != null) { Map<String, String> headerMap = new HashMap<>(); Header[] headers = httpResponse.getAllHeaders(); for (Header header : headers) { headerMap.put(header.getName(), header.getValue()); } if (JFinal.me().getConstants().getDevMode()) { LOGGER.info(uri + " --------------------------------- response"); } for (Map.Entry<String, String> t : headerMap.entrySet()) { if (JFinal.me().getConstants().getDevMode()) { LOGGER.info("key " + t.getKey() + " value-> " + t.getValue()); } } } return handle; }
Vulnerability Classification: - CWE: CWE-863 - CVE: CVE-2020-19005 - Severity: LOW - CVSS Score: 3.5 Description: Fix #48 forget remove token from ThreadLocal Function: getContext File: web/src/main/java/com/zrlog/web/handler/PluginHandler.java Repository: 94fzb/zrlog Fixed Code: public static CloseResponseHandle getContext(String uri, String method, HttpServletRequest request, boolean disableRedirect) throws IOException, InstantiationException { String pluginServerHttp = Constants.pluginServer; CloseableHttpResponse httpResponse; CloseResponseHandle handle = new CloseResponseHandle(); HttpUtil httpUtil = disableRedirect ? HttpUtil.getDisableRedirectInstance() : HttpUtil.getInstance(); //GET请求不关心request.getInputStream() 的数据 if (method.equals(request.getMethod()) && "GET".equalsIgnoreCase(method)) { httpResponse = httpUtil.sendGetRequest(pluginServerHttp + uri, request.getParameterMap(), handle, PluginHelper.genHeaderMapByRequest(request, AdminTokenThreadLocal.getUser())).getT(); } else { //如果是表单数据提交不关心请求头,反之将所有请求头都发到插件服务 if ("application/x-www-form-urlencoded".equals(request.getContentType())) { httpResponse = httpUtil.sendPostRequest(pluginServerHttp + uri, request.getParameterMap(), handle, PluginHelper.genHeaderMapByRequest(request, AdminTokenThreadLocal.getUser())).getT(); } else { httpResponse = httpUtil.sendPostRequest(pluginServerHttp + uri + "?" + request.getQueryString(), IOUtil.getByteByInputStream(request.getInputStream()), handle, PluginHelper.genHeaderMapByRequest(request, AdminTokenThreadLocal.getUser())).getT(); } } //添加插件服务的HTTP响应头到调用者响应头里面 if (httpResponse != null) { Map<String, String> headerMap = new HashMap<>(); Header[] headers = httpResponse.getAllHeaders(); for (Header header : headers) { headerMap.put(header.getName(), header.getValue()); } if (JFinal.me().getConstants().getDevMode()) { LOGGER.info(uri + " --------------------------------- response"); } for (Map.Entry<String, String> t : headerMap.entrySet()) { if (JFinal.me().getConstants().getDevMode()) { LOGGER.info("key " + t.getKey() + " value-> " + t.getValue()); } } } return handle; }
[ "CWE-863" ]
CVE-2020-19005
LOW
3.5
94fzb/zrlog
getContext
web/src/main/java/com/zrlog/web/handler/PluginHandler.java
b2b4415e2e59b6f18b0a62b633e71c96d63c43ba
1
Analyze the following code function for security vulnerabilities
private String standbyPluginStatus() { final Map<String, String> currentExternalPluginsStatus = standbyFileSyncService.getCurrentExternalPluginsStatus(); List<String> pluginsMd5 = currentExternalPluginsStatus.keySet().stream().map(pluginName -> format("%s=%s", pluginName, currentExternalPluginsStatus.get(pluginName))).sorted().collect(Collectors.toList()); return join(pluginsMd5, ", "); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: standbyPluginStatus File: server/src/main/java/com/thoughtworks/go/addon/businesscontinuity/standby/controller/DashBoardController.java Repository: gocd The code follows secure coding practices.
[ "CWE-200" ]
CVE-2021-43287
MEDIUM
5
gocd
standbyPluginStatus
server/src/main/java/com/thoughtworks/go/addon/businesscontinuity/standby/controller/DashBoardController.java
41abc210ac4e8cfa184483c9ff1c0cc04fb3511c
0
Analyze the following code function for security vulnerabilities
public abstract long getFileSize();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFileSize File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
getFileSize
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
public void setFeature(final String name, final boolean value) { // Save the specified feature for later. features.put(name, value ? Boolean.TRUE : Boolean.FALSE); engine = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFeature File: core/src/java/org/jdom2/input/SAXBuilder.java Repository: hunterhacker/jdom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-33813
MEDIUM
5
hunterhacker/jdom
setFeature
core/src/java/org/jdom2/input/SAXBuilder.java
bd3ab78370098491911d7fe9d7a43b97144a234e
0
Analyze the following code function for security vulnerabilities
private int getSyncDisabledModeConfig() { if (DEBUG) { Slog.v(LOG_TAG, "getSyncDisabledModeConfig"); } enforceWritePermission(Manifest.permission.WRITE_DEVICE_CONFIG); synchronized (mLock) { return getSyncDisabledModeConfigLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSyncDisabledModeConfig 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
getSyncDisabledModeConfig
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public static CertDataInfos fromXML(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml))); Element infosElement = document.getDocumentElement(); return fromDOM(infosElement); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: fromXML File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfos.java Repository: dogtagpki/pki Fixed Code: public static CertDataInfos fromXML(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml))); Element infosElement = document.getDocumentElement(); return fromDOM(infosElement); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromXML
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfos.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
public void extract() throws IOException { log.debug("Extract content of '{}' to '{}'", source, destination); // delete destination directory if exists if (destination.exists() && destination.isDirectory()) { FileUtils.delete(destination.toPath()); } try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(source))) { ZipEntry zipEntry; while ((zipEntry = zipInputStream.getNextEntry()) != null) { File file = new File(destination, zipEntry.getName()); // create intermediary directories - sometimes zip don't add them File dir = new File(file.getParent()); mkdirsOrThrow(dir); if (zipEntry.isDirectory()) { mkdirsOrThrow(file); } else { byte[] buffer = new byte[1024]; int length; try (FileOutputStream fos = new FileOutputStream(file)) { while ((length = zipInputStream.read(buffer)) >= 0) { fos.write(buffer, 0, length); } } } } } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2023-40828 - Severity: HIGH - CVSS Score: 7.5 Description: Add security checks to prevent directory traversal when decompressing (#538) Function: extract File: pf4j/src/main/java/org/pf4j/util/Unzip.java Repository: pf4j Fixed Code: public void extract() throws IOException { log.debug("Extract content of '{}' to '{}'", source, destination); // delete destination directory if exists if (destination.exists() && destination.isDirectory()) { FileUtils.delete(destination.toPath()); } String destinationCanonicalPath = destination.getCanonicalPath(); try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(source))) { ZipEntry zipEntry; while ((zipEntry = zipInputStream.getNextEntry()) != null) { File file = new File(destination, zipEntry.getName()); String fileCanonicalPath = file.getCanonicalPath(); if (!fileCanonicalPath.startsWith(destinationCanonicalPath)) { throw new ZipException("The file "+ zipEntry.getName() + " is trying to leave the target output directory of "+ destination); } // create intermediary directories - sometimes zip don't add them File dir = new File(file.getParent()); mkdirsOrThrow(dir); if (zipEntry.isDirectory()) { mkdirsOrThrow(file); } else { byte[] buffer = new byte[1024]; int length; try (FileOutputStream fos = new FileOutputStream(file)) { while ((length = zipInputStream.read(buffer)) >= 0) { fos.write(buffer, 0, length); } } } } } }
[ "CWE-22" ]
CVE-2023-40828
HIGH
7.5
pf4j
extract
pf4j/src/main/java/org/pf4j/util/Unzip.java
8e0aa198c4e652cfc1eb9e05ca9b64397f67cc72
1
Analyze the following code function for security vulnerabilities
private void cleanUpRemovedTaskLocked(TaskRecord tr, boolean killProcess) { mRecentTasks.remove(tr); tr.removedFromRecents(); ComponentName component = tr.getBaseIntent().getComponent(); if (component == null) { Slog.w(TAG, "No component for base intent of task: " + tr); return; } if (!killProcess) { return; } // Determine if the process(es) for this task should be killed. final String pkg = component.getPackageName(); ArrayList<ProcessRecord> procsToKill = new ArrayList<ProcessRecord>(); ArrayMap<String, SparseArray<ProcessRecord>> pmap = mProcessNames.getMap(); for (int i = 0; i < pmap.size(); i++) { SparseArray<ProcessRecord> uids = pmap.valueAt(i); for (int j = 0; j < uids.size(); j++) { ProcessRecord proc = uids.valueAt(j); if (proc.userId != tr.userId) { // Don't kill process for a different user. continue; } if (proc == mHomeProcess) { // Don't kill the home process along with tasks from the same package. continue; } if (!proc.pkgList.containsKey(pkg)) { // Don't kill process that is not associated with this task. continue; } for (int k = 0; k < proc.activities.size(); k++) { TaskRecord otherTask = proc.activities.get(k).task; if (tr.taskId != otherTask.taskId && otherTask.inRecents) { // Don't kill process(es) that has an activity in a different task that is // also in recents. return; } } // Add process to kill list. procsToKill.add(proc); } } // Find any running services associated with this app and stop if needed. mServices.cleanUpRemovedTaskLocked(tr, component, new Intent(tr.getBaseIntent())); // Kill the running processes. for (int i = 0; i < procsToKill.size(); i++) { ProcessRecord pr = procsToKill.get(i); if (pr.setSchedGroup == Process.THREAD_GROUP_BG_NONINTERACTIVE) { pr.kill("remove task", true); } else { pr.waitingToKill = "remove task"; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanUpRemovedTaskLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
cleanUpRemovedTaskLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public static String javaScriptEscape(String input) { if (input == null) { return input; } StringBuilder filtered = new StringBuilder(input.length()); char prevChar = '\u0000'; char c; for (int i = 0; i < input.length(); i++) { c = input.charAt(i); if (c == '"') { filtered.append("\\\""); } else if (c == '\'') { filtered.append("\\'"); } else if (c == '\\') { filtered.append("\\\\"); } else if (c == '/') { filtered.append("\\/"); } else if (c == '\t') { filtered.append("\\t"); } else if (c == '\n') { if (prevChar != '\r') { filtered.append("\\n"); } } else if (c == '\r') { filtered.append("\\n"); } else if (c == '\f') { filtered.append("\\f"); } else { filtered.append(c); } prevChar = c; } return filtered.toString(); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2013-6430 - Severity: LOW - CVSS Score: 3.5 Description: Update JavaScriptUtils Add escaping for <, >, and PS/LS line terminators Issue: SPR-9983 Function: javaScriptEscape File: org.springframework.web/src/main/java/org/springframework/web/util/JavaScriptUtils.java Repository: spring-projects/spring-framework Fixed Code: public static String javaScriptEscape(String input) { if (input == null) { return input; } StringBuilder filtered = new StringBuilder(input.length()); char prevChar = '\u0000'; char c; for (int i = 0; i < input.length(); i++) { c = input.charAt(i); if (c == '"') { filtered.append("\\\""); } else if (c == '\'') { filtered.append("\\'"); } else if (c == '\\') { filtered.append("\\\\"); } else if (c == '/') { filtered.append("\\/"); } else if (c == '\t') { filtered.append("\\t"); } else if (c == '\n') { if (prevChar != '\r') { filtered.append("\\n"); } } else if (c == '\r') { filtered.append("\\n"); } else if (c == '\f') { filtered.append("\\f"); } else if (c == '\b') { filtered.append("\\b"); } // No '\v' in Java, use octal value for VT ascii char else if (c == '\013') { filtered.append("\\v"); } else if (c == '<') { filtered.append("\\u003C"); } else if (c == '>') { filtered.append("\\u003E"); } // Unicode for PS (line terminator in ECMA-262) else if (c == '\u2028') { filtered.append("\\u2028"); } // Unicode for LS (line terminator in ECMA-262) else if (c == '\u2029') { filtered.append("\\u2029"); } else { filtered.append(c); } prevChar = c; } return filtered.toString(); }
[ "CWE-79" ]
CVE-2013-6430
LOW
3.5
spring-projects/spring-framework
javaScriptEscape
org.springframework.web/src/main/java/org/springframework/web/util/JavaScriptUtils.java
7a7df6637478607bef0277bf52a4e0a03e20a248
1
Analyze the following code function for security vulnerabilities
@Override protected boolean validateFormLogic(UserRequest ureq) { boolean isInputValid = true; String name = textElement.getValue(); if(name==null || name.trim().equals("")) { textElement.setErrorKey("zip.name.empty", new String[0]); isInputValid = false; } else { if (!validateFileName(name)) { textElement.setErrorKey("zip.name.notvalid", new String[0]); isInputValid = false; return isInputValid; } //Note: use java.io.File and not VFS to create a leaf. File must not exist upon ZipUtil.zip() name = name + ".zip"; VFSItem zipFile = currentContainer.resolve(name); if (zipFile != null) { textElement.setErrorKey("zip.alreadyexists", new String[] {name}); isInputValid = false; } else { isInputValid = true; } } return isInputValid; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateFormLogic File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
validateFormLogic
src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
@Transactional @Override public <E extends KrailEntity<ID, VER>> Optional<E> delete(@Nonnull E entity) { checkNotNull(entity); E mergedEntity = merge(entity); if (mergedEntity.getId() != null) { //noinspection unchecked return deleteById((Class<E>) entity.getClass(), mergedEntity.getId()); } return Optional.empty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: src/main/java/uk/q3c/krail/jpa/persist/BaseJpaDao.java Repository: KrailOrg/krail-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15018
MEDIUM
5.2
KrailOrg/krail-jpa
delete
src/main/java/uk/q3c/krail/jpa/persist/BaseJpaDao.java
c1e848665492e21ef6cc9be443205e36b9a1f6be
0
Analyze the following code function for security vulnerabilities
public String getTempFolderPath() { return tempFolderPath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTempFolderPath File: samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getTempFolderPath
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public void printXMLElement(String name) { handleSpaceWhenStartElement(); super.printXMLElement(name); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-32070 - Severity: MEDIUM - CVSS Score: 6.1 Description: XRENDERING-663: Restrict allowed attributes in HTML rendering * Change HTML renderers to only print allowed attributes and elements. * Add prefix to forbidden attributes to preserve them in XWiki syntax. * Adapt tests to expect that invalid attributes get a prefix. Function: printXMLElement File: xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java Repository: xwiki/xwiki-rendering Fixed Code: @Override public void printXMLElement(String name) { if (this.htmlElementSanitizer == null || this.htmlElementSanitizer.isElementAllowed(name)) { handleSpaceWhenStartElement(); super.printXMLElement(name); } }
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
printXMLElement
xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
1
Analyze the following code function for security vulnerabilities
public void gotoPage(EntityReference reference, String action, Object... queryParameters) { gotoPage(reference, action, toQueryString(queryParameters)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gotoPage File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
gotoPage
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private void onKeyguardExitFinished() { // only play "unlock" noises if not on a call (since the incall UI // disables the keyguard) if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState)) { playSounds(false); } setShowingLocked(false); mWakeAndUnlocking = false; mDismissCallbackRegistry.notifyDismissSucceeded(); resetKeyguardDonePendingLocked(); mHideAnimationRun = false; adjustStatusBarLocked(); sendUserPresentBroadcast(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onKeyguardExitFinished 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
onKeyguardExitFinished
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
private static Transformer createTransformer(InputStream templateStream) throws IOException { try { return TRANSFORMER_FACTORY.newTransformer(new StreamSource(templateStream)); } catch (TransformerConfigurationException e) { throw new ProcessingFailedException("Failed to create XSLT template", e); } finally { templateStream.close(); } }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2018-1000854 - Severity: HIGH - CVSS Score: 7.5 Description: Update XsltRenderer.java Function: createTransformer File: esigate-core/src/main/java/org/esigate/xml/XsltRenderer.java Repository: esigate Fixed Code: private static Transformer createTransformer(InputStream templateStream) throws IOException { try { // Ensure XSLT cannot use advanced extensions during processing. TRANSFORMER_FACTORY.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); return TRANSFORMER_FACTORY.newTransformer(new StreamSource(templateStream)); } catch (TransformerConfigurationException e) { throw new ProcessingFailedException("Failed to create XSLT template", e); } finally { templateStream.close(); } }
[ "CWE-74" ]
CVE-2018-1000854
HIGH
7.5
esigate
createTransformer
esigate-core/src/main/java/org/esigate/xml/XsltRenderer.java
8461193d2f358bcf1c3fabf82891a66786bfb540
1
Analyze the following code function for security vulnerabilities
@Override public WifiSsidPolicy getWifiSsidPolicy() { final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller) || canQueryAdminPolicy(caller), "SSID policy can only be retrieved by a device owner or " + "a profile owner on an organization-owned device or " + "an app with the QUERY_ADMIN_POLICY permission."); synchronized (getLockObject()) { final ActiveAdmin admin = getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked( UserHandle.USER_SYSTEM); return admin != null ? admin.mWifiSsidPolicy : null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWifiSsidPolicy 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
getWifiSsidPolicy
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setCaCertificate(X509Certificate cert) { if (cert != null) { if (cert.getBasicConstraints() >= 0) { mCaCert = cert; } else { throw new IllegalArgumentException("Not a CA certificate"); } } else { mCaCert = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCaCertificate File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
setCaCertificate
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
void writeNameToProto(ProtoOutputStream proto, long fieldId) { proto.write(fieldId, shortComponentName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeNameToProto File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
writeNameToProto
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public void init(FilterConfig config) throws ServletException { this.ASSET_PATH = APILocator.getFileAssetAPI().getRealAssetsRootPath(); }
Vulnerability Classification: - CWE: CWE-434 - CVE: CVE-2017-11466 - Severity: HIGH - CVSS Score: 9.0 Description: #12131 fixes arbitrary upload Function: init File: dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java Repository: dotCMS/core Fixed Code: @Override public void init(FilterConfig arg0) throws ServletException { // TODO Auto-generated method stub }
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
init
dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java
208798c6aa9ca70f90740c8a8924e481283109ce
1
Analyze the following code function for security vulnerabilities
public String getNavbarLink2Text() { return CONF.navbarCustomLink2Text(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNavbarLink2Text File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getNavbarLink2Text
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
private UserReferenceResolver<String> getUserReferenceStringResolver() { return Utils.getComponent(UserReferenceResolver.TYPE_STRING); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserReferenceStringResolver File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
getUserReferenceStringResolver
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
private static Pair<byte[], Integer> generateApkSignatureSchemeV2Block( List<SignerConfig> signerConfigs, Map<ContentDigestAlgorithm, byte[]> contentDigests, boolean v3SigningEnabled, List<byte[]> preservedV2SignerBlocks) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException { // FORMAT: // * length-prefixed sequence of length-prefixed signer blocks. List<byte[]> signerBlocks = new ArrayList<>(signerConfigs.size()); if (preservedV2SignerBlocks != null && preservedV2SignerBlocks.size() > 0) { signerBlocks.addAll(preservedV2SignerBlocks); } int signerNumber = 0; for (SignerConfig signerConfig : signerConfigs) { signerNumber++; byte[] signerBlock; try { signerBlock = generateSignerBlock(signerConfig, contentDigests, v3SigningEnabled); } catch (InvalidKeyException e) { throw new InvalidKeyException("Signer #" + signerNumber + " failed", e); } catch (SignatureException e) { throw new SignatureException("Signer #" + signerNumber + " failed", e); } signerBlocks.add(signerBlock); } return Pair.of( encodeAsSequenceOfLengthPrefixedElements( new byte[][] { encodeAsSequenceOfLengthPrefixedElements(signerBlocks), }), V2SchemeConstants.APK_SIGNATURE_SCHEME_V2_BLOCK_ID); }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2023-21253 - Severity: MEDIUM - CVSS Score: 5.5 Description: Limit the number of supported v1 and v2 signers The v1 and v2 APK Signature Schemes support multiple signers; this was intended to allow multiple entities to sign an APK. Previously, there were no limits placed on the number of signers that could sign an APK, but this commit sets a hard limit of 10 supported signers for these signature schemes to ensure a large number of signers does not place undue burden on the platform. Bug: 266580022 Test: gradlew test (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:6be64b9339c1dad28abf75b53d3866fd42f320d6) Merged-In: I4fd8f603385dd7e59c81695a75fe6df9a116185d Change-Id: I4fd8f603385dd7e59c81695a75fe6df9a116185d Function: generateApkSignatureSchemeV2Block File: src/main/java/com/android/apksig/internal/apk/v2/V2SchemeSigner.java Repository: android Fixed Code: private static Pair<byte[], Integer> generateApkSignatureSchemeV2Block( List<SignerConfig> signerConfigs, Map<ContentDigestAlgorithm, byte[]> contentDigests, boolean v3SigningEnabled, List<byte[]> preservedV2SignerBlocks) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException { // FORMAT: // * length-prefixed sequence of length-prefixed signer blocks. if (signerConfigs.size() > MAX_APK_SIGNERS) { throw new IllegalArgumentException( "APK Signature Scheme v2 only supports a maximum of " + MAX_APK_SIGNERS + ", " + signerConfigs.size() + " provided"); } List<byte[]> signerBlocks = new ArrayList<>(signerConfigs.size()); if (preservedV2SignerBlocks != null && preservedV2SignerBlocks.size() > 0) { signerBlocks.addAll(preservedV2SignerBlocks); } int signerNumber = 0; for (SignerConfig signerConfig : signerConfigs) { signerNumber++; byte[] signerBlock; try { signerBlock = generateSignerBlock(signerConfig, contentDigests, v3SigningEnabled); } catch (InvalidKeyException e) { throw new InvalidKeyException("Signer #" + signerNumber + " failed", e); } catch (SignatureException e) { throw new SignatureException("Signer #" + signerNumber + " failed", e); } signerBlocks.add(signerBlock); } return Pair.of( encodeAsSequenceOfLengthPrefixedElements( new byte[][] { encodeAsSequenceOfLengthPrefixedElements(signerBlocks), }), V2SchemeConstants.APK_SIGNATURE_SCHEME_V2_BLOCK_ID); }
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
generateApkSignatureSchemeV2Block
src/main/java/com/android/apksig/internal/apk/v2/V2SchemeSigner.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
1
Analyze the following code function for security vulnerabilities
public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; updateBasePath(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServerIndex File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setServerIndex
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void addPackageDependency(String packageName) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(packageName); mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addPackageDependency File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
addPackageDependency
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public ParceledListSlice<android.content.UriPermission> getPersistedUriPermissions( String packageName, boolean incoming) { enforceNotIsolatedCaller("getPersistedUriPermissions"); Preconditions.checkNotNull(packageName, "packageName"); final int callingUid = Binder.getCallingUid(); final IPackageManager pm = AppGlobals.getPackageManager(); try { final int packageUid = pm.getPackageUid(packageName, UserHandle.getUserId(callingUid)); if (packageUid != callingUid) { throw new SecurityException( "Package " + packageName + " does not belong to calling UID " + callingUid); } } catch (RemoteException e) { throw new SecurityException("Failed to verify package name ownership"); } final ArrayList<android.content.UriPermission> result = Lists.newArrayList(); synchronized (this) { if (incoming) { final ArrayMap<GrantUri, UriPermission> perms = mGrantedUriPermissions.get( callingUid); if (perms == null) { Slog.w(TAG, "No permission grants found for " + packageName); } else { for (UriPermission perm : perms.values()) { if (packageName.equals(perm.targetPkg) && perm.persistedModeFlags != 0) { result.add(perm.buildPersistedPublicApiObject()); } } } } else { final int size = mGrantedUriPermissions.size(); for (int i = 0; i < size; i++) { final ArrayMap<GrantUri, UriPermission> perms = mGrantedUriPermissions.valueAt(i); for (UriPermission perm : perms.values()) { if (packageName.equals(perm.sourcePkg) && perm.persistedModeFlags != 0) { result.add(perm.buildPersistedPublicApiObject()); } } } } } return new ParceledListSlice<android.content.UriPermission>(result); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPersistedUriPermissions File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
getPersistedUriPermissions
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private boolean isProfileOwnerPackage(String packageName, int userId) { synchronized (getLockObject()) { return mOwners.hasProfileOwner(userId) && mOwners.getProfileOwnerPackage(userId).equals(packageName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isProfileOwnerPackage 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
isProfileOwnerPackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private final boolean updateOomAdjLocked(ProcessRecord app, int cachedAdj, ProcessRecord TOP_APP, boolean doingAll, long now) { if (app.thread == null) { return false; } computeOomAdjLocked(app, cachedAdj, TOP_APP, doingAll, now); return applyOomAdjLocked(app, TOP_APP, doingAll, now); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateOomAdjLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
updateOomAdjLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override RemoteAnimationTarget createRemoteAnimationTarget( RemoteAnimationController.RemoteAnimationRecord record) { final WindowState mainWindow = findMainWindow(); if (task == null || mainWindow == null) { return null; } final Rect insets = mainWindow.getInsetsStateWithVisibilityOverride().calculateInsets( task.getBounds(), Type.systemBars(), false /* ignoreVisibility */).toRect(); InsetUtils.addInsets(insets, getLetterboxInsets()); final RemoteAnimationTarget target = new RemoteAnimationTarget(task.mTaskId, record.getMode(), record.mAdapter.mCapturedLeash, !fillsParent(), new Rect(), insets, getPrefixOrderIndex(), record.mAdapter.mPosition, record.mAdapter.mLocalBounds, record.mAdapter.mEndBounds, task.getWindowConfiguration(), false /*isNotInRecents*/, record.mThumbnailAdapter != null ? record.mThumbnailAdapter.mCapturedLeash : null, record.mStartBounds, task.getTaskInfo(), checkEnterPictureInPictureAppOpsState()); target.hasAnimatingParent = record.hasAnimatingParent(); return target; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createRemoteAnimationTarget File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
createRemoteAnimationTarget
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder2 ref(String name) { return reference(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ref File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
ref
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
@Nonnull public final JsonParser setCheckForEOI (final boolean bCheckForEOI) { m_bCheckForEOI = bCheckForEOI; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCheckForEOI File: ph-json/src/main/java/com/helger/json/parser/JsonParser.java Repository: phax/ph-commons The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34612
HIGH
7.5
phax/ph-commons
setCheckForEOI
ph-json/src/main/java/com/helger/json/parser/JsonParser.java
02a4d034dcfb2b6e1796b25f519bf57a6796edce
0
Analyze the following code function for security vulnerabilities
private String nextOption() { if (mNextArg >= mArgs.length) { return null; } String arg = mArgs[mNextArg]; if (!arg.startsWith("-")) { return null; } mNextArg++; if (arg.equals("--")) { return null; } if (arg.length() > 1 && arg.charAt(1) != '-') { if (arg.length() > 2) { mCurArgData = arg.substring(2); return arg.substring(0, 2); } else { mCurArgData = null; return arg; } } mCurArgData = null; return arg; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nextOption File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
nextOption
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
public String getPasswordValue(Object o) { if (o==null) return null; if (o instanceof Secret) return ((Secret)o).getEncryptedValue(); return o.toString(); }
Vulnerability Classification: - CWE: CWE-310 - CVE: CVE-2014-2061 - Severity: MEDIUM - CVSS Score: 5.0 Description: [FIXED SECURITY-93] PasswordParameterDefinition should serve existing default value in encrypted form. And strengthen functional tests (using configRoundTrip) to ensure that the same mistake is not made elsewhere. Function: getPasswordValue File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins Fixed Code: public String getPasswordValue(Object o) { if (o==null) return null; if (o instanceof Secret) return ((Secret)o).getEncryptedValue(); if (getIsUnitTest()) { throw new SecurityException("attempted to render plaintext ‘" + o + "’ in password field; use a getter of type Secret instead"); } return o.toString(); }
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
getPasswordValue
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
1
Analyze the following code function for security vulnerabilities
public void setUsageStatsManager(@NonNull UsageStatsManagerInternal usageStatsManager) { mUsageStatsService = usageStatsManager; mActivityTaskManager.setUsageStatsManager(usageStatsManager); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUsageStatsManager 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
setUsageStatsManager
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private void makeSpaceVisible(XWikiSpace space, Session session) { if (space.isHidden()) { space.setHidden(false); session.update(space); // Update parent if (space.getSpaceReference().getParent() instanceof SpaceReference) { makeSpaceVisible((SpaceReference) space.getSpaceReference().getParent(), session); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeSpaceVisible File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
makeSpaceVisible
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
@Override public void setUserIsMonkey(boolean userIsMonkey) { synchronized (mProcLock) { synchronized (mPidsSelfLocked) { final int callingPid = Binder.getCallingPid(); ProcessRecord proc = mPidsSelfLocked.get(callingPid); if (proc == null) { throw new SecurityException("Unknown process: " + callingPid); } if (proc.getActiveInstrumentation() == null || proc.getActiveInstrumentation().mUiAutomationConnection == null) { throw new SecurityException("Only an instrumentation process " + "with a UiAutomation can call setUserIsMonkey"); } } mUserIsMonkey = userIsMonkey; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserIsMonkey 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
setUserIsMonkey
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private static Key defaultKey(String id, boolean forNode) { return new Key(id,"string", null, forNode ? "node" : "edge"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultKey File: core/src/main/java/apoc/export/graphml/XmlGraphMLReader.java Repository: neo4j/apoc The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-23926
HIGH
8.1
neo4j/apoc
defaultKey
core/src/main/java/apoc/export/graphml/XmlGraphMLReader.java
3202b421b21973b2f57a43b33c88f3f6901cfd2a
0
Analyze the following code function for security vulnerabilities
public boolean isHeadsUp(String key) { return mHeadsUpManager.isHeadsUp(key); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isHeadsUp 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
isHeadsUp
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private static ActivityInfo isInstalledOrNull(ActivityInfo ai) { return isInstalled(ai) ? ai : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInstalledOrNull File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
isInstalledOrNull
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
private void pushActiveAdminPackages() { synchronized (getLockObject()) { final List<UserInfo> users = mUserManager.getUsers(); for (int i = users.size() - 1; i >= 0; --i) { final int userId = users.get(i).id; mUsageStatsManagerInternal.setActiveAdminApps( getActiveAdminPackagesLocked(userId), userId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pushActiveAdminPackages 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
pushActiveAdminPackages
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void handleDiscoveryServiceProvider(Node node, BeanDefinitionBuilder discoveryConfigBuilder) { NamedNodeMap attributes = node.getAttributes(); Node implNode = attributes.getNamedItem("implementation"); String implementation = getTextContent(implNode).trim(); isTrue(!implementation.isEmpty(), "'implementation' attribute is required to create DiscoveryServiceProvider!"); discoveryConfigBuilder.addPropertyReference("discoveryServiceProvider", implementation); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleDiscoveryServiceProvider File: hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
handleDiscoveryServiceProvider
hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public boolean setProcessMemoryTrimLevel(String process, int userId, int level) throws RemoteException { if (!isCallerShell()) { throw new SecurityException("Only shell can call it"); } synchronized (this) { final ProcessRecord app = findProcessLOSP(process, userId, "setProcessMemoryTrimLevel"); if (app == null) { throw new IllegalArgumentException("Unknown process: " + process); } final IApplicationThread thread = app.getThread(); if (thread == null) { throw new IllegalArgumentException("Process has no app thread"); } if (app.mProfile.getTrimMemoryLevel() >= level) { throw new IllegalArgumentException( "Unable to set a higher trim level than current level"); } if (!(level < ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN || app.mState.getCurProcState() > PROCESS_STATE_IMPORTANT_FOREGROUND)) { throw new IllegalArgumentException("Unable to set a background trim level " + "on a foreground process"); } thread.scheduleTrimMemory(level); synchronized (mProcLock) { app.mProfile.setTrimMemoryLevel(level); } return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProcessMemoryTrimLevel 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
setProcessMemoryTrimLevel
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private void startRestore() { sendStartRestore(mAcceptSet.size()); // If we're starting a full-system restore, set up to begin widget ID remapping if (mIsSystemRestore) { AppWidgetBackupBridge.restoreStarting(UserHandle.USER_OWNER); } try { String transportDir = mTransport.transportDirName(); mStateDir = new File(mBaseStateDir, transportDir); // Fetch the current metadata from the dataset first PackageInfo pmPackage = new PackageInfo(); pmPackage.packageName = PACKAGE_MANAGER_SENTINEL; mAcceptSet.add(0, pmPackage); PackageInfo[] packages = mAcceptSet.toArray(new PackageInfo[0]); mStatus = mTransport.startRestore(mToken, packages); if (mStatus != BackupTransport.TRANSPORT_OK) { Slog.e(TAG, "Transport error " + mStatus + "; no restore possible"); mStatus = BackupTransport.TRANSPORT_ERROR; executeNextState(UnifiedRestoreState.FINAL); return; } RestoreDescription desc = mTransport.nextRestorePackage(); if (desc == null) { Slog.e(TAG, "No restore metadata available; halting"); mStatus = BackupTransport.TRANSPORT_ERROR; executeNextState(UnifiedRestoreState.FINAL); return; } if (!PACKAGE_MANAGER_SENTINEL.equals(desc.getPackageName())) { Slog.e(TAG, "Required metadata but got " + desc.getPackageName()); mStatus = BackupTransport.TRANSPORT_ERROR; executeNextState(UnifiedRestoreState.FINAL); return; } // Pull the Package Manager metadata from the restore set first mCurrentPackage = new PackageInfo(); mCurrentPackage.packageName = PACKAGE_MANAGER_SENTINEL; mPmAgent = new PackageManagerBackupAgent(mPackageManager, null); mAgent = IBackupAgent.Stub.asInterface(mPmAgent.onBind()); if (MORE_DEBUG) { Slog.v(TAG, "initiating restore for PMBA"); } initiateOneRestore(mCurrentPackage, 0); // The PM agent called operationComplete() already, because our invocation // of it is process-local and therefore synchronous. That means that the // next-state message (RUNNING_QUEUE) is already enqueued. Only if we're // unable to proceed with running the queue do we remove that pending // message and jump straight to the FINAL state. Because this was // synchronous we also know that we should cancel the pending timeout // message. mBackupHandler.removeMessages(MSG_TIMEOUT); // Verify that the backup set includes metadata. If not, we can't do // signature/version verification etc, so we simply do not proceed with // the restore operation. if (!mPmAgent.hasMetadata()) { Slog.e(TAG, "No restore metadata available, so not restoring"); EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, PACKAGE_MANAGER_SENTINEL, "Package manager restore metadata missing"); mStatus = BackupTransport.TRANSPORT_ERROR; mBackupHandler.removeMessages(MSG_BACKUP_RESTORE_STEP, this); executeNextState(UnifiedRestoreState.FINAL); return; } // Success; cache the metadata and continue as expected with the // next state already enqueued } catch (RemoteException e) { // If we lost the transport at any time, halt Slog.e(TAG, "Unable to contact transport for restore"); mStatus = BackupTransport.TRANSPORT_ERROR; mBackupHandler.removeMessages(MSG_BACKUP_RESTORE_STEP, this); executeNextState(UnifiedRestoreState.FINAL); return; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startRestore 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
startRestore
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@Override public void onTypingStarted() { final XmppConnectionService service = activity == null ? null : activity.xmppConnectionService; if (service == null) { return; } Account.State status = conversation.getAccount().getStatus(); if (status == Account.State.ONLINE && conversation.setOutgoingChatState(ChatState.COMPOSING)) { service.sendChatState(conversation); } updateSendButton(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onTypingStarted File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onTypingStarted
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private boolean showClientCredentialsAdapterConfig(ClientModel client) { if (client.isPublicClient()) { return false; } if (client.isBearerOnly() && client.getNodeReRegistrationTimeout() <= 0) { return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showClientCredentialsAdapterConfig File: services/src/main/java/org/keycloak/services/managers/ClientManager.java Repository: keycloak The code follows secure coding practices.
[ "CWE-798" ]
CVE-2019-14837
MEDIUM
6.4
keycloak
showClientCredentialsAdapterConfig
services/src/main/java/org/keycloak/services/managers/ClientManager.java
9a7c1a91a59ab85e7f8889a505be04a71580777f
0
Analyze the following code function for security vulnerabilities
private Account getSelectedAccount(Spinner spinner) { if (!spinner.isEnabled()) { return null; } Jid jid; try { if (Config.DOMAIN_LOCK != null) { jid = Jid.of((String) spinner.getSelectedItem(), Config.DOMAIN_LOCK, null); } else { jid = Jid.of((String) spinner.getSelectedItem()); } } catch (final IllegalArgumentException e) { return null; } return xmppConnectionService.findAccountByJid(jid); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSelectedAccount File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
getSelectedAccount
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public char skipTo(char to) { char c; int index = this.myIndex; do { c = next(); if (c == 0) { this.myIndex = index; return c; } } while (c != to); back(); return c; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: skipTo File: src/main/java/org/codehaus/jettison/json/JSONTokener.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
skipTo
src/main/java/org/codehaus/jettison/json/JSONTokener.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
public void setOnsubmit(String onsubmit) { this.onsubmit = onsubmit; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOnsubmit File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-1904
MEDIUM
4.3
spring-projects/spring-framework
setOnsubmit
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
741b4b229ae032bd17175b46f98673ce0bd2d485
0
Analyze the following code function for security vulnerabilities
public static void setEmbeddedPort(int port){ embeddedPort = port; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEmbeddedPort 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
setEmbeddedPort
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public void setApplicationEnabledSetting(String appPackageName, int newState, int flags, int userId, String callingPackage) { if (!sUserManager.exists(userId)) return; if (callingPackage == null) { callingPackage = Integer.toString(Binder.getCallingUid()); } setEnabledSetting(appPackageName, null, newState, flags, userId, callingPackage); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setApplicationEnabledSetting File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
setApplicationEnabledSetting
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public int getSocketErrorCode(Object socket) { return ((SocketImpl)socket).getErrorCode(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSocketErrorCode 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
getSocketErrorCode
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl wContr, Translator trans) { this.translator = trans; this.folderComponent = fc; this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath()); VFSContainer currentContainer = folderComponent.getCurrentContainer(); List<String> lockedFiles = hasLockedFiles(currentContainer, fileSelection); if (lockedFiles.isEmpty()) { String msg = trans.translate("del.confirm") + "<p>" + fileSelection.renderAsHtml() + "</p>"; // create dialog controller dialogCtr = activateYesNoDialog(ureq, trans.translate("del.header"), msg, dialogCtr); } else { String msg = FolderCommandHelper.renderLockedMessageAsHtml(trans, lockedFiles); List<String> buttonLabels = Collections.singletonList(trans.translate("ok")); lockedFiledCtr = activateGenericDialog(ureq, trans.translate("lock.title"), msg, buttonLabels, lockedFiledCtr); } return this; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2021-41152 - Severity: MEDIUM - CVSS Score: 4.0 Description: OO-5696: validate file selections against current container Function: execute File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdDelete.java Repository: OpenOLAT Fixed Code: @Override public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl wContr, Translator trans) { this.translator = trans; this.folderComponent = fc; this.fileSelection = new FileSelection(ureq, fc.getCurrentContainer(), fc.getCurrentContainerPath()); VFSContainer currentContainer = folderComponent.getCurrentContainer(); List<String> lockedFiles = hasLockedFiles(currentContainer, fileSelection); if (lockedFiles.isEmpty()) { String msg = trans.translate("del.confirm") + "<p>" + fileSelection.renderAsHtml() + "</p>"; // create dialog controller dialogCtr = activateYesNoDialog(ureq, trans.translate("del.header"), msg, dialogCtr); } else { String msg = FolderCommandHelper.renderLockedMessageAsHtml(trans, lockedFiles); List<String> buttonLabels = Collections.singletonList(trans.translate("ok")); lockedFiledCtr = activateGenericDialog(ureq, trans.translate("lock.title"), msg, buttonLabels, lockedFiledCtr); } return this; }
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
execute
src/main/java/org/olat/core/commons/modules/bc/commands/CmdDelete.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
1
Analyze the following code function for security vulnerabilities
protected Object convert(Object parent, Class type, Converter converter) { types.push(type); try { return converter.unmarshal(reader, this); } catch (final ConversionException conversionException) { addInformationTo(conversionException, type, converter, parent); throw conversionException; } catch (RuntimeException e) { ConversionException conversionException = new ConversionException(e); addInformationTo(conversionException, type, converter, parent); throw conversionException; } finally { types.popSilently(); } }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2021-43859 - Severity: MEDIUM - CVSS Score: 5.0 Description: Describe and fix CVE-2021-43859. Function: convert File: xstream/src/java/com/thoughtworks/xstream/core/TreeUnmarshaller.java Repository: x-stream/xstream Fixed Code: protected Object convert(Object parent, Class type, Converter converter) { types.push(type); try { return converter.unmarshal(reader, this); } catch (final ConversionException conversionException) { addInformationTo(conversionException, type, converter, parent); throw conversionException; } catch (AbstractSecurityException e) { throw e; } catch (RuntimeException e) { ConversionException conversionException = new ConversionException(e); addInformationTo(conversionException, type, converter, parent); throw conversionException; } finally { types.popSilently(); } }
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
convert
xstream/src/java/com/thoughtworks/xstream/core/TreeUnmarshaller.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
1
Analyze the following code function for security vulnerabilities
public Set<String> getAllMenuIds(String appId, String version, String userviewId) { Set<String> ids = new HashSet<String>(); AppDefinition appDef = appService.getAppDefinition(appId, version); UserviewDefinition userviewDef = userviewDefinitionDao.loadById(userviewId, appDef); if (userviewDef != null) { String json = userviewDef.getJson(); try { //set userview properties JSONObject userviewObj = new JSONObject(json); JSONArray categoriesArray = userviewObj.getJSONArray("categories"); for (int i = 0; i < categoriesArray.length(); i++) { JSONObject categoryObj = (JSONObject) categoriesArray.get(i); JSONArray menusArray = categoryObj.getJSONArray("menus"); for (int j = 0; j < menusArray.length(); j++) { JSONObject menuObj = (JSONObject) menusArray.get(j); JSONObject props = menuObj.getJSONObject("properties"); String id = props.getString("id"); String customId = (props.has("customId"))?props.getString("customId"):null; if (customId != null && !customId.isEmpty()) { ids.add(customId); } else { ids.add(id); } } } } catch (Exception e) { LogUtil.debug(getClass().getName(), "get userview menu ids error."); } } return ids; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllMenuIds File: wflow-core/src/main/java/org/joget/apps/userview/service/UserviewService.java Repository: jogetworkflow/jw-community The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4560
MEDIUM
6.1
jogetworkflow/jw-community
getAllMenuIds
wflow-core/src/main/java/org/joget/apps/userview/service/UserviewService.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
0
Analyze the following code function for security vulnerabilities
String[] getSettingNames() { ArrayList<ConnectionInfo> list = getSettings(); String[] names = new String[list.size()]; for (int i = 0; i < list.size(); i++) { names[i] = list.get(i).name; } return names; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSettingNames File: h2/src/main/org/h2/server/web/WebServer.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
getSettingNames
h2/src/main/org/h2/server/web/WebServer.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@Override public void onForegroundProfileSwitch(int newProfileId) { // Ignore. }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onForegroundProfileSwitch File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
onForegroundProfileSwitch
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Override public void writeFloat(float value) throws JMSException { writePrimitive(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeFloat File: src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
writeFloat
src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
private void repairForWiringLibrary(Document doc, Element root) { Element oldBaseElt = null; String oldBaseLabel = null; Element gatesElt = null; String gatesLabel = null; int maxLabel = -1; Element firstLibElt = null; Element lastLibElt = null; for (Element libElt : XmlIterator.forChildElements(root, "lib")) { String desc = libElt.getAttribute("desc"); String label = libElt.getAttribute("name"); if (desc == null) { // skip these tests } else if (desc.equals("#Base")) { oldBaseElt = libElt; oldBaseLabel = label; } else if (desc.equals("#Wiring")) { // Wiring library already in file. This shouldn't happen, but if // somehow it does, we don't want to add it again. return; } else if (desc.equals("#Gates")) { gatesElt = libElt; gatesLabel = label; } if (firstLibElt == null) firstLibElt = libElt; lastLibElt = libElt; try { if (label != null) { int thisLabel = Integer.parseInt(label); if (thisLabel > maxLabel) maxLabel = thisLabel; } } catch (NumberFormatException e) { } } Element wiringElt; String wiringLabel; Element newBaseElt; String newBaseLabel; if (oldBaseElt != null) { wiringLabel = oldBaseLabel; wiringElt = oldBaseElt; wiringElt.setAttribute("desc", "#Wiring"); newBaseLabel = "" + (maxLabel + 1); newBaseElt = doc.createElement("lib"); newBaseElt.setAttribute("desc", "#Base"); newBaseElt.setAttribute("name", newBaseLabel); root.insertBefore(newBaseElt, lastLibElt.getNextSibling()); } else { wiringLabel = "" + (maxLabel + 1); wiringElt = doc.createElement("lib"); wiringElt.setAttribute("desc", "#Wiring"); wiringElt.setAttribute("name", wiringLabel); root.insertBefore(wiringElt, lastLibElt.getNextSibling()); newBaseLabel = null; newBaseElt = null; } HashMap<String, String> labelMap = new HashMap<String, String>(); addToLabelMap(labelMap, oldBaseLabel, newBaseLabel, "Poke Tool;" + "Edit Tool;Select Tool;Wiring Tool;Text Tool;Menu Tool;Text"); addToLabelMap(labelMap, oldBaseLabel, wiringLabel, "Splitter;Pin;" + "Probe;Tunnel;Clock;Pull Resistor;Bit Extender"); addToLabelMap(labelMap, gatesLabel, wiringLabel, "Constant"); relocateTools(oldBaseElt, newBaseElt, labelMap); relocateTools(oldBaseElt, wiringElt, labelMap); relocateTools(gatesElt, wiringElt, labelMap); updateFromLabelMap(XmlIterator.forDescendantElements(root, "comp"), labelMap); updateFromLabelMap(XmlIterator.forDescendantElements(root, "tool"), labelMap); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: repairForWiringLibrary File: src/com/cburch/logisim/file/XmlReader.java Repository: logisim-evolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000889
MEDIUM
6.8
logisim-evolution
repairForWiringLibrary
src/com/cburch/logisim/file/XmlReader.java
90aee8f8ceef463884cc400af4f6d1f109fb0972
0
Analyze the following code function for security vulnerabilities
public Profile getAuthUser(HttpServletRequest req) { return (Profile) req.getAttribute(AUTH_USER_ATTRIBUTE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthUser File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getAuthUser
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@CalledByNative private void swapWebContents( long newWebContents, boolean didStartLoad, boolean didFinishLoad) { ContentViewCore cvc = new ContentViewCore(mContext); ContentView cv = ContentView.newInstance(mContext, cvc); cvc.initialize(cv, cv, newWebContents, getWindowAndroid()); swapContentViewCore(cvc, false, didStartLoad, didFinishLoad); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: swapWebContents File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
swapWebContents
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public void selectSingle(String sql, JsonArray params, Handler<AsyncResult<JsonArray>> replyHandler) { client.getConnection(conn -> selectSingle(conn, sql, params, closeAndHandleResult(conn, replyHandler))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectSingle 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
selectSingle
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override protected boolean allowFilterResult( BroadcastFilter filter, List<BroadcastFilter> dest) { IBinder target = filter.receiverList.receiver.asBinder(); for (int i=dest.size()-1; i>=0; i--) { if (dest.get(i).receiverList.receiver.asBinder() == target) { return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: allowFilterResult File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
allowFilterResult
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
Http2StreamSourceChannel removeStreamSource(int streamId) { StreamHolder existing = currentStreams.get(streamId); if(existing == null){ return null; } existing.sourceClosed = true; Http2StreamSourceChannel ret = existing.sourceChannel; existing.sourceChannel = null; if(existing.sinkClosed) { if(streamId % 2 == (isClient() ? 1 : 0)) { sendConcurrentStreamsAtomicUpdater.getAndDecrement(this); } else { receiveConcurrentStreamsAtomicUpdater.getAndDecrement(this); } currentStreams.remove(streamId); } return ret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeStreamSource File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
removeStreamSource
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0