instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
@Override
public void parseOneFile(Project project, ProjectMetadata metadata,
ImportingJob job, String fileSource, InputStream inputStream,
ImportColumnGroup rootColumnGroup, int limit, ObjectNode options,
List<Exception> exceptions) {
try {
parseOneFile(project, metadata, job, fileSource,
new XmlParser(inputStream), rootColumnGroup, limit, options, exceptions);
super.parseOneFile(project, metadata, job, fileSource, inputStream, rootColumnGroup, limit, options, exceptions);
} catch (XMLStreamException e) {
exceptions.add(e);
} catch (IOException e) {
exceptions.add(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseOneFile
File: main/src/com/google/refine/importers/XmlImporter.java
Repository: OpenRefine
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-20157
|
MEDIUM
| 5
|
OpenRefine
|
parseOneFile
|
main/src/com/google/refine/importers/XmlImporter.java
|
6a0d7d56e4ffb420316ce7849fde881344fbf881
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public PhoneAccount getPhoneAccount(PhoneAccountHandle accountHandle,
String callingPackage) {
try {
enforceCallingPackage(callingPackage, "getPhoneAccount");
} catch (SecurityException se) {
EventLog.writeEvent(0x534e4554, "196406138", Binder.getCallingUid(),
"getPhoneAccount: invalid calling package");
throw se;
}
synchronized (mLock) {
final UserHandle callingUserHandle = Binder.getCallingUserHandle();
if (CompatChanges.isChangeEnabled(
TelecomManager.ENABLE_GET_PHONE_ACCOUNT_PERMISSION_PROTECTION,
callingPackage, Binder.getCallingUserHandle())) {
if (Binder.getCallingUid() != Process.SHELL_UID &&
!canGetPhoneAccount(callingPackage, accountHandle)) {
SecurityException e = new SecurityException("getPhoneAccount API requires" +
"READ_PHONE_NUMBERS");
Log.e(this, e, "getPhoneAccount %s", accountHandle);
throw e;
}
}
long token = Binder.clearCallingIdentity();
try {
Log.startSession("TSI.gPA");
// In ideal case, we should not resolve the handle across profiles. But given
// the fact that profile's call is handled by its parent user's in-call UI,
// parent user's in call UI need to be able to get phone account from the
// profile's phone account handle.
return mPhoneAccountRegistrar
.getPhoneAccount(accountHandle, callingUserHandle,
/* acrossProfiles */ true);
} catch (Exception e) {
Log.e(this, e, "getPhoneAccount %s", accountHandle);
throw e;
} finally {
Binder.restoreCallingIdentity(token);
Log.endSession();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPhoneAccount
File: src/com/android/server/telecom/TelecomServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21394
|
MEDIUM
| 5.5
|
android
|
getPhoneAccount
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
68dca62035c49e14ad26a54f614199cb29a3393f
| 0
|
Analyze the following code function for security vulnerabilities
|
final void idleUids() {
synchronized (this) {
mOomAdjuster.idleUidsLocked();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: idleUids
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
|
idleUids
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public void writeMapBegin(TMap map) throws TException {
writeByte(map.keyType);
writeByte(map.valueType);
writeI32(map.size);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeMapBegin
File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
Repository: facebook/fbthrift
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2019-11938
|
MEDIUM
| 5
|
facebook/fbthrift
|
writeMapBegin
|
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
|
08c2d412adb214c40bb03be7587057b25d053030
| 0
|
Analyze the following code function for security vulnerabilities
|
private String extractDefault(JsonNode node) {
if (node != null && node.has(DEFAULT)) {
if (node.get(DEFAULT).has(LOCATION)) {
return node.get(DEFAULT).get(LOCATION).asText();
} else {
return "\\\"" + node.get(DEFAULT).asText() + "\\\"";
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: extractDefault
File: src/main/java/org/commonwl/view/cwl/CWLService.java
Repository: common-workflow-language/cwlviewer
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-41110
|
HIGH
| 7.5
|
common-workflow-language/cwlviewer
|
extractDefault
|
src/main/java/org/commonwl/view/cwl/CWLService.java
|
f6066f09edb70033a2ce80200e9fa9e70a5c29de
| 0
|
Analyze the following code function for security vulnerabilities
|
private Attributes cleanAttributes(String elementName, Attributes attributes)
{
Attributes allowedAttribute;
if (this.htmlElementSanitizer == null || attributes == null) {
allowedAttribute = attributes;
} else {
allowedAttribute = new AttributesImpl();
for (int i = 0; i < attributes.getLength(); ++i) {
if (this.htmlElementSanitizer.isAttributeAllowed(elementName, attributes.getQName(i),
attributes.getValue(i)))
{
((AttributesImpl) allowedAttribute).addAttribute(null, null, attributes.getQName(i),
null, attributes.getValue(i));
} else {
((AttributesImpl) allowedAttribute).addAttribute(null, null,
TRANSLATED_ATTRIBUTE_PREFIX + attributes.getQName(i), null, attributes.getValue(i));
}
}
}
return allowedAttribute;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-37908
- Severity: CRITICAL
- CVSS Score: 9.6
Description: XRENDERING-697: XHTMLWikiPrinter doesn't validate generated data attributes
* Strip invalid characters and make sure the data attribute is allowed.
* Add tests.
Function: cleanAttributes
File: xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java
Repository: xwiki/xwiki-rendering
Fixed Code:
private Attributes cleanAttributes(String elementName, Attributes attributes)
{
Attributes allowedAttribute;
if (this.htmlElementSanitizer == null || attributes == null) {
allowedAttribute = attributes;
} else {
allowedAttribute = new AttributesImpl();
for (int i = 0; i < attributes.getLength(); ++i) {
if (this.htmlElementSanitizer.isAttributeAllowed(elementName, attributes.getQName(i),
attributes.getValue(i)))
{
((AttributesImpl) allowedAttribute).addAttribute(null, null, attributes.getQName(i),
null, attributes.getValue(i));
} else {
// Keep but clean invalid attributes with a prefix (removed during parsing) to avoid loosing them
// through WYSIWYG editing.
String translatedName =
TRANSLATED_ATTRIBUTE_PREFIX + removeInvalidDataAttributeCharacters(attributes.getQName(i));
if (this.htmlElementSanitizer.isAttributeAllowed(elementName, translatedName,
attributes.getValue(i)))
{
((AttributesImpl) allowedAttribute).addAttribute(null, null,
translatedName, null, attributes.getValue(i));
}
}
}
}
return allowedAttribute;
}
|
[
"CWE-79"
] |
CVE-2023-37908
|
CRITICAL
| 9.6
|
xwiki/xwiki-rendering
|
cleanAttributes
|
xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java
|
f4d5acac451dccaf276e69f0b49b72221eef5d2f
| 1
|
Analyze the following code function for security vulnerabilities
|
public UserInfo getCurrentUser() throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentUser
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getCurrentUser
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getUserPreferenceAsInt(String prefname, XWikiContext context)
{
return Integer.parseInt(getUserPreference(prefname, context));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserPreferenceAsInt
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
getUserPreferenceAsInt
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final void activityPaused(IBinder token) {
final long origId = Binder.clearCallingIdentity();
synchronized(this) {
ActivityStack stack = ActivityRecord.getStackLocked(token);
if (stack != null) {
stack.activityPausedLocked(token, false);
}
}
Binder.restoreCallingIdentity(origId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: activityPaused
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
|
activityPaused
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getResourceableTypeName() {
return typeName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getResourceableTypeName
File: src/main/java/org/olat/fileresource/types/FileResource.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
getResourceableTypeName
|
src/main/java/org/olat/fileresource/types/FileResource.java
|
699490be8e931af0ef1f135c55384db1f4232637
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getRequestMethod() {
return request.method().name();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequestMethod
File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
Repository: quarkusio/quarkus
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-0981
|
MEDIUM
| 6.5
|
quarkusio/quarkus
|
getRequestMethod
|
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
|
96c64fd8f09c02a497e2db366c64dd9196582442
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Object stringToValue(String string, XMLXsiTypeConverter<?> typeConverter) {
if(typeConverter != null) {
return typeConverter.convert(string);
}
return stringToValue(string);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stringToValue
File: src/main/java/org/json/XML.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2022-45688
|
HIGH
| 7.5
|
stleary/JSON-java
|
stringToValue
|
src/main/java/org/json/XML.java
|
f566a1d9ee1f8139357017dc6c7def1da19cd8d4
| 0
|
Analyze the following code function for security vulnerabilities
|
void updateRotation(boolean alwaysSendConfiguration) {
try {
//set orientation on WindowManager
mWindowManager.updateRotation(alwaysSendConfiguration, false);
} catch (RemoteException e) {
// Ignore
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateRotation
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
updateRotation
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Pair<String, Resources> findSystemApk(String action, PackageManager pm) {
final Intent intent = new Intent(action);
for (ResolveInfo info : pm.queryBroadcastReceivers(intent, MATCH_SYSTEM_ONLY)) {
final String packageName = info.activityInfo.packageName;
try {
final Resources res = pm.getResourcesForApplication(packageName);
return Pair.create(packageName, res);
} catch (NameNotFoundException e) {
Log.w(TAG, "Failed to find resources for " + packageName);
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findSystemApk
File: src/com/android/launcher3/util/PackageManagerHelper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-40097
|
HIGH
| 7.8
|
android
|
findSystemApk
|
src/com/android/launcher3/util/PackageManagerHelper.java
|
6c9a41117d5a9365cf34e770bbb00138f6bf997e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void save7binary(TestContext context) {
String id = randomUuid();
byte [] apple = "apple".getBytes();
byte [] banana = "banana".getBytes();
PostgresClient postgresClient = createFooBinary(context);
postgresClient.save(FOO, id, new JsonArray().add(apple), true, true, false, context.asyncAssertSuccess(save -> {
context.assertEquals(id, save);
String fullTable = PostgresClient.convertToPsqlStandard(TENANT) + "." + FOO;
postgresClient.select("SELECT jsonb FROM " + fullTable, context.asyncAssertSuccess(select -> {
context.assertEquals(base64(apple), select.getRows().get(0).getString("jsonb"), "select");
postgresClient.save(FOO, id, new JsonArray().add(banana), true, true, false, context.asyncAssertSuccess(update -> {
context.assertEquals(id, update);
postgresClient.select("SELECT jsonb FROM " + fullTable, context.asyncAssertSuccess(select2 -> {
context.assertEquals(base64(banana), select2.getRows().get(0).getString("jsonb"), "select2");
}));
}));
}));
}));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: save7binary
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
|
save7binary
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean handleSpecialAttachmentUri(final Uri contentUri) {
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleSpecialAttachmentUri
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2425
|
MEDIUM
| 4.3
|
android
|
handleSpecialAttachmentUri
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
public void putDeserializer(Type type, ObjectDeserializer deserializer) {
Type mixin = JSON.getMixInAnnotations(type);
if (mixin != null) {
IdentityHashMap<Type, ObjectDeserializer> mixInClasses = this.mixInDeserializers.get(type);
if (mixInClasses == null) {
//多线程下可能会重复创建,但不影响正确性
mixInClasses = new IdentityHashMap<Type, ObjectDeserializer>(4);
this.mixInDeserializers.put(type, mixInClasses);
}
mixInClasses.put(mixin, deserializer);
} else {
this.deserializers.put(type, deserializer);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: putDeserializer
File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
Repository: alibaba/fastjson
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2022-25845
|
MEDIUM
| 6.8
|
alibaba/fastjson
|
putDeserializer
|
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
|
8f3410f81cbd437f7c459f8868445d50ad301f15
| 0
|
Analyze the following code function for security vulnerabilities
|
public void notifyActivityDrawnForKeyguardLw() {
if (mKeyguardDelegate != null) {
mHandler.post(new Runnable() {
@Override
public void run() {
mKeyguardDelegate.onActivityDrawn();
}
});
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyActivityDrawnForKeyguardLw
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
notifyActivityDrawnForKeyguardLw
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean canPlaceAt(BlockVector3 position, com.sk89q.worldedit.world.block.BlockState blockState) {
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
if (adapter != null) {
return adapter.canPlaceAt(getWorld(), position, blockState);
}
// We can't check, so assume yes.
return true;
}
|
Vulnerability Classification:
- CWE: CWE-400
- CVE: CVE-2023-35925
- Severity: MEDIUM
- CVSS Score: 5.5
Description: feat: prevent edits outside +/- 30,000,000 blocks
Function: canPlaceAt
File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
Repository: IntellectualSites/FastAsyncWorldEdit
Fixed Code:
@Override
public boolean canPlaceAt(BlockVector3 position, com.sk89q.worldedit.world.block.BlockState blockState) {
//FAWE start - safe edit region
testCoords(position);
//FAWE end
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
if (adapter != null) {
return adapter.canPlaceAt(getWorld(), position, blockState);
}
// We can't check, so assume yes.
return true;
}
|
[
"CWE-400"
] |
CVE-2023-35925
|
MEDIUM
| 5.5
|
IntellectualSites/FastAsyncWorldEdit
|
canPlaceAt
|
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
|
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public Float get(NotificationPanelView object) {
return object.mDarkAmount;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: get
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
get
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isProfileOwnerOfOrganizationOwnedDevice(int userId) {
synchronized (getLockObject()) {
return mOwners.isProfileOwnerOfOrganizationOwnedDevice(userId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isProfileOwnerOfOrganizationOwnedDevice
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
|
isProfileOwnerOfOrganizationOwnedDevice
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private void encodeTag(int currentStackDepth, Element ele, String tagName, NodeList eleChildNodes) throws ScanException {
addError(ErrorMessageUtil.ERROR_TAG_ENCODED, new Object[]{HTMLEntityEncoder.htmlEntityEncode(tagName)});
processChildren(eleChildNodes, currentStackDepth);
/*
* Transform the tag to text, HTML-encode it and promote the
* children. The tag will be kept in the fragment as one or two text
* Nodes located before and after the children; representing how the
* tag used to wrap them.
*/
encodeAndPromoteChildren(ele);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: encodeTag
File: src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
Repository: nahsra/antisamy
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-28367
|
MEDIUM
| 4.3
|
nahsra/antisamy
|
encodeTag
|
src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
|
0199e7e194dba5e7d7197703f43ebe22401e61ae
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<AbstractProject> getChildProjects(ItemGroup base) {
return Items.fromNameList(base,childProjects,AbstractProject.class);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getChildProjects
File: core/src/main/java/hudson/tasks/BuildTrigger.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
getChildProjects
|
core/src/main/java/hudson/tasks/BuildTrigger.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
public static List<String> splitAsList(String source, char delimiter) {
return splitAsList(source, delimiter, false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: splitAsList
File: src/org/opencms/util/CmsStringUtil.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2013-4600
|
MEDIUM
| 4.3
|
alkacon/opencms-core
|
splitAsList
|
src/org/opencms/util/CmsStringUtil.java
|
72a05e3ea1cf692e2efce002687272e63f98c14a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Map<String, Path> getDataFolders(String pi, String... dataFolderNames) throws PresentationException, IndexUnreachableException {
if (pi == null) {
throw new IllegalArgumentException("pi may not be null");
}
if (dataFolderNames == null) {
throw new IllegalArgumentException("dataFolderNames may not be null");
}
String dataRepositoryName = DataManager.getInstance().getSearchIndex().findDataRepositoryName(pi);
Map<String, Path> ret = new HashMap<>(dataFolderNames.length);
for (String dataFolderName : dataFolderNames) {
ret.put(dataFolderName, getDataFolder(pi, dataFolderName, dataRepositoryName));
}
return ret;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDataFolders
File: goobi-viewer-core/src/main/java/io/goobi/viewer/controller/DataFileTools.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-15124
|
MEDIUM
| 4
|
intranda/goobi-viewer-core
|
getDataFolders
|
goobi-viewer-core/src/main/java/io/goobi/viewer/controller/DataFileTools.java
|
44ceb8e2e7e888391e8a941127171d6366770df3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getTextOffset() throws IOException {
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTextOffset
File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
Repository: FasterXML/jackson-dataformats-binary
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2020-28491
|
MEDIUM
| 5
|
FasterXML/jackson-dataformats-binary
|
getTextOffset
|
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
|
de072d314af8f5f269c8abec6930652af67bc8e6
| 0
|
Analyze the following code function for security vulnerabilities
|
public static long parseSize(String text) {
double d = Double.parseDouble(text.replaceAll("[GMK]B$", ""));
long l = Math.round(d * 1024 * 1024 * 1024L);
switch (text.charAt(Math.max(0, text.length() - 2))) {
default:
l /= 1024;
case 'K':
l /= 1024;
case 'M':
l /= 1024;
case 'G':
return l;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseSize
File: src/main/java/com/openkm/util/FormatUtil.java
Repository: openkm/document-management-system
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-40317
|
MEDIUM
| 5.4
|
openkm/document-management-system
|
parseSize
|
src/main/java/com/openkm/util/FormatUtil.java
|
870d518f7de349c3fa4c7b9883789fdca4590c4e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Boolean checkProjectExist(String relateId) {
return zentaoClient.checkProjectExist(relateId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkProjectExist
File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
checkProjectExist
|
test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
public Entity<?> serialize(Object obj, Map<String, Object> formParams, String contentType, boolean isBodyNullable) throws ApiException {
Entity<?> entity;
if (contentType.startsWith("multipart/form-data")) {
MultiPart multiPart = new MultiPart();
for (Entry<String, Object> param: formParams.entrySet()) {
if (param.getValue() instanceof File) {
File file = (File) param.getValue();
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey())
.fileName(file.getName()).size(file.length()).build();
multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
} else {
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build();
multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue())));
}
}
entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE);
} else if (contentType.startsWith("application/x-www-form-urlencoded")) {
Form form = new Form();
for (Entry<String, Object> param: formParams.entrySet()) {
form.param(param.getKey(), parameterToString(param.getValue()));
}
entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
} else {
// We let jersey handle the serialization
if (isBodyNullable) { // payload is nullable
if (obj instanceof String) {
entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType);
} else {
entity = Entity.entity(obj == null ? "null" : obj, contentType);
}
} else {
if (obj instanceof String) {
entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType);
} else {
entity = Entity.entity(obj == null ? "" : obj, contentType);
}
}
}
return entity;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: serialize
File: samples/client/petstore/java/okhttp-gson-dynamicOperations/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
|
serialize
|
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public Map<String, String> getServerVariables() {
return serverVariables;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServerVariables
File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
getServerVariables
|
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getFeedbackEMail()
{
return feedbackEMail;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFeedbackEMail
File: src/main/java/org/projectforge/web/admin/SetupForm.java
Repository: micromata/projectforge-webapp
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2013-7251
|
MEDIUM
| 6.8
|
micromata/projectforge-webapp
|
getFeedbackEMail
|
src/main/java/org/projectforge/web/admin/SetupForm.java
|
422de35e3c3141e418a73bfb39b430d5fd74077e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSerialNumber
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/trade/TradeOrder.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-21333
|
LOW
| 3.5
|
sanluan/PublicCMS
|
setSerialNumber
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/trade/TradeOrder.java
|
b4d5956e65b14347b162424abb197a180229b3db
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setCid(Integer cid) {
this.cid = cid;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCid
File: src/main/java/cn/luischen/model/ContentDomain.java
Repository: WinterChenS/my-site
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29638
|
MEDIUM
| 5.4
|
WinterChenS/my-site
|
setCid
|
src/main/java/cn/luischen/model/ContentDomain.java
|
d104f38aaae2f1b76c33fadfcf6b1ef1c6c340ed
| 0
|
Analyze the following code function for security vulnerabilities
|
private void writeData(CellReference cell, JsonObject data) {
Column column = getColumn(cell.getPropertyId());
Converter<?, ?> converter = column.getConverter();
Renderer<?> renderer = column.getRenderer();
Item item = cell.getItem();
Property itemProperty = item.getItemProperty(cell.getPropertyId());
Object modelValue = itemProperty == null ? null
: itemProperty.getValue();
data.put(columnKeys.key(cell.getPropertyId()), AbstractRenderer
.encodeValue(modelValue, renderer, converter, getLocale()));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeData
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
|
writeData
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
void comeOutOfSleepIfNeededLocked() {
removeSleepTimeouts();
if (mGoingToSleep.isHeld()) {
mGoingToSleep.release();
}
for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) {
final ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
final ActivityStack stack = stacks.get(stackNdx);
stack.awakeFromSleepingLocked();
if (isFrontStack(stack)) {
resumeTopActivitiesLocked();
}
}
}
mGoingToSleepActivities.clear();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: comeOutOfSleepIfNeededLocked
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
|
comeOutOfSleepIfNeededLocked
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
public ZentaoClient getZentaoClient() {
return zentaoClient;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getZentaoClient
File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
getZentaoClient
|
test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
private void removeSubmoduleSectionsFromGitConfig(ConsoleOutputStreamConsumer outputStreamConsumer) {
log(outputStreamConsumer, "Cleaning submodule configurations in .git/config");
for (String submoduleFolder : submoduleUrls().keySet()) {
configRemoveSection("submodule." + submoduleFolder);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeSubmoduleSectionsFromGitConfig
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
|
removeSubmoduleSectionsFromGitConfig
|
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setOauthPasswordFlow(String username, String password) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).usePasswordFlow(username, password);
return this;
}
}
throw new RuntimeException("No OAuth2 authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOauthPasswordFlow
File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setOauthPasswordFlow
|
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public int createUser(XWikiContext context) throws XWikiException
{
return createUser(false, "edit", context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createUser
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
createUser
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String stringifySize(long size, int order) {
Locale locale = Locale.US;
switch (order) {
case 1:
return String.format(locale, "%,13d", size);
case 1024:
return String.format(locale, "%,9dK", size / 1024);
case 1024 * 1024:
return String.format(locale, "%,5dM", size / 1024 / 1024);
case 1024 * 1024 * 1024:
return String.format(locale, "%,1dG", size / 1024 / 1024 / 1024);
default:
throw new IllegalArgumentException("Invalid size order");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stringifySize
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
|
stringifySize
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setMaximumBssLoadValue(int maximumBssLoadValue) {
mMaximumBssLoadValue = maximumBssLoadValue;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMaximumBssLoadValue
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
|
setMaximumBssLoadValue
|
framework/java/android/net/wifi/hotspot2/pps/Policy.java
|
69119d1d3102e27b6473c785125696881bce9563
| 0
|
Analyze the following code function for security vulnerabilities
|
protected static Document createDocumentImpl(String name, String namespaceURI)
throws ParserConfigurationException, FactoryConfigurationError
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(isNamespaceAware);
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();
Element rootElement = null;
if (namespaceURI != null && namespaceURI.length() > 0) {
rootElement = document.createElementNS(namespaceURI, name);
} else {
rootElement = document.createElement(name);
}
document.appendChild(rootElement);
return document;
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2014-125087
- Severity: MEDIUM
- CVSS Score: 5.2
Description: Disable external entities by default to prevent XXE injection attacks, re #6
XML Builder classes now explicitly enable or disable
'external-general-entities' and 'external-parameter-entities' features
of the DocumentBuilderFactory when #create or #parse methods are used.
To prevent XML External Entity (XXE) injection attacks, these features
are disabled by default. They can only be enabled by passing a true
boolean value to new versions of the #create and #parse methods that
accept a flag for this feature.
Function: createDocumentImpl
File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
Repository: jmurty/java-xmlbuilder
Fixed Code:
protected static Document createDocumentImpl(
String name, String namespaceURI, boolean enableExternalEntities)
throws ParserConfigurationException, FactoryConfigurationError
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(isNamespaceAware);
enableOrDisableExternalEntityParsing(factory, enableExternalEntities);
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();
Element rootElement = null;
if (namespaceURI != null && namespaceURI.length() > 0) {
rootElement = document.createElementNS(namespaceURI, name);
} else {
rootElement = document.createElement(name);
}
document.appendChild(rootElement);
return document;
}
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
createDocumentImpl
|
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 1
|
Analyze the following code function for security vulnerabilities
|
protected void validateCredentials() {
try {
if (isBlank(getUrl()) || isAllBlank(userName, getPassword())) {
return;
}
if (UrlUserInfo.hasUserInfo(getUrl())) {
errors().add(URL, "Ambiguous credentials, must be provided either in URL or as attributes.");
}
} catch (Exception e) {
//ignore
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateCredentials
File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
validateCredentials
|
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: moveTaskToStack
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
moveTaskToStack
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onCompletion(MediaPlayer arg0) {
fireMediaStateChange(State.Paused);
fireCompletionHandlers();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCompletion
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
|
onCompletion
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ProfileDataInfos fromXML(String xml) throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xml)));
Element element = document.getDocumentElement();
return fromDOM(element);
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2022-2414
- Severity: HIGH
- CVSS Score: 7.5
Description: Disable access to external entities when parsing XML
This reduces the vulnerability of XML parsers to XXE (XML external
entity) injection.
The best way to prevent XXE is to stop using XML altogether, which we do
plan to do. Until that happens I consider it worthwhile to tighten the
security here though.
Function: fromXML
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileDataInfos.java
Repository: dogtagpki/pki
Fixed Code:
public static ProfileDataInfos fromXML(String xml) throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xml)));
Element element = document.getDocumentElement();
return fromDOM(element);
}
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
fromXML
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileDataInfos.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override // binder call
public void onAuthenticationFailed(long deviceId) {
mHandler.obtainMessage(MSG_AUTHENTICATION_FAILED).sendToTarget();;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onAuthenticationFailed
File: core/java/android/hardware/fingerprint/FingerprintManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
onAuthenticationFailed
|
core/java/android/hardware/fingerprint/FingerprintManager.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void receiveBroadcast(Message message) {
if (_logger.isDebugEnabled()) {
_logger.debug("Received broadcast message {}", message);
}
Map<String, Object> data = message.getDataAsMap();
Boolean presence = (Boolean)data.get(SetiPresence.PRESENCE_FIELD);
if (presence != null) {
receivePresence(data);
} else {
receiveMessage(data);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: receiveBroadcast
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
|
receiveBroadcast
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
@GET
@ApiOperation(value = "Validate an existing session",
notes = "Checks the session with the given ID: returns http status 204 (No Content) if session is valid.",
code = 204,
response = SessionValidationResponse.class
)
public Response validateSession(@Context ContainerRequestContext requestContext) {
try {
this.authenticationFilter.filter(requestContext);
} catch (NotAuthorizedException | LockedAccountException | IOException e) {
return Response.ok(SessionValidationResponse.invalid())
.cookie(cookieFactory.deleteAuthenticationCookie(requestContext))
.build();
}
final Subject subject = getSubject();
if (!subject.isAuthenticated()) {
return Response.ok(SessionValidationResponse.invalid())
.cookie(cookieFactory.deleteAuthenticationCookie(requestContext))
.build();
}
final Optional<Session> optionalSession = Optional.ofNullable(retrieveOrCreateSession(subject));
final User user = getCurrentUser();
return optionalSession.map(session -> {
final SessionResponse response = sessionResponseFactory.forSession(session);
return Response.ok(
SessionValidationResponse.validWithNewSession(
String.valueOf(session.getId()),
String.valueOf(user.getName())
))
.cookie(cookieFactory.createAuthenticationCookie(response, requestContext))
.build();
}).orElseGet(() -> Response.ok(SessionValidationResponse.authenticatedWithNoSession(user.getName()))
.cookie(cookieFactory.deleteAuthenticationCookie(requestContext))
.build());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateSession
File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-384"
] |
CVE-2024-24823
|
MEDIUM
| 4.4
|
Graylog2/graylog2-server
|
validateSession
|
graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java
|
1596b749db86368ba476662f23a0f0c5ec2b5097
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setLockTaskFeatures(ComponentName who, int flags) {
Objects.requireNonNull(who, "ComponentName is null");
// Throw if Overview is used without Home.
boolean hasHome = (flags & LOCK_TASK_FEATURE_HOME) != 0;
boolean hasOverview = (flags & LOCK_TASK_FEATURE_OVERVIEW) != 0;
Preconditions.checkArgument(hasHome || !hasOverview,
"Cannot use LOCK_TASK_FEATURE_OVERVIEW without LOCK_TASK_FEATURE_HOME");
boolean hasNotification = (flags & LOCK_TASK_FEATURE_NOTIFICATIONS) != 0;
Preconditions.checkArgument(hasHome || !hasNotification,
"Cannot use LOCK_TASK_FEATURE_NOTIFICATIONS without LOCK_TASK_FEATURE_HOME");
final CallerIdentity caller = getCallerIdentity(who);
final int userHandle = caller.getUserId();
synchronized (getLockObject()) {
enforceCanCallLockTaskLocked(caller);
enforceCanSetLockTaskFeaturesOnFinancedDevice(caller, flags);
checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_SET_LOCK_TASK_FEATURES);
setLockTaskFeaturesLocked(userHandle, flags);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLockTaskFeatures
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
|
setLockTaskFeatures
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public float getScale() {
final IAccessibilityServiceConnection connection =
AccessibilityInteractionClient.getInstance().getConnection(
mService.mConnectionId);
if (connection != null) {
try {
return connection.getMagnificationScale();
} catch (RemoteException re) {
Log.w(LOG_TAG, "Failed to obtain scale", re);
re.rethrowFromSystemServer();
}
}
return 1.0f;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getScale
File: core/java/android/accessibilityservice/AccessibilityService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3923
|
MEDIUM
| 4.3
|
android
|
getScale
|
core/java/android/accessibilityservice/AccessibilityService.java
|
5f256310187b4ff2f13a7abb9afed9126facd7bc
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onRenameUpload() {
mUploadsStorageManager.updateDatabaseUploadStart(mCurrentUpload);
sendBroadcastUploadStarted(mCurrentUpload);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onRenameUpload
File: src/main/java/com/owncloud/android/files/services/FileUploader.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2022-24886
|
LOW
| 2.1
|
nextcloud/android
|
onRenameUpload
|
src/main/java/com/owncloud/android/files/services/FileUploader.java
|
c01fa0b17050cdcf77a468cc22f4071eae29d464
| 0
|
Analyze the following code function for security vulnerabilities
|
public synchronized void doTestPost( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
rsp.sendRedirect("foo");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doTestPost
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
doTestPost
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean readIf(char ch) throws IOException {
if (current!=ch) {
return false;
}
read();
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readIf
File: src/main/org/hjson/HjsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34620
|
HIGH
| 7.5
|
hjson/hjson-java
|
readIf
|
src/main/org/hjson/HjsonParser.java
|
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
| 0
|
Analyze the following code function for security vulnerabilities
|
private LookupResult performReverseLookup(Object key) {
final PtrDnsAnswer dnsResponse;
try {
dnsResponse = dnsClient.reverseLookup(key.toString());
} catch (Exception e) {
LOG.error("Could not perform reverse DNS lookup for [{}]. Cause [{}]", key, ExceptionUtils.getRootCauseOrMessage(e));
errorCounter.inc();
return getErrorResult();
}
if (dnsResponse != null) {
if (!Strings.isNullOrEmpty(dnsResponse.fullDomain())) {
// Include answer in both single and multiValue fields.
final Map<Object, Object> multiValueResults = new LinkedHashMap<>();
multiValueResults.put(PtrDnsAnswer.FIELD_DOMAIN, dnsResponse.domain());
multiValueResults.put(PtrDnsAnswer.FIELD_FULL_DOMAIN, dnsResponse.fullDomain());
multiValueResults.put(PtrDnsAnswer.FIELD_DNS_TTL, dnsResponse.dnsTTL());
final LookupResult.Builder builder = LookupResult.builder()
.single(dnsResponse.fullDomain())
.multiValue(multiValueResults)
.stringListValue(ImmutableList.of(dnsResponse.fullDomain()));
if (config.hasOverrideTTL()) {
builder.cacheTTL(config.getCacheTTLOverrideMillis());
} else {
builder.cacheTTL(dnsResponse.dnsTTL() * 1000);
}
return builder.build();
}
}
LOG.debug("Could not perform reverse lookup on IP address [{}]. No PTR record was found.", key);
return getEmptyResult();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: performReverseLookup
File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2023-41045
|
MEDIUM
| 5.3
|
Graylog2/graylog2-server
|
performReverseLookup
|
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
|
466af814523cffae9fbc7e77bab7472988f03c3e
| 0
|
Analyze the following code function for security vulnerabilities
|
public MenuItem getMenuItemDownloadMoreItems() {
return menuItemDownloadMoreItems;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMenuItemDownloadMoreItems
File: News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
Repository: nextcloud/news-android
The code follows secure coding practices.
|
[
"CWE-829"
] |
CVE-2021-41256
|
MEDIUM
| 5.8
|
nextcloud/news-android
|
getMenuItemDownloadMoreItems
|
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
|
05449cb666059af7de2302df9d5c02997a23df85
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public DataSource createDataSource(Map<String, ?> params) throws IOException {
return createNewDataSource(params);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createDataSource
File: modules/library/jdbc/src/main/java/org/geotools/data/jdbc/datasource/JNDIDataSourceFactory.java
Repository: geotools
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2022-24818
|
HIGH
| 7.5
|
geotools
|
createDataSource
|
modules/library/jdbc/src/main/java/org/geotools/data/jdbc/datasource/JNDIDataSourceFactory.java
|
4f70fa3234391dd0cda883a20ab0ec75688cba49
| 0
|
Analyze the following code function for security vulnerabilities
|
private final int jjStartNfa_0(int pos, long active0)
{
return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jjStartNfa_0
File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
Repository: jakartaee/expression-language
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2021-28170
|
MEDIUM
| 5
|
jakartaee/expression-language
|
jjStartNfa_0
|
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
|
b6a3943ac5fba71cbc6719f092e319caa747855b
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean jsFunction_hasPublisherAccess(Context cx, Scriptable thisObj, Object[] args, Function funObj) {
String usernameWithDomain = (String) args[0];
String tenantDomain = MultitenantUtils.getTenantDomain(usernameWithDomain);
if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
usernameWithDomain = usernameWithDomain + "@" + tenantDomain;
}
boolean displayPublishUrlFromStore = false;
APIManagerConfiguration config = HostObjectComponent.getAPIManagerConfiguration();
if (config != null) {
displayPublishUrlFromStore = Boolean.parseBoolean(config.getFirstProperty(APIConstants.SHOW_API_PUBLISHER_URL_FROM_STORE));
}
boolean loginUserHasPublisherAccess = false;
if (displayPublishUrlFromStore) {
loginUserHasPublisherAccess = APIUtil.checkPermissionQuietly(usernameWithDomain, APIConstants.Permissions.API_CREATE) ||
APIUtil.checkPermissionQuietly(usernameWithDomain, APIConstants.Permissions.API_PUBLISH);
}
return loginUserHasPublisherAccess;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jsFunction_hasPublisherAccess
File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
Repository: wso2/carbon-apimgt
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2018-20736
|
LOW
| 3.5
|
wso2/carbon-apimgt
|
jsFunction_hasPublisherAccess
|
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
|
490f2860822f89d745b7c04fa9570bd86bef4236
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isDisconnectedButSmResumptionPossible() {
return disconnectedButResumeable && isSmResumptionPossible();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDisconnectedButSmResumptionPossible
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
|
isDisconnectedButSmResumptionPossible
|
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
public HttpRequest followRedirects(final boolean followRedirects) {
this.followRedirects = followRedirects;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: followRedirects
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
|
followRedirects
|
src/main/java/jodd/http/HttpRequest.java
|
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private void actionFilter(int currentStackDepth, Element ele, String tagName, Tag tag, NodeList eleChildNodes) throws ScanException {
if (tag == null) {
addError(ErrorMessageUtil.ERROR_TAG_NOT_IN_POLICY, new Object[]{HTMLEntityEncoder.htmlEntityEncode(tagName)});
} else {
addError(ErrorMessageUtil.ERROR_TAG_FILTERED, new Object[]{HTMLEntityEncoder.htmlEntityEncode(tagName)});
}
processChildren(eleChildNodes, currentStackDepth);
promoteChildren(ele);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: actionFilter
File: src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
Repository: nahsra/antisamy
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-28367
|
MEDIUM
| 4.3
|
nahsra/antisamy
|
actionFilter
|
src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
|
0199e7e194dba5e7d7197703f43ebe22401e61ae
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
private OneTimePermissionUserManager getOneTimePermissionUserManager(@UserIdInt int userId) {
OneTimePermissionUserManager oneTimePermissionUserManager;
synchronized (mLock) {
oneTimePermissionUserManager = mOneTimePermissionUserManagers.get(userId);
if (oneTimePermissionUserManager != null) {
return oneTimePermissionUserManager;
}
}
// We cannot create a new instance of OneTimePermissionUserManager while holding our own
// lock, which may lead to a deadlock with the package manager lock. So we do it in a
// retry-like way, and just discard the newly created instance if someone else managed to be
// a little bit faster than us when we dropped our own lock.
final OneTimePermissionUserManager newOneTimePermissionUserManager =
new OneTimePermissionUserManager(mContext.createContextAsUser(UserHandle.of(userId),
/*flags*/ 0));
synchronized (mLock) {
oneTimePermissionUserManager = mOneTimePermissionUserManagers.get(userId);
if (oneTimePermissionUserManager != null) {
return oneTimePermissionUserManager;
}
oneTimePermissionUserManager = newOneTimePermissionUserManager;
mOneTimePermissionUserManagers.put(userId, oneTimePermissionUserManager);
}
oneTimePermissionUserManager.registerUninstallListener();
return oneTimePermissionUserManager;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOneTimePermissionUserManager
File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
getOneTimePermissionUserManager
|
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Transactional(readOnly = false)
public void complete(String taskId, String procInsId, String comment, String title, Map<String, Object> vars){
// 添加意见
if (StringUtils.isNotBlank(procInsId) && StringUtils.isNotBlank(comment)){
taskService.addComment(taskId, procInsId, comment);
}
// 设置流程变量
if (vars == null){
vars = Maps.newHashMap();
}
// 设置流程标题
if (StringUtils.isNotBlank(title)){
vars.put("title", title);
}
// 提交任务
taskService.complete(taskId, vars);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: complete
File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
Repository: thinkgem/jeesite
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-34601
|
CRITICAL
| 9.8
|
thinkgem/jeesite
|
complete
|
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
|
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
| 0
|
Analyze the following code function for security vulnerabilities
|
public Task getTask(String taskId){
return taskService.createTaskQuery().taskId(taskId).singleResult();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTask
File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
Repository: thinkgem/jeesite
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-34601
|
CRITICAL
| 9.8
|
thinkgem/jeesite
|
getTask
|
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
|
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void enableKeyguard(boolean enabled) {
if (mKeyguardDelegate != null) {
mKeyguardDelegate.setKeyguardEnabled(enabled);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enableKeyguard
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
enableKeyguard
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
public SystemMessagesProvider getSystemMessagesProvider() {
return systemMessagesProvider;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSystemMessagesProvider
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
|
getSystemMessagesProvider
|
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
|
621ef1b322737d963bee624b2d2e38cd739903d9
| 0
|
Analyze the following code function for security vulnerabilities
|
private ProviderInfo getProviderInfoLocked(String authority, int userHandle, int pmFlags) {
ProviderInfo pi = null;
ContentProviderRecord cpr = mProviderMap.getProviderByName(authority, userHandle);
if (cpr != null) {
pi = cpr.info;
} else {
try {
pi = AppGlobals.getPackageManager().resolveContentProvider(
authority, PackageManager.GET_URI_PERMISSION_PATTERNS | pmFlags,
userHandle);
} catch (RemoteException ex) {
}
}
return pi;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProviderInfoLocked
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
|
getProviderInfoLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private ActionConfiguration updateActionConfigurationForPagination(ActionConfiguration actionConfiguration,
PaginationField paginationField) {
if (PaginationField.NEXT.equals(paginationField) || PaginationField.PREV.equals(paginationField)) {
actionConfiguration.setPath("");
actionConfiguration.setQueryParameters(null);
}
return actionConfiguration;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateActionConfigurationForPagination
File: app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
Repository: appsmithorg/appsmith
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-38298
|
HIGH
| 8.8
|
appsmithorg/appsmith
|
updateActionConfigurationForPagination
|
app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
|
c59351ef94f9780c2a1ffc991e29b9272ab9fe64
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getSignatureKey(DatasourceConfiguration datasourceConfiguration) throws AppsmithPluginException {
if (!CollectionUtils.isEmpty(datasourceConfiguration.getProperties())) {
boolean isSendSessionEnabled = false;
String secretKey = null;
for (Property property : datasourceConfiguration.getProperties()) {
if (IS_SEND_SESSION_ENABLED_KEY.equals(property.getKey())) {
isSendSessionEnabled = "Y".equals(property.getValue());
} else if (SESSION_SIGNATURE_KEY_KEY.equals(property.getKey())) {
secretKey = (String) property.getValue();
}
}
if (isSendSessionEnabled) {
if (StringUtils.isEmpty(secretKey) || secretKey.length() < 32) {
throw new AppsmithPluginException(
AppsmithPluginError.PLUGIN_DATASOURCE_ARGUMENT_ERROR,
"Secret key is required when sending session details is switched on," +
" and should be at least 32 characters in length."
);
}
return secretKey;
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSignatureKey
File: app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
Repository: appsmithorg/appsmith
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-38298
|
HIGH
| 8.8
|
appsmithorg/appsmith
|
getSignatureKey
|
app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
|
c59351ef94f9780c2a1ffc991e29b9272ab9fe64
| 0
|
Analyze the following code function for security vulnerabilities
|
protected JsonFormat.Value findFormatOverrides(DeserializationContext ctxt,
BeanProperty prop, Class<?> typeForDefaults)
{
if (prop != null) {
return prop.findPropertyFormat(ctxt.getConfig(), typeForDefaults);
}
// even without property or AnnotationIntrospector, may have type-specific defaults
return ctxt.getDefaultPropertyFormat(typeForDefaults);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findFormatOverrides
File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2022-42003
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
findFormatOverrides
|
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
|
d78d00ee7b5245b93103fef3187f70543d67ca33
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setUserRestrictionsInternalLocked(Bundle restrictions, int userId) {
final Bundle userRestrictions = mUserRestrictions.get(userId);
userRestrictions.clear();
userRestrictions.putAll(restrictions);
long token = Binder.clearCallingIdentity();
try {
mAppOpsService.setUserRestrictions(userRestrictions, userId);
} catch (RemoteException e) {
Log.w(LOG_TAG, "Unable to notify AppOpsService of UserRestrictions");
} finally {
Binder.restoreCallingIdentity(token);
}
scheduleWriteUserLocked(mUsers.get(userId));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUserRestrictionsInternalLocked
File: services/core/java/com/android/server/pm/UserManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2457
|
LOW
| 2.1
|
android
|
setUserRestrictionsInternalLocked
|
services/core/java/com/android/server/pm/UserManagerService.java
|
12332e05f632794e18ea8c4ac52c98e82532e5db
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onHeadsUpPinnedModeChanged(boolean inPinnedMode) {
if (inPinnedMode) {
mStatusBarWindowManager.setHeadsUpShowing(true);
mStatusBarWindowManager.setForceStatusBarVisible(true);
if (mNotificationPanel.isFullyCollapsed()) {
// We need to ensure that the touchable region is updated before the window will be
// resized, in order to not catch any touches. A layout will ensure that
// onComputeInternalInsets will be called and after that we can resize the layout. Let's
// make sure that the window stays small for one frame until the touchableRegion is set.
mNotificationPanel.requestLayout();
mStatusBarWindowManager.setForceWindowCollapsed(true);
mNotificationPanel.post(new Runnable() {
@Override
public void run() {
mStatusBarWindowManager.setForceWindowCollapsed(false);
}
});
}
} else {
if (!mNotificationPanel.isFullyCollapsed() || mNotificationPanel.isTracking()) {
// We are currently tracking or is open and the shade doesn't need to be kept
// open artificially.
mStatusBarWindowManager.setHeadsUpShowing(false);
} else {
// we need to keep the panel open artificially, let's wait until the animation
// is finished.
mHeadsUpManager.setHeadsUpGoingAway(true);
mStackScroller.runAfterAnimationFinished(new Runnable() {
@Override
public void run() {
if (!mHeadsUpManager.hasPinnedHeadsUp()) {
mStatusBarWindowManager.setHeadsUpShowing(false);
mHeadsUpManager.setHeadsUpGoingAway(false);
}
removeRemoteInputEntriesKeptUntilCollapsed();
}
});
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onHeadsUpPinnedModeChanged
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
onHeadsUpPinnedModeChanged
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setOauthCredentials(String clientId, String clientSecret) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).setCredentials(clientId, clientSecret, isDebugging());
return this;
}
}
throw new RuntimeException("No OAuth2 authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOauthCredentials
File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setOauthCredentials
|
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setPackageName(String packageName)
{
this.packageName = packageName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPackageName
File: xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2023-27480
|
HIGH
| 7.7
|
xwiki/xwiki-platform
|
setPackageName
|
xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java
|
e3527b98fdd8dc8179c24dc55e662b2c55199434
| 0
|
Analyze the following code function for security vulnerabilities
|
protected final String getEncoding() {
return this.encoding;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEncoding
File: cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java
Repository: apereo/java-cas-client
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2014-4172
|
HIGH
| 7.5
|
apereo/java-cas-client
|
getEncoding
|
cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java
|
ae37092100c8eaec610dab6d83e5e05a8ee58814
| 0
|
Analyze the following code function for security vulnerabilities
|
public void playFromSearch(String packageName, int pid, int uid, String query,
Bundle extras) {
try {
final String reason = TAG + ":playFromSearch";
mService.tempAllowlistTargetPkgIfPossible(getUid(), getPackageName(),
pid, uid, packageName, reason);
mCb.onPlayFromSearch(packageName, pid, uid, query, extras);
} catch (RemoteException e) {
Log.e(TAG, "Remote failure in playFromSearch.", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: playFromSearch
File: services/core/java/com/android/server/media/MediaSessionRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21280
|
MEDIUM
| 5.5
|
android
|
playFromSearch
|
services/core/java/com/android/server/media/MediaSessionRecord.java
|
06e772e05514af4aa427641784c5eec39a892ed3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void disconnect(DisconnectReason reason, String message) {
close.lock();
try {
if (isRunning()) {
disconnectListener.notifyDisconnect(reason, message);
getService().notifyError(new TransportException(reason, "Disconnected"));
sendDisconnect(reason, message);
finishOff();
close.set();
}
} finally {
close.unlock();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: disconnect
File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java
Repository: hierynomus/sshj
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
hierynomus/sshj
|
disconnect
|
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
|
94fcc960e0fb198ddec0f7efc53f95ac627fe083
| 0
|
Analyze the following code function for security vulnerabilities
|
public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIntentForIntentSender
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getIntentForIntentSender
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public void unloadPlugin(String pluginId) {
getPluginManager().deletePlugin(pluginId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unloadPlugin
File: test-track/backend/src/main/java/io/metersphere/service/PlatformPluginService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
unloadPlugin
|
test-track/backend/src/main/java/io/metersphere/service/PlatformPluginService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<String> getAssistantAdjustments(String pkg) {
try {
return sINM.getAllowedAssistantAdjustments(pkg);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
}
return new ArrayList<>();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAssistantAdjustments
File: src/com/android/settings/notification/NotificationBackend.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35667
|
HIGH
| 7.8
|
android
|
getAssistantAdjustments
|
src/com/android/settings/notification/NotificationBackend.java
|
d8355ac47e068ad20c6a7b1602e72f0585ec0085
| 0
|
Analyze the following code function for security vulnerabilities
|
private void cancelPreloadRecentApps() {
if (mPreloadedRecentApps) {
mPreloadedRecentApps = false;
try {
IStatusBarService statusbar = getStatusBarService();
if (statusbar != null) {
statusbar.cancelPreloadRecentApps();
}
} catch (RemoteException e) {
Slog.e(TAG, "RemoteException when cancelling recent apps preload", e);
// re-acquire status bar service next time it is needed.
mStatusBarService = null;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cancelPreloadRecentApps
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
cancelPreloadRecentApps
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
private Library toLibrary(Element elt) {
if (!elt.hasAttribute("name")) {
loader.showError(Strings.get("libNameMissingError"));
return null;
}
if (!elt.hasAttribute("desc")) {
loader.showError(Strings.get("libDescMissingError"));
return null;
}
String name = elt.getAttribute("name");
String desc = elt.getAttribute("desc");
Library ret = loader.loadLibrary(desc);
if (ret == null)
return null;
libs.put(name, ret);
for (Element sub_elt : XmlIterator.forChildElements(elt, "tool")) {
if (!sub_elt.hasAttribute("name")) {
loader.showError(Strings.get("toolNameMissingError"));
} else {
String tool_str = sub_elt.getAttribute("name");
Tool tool = ret.getTool(tool_str);
if (tool != null) {
try {
initAttributeSet(sub_elt, tool.getAttributeSet(),
tool);
} catch (XmlReaderException e) {
addErrors(e, "lib." + name + "." + tool_str);
}
}
}
}
return ret;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toLibrary
File: src/com/cburch/logisim/file/XmlReader.java
Repository: logisim-evolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000889
|
MEDIUM
| 6.8
|
logisim-evolution
|
toLibrary
|
src/com/cburch/logisim/file/XmlReader.java
|
90aee8f8ceef463884cc400af4f6d1f109fb0972
| 0
|
Analyze the following code function for security vulnerabilities
|
private void processContentFileEntry(Context c, Item i, String path,
String fileName, String bundleName, boolean primary) throws SQLException,
IOException, AuthorizeException
{
String fullpath = path + File.separatorChar + fileName;
// get an input stream
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(
fullpath));
Bitstream bs = null;
String newBundleName = bundleName;
if (bundleName == null)
{
// is it license.txt?
if ("license.txt".equals(fileName))
{
newBundleName = "LICENSE";
}
else
{
// call it ORIGINAL
newBundleName = "ORIGINAL";
}
}
if (!isTest)
{
// find the bundle
Bundle[] bundles = i.getBundles(newBundleName);
Bundle targetBundle = null;
if (bundles.length < 1)
{
// not found, create a new one
targetBundle = i.createBundle(newBundleName);
}
else
{
// put bitstreams into first bundle
targetBundle = bundles[0];
}
// now add the bitstream
bs = targetBundle.createBitstream(bis);
bs.setName(fileName);
// Identify the format
// FIXME - guessing format guesses license.txt incorrectly as a text
// file format!
BitstreamFormat bf = FormatIdentifier.guessFormat(c, bs);
bs.setFormat(bf);
// Is this a the primary bitstream?
if (primary)
{
targetBundle.setPrimaryBitstreamID(bs.getID());
targetBundle.update();
}
bs.update();
}
bis.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processContentFileEntry
File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31195
|
HIGH
| 7.2
|
DSpace
|
processContentFileEntry
|
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
|
56e76049185bbd87c994128a9d77735ad7af0199
| 0
|
Analyze the following code function for security vulnerabilities
|
private int checkDeviceOwnerProvisioningPreConditionLocked(@Nullable ComponentName owner,
@UserIdInt int deviceOwnerUserId, @UserIdInt int callingUserId, boolean isAdb,
boolean hasIncompatibleAccountsOrNonAdb) {
if (mOwners.hasDeviceOwner()) {
return STATUS_HAS_DEVICE_OWNER;
}
if (mOwners.hasProfileOwner(deviceOwnerUserId)) {
return STATUS_USER_HAS_PROFILE_OWNER;
}
if (!mUserManager.isUserRunning(new UserHandle(deviceOwnerUserId))) {
return STATUS_USER_NOT_RUNNING;
}
if (mIsWatch && hasPaired(UserHandle.USER_SYSTEM)) {
return STATUS_HAS_PAIRED;
}
boolean isHeadlessSystemUserMode = mInjector.userManagerIsHeadlessSystemUserMode();
if (isHeadlessSystemUserMode) {
if (deviceOwnerUserId != UserHandle.USER_SYSTEM) {
Slogf.e(LOG_TAG, "In headless system user mode, "
+ "device owner can only be set on headless system user.");
return STATUS_NOT_SYSTEM_USER;
}
if (owner != null) {
DeviceAdminInfo adminInfo = findAdmin(
owner, deviceOwnerUserId, /* throwForMissingPermission= */ false);
if (adminInfo.getHeadlessDeviceOwnerMode()
!= HEADLESS_DEVICE_OWNER_MODE_AFFILIATED) {
return STATUS_HEADLESS_SYSTEM_USER_MODE_NOT_SUPPORTED;
}
}
}
if (isAdb) {
// If shell command runs after user setup completed check device status. Otherwise, OK.
if (mIsWatch || hasUserSetupCompleted(UserHandle.USER_SYSTEM)) {
// DO can be setup only if there are no users which are neither created by default
// nor marked as FOR_TESTING
if (nonTestNonPrecreatedUsersExist()) {
return STATUS_NONSYSTEM_USER_EXISTS;
}
int currentForegroundUser = getCurrentForegroundUserId();
if (callingUserId != currentForegroundUser
&& mInjector.userManagerIsHeadlessSystemUserMode()
&& currentForegroundUser == UserHandle.USER_SYSTEM) {
Slogf.wtf(LOG_TAG, "In headless system user mode, "
+ "current user cannot be system user when setting device owner");
return STATUS_SYSTEM_USER;
}
if (hasIncompatibleAccountsOrNonAdb) {
return STATUS_ACCOUNTS_NOT_EMPTY;
}
}
return STATUS_OK;
} else {
// DO has to be user 0
if (deviceOwnerUserId != UserHandle.USER_SYSTEM) {
return STATUS_NOT_SYSTEM_USER;
}
// Only provision DO before setup wizard completes
if (hasUserSetupCompleted(UserHandle.USER_SYSTEM)) {
return STATUS_USER_SETUP_COMPLETED;
}
return STATUS_OK;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkDeviceOwnerProvisioningPreConditionLocked
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
|
checkDeviceOwnerProvisioningPreConditionLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private static Method getSetter(Class<? extends Object> clazz, Method getter, String methodname) {
List<Method> setterMethods = getMethodCaseInsensitive(clazz, methodname);
if (setterMethods != null && !setterMethods.isEmpty()) {
if (setterMethods.size() == 1) {
return setterMethods.get(0);
} else if (setterMethods.size() > 1) {
for (Method m : setterMethods) {
Class<?>[] parameters = m.getParameterTypes();
for (Class<?> parameter : parameters) {
if (getter.getReturnType().equals(parameter)) {
return m;
}
}
}
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSetter
File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
Repository: openmrs/openmrs-module-htmlformentry
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-16521
|
HIGH
| 7.5
|
openmrs/openmrs-module-htmlformentry
|
getSetter
|
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
|
9dcd304688e65c31cac5532fe501b9816ed975ae
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<String> getTypesVisibleToCaller(int callingUid, int userId,
String opPackageName) {
return getTypesForCaller(callingUid, userId, true /* isOtherwisePermitted*/);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTypesVisibleToCaller
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
getTypesVisibleToCaller
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
public HashMap<String, String> getBackendConfiguration() {
HashMap<String, String> config = new HashMap<>();
// Append properties used by backend worker here
config.put("TS_DECODE_INPUT_REQUEST", prop.getProperty(TS_DECODE_INPUT_REQUEST, "true"));
config.put("TS_IPEX_ENABLE", prop.getProperty(TS_IPEX_ENABLE, "false"));
return config;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBackendConfiguration
File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
Repository: pytorch/serve
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2023-43654
|
CRITICAL
| 9.8
|
pytorch/serve
|
getBackendConfiguration
|
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
|
391bdec3348e30de173fbb7c7277970e0b53c8ad
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected int beforeHandle(Request request, Response response)
{
ComponentManager componentManager =
(ComponentManager) getContext().getAttributes().get(Constants.XWIKI_COMPONENT_MANAGER);
XWikiContext xwikiContext = Utils.getXWikiContext(componentManager);
try {
EntityReferenceSerializer<String> serializer =
componentManager.getInstance(EntityReferenceSerializer.TYPE_STRING);
/*
* We add headers to the response to allow applications to verify if the authentication is still valid. We
* are also adding the XWiki version at the same moment.
*/
Series<Header> responseHeaders =
(Series<Header>) response.getAttributes().get(HeaderConstants.ATTRIBUTE_HEADERS);
if (responseHeaders == null) {
responseHeaders = new Series<>(Header.class);
response.getAttributes().put(HeaderConstants.ATTRIBUTE_HEADERS, responseHeaders);
}
responseHeaders.add("XWiki-User", serializer.serialize(xwikiContext.getUserReference()));
responseHeaders.add("XWiki-Version", xwikiContext.getWiki().getVersion());
} catch (ComponentLookupException e) {
getLogger()
.warning("Failed to lookup the entity reference serializer: " + ExceptionUtils.getRootCauseMessage(e));
}
return CONTINUE;
}
|
Vulnerability Classification:
- CWE: CWE-352
- CVE: CVE-2023-37277
- Severity: CRITICAL
- CVSS Score: 9.6
Description: XWIKI-20135: Require a CSRF token for some request types in the REST API
* Require a CSRF token in the XWiki-Form-Token header in content types
allowed in simple requests.
* Add integration tests to check that the check is indeed working.
* Automatically add the CSRF token header in same-origin requests
initiated from JavaScript.
* Add an integration test to check that the form token is correctly
added and fetch requests are still working.
Co-authored-by: Marius Dumitru Florea <marius@xwiki.com>
Function: beforeHandle
File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/XWikiFilter.java
Repository: xwiki/xwiki-platform
Fixed Code:
@Override
protected int beforeHandle(Request request, Response response)
{
ComponentManager componentManager =
(ComponentManager) getContext().getAttributes().get(Constants.XWIKI_COMPONENT_MANAGER);
XWikiContext xwikiContext = Utils.getXWikiContext(componentManager);
CSRFToken csrfToken = null;
try {
csrfToken = componentManager.getInstance(CSRFToken.class);
} catch (ComponentLookupException e) {
getLogger().warning("Failed to lookup CSRF token validator: " + ExceptionUtils.getRootCauseMessage(e));
}
try {
EntityReferenceSerializer<String> serializer =
componentManager.getInstance(EntityReferenceSerializer.TYPE_STRING);
/*
* We add headers to the response to allow applications to verify if the authentication is still valid. We
* are also adding the XWiki version at the same moment.
*/
Series<Header> responseHeaders =
(Series<Header>) response.getAttributes().get(HeaderConstants.ATTRIBUTE_HEADERS);
if (responseHeaders == null) {
responseHeaders = new Series<>(Header.class);
response.getAttributes().put(HeaderConstants.ATTRIBUTE_HEADERS, responseHeaders);
}
responseHeaders.add("XWiki-User", serializer.serialize(xwikiContext.getUserReference()));
responseHeaders.add("XWiki-Version", xwikiContext.getWiki().getVersion());
if (csrfToken != null) {
responseHeaders.add(FORM_TOKEN_HEADER, csrfToken.getToken());
}
} catch (ComponentLookupException e) {
getLogger()
.warning("Failed to lookup the entity reference serializer: " + ExceptionUtils.getRootCauseMessage(e));
}
int result = CONTINUE;
HttpServletRequest servletRequest = ServletUtils.getRequest(Request.getCurrent());
// Require a CSRF token for requests that browsers allow through HTML forms and across origins.
// See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS for more information.
// Compare to the method from the servlet request to avoid the automatic conversion from POST to PUT request.
// Check for a prefix match to make sure it matches regardless of the supplied parameters (like charset).
if ("POST".equals(servletRequest.getMethod()) && SIMPLE_CONTENT_TYPES.stream().anyMatch(expectedType ->
StringUtils.startsWith(StringUtils.lowerCase(servletRequest.getContentType()), expectedType)))
{
Series<Header> requestHeaders = request.getHeaders();
String formToken = requestHeaders.getFirstValue(FORM_TOKEN_HEADER);
// Skip the main request handler but allow cleanup if either the CSRF validator failed or the token is
// invalid.
if (csrfToken == null) {
response.setStatus(Status.SERVER_ERROR_INTERNAL);
response.setEntity("Failed to lookup the CSRF token validator.", MediaType.TEXT_PLAIN);
result = SKIP;
} else if (!csrfToken.isTokenValid(formToken)) {
response.setStatus(Status.CLIENT_ERROR_FORBIDDEN);
response.setEntity("Invalid or missing form token.", MediaType.TEXT_PLAIN);
result = SKIP;
}
}
return result;
}
|
[
"CWE-352"
] |
CVE-2023-37277
|
CRITICAL
| 9.6
|
xwiki/xwiki-platform
|
beforeHandle
|
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/XWikiFilter.java
|
4c175405faa0e62437df397811c7526dfc0fbae7
| 1
|
Analyze the following code function for security vulnerabilities
|
private void readEscape() throws IOException {
pauseCapture();
read();
switch(current) {
case '"':
case '\'':
case '/':
case '\\':
captureBuffer.append((char)current);
break;
case 'b':
captureBuffer.append('\b');
break;
case 'f':
captureBuffer.append('\f');
break;
case 'n':
captureBuffer.append('\n');
break;
case 'r':
captureBuffer.append('\r');
break;
case 't':
captureBuffer.append('\t');
break;
case 'u':
char[] hexChars=new char[4];
for (int i=0; i<4; i++) {
read();
if (!isHexDigit()) {
throw expected("hexadecimal digit");
}
hexChars[i]=(char)current;
}
captureBuffer.append((char)Integer.parseInt(new String(hexChars), 16));
break;
default:
throw expected("valid escape sequence");
}
capture=true;
read();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readEscape
File: src/main/org/hjson/HjsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34620
|
HIGH
| 7.5
|
hjson/hjson-java
|
readEscape
|
src/main/org/hjson/HjsonParser.java
|
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test(description = "Test pullCount of a package from central", dependsOnMethods = "testPull", enabled = false)
public void testPullCount() throws IOException {
initializeSsl();
String url = RepoUtils.getRemoteRepoURL() + "/modules/info/" + orgName + "/" + moduleName + "/*/";
HttpURLConnection conn = createHttpUrlConnection(convertToUrl(url), "", 0, "", "");
conn.setInstanceFollowRedirects(false);
setRequestMethod(conn, Utils.RequestMethod.GET);
int statusCode = conn.getResponseCode();
if (statusCode == 200) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(),
Charset.defaultCharset()))) {
StringBuilder result = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
result.append(line);
}
Object payload = JSONParser.parse(result.toString());
if (payload instanceof MapValue) {
long pullCount = ((MapValue) payload).getIntValue("totalPullCount");
Assert.assertEquals(pullCount, totalPullCount);
} else {
Assert.fail("error: invalid response received");
}
}
} else {
Assert.fail("error: could not connect to remote repository to find the latest version of module");
}
}
|
Vulnerability Classification:
- CWE: CWE-306
- CVE: CVE-2021-32700
- Severity: MEDIUM
- CVSS Score: 5.8
Description: Fix central connection
Function: testPullCount
File: tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PackagingTestCase.java
Repository: ballerina-platform/ballerina-lang
Fixed Code:
@Test(description = "Test pullCount of a package from central", dependsOnMethods = "testPull", enabled = false)
public void testPullCount() throws IOException {
String url = RepoUtils.getRemoteRepoURL() + "/modules/info/" + orgName + "/" + moduleName + "/*/";
HttpsURLConnection conn = createHttpsUrlConnection(convertToUrl(url), "", 0, "", "");
conn.setInstanceFollowRedirects(false);
setRequestMethod(conn, Utils.RequestMethod.GET);
int statusCode = conn.getResponseCode();
if (statusCode == 200) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(),
Charset.defaultCharset()))) {
StringBuilder result = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
result.append(line);
}
Object payload = JSONParser.parse(result.toString());
if (payload instanceof MapValue) {
long pullCount = ((MapValue) payload).getIntValue("totalPullCount");
Assert.assertEquals(pullCount, totalPullCount);
} else {
Assert.fail("error: invalid response received");
}
}
} else {
Assert.fail("error: could not connect to remote repository to find the latest version of module");
}
}
|
[
"CWE-306"
] |
CVE-2021-32700
|
MEDIUM
| 5.8
|
ballerina-platform/ballerina-lang
|
testPullCount
|
tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PackagingTestCase.java
|
4609ffee1744ecd16aac09303b1783bf0a525816
| 1
|
Analyze the following code function for security vulnerabilities
|
public static String getWin32ErrorMessage(IOException e) {
return Util.getWin32ErrorMessage(e);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWin32ErrorMessage
File: core/src/main/java/hudson/Functions.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2014-2061
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
getWin32ErrorMessage
|
core/src/main/java/hudson/Functions.java
|
bf539198564a1108b7b71a973bf7de963a6213ef
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean hasMethodReadResolve() {
return (methodReadResolve != null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasMethodReadResolve
File: luni/src/main/java/java/io/ObjectStreamClass.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
hasMethodReadResolve
|
luni/src/main/java/java/io/ObjectStreamClass.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int ndefMakeReadOnly(int nativeHandle) throws RemoteException {
NfcPermissions.enforceUserPermissions(mContext);
TagEndpoint tag;
// Check if NFC is enabled
if (!isNfcEnabled()) {
return ErrorCodes.ERROR_NOT_INITIALIZED;
}
/* find the tag in the hmap */
tag = (TagEndpoint) findObject(nativeHandle);
if (tag == null) {
return ErrorCodes.ERROR_IO;
}
if (tag.makeReadOnly()) {
return ErrorCodes.SUCCESS;
} else {
return ErrorCodes.ERROR_IO;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: ndefMakeReadOnly
File: src/com/android/nfc/NfcService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3761
|
LOW
| 2.1
|
android
|
ndefMakeReadOnly
|
src/com/android/nfc/NfcService.java
|
9ea802b5456a36f1115549b645b65c791eff3c2c
| 0
|
Analyze the following code function for security vulnerabilities
|
static Trampoline getInstance() {
// Always constructed during system bringup, so no need to lazy-init
return sInstance;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInstance
File: services/backup/java/com/android/server/backup/BackupManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3759
|
MEDIUM
| 5
|
android
|
getInstance
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
public void hideImeIfNeeded() {
// Hide input method window from the current view synchronously
// because ImeAdapter does so asynchronouly with a delay, and
// by the time when ImeAdapter dismisses the input, the
// containerView may have lost focus.
// We cannot trust ContentViewClient#onImeStateChangeRequested to
// hide the input window because it has an empty default implementation.
// So we need to explicitly hide the input method window here.
if (mInputMethodManagerWrapper.isActive(mContainerView)) {
mInputMethodManagerWrapper.hideSoftInputFromWindow(
mContainerView.getWindowToken(), 0, null);
}
getContentViewClient().onImeStateChangeRequested(false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hideImeIfNeeded
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
hideImeIfNeeded
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void sendShutdown() {
super.sendShutdown();
try {
// FORCE SOCKET CLOSING
if (channel.socket != null)
channel.socket.close();
} catch (final Exception e) {
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendShutdown
File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
Repository: orientechnologies/orientdb
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2015-2912
|
MEDIUM
| 6.8
|
orientechnologies/orientdb
|
sendShutdown
|
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
|
d5a45e608ba8764fd817c1bdd7cf966564e828e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public static float[] uncompressFloatArray(byte[] input, int offset, int length)
throws IOException
{
int uncompressedLength = Snappy.uncompressedLength(input, offset, length);
float[] result = new float[uncompressedLength / 4];
impl.rawUncompress(input, offset, length, result, 0);
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uncompressFloatArray
File: src/main/java/org/xerial/snappy/Snappy.java
Repository: xerial/snappy-java
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2023-34454
|
HIGH
| 7.5
|
xerial/snappy-java
|
uncompressFloatArray
|
src/main/java/org/xerial/snappy/Snappy.java
|
d0042551e4a3509a725038eb9b2ad1f683674d94
| 0
|
Analyze the following code function for security vulnerabilities
|
public static CertRevokeRequest fromDOM(Element dataElement) {
CertRevokeRequest request = new CertRevokeRequest();
NodeList reasonList = dataElement.getElementsByTagName("Reason");
if (reasonList.getLength() > 0) {
String value = reasonList.item(0).getTextContent();
request.setReason(value);
}
NodeList invalidityDateList = dataElement.getElementsByTagName("InvalidityDate");
if (invalidityDateList.getLength() > 0) {
String value = invalidityDateList.item(0).getTextContent();
request.setInvalidityDate(new Date(Long.parseLong(value)));
}
NodeList commentsList = dataElement.getElementsByTagName("Comments");
if (commentsList.getLength() > 0) {
String value = commentsList.item(0).getTextContent();
request.setComments(value);
}
NodeList encodedList = dataElement.getElementsByTagName("Encoded");
if (encodedList.getLength() > 0) {
String value = encodedList.item(0).getTextContent();
request.setEncoded(value);
}
NodeList nonceList = dataElement.getElementsByTagName("Nonce");
if (nonceList.getLength() > 0) {
String value = nonceList.item(0).getTextContent();
request.setNonce(Long.parseLong(value));
}
return request;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fromDOM
File: base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
fromDOM
|
base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<RxFateReport> getRxPktFates() {
return mWifiNative.getRxPktFates(mInterfaceName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRxPktFates
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
getRxPktFates
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.