instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
private Message.Builder newMessageFieldInstance( FieldDescriptor field, Message defaultInstance) { // When default instance is not null. The field is an extension field. if (defaultInstance != null) { return defaultInstance.newBuilderForType(); } else { return builder.newBuilderForField(field); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newMessageFieldInstance File: java/core/src/main/java/com/google/protobuf/MessageReflection.java Repository: protocolbuffers/protobuf The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-3509
HIGH
7.5
protocolbuffers/protobuf
newMessageFieldInstance
java/core/src/main/java/com/google/protobuf/MessageReflection.java
a3888f53317a8018e7a439bac4abeb8f3425d5e9
0
Analyze the following code function for security vulnerabilities
public List<String> findFiles(File jar, String baseDirectoryName, String fileName) { requireFileExistence(jar); Objects.requireNonNull(baseDirectoryName); Objects.requireNonNull(fileName); try (JarFile jarFile = new JarFile(jar, false)) { return jarFile.stream().filter(entry -> !entry.isDirectory()) .map(ZipEntry::getName) .filter(path -> path.startsWith(baseDirectoryName)) .filter(path -> path .endsWith(JAR_PATH_SEPARATOR + fileName)) .collect(Collectors.toList()); } catch (IOException e) { throw new UncheckedIOException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findFiles File: flow-server/src/main/java/com/vaadin/flow/server/frontend/JarContentsManager.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-379" ]
CVE-2021-31411
MEDIUM
4.6
vaadin/flow
findFiles
flow-server/src/main/java/com/vaadin/flow/server/frontend/JarContentsManager.java
82cea56045b8430f7a26f037c01486b1feffa51d
0
Analyze the following code function for security vulnerabilities
public static PackageManagerService main(Context context, Installer installer, boolean factoryTest, boolean onlyCore) { PackageManagerService m = new PackageManagerService(context, installer, factoryTest, onlyCore); ServiceManager.addService("package", m); return m; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: main 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
main
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public SimpleObject checkIfLoggedIn() { return SimpleObject.create("isLoggedIn", Context.isAuthenticated()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkIfLoggedIn File: omod/src/main/java/org/openmrs/module/htmlformentryui/fragment/controller/htmlform/EnterHtmlFormFragmentController.java Repository: openmrs/openmrs-module-htmlformentryui The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-4284
MEDIUM
6.1
openmrs/openmrs-module-htmlformentryui
checkIfLoggedIn
omod/src/main/java/org/openmrs/module/htmlformentryui/fragment/controller/htmlform/EnterHtmlFormFragmentController.java
811990972ea07649ae33c4b56c61c3b520895f07
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting int injectDipToPixel(int dip) { return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, mContext.getResources().getDisplayMetrics()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: injectDipToPixel 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
injectDipToPixel
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public boolean canMakeReadOnly(int ndefType) throws RemoteException { return mDeviceHost.canMakeReadOnly(ndefType); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canMakeReadOnly File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
canMakeReadOnly
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
public String getFqdn() { return mFqdn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFqdn File: framework/java/android/net/wifi/hotspot2/pps/Policy.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21240
MEDIUM
5.5
android
getFqdn
framework/java/android/net/wifi/hotspot2/pps/Policy.java
69119d1d3102e27b6473c785125696881bce9563
0
Analyze the following code function for security vulnerabilities
public void setDimensions(final short width, final short height) { if (width < MIN_PIXELS || height < MIN_PIXELS) { final String what = width < MIN_PIXELS ? "width" : "height"; throw new IllegalArgumentException(what + " smaller than " + MIN_PIXELS + " in " + width + 'x' + height); } this.width = width; this.height = height; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDimensions File: src/graph/Plot.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2020-35476
HIGH
7.5
OpenTSDB/opentsdb
setDimensions
src/graph/Plot.java
b762338664c3ee6e3f773bc04da2a8af24a5c486
0
Analyze the following code function for security vulnerabilities
protected T blankInstance() { try { return backedType.getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException( "Cannot instantiate " + backedType + ". It must have a default constructor", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: blankInstance File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
blankInstance
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
@RequestMapping({"/userview/(*:appId)/(*:userviewId)/(~:key)","/userview/(*:appId)/(*:userviewId)","/userview/(*:appId)/(*:userviewId)/(*:key)/(*:menuId)"}) public String view(ModelMap map, HttpServletRequest request, HttpServletResponse response, @RequestParam("appId") String appId, @RequestParam("userviewId") String userviewId, @RequestParam(value = "menuId", required = false) String menuId, @RequestParam(value = "key", required = false) String key, @RequestParam(value = "embed", required = false) Boolean embed) throws Exception { if (embed == null) { embed = false; } return embedView(map, request, response, appId, userviewId, menuId, key, embed, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: view File: wflow-consoleweb/src/main/java/org/joget/apps/app/controller/UserviewWebController.java Repository: jogetworkflow/jw-community The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4560
MEDIUM
6.1
jogetworkflow/jw-community
view
wflow-consoleweb/src/main/java/org/joget/apps/app/controller/UserviewWebController.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
0
Analyze the following code function for security vulnerabilities
private boolean isAncestorOf(StateNode node) { while (node != null) { if (node == this) { return true; } node = node.getParent(); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAncestorOf File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
isAncestorOf
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
final StandardTemplateParams viewType(int viewType) { mViewType = viewType; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: viewType File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
viewType
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private void debugLog(String data) { if (LogConstants.LOG_DEBUG) { Log.d(TAG, data); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: debugLog File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
debugLog
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((descriptor == null) ? 0 : descriptor.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hashCode File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
hashCode
base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private static boolean isInstalled(@Nullable PackageInfo pi) { return (pi != null) && isInstalled(pi.applicationInfo); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInstalled 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
isInstalled
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public boolean performAccessibilityAction(View host, int action, Bundle args) { if (action == ACTION_CLICK) { if (host == mLockIcon) { mStatusBar.animateCollapsePanels( CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */); return true; } else if (host == mRightAffordanceView) { launchCamera(CAMERA_LAUNCH_SOURCE_AFFORDANCE); return true; } else if (host == mLeftAffordanceView) { launchLeftAffordance(); return true; } } return super.performAccessibilityAction(host, action, args); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: performAccessibilityAction File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
performAccessibilityAction
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
protected List<Collection> processCollectionFile(Context c, String path, String filename) throws IOException, SQLException { File file = new File(path + File.separatorChar + filename); ArrayList<Collection> collections = new ArrayList<>(); List<Collection> result = null; System.out.println("Processing collections file: " + filename); if(file.exists()) { BufferedReader br = null; try { br = new BufferedReader(new FileReader(file)); String line = null; while ((line = br.readLine()) != null) { DSpaceObject obj = null; if (line.indexOf('/') != -1) { obj = handleService.resolveToObject(c, line); if (obj == null || obj.getType() != Constants.COLLECTION) { obj = null; } } else { obj = collectionService.find(c, UUID.fromString(line)); } if (obj == null) { throw new IllegalArgumentException("Cannot resolve " + line + " to a collection."); } collections.add((Collection)obj); } result = collections; } catch (FileNotFoundException e) { System.out.println("No collections file found."); } finally { if (br != null) { try { br.close(); } catch (IOException e) { System.out.println("Non-critical problem releasing resources."); } } } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processCollectionFile File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
processCollectionFile
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
0
Analyze the following code function for security vulnerabilities
@Override public CharSequence subSequence(int start, int end) { char[] s = new char[end - start]; getChars(start, end, s, 0); SpannableString ss = new SpannableString(new String(s)); TextUtils.copySpansFrom(mSpanned, start, end, Object.class, ss, 0); return ss; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: subSequence File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
subSequence
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
@Nonnull private TwoStrings _readString (@Nonnull final EStringQuoteMode eQuoteMode) throws JsonParseException { final IJsonParsePosition aStartPos = _getCurrentParsePos (); final JsonStringBuilder aStrStringOriginalContent = m_aSB1.reset (); final JsonStringBuilder aStrStringUnescapedContent = m_aSB2.reset (); final int cQuoteChar = eQuoteMode.getQuoteChar (); final int cStart = _readChar (); final boolean bStringIsQuoted = cStart == cQuoteChar; if (bStringIsQuoted) { aStrStringOriginalContent.append ((char) cQuoteChar); } else { if (m_bRequireStringQuotes) throw _parseEx (aStartPos, "Invalid JSON String start character " + _getPrintableChar (cStart) + " - expected " + _getPrintableChar (cQuoteChar)); _backupChar (cStart); aStrStringOriginalContent.append ((char) cQuoteChar); } outer: while (true) { final int c = _readChar (); aStrStringOriginalContent.append ((char) c); switch (c) { case '\\': { // Escape char _readStringEscapeChar (aStartPos, aStrStringOriginalContent, aStrStringUnescapedContent); break; } case EOI: throw _parseEx (aStartPos, "Unclosed JSON String at end of input"); case '\b': case '\f': case '\n': case '\r': case '\t': if (!m_bAllowSpecialCharsInStrings) throw _parseEx (aStartPos, "Invalid JSON String character " + _getPrintableChar (c)); // else fall-though! default: if (bStringIsQuoted) { if (c == cQuoteChar) { // End of quoted string // No append to unescaped content break outer; } } else { if (!_isUnquotedStringValidChar (c)) { // End of unquoted string // Remove from original content _backupChar (c); aStrStringOriginalContent.backup (1); if (aStrStringUnescapedContent.getLength () == 0) throw _parseEx (aStartPos, "Empty unquoted JSON String encountered"); // Since it is present on open, it must also be present on close aStrStringOriginalContent.append ((char) cQuoteChar); break outer; } } // Regular string character aStrStringUnescapedContent.append ((char) c); break; } } return new TwoStrings (aStrStringOriginalContent.getAsString (), aStrStringUnescapedContent.getAsString ()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _readString 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
_readString
ph-json/src/main/java/com/helger/json/parser/JsonParser.java
02a4d034dcfb2b6e1796b25f519bf57a6796edce
0
Analyze the following code function for security vulnerabilities
public List<Modification> modificationsSince(Revision revision) { return gitLog("--date=iso", "--pretty=medium", "--no-decorate", "--no-color", format("%s..%s", revision.getRevision(), remoteBranch())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: modificationsSince File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
modificationsSince
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
private void logVerboseOpenFileInfo(Uri uri, String mode) { Log.v(Constants.TAG, "openFile uri: " + uri + ", mode: " + mode + ", uid: " + Binder.getCallingUid()); Cursor cursor = query(Downloads.Impl.CONTENT_URI, new String[] { "_id" }, null, null, "_id"); if (cursor == null) { Log.v(Constants.TAG, "null cursor in openFile"); } else { try { if (!cursor.moveToFirst()) { Log.v(Constants.TAG, "empty cursor in openFile"); } else { do { Log.v(Constants.TAG, "row " + cursor.getInt(0) + " available"); } while(cursor.moveToNext()); } } finally { cursor.close(); } } cursor = query(uri, new String[] { "_data" }, null, null, null); if (cursor == null) { Log.v(Constants.TAG, "null cursor in openFile"); } else { try { if (!cursor.moveToFirst()) { Log.v(Constants.TAG, "empty cursor in openFile"); } else { String filename = cursor.getString(0); Log.v(Constants.TAG, "filename in openFile: " + filename); if (new java.io.File(filename).isFile()) { Log.v(Constants.TAG, "file exists in openFile"); } } } finally { cursor.close(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logVerboseOpenFileInfo File: src/com/android/providers/downloads/DownloadProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-0848
HIGH
7.2
android
logVerboseOpenFileInfo
src/com/android/providers/downloads/DownloadProvider.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
private static String buildRegex(final String value) { return "\\{\\{" + value + "\\}\\}"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildRegex File: spark/spark-base/src/main/java/com/thoughtworks/go/spark/HtmlErrorPage.java Repository: gocd The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-29183
MEDIUM
4.3
gocd
buildRegex
spark/spark-base/src/main/java/com/thoughtworks/go/spark/HtmlErrorPage.java
bda81084c0401234b168437cf35a63390e3064d1
0
Analyze the following code function for security vulnerabilities
public void execSQL(String sql) throws SQLException { executeSql(sql, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: execSQL File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
execSQL
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
@Override public void dismissNotification(Object o) { NotificationManager notificationManager = (NotificationManager) getContext().getSystemService(Activity.NOTIFICATION_SERVICE); if(o != null){ Integer n = (Integer)o; notificationManager.cancel("CN1", n.intValue()); }else{ notificationManager.cancelAll(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dismissNotification 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
dismissNotification
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public static boolean isIndexValid(int height, long index) { if (index < 0) { throw new IllegalStateException("index must not be negative"); } return index < (1L << height); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isIndexValid File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
isIndexValid
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
@Override public int getUidForIntentSender(IIntentSender sender) { if (sender instanceof PendingIntentRecord) { try { PendingIntentRecord res = (PendingIntentRecord)sender; return res.uid; } catch (ClassCastException e) { } } return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUidForIntentSender 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
getUidForIntentSender
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@NonNull public Builder setAllowSystemGeneratedContextualActions(boolean allowed) { mN.mAllowSystemGeneratedContextualActions = allowed; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAllowSystemGeneratedContextualActions File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setAllowSystemGeneratedContextualActions
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@PostMapping("/save") public ResultDTO<Void> saveAppInfo(@RequestBody ModifyAppInfoRequest req) { req.valid(); AppInfoDO appInfoDO; Long id = req.getId(); if (id == null) { appInfoDO = new AppInfoDO(); appInfoDO.setGmtCreate(new Date()); }else { appInfoDO = appInfoRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("can't find appInfo by id:" + id)); } BeanUtils.copyProperties(req, appInfoDO); appInfoDO.setGmtModified(new Date()); appInfoRepository.saveAndFlush(appInfoDO); return ResultDTO.success(null); }
Vulnerability Classification: - CWE: CWE-522 - CVE: CVE-2020-28865 - Severity: MEDIUM - CVSS Score: 5.0 Description: fix: arbitrary password modification vulnerability #99 Function: saveAppInfo File: powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/controller/AppInfoController.java Repository: PowerJob Fixed Code: @PostMapping("/save") public ResultDTO<Void> saveAppInfo(@RequestBody ModifyAppInfoRequest req) { req.valid(); AppInfoDO appInfoDO; Long id = req.getId(); if (id == null) { appInfoDO = new AppInfoDO(); appInfoDO.setGmtCreate(new Date()); }else { appInfoDO = appInfoRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("can't find appInfo by id:" + id)); // 对比密码 if (!Objects.equals(req.getOldPassword(), appInfoDO.getPassword())) { throw new PowerJobException("The password is incorrect."); } } BeanUtils.copyProperties(req, appInfoDO); appInfoDO.setGmtModified(new Date()); appInfoRepository.saveAndFlush(appInfoDO); return ResultDTO.success(null); }
[ "CWE-522" ]
CVE-2020-28865
MEDIUM
5
PowerJob
saveAppInfo
powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/controller/AppInfoController.java
464ce2dc0ca3e65fa1dc428239829890c52a413a
1
Analyze the following code function for security vulnerabilities
private static boolean equalURL(String url1, String url2) { try { URL u1 = new URL(url1); URL u2 = new URL(url2); int port1 = u1.getPort(); if (port1 == -1) { port1 = u1.getDefaultPort(); } int port2 = u2.getPort(); if (port2 == -1) { port2 = u2.getDefaultPort(); } if ((u1.getProtocol().equalsIgnoreCase(u2.getProtocol())) && (u1.getHost().equalsIgnoreCase(u2.getHost())) && (port1 == port2) && (u1.getPath().equalsIgnoreCase(u2.getPath()))) { return true; } else { return false; } } catch (MalformedURLException m) { debug.message("Error in SAMLUtils.equalURL", m); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equalURL File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java Repository: OpenIdentityPlatform/OpenAM The code follows secure coding practices.
[ "CWE-287" ]
CVE-2023-37471
CRITICAL
9.8
OpenIdentityPlatform/OpenAM
equalURL
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
7c18543d126e8a567b83bb4535631825aaa9d742
0
Analyze the following code function for security vulnerabilities
static void writeAttr(TypedXmlSerializer out, String name, boolean value) throws IOException { if (value) { writeAttr(out, name, "1"); } else { writeAttr(out, name, "0"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeAttr 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
writeAttr
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
private ChannelFuture wrapNonAppData(ChannelHandlerContext ctx, Channel channel) throws SSLException { ChannelFuture future = null; ByteBuffer outNetBuf = bufferPool.acquireBuffer(); SSLEngineResult result; try { for (;;) { synchronized (handshakeLock) { result = engine.wrap(EMPTY_BUFFER, outNetBuf); } if (result.bytesProduced() > 0) { outNetBuf.flip(); ChannelBuffer msg = ctx.getChannel().getConfig().getBufferFactory().getBuffer(outNetBuf.remaining()); // Transfer the bytes to the new ChannelBuffer using some safe method that will also // work with "non" heap buffers // // See https://github.com/netty/netty/issues/329 msg.writeBytes(outNetBuf); outNetBuf.clear(); future = future(channel); future.addListener(new ChannelFutureListener() { public void operationComplete(ChannelFuture future) throws Exception { if (future.getCause() instanceof ClosedChannelException) { synchronized (ignoreClosedChannelExceptionLock) { ignoreClosedChannelException ++; } } } }); write(ctx, future, msg); } final HandshakeStatus handshakeStatus = result.getHandshakeStatus(); handleRenegotiation(handshakeStatus); switch (handshakeStatus) { case FINISHED: setHandshakeSuccess(channel); runDelegatedTasks(); break; case NEED_TASK: runDelegatedTasks(); break; case NEED_UNWRAP: if (!Thread.holdsLock(handshakeLock)) { // unwrap shouldn't be called when this method was // called by unwrap - unwrap will keep running after // this method returns. unwrapNonAppData(ctx, channel); } break; case NOT_HANDSHAKING: if (setHandshakeSuccessIfStillHandshaking(channel)) { runDelegatedTasks(); } break; case NEED_WRAP: break; default: throw new IllegalStateException( "Unexpected handshake status: " + handshakeStatus); } if (result.bytesProduced() == 0) { break; } } } catch (SSLException e) { setHandshakeFailure(channel, e); throw e; } finally { bufferPool.releaseBuffer(outNetBuf); } if (future == null) { future = succeededFuture(channel); } return future; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: wrapNonAppData File: src/main/java/org/jboss/netty/handler/ssl/SslHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-119" ]
CVE-2014-3488
MEDIUM
5
netty
wrapNonAppData
src/main/java/org/jboss/netty/handler/ssl/SslHandler.java
2fa9400a59d0563a66908aba55c41e7285a04994
0
Analyze the following code function for security vulnerabilities
@Override public int checkPermission(String permission, int pid, int uid) { if (permission == null) { return PackageManager.PERMISSION_DENIED; } return checkComponentPermission(permission, pid, uid, -1, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermission 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
checkPermission
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public void batteryPowerChanged(boolean onBattery) { // When plugging in, update the CPU stats first before changing // the plug state. updateCpuStatsNow(); synchronized (mProcLock) { mOnBattery = DEBUG_POWER ? true : onBattery; mOomAdjProfiler.batteryPowerChanged(onBattery); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: batteryPowerChanged 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
batteryPowerChanged
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public VaadinSession findVaadinSession(VaadinRequest request) throws SessionExpiredException { VaadinSession vaadinSession = findOrCreateVaadinSession(request); if (vaadinSession == null) { return null; } VaadinSession.setCurrent(vaadinSession); request.setAttribute(VaadinSession.class.getName(), vaadinSession); return vaadinSession; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findVaadinSession File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
findVaadinSession
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
public JSONObject put(String key, double value) throws JSONException { put(key, new Double(value)); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: src/main/java/org/codehaus/jettison/json/JSONObject.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
put
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@JsonProperty("RevokedBy") public String getRevokedBy() { return revokedBy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRevokedBy File: base/common/src/main/java/com/netscape/certsrv/cert/CertData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getRevokedBy
base/common/src/main/java/com/netscape/certsrv/cert/CertData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
IActivityTaskManager getIActivityTaskManager() { return ActivityTaskManager.getService(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIActivityTaskManager 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
getIActivityTaskManager
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void populateEnvironmentContext(EnvironmentVariableContext environmentVariableContext, MaterialRevision materialRevision, File workingDir) { String toRevision = materialRevision.getRevision().getRevision(); String fromRevision = materialRevision.getOldestRevision().getRevision(); setGoRevisionVariables(environmentVariableContext, fromRevision, toRevision); setGoMaterialVariables(environmentVariableContext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: populateEnvironmentContext File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
populateEnvironmentContext
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
public @Nullable Bundle getEnforcingAdminAndUserDetails(int userId, @Nullable String restriction) { if (mService != null) { try { return mService.getEnforcingAdminAndUserDetails(userId, restriction); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEnforcingAdminAndUserDetails 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
getEnforcingAdminAndUserDetails
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public String selectHeaderAccept(String[] accepts) { if (accepts.length == 0) { return null; } for (String accept : accepts) { if (isJsonMime(accept)) { return accept; } } return StringUtil.join(accepts, ","); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectHeaderAccept 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
selectHeaderAccept
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 boolean isCacheAllowed() { return this.configuration.isCacheAllowed(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCacheAllowed File: xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-api/src/main/java/org/xwiki/rendering/async/internal/block/DefaultBlockAsyncRenderer.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-26471
HIGH
8.8
xwiki/xwiki-platform
isCacheAllowed
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-api/src/main/java/org/xwiki/rendering/async/internal/block/DefaultBlockAsyncRenderer.java
00532d9f1404287cf3ec3a05056640d809516006
0
Analyze the following code function for security vulnerabilities
private void killUid(int appId, int userId, String reason) { final long identity = Binder.clearCallingIdentity(); try { IActivityManager am = ActivityManagerNative.getDefault(); if (am != null) { try { am.killUid(appId, userId, reason); } catch (RemoteException e) { /* ignore - same process */ } } } finally { Binder.restoreCallingIdentity(identity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: killUid 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
killUid
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public I18NKey getName() { return name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getName File: src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java Repository: KrailOrg/krail-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15018
MEDIUM
5.2
KrailOrg/krail-jpa
getName
src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java
c1e848665492e21ef6cc9be443205e36b9a1f6be
0
Analyze the following code function for security vulnerabilities
public static String getPlatform() { return getOperatingSystem()+getBitModel(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPlatform File: hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java Repository: fusesource/hawtjni The code follows secure coding practices.
[ "CWE-94" ]
CVE-2013-2035
MEDIUM
4.4
fusesource/hawtjni
getPlatform
hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java
92c266170ce98edc200c656bd034a237098b8aa5
0
Analyze the following code function for security vulnerabilities
private boolean isDeviceOwnerPackage(String packageName, int userId) { synchronized (getLockObject()) { return mOwners.hasDeviceOwner() && mOwners.getDeviceOwnerUserId() == userId && mOwners.getDeviceOwnerPackageName().equals(packageName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDeviceOwnerPackage 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
isDeviceOwnerPackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean isShallow() { return new File(workingDir, ".git/shallow").exists(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isShallow File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
isShallow
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
public Configuration computeNewConfiguration() { synchronized (mWindowMap) { return computeNewConfigurationLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: computeNewConfiguration 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
computeNewConfiguration
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public void deselect(T item) { getSelectionModel().deselect(item); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deselect 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
deselect
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
protected String getOCSubjectEventFormSql(String studyIds, String sedIds, String itemIds, String dateConstraint, int datasetItemStatusId) { return "select ss.oc_oid as study_subject_oid, ss.label, ss.unique_identifier, ss.secondary_label, ss.gender, ss.date_of_birth," + " ss.status_id, ss.sgc_id, ss.sgc_name, ss.sg_name, sed.ordinal as definition_order, sed.oc_oid as definition_oid, sed.repeating as definition_repeating," + " se.sample_ordinal as sample_ordinal, se.se_location, se.date_start, se.date_end, se.start_time_flag," + " se.end_time_flag, se.subject_event_status_id as event_status_id, edc.ordinal as crf_order," + " cv.oc_oid as crf_version_oid, cv.name as crf_version, cv.status_id as cv_status_id, ec.status_id as ec_status_id, ec.event_crf_id, ec.date_interviewed," + " ec.interviewer_name, ec.validator_id from (select study_event_id, study_event_definition_id, study_subject_id, location as se_location," + " sample_ordinal, date_start, date_end, subject_event_status_id, start_time_flag, end_time_flag from study_event " + " where study_event_definition_id in " + sedIds + " and study_subject_id in (select ss.study_subject_id from study_subject ss where ss.study_id in (" + studyIds + ") " + dateConstraint + ")) se, ( select st_sub.oc_oid, st_sub.study_subject_id, st_sub.label," + " st_sub.secondary_label, st_sub.subject_id, st_sub.unique_identifier, st_sub.gender, st_sub.date_of_birth, st_sub.status_id," + " sb_g.sgc_id, sb_g.sgc_name, sb_g.sg_id, sb_g.sg_name from (select ss.oc_oid, ss.study_subject_id, ss.label, ss.secondary_label, ss.subject_id," + " s.unique_identifier, s.gender, s.date_of_birth, s.status_id from study_subject ss, subject s where ss.study_id in (" + studyIds + ") " + dateConstraint + " and ss.subject_id = s.subject_id)st_sub left join (select sgm.study_subject_id, sgc.study_group_class_id as sgc_id, sgc.name as sgc_name," + " sg.study_group_id as sg_id, sg.name as sg_name from subject_group_map sgm, study_group_class sgc, study_group sg where sgc.study_id in (" + studyIds + ") and sgm.study_group_class_id = sgc.study_group_class_id and sgc.study_group_class_id = sg.study_group_class_id" + " and sgm.study_group_id = sg.study_group_id) sb_g on st_sub.study_subject_id = sb_g.study_subject_id) ss, " + " study_event_definition sed, event_definition_crf edc," + " (select event_crf_id, crf_version_id, study_event_id, status_id, date_interviewed, interviewer_name, validator_id from event_crf where event_crf_id in (" + getEventCrfIdsByItemDataSql(studyIds, sedIds, itemIds, dateConstraint, datasetItemStatusId) + ")) ec, crf_version cv" + " where sed.study_event_definition_id in " + sedIds + " and sed.study_event_definition_id = se.study_event_definition_id and se.study_subject_id = ss.study_subject_id" + " and sed.study_event_definition_id = edc.study_event_definition_id and se.study_event_id = ec.study_event_id" + " and edc.crf_id = cv.crf_id and ec.crf_version_id = cv.crf_version_id order by ss.oc_oid, sed.ordinal, se.sample_ordinal, edc.ordinal, ss.sgc_id"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOCSubjectEventFormSql File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getOCSubjectEventFormSql
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public void setIncludeModifiedFiles(boolean includeModifiedFiles) { this.includeModifiedFiles = includeModifiedFiles; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIncludeModifiedFiles File: server/src/main/java/com/thoughtworks/go/server/presentation/models/MaterialRevisionsJsonBuilder.java Repository: gocd The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-28629
MEDIUM
5.4
gocd
setIncludeModifiedFiles
server/src/main/java/com/thoughtworks/go/server/presentation/models/MaterialRevisionsJsonBuilder.java
95f758229d419411a38577608709d8552cccf193
0
Analyze the following code function for security vulnerabilities
public void sendRemoveCall(String id) throws Exception { for (IConnectionServiceAdapter a : mConnectionServiceAdapters) { a.removeCall(id, null /*Session.Info*/); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendRemoveCall File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
sendRemoveCall
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public void setName(String name) { this.name = name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setName File: server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-94" ]
CVE-2021-21248
MEDIUM
6.5
theonedev/onedev
setName
server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java
39d95ab8122c5d9ed18e69dc024870cae08d2d60
0
Analyze the following code function for security vulnerabilities
@Override public PermissionGroupInfo getPermissionGroupInfo(String name, int flags) { // reader synchronized (mPackages) { return PackageParser.generatePermissionGroupInfo( mPermissionGroups.get(name), flags); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermissionGroupInfo 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
getPermissionGroupInfo
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private static byte[] generateSignerBlock( SignerConfig signerConfig, Map<ContentDigestAlgorithm, byte[]> contentDigests, boolean v3SigningEnabled) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException { if (signerConfig.certificates.isEmpty()) { throw new SignatureException("No certificates configured for signer"); } PublicKey publicKey = signerConfig.certificates.get(0).getPublicKey(); byte[] encodedPublicKey = encodePublicKey(publicKey); V2SignatureSchemeBlock.SignedData signedData = new V2SignatureSchemeBlock.SignedData(); try { signedData.certificates = encodeCertificates(signerConfig.certificates); } catch (CertificateEncodingException e) { throw new SignatureException("Failed to encode certificates", e); } List<Pair<Integer, byte[]>> digests = new ArrayList<>(signerConfig.signatureAlgorithms.size()); for (SignatureAlgorithm signatureAlgorithm : signerConfig.signatureAlgorithms) { ContentDigestAlgorithm contentDigestAlgorithm = signatureAlgorithm.getContentDigestAlgorithm(); byte[] contentDigest = contentDigests.get(contentDigestAlgorithm); if (contentDigest == null) { throw new RuntimeException( contentDigestAlgorithm + " content digest for " + signatureAlgorithm + " not computed"); } digests.add(Pair.of(signatureAlgorithm.getId(), contentDigest)); } signedData.digests = digests; signedData.additionalAttributes = generateAdditionalAttributes(v3SigningEnabled); V2SignatureSchemeBlock.Signer signer = new V2SignatureSchemeBlock.Signer(); // FORMAT: // * length-prefixed sequence of length-prefixed digests: // * uint32: signature algorithm ID // * length-prefixed bytes: digest of contents // * length-prefixed sequence of certificates: // * length-prefixed bytes: X.509 certificate (ASN.1 DER encoded). // * length-prefixed sequence of length-prefixed additional attributes: // * uint32: ID // * (length - 4) bytes: value signer.signedData = encodeAsSequenceOfLengthPrefixedElements( new byte[][] { encodeAsSequenceOfLengthPrefixedPairsOfIntAndLengthPrefixedBytes( signedData.digests), encodeAsSequenceOfLengthPrefixedElements(signedData.certificates), signedData.additionalAttributes, new byte[0], }); signer.publicKey = encodedPublicKey; signer.signatures = new ArrayList<>(); signer.signatures = ApkSigningBlockUtils.generateSignaturesOverData(signerConfig, signer.signedData); // FORMAT: // * length-prefixed signed data // * length-prefixed sequence of length-prefixed signatures: // * uint32: signature algorithm ID // * length-prefixed bytes: signature of signed data // * length-prefixed bytes: public key (X.509 SubjectPublicKeyInfo, ASN.1 DER encoded) return encodeAsSequenceOfLengthPrefixedElements( new byte[][] { signer.signedData, encodeAsSequenceOfLengthPrefixedPairsOfIntAndLengthPrefixedBytes( signer.signatures), signer.publicKey, }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateSignerBlock File: src/main/java/com/android/apksig/internal/apk/v2/V2SchemeSigner.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
generateSignerBlock
src/main/java/com/android/apksig/internal/apk/v2/V2SchemeSigner.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
public ConstantPool getConstantPool() { return constantPool; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConstantPool File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
getConstantPool
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
@Override public int getKeyguardDisabledFeatures(ComponentName who, int userHandle, boolean parent) { if (!mHasFeature) { return 0; } Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId"); final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle)); Preconditions.checkCallAuthorization( who == null || isCallingFromPackage(who.getPackageName(), caller.getUid()) || isSystemUid(caller)); int affectedUserId = parent ? getProfileParentId(userHandle) : userHandle; synchronized (getLockObject()) { if (who != null) { if (isUnicornFlagEnabled()) { EnforcingAdmin admin = getEnforcingAdminForPackage( who, who.getPackageName(), userHandle); Integer features = mDevicePolicyEngine.getLocalPolicySetByAdmin( PolicyDefinition.KEYGUARD_DISABLED_FEATURES, admin, affectedUserId); return features == null ? 0 : features; } else { ActiveAdmin admin = getActiveAdminUncheckedLocked(who, userHandle, parent); return (admin != null) ? admin.disabledKeyguardFeatures : 0; } } if (isUnicornFlagEnabled()) { Integer features = mDevicePolicyEngine.getResolvedPolicy( PolicyDefinition.KEYGUARD_DISABLED_FEATURES, affectedUserId); return Binder.withCleanCallingIdentity(() -> { int combinedFeatures = features == null ? 0 : features; List<UserInfo> profiles = mUserManager.getProfiles(affectedUserId); for (UserInfo profile : profiles) { int profileId = profile.id; if (profileId == affectedUserId) { continue; } Integer profileFeatures = mDevicePolicyEngine.getResolvedPolicy( PolicyDefinition.KEYGUARD_DISABLED_FEATURES, profileId); if (profileFeatures != null) { combinedFeatures |= (profileFeatures & PROFILE_KEYGUARD_FEATURES_AFFECT_OWNER); } } return combinedFeatures; }); } final long ident = mInjector.binderClearCallingIdentity(); try { final List<ActiveAdmin> admins; if (!parent && isManagedProfile(userHandle)) { // If we are being asked about a managed profile, just return keyguard features // disabled by admins in the profile. admins = getUserDataUnchecked(userHandle).mAdminList; } else { // Otherwise return those set by admins in the user and its profiles. admins = getActiveAdminsForLockscreenPoliciesLocked( getProfileParentUserIfRequested(userHandle, parent)); } int which = DevicePolicyManager.KEYGUARD_DISABLE_FEATURES_NONE; final int N = admins.size(); for (int i = 0; i < N; i++) { ActiveAdmin admin = admins.get(i); int userId = admin.getUserHandle().getIdentifier(); boolean isRequestedUser = !parent && (userId == userHandle); if (isRequestedUser || !isManagedProfile(userId)) { // If we are being asked explicitly about this user // return all disabled features even if its a managed profile. which |= admin.disabledKeyguardFeatures; } else { // Otherwise a managed profile is only allowed to disable // some features on the parent user. which |= (admin.disabledKeyguardFeatures & PROFILE_KEYGUARD_FEATURES_AFFECT_OWNER); } } return which; } finally { mInjector.binderRestoreCallingIdentity(ident); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKeyguardDisabledFeatures File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getKeyguardDisabledFeatures
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void checkPathAccess(String path, PathActionLevel pathActionLevel) { var whitelisted = false; var blacklisted = false; try { if ("<<ALL FILES>>".equals(path)) { //$NON-NLS-1$ blacklisted = true; } else { String commonPath = getFilePermissionsCommonPath(path); if (commonPath == null) { var absolutePath = Path.of(path).toAbsolutePath(); blacklisted = isPathBlacklisted(absolutePath, pathActionLevel); whitelisted = isPathWhitelisted(absolutePath, pathActionLevel); } else { var absolutePath = Path.of(commonPath).toAbsolutePath(); blacklisted = !configuration.blacklistedPaths().isEmpty(); whitelisted = !blacklisted && configuration.whitelistedPaths().orElse(Set.of()).stream() .anyMatch(pm -> pm.matchesRecursivelyWithLevel(absolutePath, pathActionLevel)); } } if (!blacklisted && whitelisted) return; } catch (Exception e) { LOG.warn("Error in checkPathAccess", e); //$NON-NLS-1$ } if (isMainThreadAndInactive() && pathActionLevel.isBelowOrEqual(PathActionLevel.READLINK)) { LOG.trace("Allowing read access for main thread inbetween tests"); // appears very often //$NON-NLS-1$ return; } var message = String.format("BAD PATH ACCESS: %s (BL:%s, WL:%s)", path, blacklisted, whitelisted); //$NON-NLS-1$ if (configuration == null || configuration.threadTrustScope() == TrustScope.MINIMAL) { /* * If the configuration is not present or minimal, we keep the old behavior, as * we can protect resources better if the thread whitelisting is restricted. */ checkForNonWhitelistedStackFrames(() -> { LOG.warn(message); return formatLocalized("security.error_path_access", path); //$NON-NLS-1$ }); } else { /* * this is stricter with IGNORE_ACCESS_PRIVILEGED because we can now regulate * wich paths are accessed in more detail (necessary to have a somewhat decent * and secure configuration */ checkForNonWhitelistedStackFrames(() -> { LOG.warn(message); return formatLocalized("security.error_path_access", path); //$NON-NLS-1$ }, IGNORE_ACCESS_PRIVILEGED); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPathAccess File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2024-23683
HIGH
8.2
ls1intum/Ares
checkPathAccess
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
af4f28a56e2fe600d8750b3b415352a0a3217392
0
Analyze the following code function for security vulnerabilities
@Override public void addMediaStateChangeListener(ActionListener<MediaStateChangeEvent> l) { stateChangeListeners.addListener(l); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addMediaStateChangeListener 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
addMediaStateChangeListener
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private void setRootLevel(Level newRootLevel) { Configurator.setRootLevel(newRootLevel); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRootLevel File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
setRootLevel
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private Set<String> removeRemotePresences(String oortURL) { Set<String> userIds = new HashSet<>(); synchronized (_uid2Location) { Iterator<Map.Entry<String, Set<Location>>> entries = _uid2Location.entrySet().iterator(); while (entries.hasNext()) { Map.Entry<String, Set<Location>> entry = entries.next(); Set<Location> userLocations = entry.getValue(); Iterator<Location> iterator = userLocations.iterator(); while (iterator.hasNext()) { Location location = iterator.next(); if (location instanceof SetiLocation) { if (oortURL.equals(((SetiLocation)location)._oortURL)) { iterator.remove(); userIds.add(entry.getKey()); break; } } } if (userLocations.isEmpty()) { entries.remove(); } } } return userIds; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeRemotePresences File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
removeRemotePresences
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
boolean isLastConfigReportedToClient() { return mLastConfigReportedToClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLastConfigReportedToClient File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
isLastConfigReportedToClient
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public String create() { setLastseen(System.currentTimeMillis()); client().create(this); return getId(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: create File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
create
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public Jooby onStarted(final Throwing.Runnable callback) { LifeCycle.super.onStarted(callback); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onStarted File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
onStarted
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Override public void onWnmFrameReceived(WnmData event) { // Empty }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onWnmFrameReceived File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
onWnmFrameReceived
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
private static void dumpHost(Host host, int index, PrintWriter pw) { pw.print(" ["); pw.print(index); pw.print("] hostId="); pw.println(host.id); pw.print(" callbacks="); pw.println(host.callbacks); pw.print(" widgets.size="); pw.print(host.widgets.size()); pw.print(" zombie="); pw.println(host.zombie); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpHost File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
dumpHost
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
private void resizeStackWithBoundsFromWindowManager(int stackId, boolean deferResume) { final Rect newStackBounds = new Rect(); final ActivityStack stack = mStackSupervisor.getStack(stackId); // TODO(b/71548119): Revert CL introducing below once cause of mismatch is found. if (stack == null) { final StringWriter writer = new StringWriter(); final PrintWriter printWriter = new PrintWriter(writer); mStackSupervisor.dumpDisplays(printWriter); printWriter.flush(); Log.wtf(TAG, "stack not found:" + stackId + " displays:" + writer); } stack.getBoundsForNewConfiguration(newStackBounds); mStackSupervisor.resizeStackLocked( stack, !newStackBounds.isEmpty() ? newStackBounds : null /* bounds */, null /* tempTaskBounds */, null /* tempTaskInsetBounds */, false /* preserveWindows */, false /* allowResizeInDockedMode */, deferResume); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resizeStackWithBoundsFromWindowManager 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
resizeStackWithBoundsFromWindowManager
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public long getOrdinal(String fieldValue) { return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOrdinal File: server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-94" ]
CVE-2021-21248
MEDIUM
6.5
theonedev/onedev
getOrdinal
server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java
39d95ab8122c5d9ed18e69dc024870cae08d2d60
0
Analyze the following code function for security vulnerabilities
protected abstract <T> GridSelectionModel<T> createModel();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createModel 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
createModel
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override public BaseObject remove(int index) { rangeCheck(index); return this.map.remove(index); }
Vulnerability Classification: - CWE: CWE-787 - CVE: CVE-2023-26470 - Severity: HIGH - CVSS Score: 7.5 Description: XWIKI-19223: Improve xobject memory storage in XWikidocument * fix List#remove implementation * override List#clear implementation for performances Function: remove File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/doc/BaseObjects.java Repository: xwiki/xwiki-platform Fixed Code: @Override public BaseObject remove(int index) { rangeCheck(index); BaseObject previous = this.map.remove(index); // Shifts right values to the left if (index < this.size - 1) { for (int i = index; i < this.size - 1; ++i) { put(i, get(i + 1)); } } // The list is one element shorter --this.size; return previous; }
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
remove
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/doc/BaseObjects.java
fdfce062642b0ac062da5cda033d25482f4600fa
1
Analyze the following code function for security vulnerabilities
private void filter(@NonNull final List<ShortcutInfo> result, @Nullable final Predicate<ShortcutInfo> query, final int cloneFlag, @Nullable final String callingLauncher, @NonNull final ArraySet<String> pinnedByCallerSet, final boolean getPinnedByAnyLauncher, @NonNull final ShortcutInfo si) { // Need to adjust PINNED flag depending on the caller. // Basically if the caller is a launcher (callingLauncher != null) and the launcher // isn't pinning it, then we need to clear PINNED for this caller. final boolean isPinnedByCaller = (callingLauncher == null) || ((pinnedByCallerSet != null) && pinnedByCallerSet.contains(si.getId())); if (!getPinnedByAnyLauncher) { if (si.isFloating() && !si.isCached()) { if (!isPinnedByCaller) { return; } } } final ShortcutInfo clone = si.clone(cloneFlag); // Fix up isPinned for the caller. Note we need to do it before the "test" callback, // since it may check isPinned. // However, if getPinnedByAnyLauncher is set, we do it after the test. if (!getPinnedByAnyLauncher) { if (!isPinnedByCaller) { clone.clearFlags(ShortcutInfo.FLAG_PINNED); } } if (query == null || query.test(clone)) { if (!isPinnedByCaller) { clone.clearFlags(ShortcutInfo.FLAG_PINNED); } result.add(clone); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filter File: services/core/java/com/android/server/pm/ShortcutPackage.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40075
MEDIUM
5.5
android
filter
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
public boolean getTitlePrinted() { return mTitlePrinted; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTitlePrinted 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
getTitlePrinted
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public void addDateHeader(String name, long date) { addHeader(name, formatHeaderDate(new Date(date))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addDateHeader File: src/java/winstone/WinstoneResponse.java Repository: jenkinsci/winstone The code follows secure coding practices.
[ "CWE-79" ]
CVE-2011-4344
LOW
2.6
jenkinsci/winstone
addDateHeader
src/java/winstone/WinstoneResponse.java
410ed3001d51c689cf59085b7417466caa2ded7b
0
Analyze the following code function for security vulnerabilities
public String getKeyName() { return this.keyName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKeyName File: src/main/java/org/cryptacular/CiphertextHeader.java Repository: vt-middleware/cryptacular The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-7226
MEDIUM
5
vt-middleware/cryptacular
getKeyName
src/main/java/org/cryptacular/CiphertextHeader.java
8c6c7528f1e24c6b71f3e36db0cb8a697256ce25
0
Analyze the following code function for security vulnerabilities
public XWikiAttachment setAttachment(String fileName, InputStream content, XWikiContext context) throws IOException { int i = fileName.indexOf('\\'); if (i == -1) { i = fileName.indexOf('/'); } String filename = fileName.substring(i + 1); XWikiAttachment attachment = getAttachment(filename); if (attachment == null) { attachment = new XWikiAttachment(this, filename); // Add the attachment in the current doc setAttachment(attachment); } attachment.setContent(content); attachment.setAuthorReference(context.getUserReference()); return attachment; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAttachment File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
setAttachment
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
static void dumpApps(IndentingPrintWriter pw, String name, String[] apps) { dumpApps(pw, name, Arrays.asList(apps)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpApps 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
dumpApps
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static String getInternalPropertyName(String propname, XWikiContext context) { ContextualLocalizationManager localizationManager = Utils.getComponent(ContextualLocalizationManager.class); String cpropname = StringUtils.capitalize(propname); return localizationManager == null ? cpropname : localizationManager.getTranslationPlain(cpropname); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInternalPropertyName File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getInternalPropertyName
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
@Override public List<Intent> getAllSourceIntents() { final List<Intent> results = new ArrayList<>(); if (mSourceInfo != null) { // We only queried the service for the first one in our sourceinfo. results.add(mSourceInfo.getAllSourceIntents().get(0)); } return results; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllSourceIntents File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
getAllSourceIntents
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
@Override public AviatorObject call(Map<String, Object> env, AviatorObject arg) { if (arg == null) { return AviatorBoolean.FALSE; } Object keyTmp = arg.getValue(env); if (Objects.isNull(keyTmp)) { return AviatorBoolean.FALSE; } else { String key = String.valueOf(keyTmp); return AviatorBoolean.valueOf(StringUtils.isNotEmpty(key)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: call File: common/src/main/java/org/dromara/hertzbeat/common/config/AviatorConfiguration.java Repository: apache/hertzbeat The code follows secure coding practices.
[ "CWE-94" ]
CVE-2023-51387
HIGH
8.8
apache/hertzbeat
call
common/src/main/java/org/dromara/hertzbeat/common/config/AviatorConfiguration.java
8dcf050e27ca95d15460a7ba98a3df8a9cd1d3d2
0
Analyze the following code function for security vulnerabilities
private JsonNode yamlPathToJson(Path path) throws IOException { Yaml reader = new Yaml(); ObjectMapper mapper = new ObjectMapper(); Path p; try (InputStream in = Files.newInputStream(path)) { return mapper.valueToTree(reader.load(in)); } }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2021-41110 - Severity: HIGH - CVSS Score: 7.5 Description: Use Yaml SafeConstructor (#355) Function: yamlPathToJson File: src/main/java/org/commonwl/view/cwl/CWLService.java Repository: common-workflow-language/cwlviewer Fixed Code: private JsonNode yamlPathToJson(Path path) throws IOException { Yaml reader = new Yaml(new SafeConstructor()); ObjectMapper mapper = new ObjectMapper(); try (InputStream in = Files.newInputStream(path)) { return mapper.valueToTree(reader.load(in)); } }
[ "CWE-502" ]
CVE-2021-41110
HIGH
7.5
common-workflow-language/cwlviewer
yamlPathToJson
src/main/java/org/commonwl/view/cwl/CWLService.java
f6066f09edb70033a2ce80200e9fa9e70a5c29de
1
Analyze the following code function for security vulnerabilities
private static boolean hasParameter(VaadinRequest request, String parameterName) { return request.getParameter(parameterName) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasParameter File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
hasParameter
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
private void createContentTypeWorkflowActionMappingTable() throws SQLException { Logger.info(this, "Creates the table content_type_workflow_action_mapping."); try { new DotConnect().executeStatement(getCreateContentTypeWorkflowActionMappingTableSQL()); } catch (SQLException e) { Logger.error(this, "The table 'content_type_workflow_action_mapping' could not be created.", e); throw e; } }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-17542 - Severity: LOW - CVSS Score: 3.5 Description: #16890 renaming the content_type_workflow_action_mapping to workflow_action_mappings Function: createContentTypeWorkflowActionMappingTable File: dotCMS/src/main/java/com/dotmarketing/startup/runonce/Task05165CreateContentTypeWorkflowActionMappingTable.java Repository: dotCMS/core Fixed Code: private void createContentTypeWorkflowActionMappingTable() throws SQLException { Logger.info(this, "Creates the table workflow_action_mappings."); try { new DotConnect().executeStatement(getCreateContentTypeWorkflowActionMappingTableSQL()); } catch (SQLException e) { Logger.error(this, "The table 'workflow_action_mappings' could not be created.", e); throw e; } }
[ "CWE-79" ]
CVE-2020-17542
LOW
3.5
dotCMS/core
createContentTypeWorkflowActionMappingTable
dotCMS/src/main/java/com/dotmarketing/startup/runonce/Task05165CreateContentTypeWorkflowActionMappingTable.java
782c342b660d359a71e190c8b5110bc651736591
1
Analyze the following code function for security vulnerabilities
@Override public Connection getConnection(Context context) throws SQLException { DatabaseTypePojo type = databaseTypeDao.selectByDatabaseType(context.getDatabaseType()); File driverFile = driverResources.loadOrDownload(context.getDatabaseType(), type.getJdbcDriverFileUrl()); URLClassLoader loader = null; try { loader = new URLClassLoader( new URL[]{ driverFile.toURI().toURL() }, this.getClass().getClassLoader() ); } catch (MalformedURLException e) { log.error("load driver error " + context, e); throw DomainErrors.CONNECT_DATABASE_FAILED.exception(e.getMessage()); } // retrieve the driver class Class<?> clazz = null; Driver driver = null; try { clazz = Class.forName(type.getJdbcDriverClassName(), true, loader); driver = (Driver) clazz.getConstructor().newInstance(); } catch (ClassNotFoundException e) { log.error("init driver error", e); throw DomainErrors.CONNECT_DATABASE_FAILED.exception("驱动初始化异常, 请检查 Driver name:" + e.getMessage()); } catch (InvocationTargetException | InstantiationException | IllegalAccessException | NoSuchMethodException e) { log.error("init driver error", e); throw DomainErrors.CONNECT_DATABASE_FAILED.exception("驱动初始化异常:" + e.getMessage()); } String urlPattern = type.getUrlPattern(); String jdbcUrl = urlPattern.replace("{{jdbc.protocol}}", type.getJdbcProtocol()) .replace("{{db.url}}", context.getUrl()) .replace("{{db.name}}", context.getDatabaseName()) .replace("{{db.schema}}", context.getSchemaName()); Properties info = new Properties(); info.put("user", context.getUsername()); info.put("password", context.getPassword()); return driver.connect(jdbcUrl, info); }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2022-24861 - Severity: MEDIUM - CVSS Score: 6.5 Description: fix some security bug (#103) * fix: use hard-code secret * feat: add driver class validate * feat: optimize drvier resource code * fix:ut failed Function: getConnection File: core/src/main/java/com/databasir/core/infrastructure/connection/CustomDatabaseConnectionFactory.java Repository: vran-dev/databasir Fixed Code: @Override public Connection getConnection(Context context) throws SQLException { String databaseType = context.getDatabaseType(); DatabaseTypePojo type = databaseTypeDao.selectByDatabaseType(databaseType); File driverFile = driverResources.loadOrDownloadByDatabaseType(databaseType, type.getJdbcDriverFileUrl()); URLClassLoader loader = null; try { loader = new URLClassLoader( new URL[]{ driverFile.toURI().toURL() }, this.getClass().getClassLoader() ); } catch (MalformedURLException e) { log.error("load driver error " + context, e); throw DomainErrors.CONNECT_DATABASE_FAILED.exception(e.getMessage()); } // retrieve the driver class Class<?> clazz = null; Driver driver = null; try { clazz = Class.forName(type.getJdbcDriverClassName(), false, loader); driver = (Driver) clazz.getConstructor().newInstance(); } catch (ClassNotFoundException e) { log.error("init driver error", e); throw DomainErrors.CONNECT_DATABASE_FAILED.exception("驱动初始化异常, 请检查驱动类名:" + e.getMessage()); } catch (InvocationTargetException | InstantiationException | IllegalAccessException | NoSuchMethodException e) { log.error("init driver error", e); throw DomainErrors.CONNECT_DATABASE_FAILED.exception("驱动初始化异常:" + e.getMessage()); } String urlPattern = type.getUrlPattern(); String jdbcUrl = urlPattern.replace("{{jdbc.protocol}}", type.getJdbcProtocol()) .replace("{{db.url}}", context.getUrl()) .replace("{{db.name}}", context.getDatabaseName()) .replace("{{db.schema}}", context.getSchemaName()); Properties info = new Properties(); info.put("user", context.getUsername()); info.put("password", context.getPassword()); return driver.connect(jdbcUrl, info); }
[ "CWE-20" ]
CVE-2022-24861
MEDIUM
6.5
vran-dev/databasir
getConnection
core/src/main/java/com/databasir/core/infrastructure/connection/CustomDatabaseConnectionFactory.java
ca22a8fef7a31c0235b0b2951260a7819b89993b
1
Analyze the following code function for security vulnerabilities
public boolean getLocked() { try { XWikiLock lock = this.doc.getLock(getXWikiContext()); if (lock != null && !getXWikiContext().getUser().equals(lock.getUserName())) { return true; } else { return false; } } catch (Exception e) { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocked File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getLocked
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public User doCreateAccount(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { return _doCreateAccount(req, rsp, "signup.jelly"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doCreateAccount File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-200" ]
CVE-2014-2064
MEDIUM
5
jenkinsci/jenkins
doCreateAccount
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
fbf96734470caba9364f04e0b77b0bae7293a1ec
0
Analyze the following code function for security vulnerabilities
public <R> R sendAndReceive(final Function<HttpResponse, R> responseHandler) { return responseHandler.apply(send()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendAndReceive File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
sendAndReceive
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
private boolean done() { return shutdownTimestamp != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: done File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
done
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
protected void setRoamingType(ServiceState currentServiceState) { final boolean isVoiceInService = (currentServiceState.getVoiceRegState() == ServiceState.STATE_IN_SERVICE); if (isVoiceInService) { if (currentServiceState.getVoiceRoaming()) { // check roaming type by MCC if (inSameCountry(currentServiceState.getVoiceOperatorNumeric())) { currentServiceState.setVoiceRoamingType( ServiceState.ROAMING_TYPE_DOMESTIC); } else { currentServiceState.setVoiceRoamingType( ServiceState.ROAMING_TYPE_INTERNATIONAL); } } else { currentServiceState.setVoiceRoamingType(ServiceState.ROAMING_TYPE_NOT_ROAMING); } } final boolean isDataInService = (currentServiceState.getDataRegState() == ServiceState.STATE_IN_SERVICE); final int dataRegType = currentServiceState.getRilDataRadioTechnology(); if (isDataInService) { if (!currentServiceState.getDataRoaming()) { currentServiceState.setDataRoamingType(ServiceState.ROAMING_TYPE_NOT_ROAMING); } else if (ServiceState.isGsm(dataRegType)) { if (isVoiceInService) { // GSM data should have the same state as voice currentServiceState.setDataRoamingType(currentServiceState .getVoiceRoamingType()); } else { // we can not decide GSM data roaming type without voice currentServiceState.setDataRoamingType(ServiceState.ROAMING_TYPE_UNKNOWN); } } else { // we can not decide 3gpp2 roaming state here currentServiceState.setDataRoamingType(ServiceState.ROAMING_TYPE_UNKNOWN); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRoamingType File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
setRoamingType
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
@Override public int getDisplayId() { synchronized (mService) { if (mActivityDisplay != null) { return mActivityDisplay.mDisplayId; } } return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDisplayId File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
getDisplayId
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public void setSubscriptionUpdate(UpdateParameter subscriptionUpdate) { mSubscriptionUpdate = subscriptionUpdate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSubscriptionUpdate File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
setSubscriptionUpdate
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
private Map < String, Property<?>> parseProperties(String prefix, Map<String, String> mapConfigProperties) { Map < String, Property<?>> result = new HashMap<>(); int idx = 0; String currentPropertyKey = prefix + "." + idx; while (mapConfigProperties.containsKey(currentPropertyKey + "." + PROPERTY_PARAMNAME)) { assertKeyNotEmpty(mapConfigProperties, currentPropertyKey + "." + PROPERTY_PARAMNAME); String name = mapConfigProperties.get(currentPropertyKey + "." + PROPERTY_PARAMNAME); assertKeyNotEmpty(mapConfigProperties, currentPropertyKey + "." + PROPERTY_PARAMVALUE); String strValue = mapConfigProperties.get(currentPropertyKey + "." + PROPERTY_PARAMVALUE); Property<?> ap = new PropertyString(name, strValue); String optionalType = mapConfigProperties.get(currentPropertyKey + "." + PROPERTY_PARAMTYPE); // If specific type defined ? if (null != optionalType) { // Substitution if relevant (e.g. 'int' -> 'org.ff4j.property.PropertyInt') optionalType = MappingUtil.mapPropertyType(optionalType); try { // Constructor (String, String) is mandatory in Property interface Constructor<?> constr = Class.forName(optionalType).getConstructor(String.class, String.class); ap = (Property<?>) constr.newInstance(name, strValue); } catch (Exception e) { throw new IllegalArgumentException("Cannot instantiate '" + optionalType + "' check default constructor", e); } } // Description String description = mapConfigProperties.get(currentPropertyKey + "." + PROPERTY_PARAMDESCRIPTION); if (null != description) { ap.setDescription(description); } // Fixed Values String strFixedValues = mapConfigProperties.get(currentPropertyKey + "." + PROPERTY_PARAMFIXED_VALUES); if (null != strFixedValues && !"".equals(strFixedValues)) { Arrays.asList(strValue.split(",")) .stream() .map(String::trim) .forEach(ap::add2FixedValueFromString); } // Check fixed value if (ap.getFixedValues() != null && !ap.getFixedValues().isEmpty() && !ap.getFixedValues().contains(ap.getValue())) { throw new IllegalArgumentException("Cannot create property <" + ap.getName() + "> invalid value <" + ap.getValue() + "> expected one of " + ap.getFixedValues()); } result.put(ap.getName(), ap); // ff4j.properties.X currentPropertyKey = prefix + "." + ++idx; } return result; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2022-44262 - Severity: CRITICAL - CVSS Score: 9.8 Description: fix: Add assignable check to PropertiesParser, YamlParser and XmlParser (#624) Function: parseProperties File: ff4j-config-properties/src/main/java/org/ff4j/parser/properties/PropertiesParser.java Repository: ff4j Fixed Code: private Map < String, Property<?>> parseProperties(String prefix, Map<String, String> mapConfigProperties) { Map < String, Property<?>> result = new HashMap<>(); int idx = 0; String currentPropertyKey = prefix + "." + idx; while (mapConfigProperties.containsKey(currentPropertyKey + "." + PROPERTY_PARAMNAME)) { assertKeyNotEmpty(mapConfigProperties, currentPropertyKey + "." + PROPERTY_PARAMNAME); String name = mapConfigProperties.get(currentPropertyKey + "." + PROPERTY_PARAMNAME); assertKeyNotEmpty(mapConfigProperties, currentPropertyKey + "." + PROPERTY_PARAMVALUE); String strValue = mapConfigProperties.get(currentPropertyKey + "." + PROPERTY_PARAMVALUE); Property<?> ap = new PropertyString(name, strValue); String optionalType = mapConfigProperties.get(currentPropertyKey + "." + PROPERTY_PARAMTYPE); // If specific type defined ? if (null != optionalType) { // Substitution if relevant (e.g. 'int' -> 'org.ff4j.property.PropertyInt') optionalType = MappingUtil.mapPropertyType(optionalType); try { // Constructor (String, String) is mandatory in Property interface Class<?> typeClass = Class.forName(optionalType); if (!Property.class.isAssignableFrom(typeClass)) { throw new IllegalArgumentException("Cannot create property <" + name + "> invalid type <" + optionalType + ">"); } Constructor<?> constr = typeClass.getConstructor(String.class, String.class); ap = (Property<?>) constr.newInstance(name, strValue); } catch (Exception e) { throw new IllegalArgumentException("Cannot instantiate '" + optionalType + "' check default constructor", e); } } // Description String description = mapConfigProperties.get(currentPropertyKey + "." + PROPERTY_PARAMDESCRIPTION); if (null != description) { ap.setDescription(description); } // Fixed Values String strFixedValues = mapConfigProperties.get(currentPropertyKey + "." + PROPERTY_PARAMFIXED_VALUES); if (null != strFixedValues && !"".equals(strFixedValues)) { Arrays.asList(strValue.split(",")) .stream() .map(String::trim) .forEach(ap::add2FixedValueFromString); } // Check fixed value if (ap.getFixedValues() != null && !ap.getFixedValues().isEmpty() && !ap.getFixedValues().contains(ap.getValue())) { throw new IllegalArgumentException("Cannot create property <" + ap.getName() + "> invalid value <" + ap.getValue() + "> expected one of " + ap.getFixedValues()); } result.put(ap.getName(), ap); // ff4j.properties.X currentPropertyKey = prefix + "." + ++idx; } return result; }
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
parseProperties
ff4j-config-properties/src/main/java/org/ff4j/parser/properties/PropertiesParser.java
e915c026aef46b502934cb05a825ea2ea15eb9e6
1
Analyze the following code function for security vulnerabilities
private PackageFreezer freezePackageForInstall(String packageName, int installFlags, String killReason) { return freezePackageForInstall(packageName, UserHandle.USER_ALL, installFlags, killReason); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: freezePackageForInstall File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
freezePackageForInstall
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
@Override public boolean launchBugReportHandlerApp() { if (!BugReportHandlerUtil.isBugReportHandlerEnabled(mContext)) { return false; } // Always log caller, even if it does not have permission to dump. Slog.i(TAG, "launchBugReportHandlerApp requested by UID " + Binder.getCallingUid()); enforceCallingPermission(android.Manifest.permission.DUMP, "launchBugReportHandlerApp"); return BugReportHandlerUtil.launchBugReportHandlerApp(mContext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: launchBugReportHandlerApp 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
launchBugReportHandlerApp
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
protected String auditSubjectID() { SessionContext auditContext = SessionContext.getExistingContext(); if (auditContext == null) { return ILogger.UNIDENTIFIED; } String subjectID = (String) auditContext.get(SessionContext.USER_ID); if (subjectID == null) { return ILogger.NONROLEUSER; } return subjectID.trim(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: auditSubjectID File: base/server/src/main/java/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
auditSubjectID
base/server/src/main/java/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") private UriPermission findOrCreateUriPermissionLocked(String sourcePkg, String targetPkg, int targetUid, GrantUri grantUri) { ArrayMap<GrantUri, UriPermission> targetUris = mGrantedUriPermissions.get(targetUid); if (targetUris == null) { targetUris = Maps.newArrayMap(); mGrantedUriPermissions.put(targetUid, targetUris); } UriPermission perm = targetUris.get(grantUri); if (perm == null) { perm = new UriPermission(sourcePkg, targetPkg, targetUid, grantUri); targetUris.put(grantUri, perm); } return perm; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findOrCreateUriPermissionLocked 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
findOrCreateUriPermissionLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected static String fixURI(String str) { // handle platform dependent strings str = str.replace(java.io.File.separatorChar, '/'); // Windows fix if (str.length() >= 2) { char ch1 = str.charAt(1); // change "C:blah" to "/C:blah" if (ch1 == ':') { final char ch0 = String.valueOf(str.charAt(0)).toUpperCase(Locale.ENGLISH).charAt(0); if (ch0 >= 'A' && ch0 <= 'Z') { str = "/" + str; } } // change "//blah" to "file://blah" else if (ch1 == '/' && str.charAt(0) == '/') { str = "file:" + str; } } // done return str; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fixURI File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
fixURI
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
void createCopyFile() { cid = mInstallerService.allocateExternalStageCidLegacy(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createCopyFile 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
createCopyFile
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
protected void printChildrenAsXml(final String indent, final PrintWriter printWriter) { DomNode child = getFirstChild(); while (child != null) { child.printXml(indent + " ", printWriter); child = child.getNextSibling(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: printChildrenAsXml File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
printChildrenAsXml
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
private void trialConnect() throws IOException, RetryDirectly, IllegalAccessException { FileDownloadConnection trialConnection = null; try { final ConnectionProfile trialConnectionProfile; if (isNeedForceDiscardRange) { trialConnectionProfile = ConnectionProfile.ConnectionProfileBuild .buildTrialConnectionProfileNoRange(); } else { trialConnectionProfile = ConnectionProfile.ConnectionProfileBuild .buildTrialConnectionProfile(); } final ConnectTask trialConnectTask = new ConnectTask.Builder() .setDownloadId(model.getId()) .setUrl(model.getUrl()) .setEtag(model.getETag()) .setHeader(userRequestHeader) .setConnectionProfile(trialConnectionProfile) .build(); trialConnection = trialConnectTask.connect(); handleTrialConnectResult(trialConnectTask.getRequestHeader(), trialConnectTask, trialConnection); } finally { if (trialConnection != null) trialConnection.ending(); } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2018-11248 - Severity: HIGH - CVSS Score: 7.5 Description: fix: fix directory traversal vulnerability security issue closes #1028 Function: trialConnect File: library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java Repository: lingochamp/FileDownloader Fixed Code: private void trialConnect() throws IOException, RetryDirectly, IllegalAccessException, FileDownloadSecurityException { FileDownloadConnection trialConnection = null; try { final ConnectionProfile trialConnectionProfile; if (isNeedForceDiscardRange) { trialConnectionProfile = ConnectionProfile.ConnectionProfileBuild .buildTrialConnectionProfileNoRange(); } else { trialConnectionProfile = ConnectionProfile.ConnectionProfileBuild .buildTrialConnectionProfile(); } final ConnectTask trialConnectTask = new ConnectTask.Builder() .setDownloadId(model.getId()) .setUrl(model.getUrl()) .setEtag(model.getETag()) .setHeader(userRequestHeader) .setConnectionProfile(trialConnectionProfile) .build(); trialConnection = trialConnectTask.connect(); handleTrialConnectResult(trialConnectTask.getRequestHeader(), trialConnectTask, trialConnection); } finally { if (trialConnection != null) trialConnection.ending(); } }
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
trialConnect
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
1
Analyze the following code function for security vulnerabilities
@Override public void setBooleanProperty(String name, boolean value) throws JMSException { this.setObjectProperty(name, Boolean.valueOf(value)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBooleanProperty File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
setBooleanProperty
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
public boolean exists(String fullname) throws XWikiException { return this.xwiki.exists(fullname, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: exists File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
exists
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0