messages
listlengths
2
2
[ { "role": "user", "content": "Review this code for security vulnerabilities:\n\n```python\nimport zipfile\ndef extract_upload(zip_path, dest):\n with zipfile.ZipFile(zip_path) as zf:\n zf.extractall(dest)\n```\n\nIdentify any security issues, their severity, and how to fix them." }, { "role": "assistant", "content": "**Security Issue Found:**\n\n**Zip Bomb / Decompression Bomb (CWE-409)**\n- **Severity:** Critical\n- **Location:** See code above\n\n**Explanation:**\nNo size limits. A 42KB zip can expand to 4.5 petabytes (zip bomb), causing disk exhaustion or DoS.\n\n**How to Fix:**\nCheck total uncompressed size before extraction, set limits, extract one file at a time with size checks." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: PYSEC-2015-26\nDescription: \n\n```diff\nFrom 35f32dd2da804d108a3a3585b69ec3295b2677ed Mon Sep 17 00:00:00 2001\nFrom: Matthias Bussonnier <bussonniermatthias@gmail.com>\nDate: Fri, 21 Aug 2015 17:58:12 +0200\nSubject: [PATCH] Fix XSS reported on Security list\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\nNo CVE-ID yet\n\nAugust 18, 2015\n-----\nReported to Quantopian by Juan Broullón <thebrowfc@gmail.com>...\n\nIf you create a new folder in the iPython file browser and set\nJavascript code as its name the code injected will be executed. So, if I\ncreate a folder called \"><img src=x onerror=alert(document.cookie)> and\nthen I access to it, the cookies will be prompted.\n\nThe XSS code is also executed if you access a link pointing directly at\nthe folder.\n\n jik\n------\n---\n notebook/notebookapp.py | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/notebook/notebookapp.py b/notebook/notebookapp.py\nindex 35d9312e9f..02aab5f448 100644\n--- a/notebook/notebookapp.py\n+++ b/notebook/notebookapp.py\n@@ -159,7 +159,9 @@ def init_settings(self, ipython_app, kernel_manager, contents_manager,\n _template_path = (_template_path,)\n template_path = [os.path.expanduser(path) for path in _template_path]\n \n- jenv_opt = jinja_env_options if jinja_env_options else {}\n+ jenv_opt = {\"autoescape\": True}\n+ jenv_opt.update(jinja_env_options if jinja_env_options else {})\n+\n env = Environment(loader=FileSystemLoader(template_path), **jenv_opt)\n \n sys_info = get_sys_info()\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** PYSEC-2015-26\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2022-24842\nDescription: MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. A security issue was found where an non-admin user is able to create service accounts for root or other admin users and then is able to assume their access policies via the generated credentials. This in turn allows the user to escalate privilege to that of the root user. This vulnerability has been resolved in pull request #14729 and is included in `RELEASE.2022-04-12T06-55-35Z`. Users unable to up\n\n```diff\nFrom 66b14a0d32684d527ae8018dc6d9d46ccce58ae3 Mon Sep 17 00:00:00 2001\nFrom: Aditya Manthramurthy <donatello@users.noreply.github.com>\nDate: Mon, 11 Apr 2022 15:30:28 -0700\nSubject: [PATCH] Fix service account privilege escalation (#14729)\n\nEnsure that a regular unprivileged user is unable to create service accounts for other users/root.\n---\n cmd/admin-handlers-users.go | 1 -\n cmd/admin-handlers-users_test.go | 3 +++\n cmd/sts-handlers_test.go | 9 +++++++++\n 3 files changed, 12 insertions(+), 1 deletion(-)\n\ndiff --git a/cmd/admin-handlers-users.go b/cmd/admin-handlers-users.go\nindex 43e8ef543993a..97dec64825121 100644\n--- a/cmd/admin-handlers-users.go\n+++ b/cmd/admin-handlers-users.go\n@@ -605,7 +605,6 @@ func (a adminAPIHandlers) AddServiceAccount(w http.ResponseWriter, r *http.Reque\n \t\t\tConditionValues: getConditionValues(r, \"\", cred.AccessKey, claims),\n \t\t\tIsOwner: owner,\n \t\t\tClaims: claims,\n-\t\t\tDenyOnly: true,\n \t\t}) {\n \t\t\twriteErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrAccessDenied), r.URL)\n \t\t\treturn\ndiff --git a/cmd/admin-handlers-users_test.go b/cmd/admin-handlers-users_test.go\nindex 1f9f94316eada..1677bcff586e2 100644\n--- a/cmd/admin-handlers-users_test.go\n+++ b/cmd/admin-handlers-users_test.go\n@@ -890,6 +890,9 @@ func (s *TestSuiteIAM) TestServiceAccountOpsByUser(c *check) {\n \n \t// 5. Check that service account can be deleted.\n \tc.assertSvcAccDeletion(ctx, s, userAdmClient, accessKey, bucket)\n+\n+\t// 6. Check that service account cannot be created for some other user.\n+\tc.mustNotCreateSvcAccount(ctx, globalActiveCred.AccessKey, userAdmClient)\n }\n \n func (s *TestSuiteIAM) TestServiceAccountOpsByAdmin(c *check) {\ndiff --git a/cmd/sts-handlers_test.go b/cmd/sts-handlers_test.go\nindex 86a19efd1da6c..7ea02b5815f08 100644\n--- a/cmd/sts-handlers_test.go\n+++ b/cmd/sts-handlers_test.go\n@@ -625,6 +625,9 @@ func (s *TestSuiteIAM) TestLDAPSTSServiceAccounts(c *check) {\n \n \t// 5. Check that service account can be deleted.\n \tc.assertSvcAccDeletion(ctx, s, userAdmClient, value.AccessKeyID, bucket)\n+\n+\t// 6. Check that service account cannot be created for some other user.\n+\tc.mustNotCreateSvcAccount(ctx, globalActiveCred.AccessKey, userAdmClient)\n }\n \n // In this test, the parent users gets their permissions from a group, rather\n@@ -725,6 +728,9 @@ func (s *TestSuiteIAM) TestLDAPSTSServiceAccountsWithGroups(c *check) {\n \n \t// 5. Check that service account can be deleted.\n \tc.assertSvcAccDeletion(ctx, s, userAdmClient, value.AccessKeyID, bucket)\n+\n+\t// 6. Check that service account cannot be created for some other user.\n+\tc.mustNotCreateSvcAccount(ctx, globalActiveCred.AccessKey, userAdmClient)\n }\n \n func (s *TestSuiteIAM) TestOpenIDSTS(c *check) {\n@@ -979,6 +985,9 @@ func (s *TestSuiteIAM) TestOpenIDServiceAcc(c *check) {\n \n \t// 5. Check that service account can be deleted.\n \tc.assertSvcAccDeletion(ctx, s, userAdmClient, value.AccessKeyID, bucket)\n+\n+\t// 6. Check that service account cannot be created for some ot\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2022-24842\n**CWE:** CWE-269: Improper Privilege Management\n**Title:** Improper Privilege Management in MinIO\n\nThis patch addresses: MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. A security issue was found where an non-admin user is able to create service accounts for root or other admin users and then is able to assume their access policies via the generated credentials. This in turn allows the user to escalate privilege to that of the root user. This vulnerability has been resolved in pull request #14729 and is included in `RELEASE.2022-04-12T06-55-35Z`. Users unable to up\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-5xv5-wxfg-845r\nDescription: \n\n```diff\nFrom be95a4fe2951374676efc9454ffee8638faaf68d Mon Sep 17 00:00:00 2001\nFrom: Akim Demaille <akim.demaille@gmail.com>\nDate: Tue, 28 Jul 2020 18:51:30 +0200\nSubject: [PATCH] scanner: don't crash on strings containing a NUL byte\n\nWe crash if the input contains a string containing a NUL byte.\nReported by Suhwan Song.\nhttps://lists.gnu.org/r/bug-bison/2020-07/msg00051.html\n\n* src/flex-scanner.h (STRING_FREE): Avoid accidental use of\nlast_string.\n* src/scan-gram.l: Don't call STRING_FREE without calling\nSTRING_FINISH first.\n* tests/input.at (Invalid inputs): Check that case.\n---\n THANKS | 1 +\n src/flex-scanner.h | 10 +++++++++-\n src/scan-gram.l | 3 ++-\n tests/input.at | 48 ++++++++++++++++++++++++++++++++++++----------\n 4 files changed, 50 insertions(+), 12 deletions(-)\n\ndiff --git a/THANKS b/THANKS\nindex ac073ea67..5c64da3c0 100644\n--- a/THANKS\n+++ b/THANKS\n@@ -185,6 +185,7 @@ Simon Sobisch simonsobisch@web.de\n Stefano Lattarini stefano.lattarini@gmail.com\n Stephen Cameron stephenmcameron@gmail.com\n Steve Murphy murf@parsetree.com\n+Suhwan Song prada960808@gmail.com\n Sum Wu sum@geekhouse.org\n Théophile Ranquet theophile.ranquet@gmail.com\n Thiru Ramakrishnan thiru.ramakrishnan@gmail.com\ndiff --git a/src/flex-scanner.h b/src/flex-scanner.h\nindex 56ca7ce32..028847fda 100644\n--- a/src/flex-scanner.h\n+++ b/src/flex-scanner.h\n@@ -112,7 +112,15 @@ static struct obstack obstack_for_string;\n # define STRING_1GROW(Char) \\\n obstack_1grow (&obstack_for_string, Char)\n \n-# define STRING_FREE() \\\n+# ifdef NDEBUG\n+# define STRING_FREE() \\\n obstack_free (&obstack_for_string, last_string)\n+# else\n+# define STRING_FREE() \\\n+ do { \\\n+ obstack_free (&obstack_for_string, last_string); \\\n+ last_string = NULL; \\\n+ } while (0)\n+#endif\n \n #endif\ndiff --git a/src/scan-gram.l b/src/scan-gram.l\nindex f8d85f23f..ad2904ce8 100644\n--- a/src/scan-gram.l\n+++ b/src/scan-gram.l\n@@ -403,6 +403,7 @@ eqopt ({sp}=)?\n {\n \\0 {\n complain (loc, complaint, _(\"invalid null character\"));\n+ STRING_FINISH ();\n STRING_FREE ();\n return GRAM_error;\n }\n@@ -599,7 +600,6 @@ eqopt ({sp}=)?\n STRING_FINISH ();\n BEGIN INITIAL;\n loc->start = token_start;\n- val->CHAR = last_string[0];\n \n if (last_string[0] == '\\0')\n {\n@@ -615,6 +615,7 @@ eqopt ({sp}=)?\n }\n else\n {\n+ val->CHAR = last_string[0];\n STRING_FREE ();\n return CHAR;\n }\ndiff --git a/tests/input.at b/tests/input.at\nindex 4da637955..effcd1cc9 100644\n--- a/tests/input.at\n+++ b/tests/input.at\n@@ -1,4 +1,4 @@\n-# Checking the Bison scanner. -*- Autotest -*-\n+# Checking the Bison reader. -*- Auto\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-5xv5-wxfg-845r\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2020-26268\nDescription: In affected versions of TensorFlow the tf.raw_ops.ImmutableConst operation returns a constant tensor created from a memory mapped file which is assumed immutable. However, if the type of the tensor is not an integral type, the operation crashes the Python interpreter as it tries to write to the memory area. If the file is too small, TensorFlow properly returns an error as the memory area has fewer bytes than what is needed for the tensor it creates. However, as soon as there are enough bytes, th\n\n```diff\nFrom c1e1fc899ad5f8c725dcbb6470069890b5060bc7 Mon Sep 17 00:00:00 2001\nFrom: Mihai Maruseac <mihaimaruseac@google.com>\nDate: Fri, 4 Dec 2020 17:06:23 -0800\nSubject: [PATCH] Mark `MemmappedTensorAllocator` as returning opaque handle.\n\nThis allocator is used for `ImmutableConstantOp` and it returns a handle to the contents of a memory mapped file which is supposed to represent a tensor.\n\nFor tensors of complex types (resources, variables and strings), allocators which are not marked as returning opaque handles will call placement new to initialize each element. This means writing to the buffer. However, in our case, the buffer is immutable and already contains the tensor data. Hence, writing to it is both destructive and causes a crash.\n\nPiperOrigin-RevId: 345786451\nChange-Id: I46369c50fa60b3431709ffe068a728d3061f49c4\n---\n tensorflow/core/kernels/immutable_constant_op.cc | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/tensorflow/core/kernels/immutable_constant_op.cc b/tensorflow/core/kernels/immutable_constant_op.cc\nindex 0dd08c694eb6c5..1cfbdb82778913 100644\n--- a/tensorflow/core/kernels/immutable_constant_op.cc\n+++ b/tensorflow/core/kernels/immutable_constant_op.cc\n@@ -62,6 +62,12 @@ class MemmappedTensorAllocator : public Allocator {\n \n void set_delete_on_deallocate() { delete_on_deallocate_ = true; }\n \n+ // Make sure tensors or complex types (strings, variants, resources) don't get\n+ // their constructor called via a placement new since that would require\n+ // writing to immutable data.\n+ // See also: tensorflow/core/framework/typed_allocator.h\n+ bool AllocatesOpaqueHandle() const override { return true; }\n+\n private:\n std::unique_ptr<ReadOnlyMemoryRegion> memory_region_;\n // If there is an error during allocation we keep it in this status.\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2020-26268\n**CWE:** CWE-471 Modification of Assumed-Immutable Data (MAID)\n**Title:** Write to immutable memory region in TensorFlow\n\nThis patch addresses: In affected versions of TensorFlow the tf.raw_ops.ImmutableConst operation returns a constant tensor created from a memory mapped file which is assumed immutable. However, if the type of the tensor is not an integral type, the operation crashes the Python interpreter as it tries to write to the memory area. If the file is too small, TensorFlow properly returns an error as the memory area has fewer bytes than what is needed for the tensor it creates. However, as soon as there are enough bytes, th\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-r48p-vhgj-x8mm\nDescription: \n\n```diff\nFrom 8ca431f86ae3a6f9a17afcfed51cdd065fcff1a5 Mon Sep 17 00:00:00 2001\nFrom: Alex Tugarev <alex.tugarev@typefox.io>\nDate: Wed, 13 Jan 2021 08:36:53 +0000\nSubject: [PATCH] [server/auth] ensure safe returnTo param\n\n---\n components/server/src/user/user-controller.ts | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/components/server/src/user/user-controller.ts b/components/server/src/user/user-controller.ts\nindex c62964420cbc2e..bd3b68596ce953 100644\n--- a/components/server/src/user/user-controller.ts\n+++ b/components/server/src/user/user-controller.ts\n@@ -81,6 +81,7 @@ export class UserController {\n }\n \n // Proceed with login\n+ this.ensureSafeReturnToParam(req);\n await this.authenticator.authenticate(req, res, next);\n });\n router.get(\"/authorize\", (req: express.Request, res: express.Response, next: express.NextFunction) => {\n@@ -88,6 +89,7 @@ export class UserController {\n res.sendStatus(401);\n return;\n }\n+ this.ensureSafeReturnToParam(req);\n this.authenticator.authorize(req, res, next);\n });\n const branding = this.env.brandingConfig;\n@@ -483,6 +485,10 @@ export class UserController {\n }\n }\n \n+ protected ensureSafeReturnToParam(req: express.Request) {\n+ req.query.returnTo = this.getSafeReturnToParam(req);\n+ }\n+\n protected getSafeReturnToParam(req: express.Request) {\n const returnToURL: string | undefined = req.query.redirect || req.query.returnTo;\n if (returnToURL) {\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-r48p-vhgj-x8mm\n**CWE:** Unknown\n**Title:** Unvalidated redirects\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-fpr2-2gg6-pf5c\nDescription: \n\n```diff\nFrom 288f81cc4d69d9ff947596fbb48c3446eeee8e2e Mon Sep 17 00:00:00 2001\nFrom: Matteo Beccati <matteo@beccati.com>\nDate: Sun, 27 Sep 2015 13:02:40 +0200\nSubject: [PATCH] Fix CVE-2015-7364\n\nCross-Site Request Forgery (CSRF)\n---------------------------------\n\nAbdullah Hussam Gazi discovered that the CSRF protection mechanism introduced\na few years ago to secure the forms generated with the HTML_Quickform library\n(most fo the forms in Revive Adserver's admin UI) could be easily bypassed by\nsending an empty token along with the POST data. The range of malicious actions\ninclude, but is not limited to, modifying entities like banners and zones and\naltering preferences and settings.\n\nCWE: CWE-352\nCVSSv2: 5.1 (AV:N/AC:H/Au:N/C:P/I:P/A:P)\n---\n lib/OA/Admin/UI/component/Form.php | 9 ++++++---\n lib/pear/HTML/QuickForm/Renderer/Array.php | 5 ++++-\n lib/pear/HTML/QuickForm/hidden.php | 6 ++++--\n 3 files changed, 14 insertions(+), 6 deletions(-)\n\ndiff --git a/lib/OA/Admin/UI/component/Form.php b/lib/OA/Admin/UI/component/Form.php\nindex 48ad48b655..7d21c5d617 100644\n--- a/lib/OA/Admin/UI/component/Form.php\n+++ b/lib/OA/Admin/UI/component/Form.php\n@@ -125,8 +125,11 @@ function __construct($formName='', $method='POST', $action='', $target='', $attr\n //trim spaces from all data sent by the user\n $this->applyFilter('__ALL__', 'trim');\n \n- $this->addElement('hidden', 'token', phpAds_SessionGetToken());\n- $this->addRule('token', 'Invalid request token', 'callback', 'phpAds_SessionValidateToken');\n+ if (!defined('phpAds_installing')) {\n+ $this->addElement('hidden', 'token', phpAds_SessionGetToken());\n+ $this->addRule('token', 'Missing request token', 'required');\n+ $this->addRule('token', 'Invalid request token', 'callback', 'phpAds_SessionValidateToken');\n+ }\n }\n \n function validate()\n@@ -136,7 +139,7 @@ function validate()\n if (!$ret) {\n // The form returned an error. We need to generate a new CSRF token, in any.\n $token = $this->getElement('token');\n- if (!empty($token)) {\n+ if (!empty($token) && !PEAR::isError($token)) {\n $token->setValue(phpAds_SessionGetToken());\n }\n }\ndiff --git a/lib/pear/HTML/QuickForm/Renderer/Array.php b/lib/pear/HTML/QuickForm/Renderer/Array.php\nindex b837d70f70..075bfff295 100644\n--- a/lib/pear/HTML/QuickForm/Renderer/Array.php\n+++ b/lib/pear/HTML/QuickForm/Renderer/Array.php\n@@ -225,13 +225,16 @@ function renderElement(&$element, $required, $error)\n } // end func renderElement\n \n \n- function renderHidden(&$element)\n+ function renderHidden(&$element, $required, $error)\n {\n if ($this->_collectHidden) {\n $this->_ary['hidden'] .= $element->toHtml() . \"\\n\";\n } else {\n $this->renderElement($element, false, null);\n }\n+ if (!empty($error)) {\n+ $this->_ary['errors'][$elAry['name']] \n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-fpr2-2gg6-pf5c\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-h46p-wf26-6wcw\nDescription: \n\n```diff\nFrom ab612b1daf415b62c58e130cb3d0f30b255a14d0 Mon Sep 17 00:00:00 2001\nFrom: Navid Emamdoost <navid.emamdoost@gmail.com>\nDate: Thu, 19 Sep 2019 10:50:02 -0500\nSubject: [PATCH] iio: imu: adis16400: release allocated memory on failure\n\nIn adis_update_scan_mode, if allocation for adis->buffer fails,\npreviously allocated adis->xfer needs to be released.\n\nSigned-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>\nReviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>\nSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>\n---\n drivers/iio/imu/adis_buffer.c | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c\nindex 9ac8356d9a954b..f446ff49780919 100644\n--- a/drivers/iio/imu/adis_buffer.c\n+++ b/drivers/iio/imu/adis_buffer.c\n@@ -78,8 +78,11 @@ int adis_update_scan_mode(struct iio_dev *indio_dev,\n \t\treturn -ENOMEM;\n \n \tadis->buffer = kcalloc(indio_dev->scan_bytes, 2, GFP_KERNEL);\n-\tif (!adis->buffer)\n+\tif (!adis->buffer) {\n+\t\tkfree(adis->xfer);\n+\t\tadis->xfer = NULL;\n \t\treturn -ENOMEM;\n+\t}\n \n \trx = adis->buffer;\n \ttx = rx + scan_count;\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-h46p-wf26-6wcw\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-r4pf-3v7r-hh55\nDescription: \n\n```diff\nFrom 8f4acff3c2d45c1cb07779bb3fe79644408ee387 Mon Sep 17 00:00:00 2001\nFrom: Mike Maietta <mmaietta@users.noreply.github.com>\nDate: Mon, 19 Feb 2024 19:02:24 -0800\nSubject: [PATCH] fix: execute `%SYSTEMROOT%` cmd.exe directly during NSIS\n installer (#8059)\n\n---\n .changeset/large-trainers-enjoy.md | 5 +++++\n .../nsis/include/allowOnlyOneInstallerInstance.nsh | 6 +++---\n 2 files changed, 8 insertions(+), 3 deletions(-)\n create mode 100644 .changeset/large-trainers-enjoy.md\n\ndiff --git a/.changeset/large-trainers-enjoy.md b/.changeset/large-trainers-enjoy.md\nnew file mode 100644\nindex 00000000000..7d30a7a9d23\n--- /dev/null\n+++ b/.changeset/large-trainers-enjoy.md\n@@ -0,0 +1,5 @@\n+---\n+\"app-builder-lib\": patch\n+---\n+\n+fix: execute %SYSTEMROOT% cmd.exe directly during NSIS installer\ndiff --git a/packages/app-builder-lib/templates/nsis/include/allowOnlyOneInstallerInstance.nsh b/packages/app-builder-lib/templates/nsis/include/allowOnlyOneInstallerInstance.nsh\nindex a5ce47bcff3..fe5d45c730f 100644\n--- a/packages/app-builder-lib/templates/nsis/include/allowOnlyOneInstallerInstance.nsh\n+++ b/packages/app-builder-lib/templates/nsis/include/allowOnlyOneInstallerInstance.nsh\n@@ -42,7 +42,7 @@\n ${nsProcess::FindProcess} \"${_FILE}\" ${_ERR}\n !else\n # find process owned by current user\n- nsExec::Exec `cmd /c tasklist /FI \"USERNAME eq %USERNAME%\" /FI \"IMAGENAME eq ${_FILE}\" /FO csv | %SYSTEMROOT%\\System32\\find.exe \"${_FILE}\"`\n+ nsExec::Exec `%SYSTEMROOT%\\System32\\cmd.exe /c tasklist /FI \"USERNAME eq %USERNAME%\" /FI \"IMAGENAME eq ${_FILE}\" /FO csv | %SYSTEMROOT%\\System32\\find.exe \"${_FILE}\"`\n Pop ${_ERR}\n !endif\n !macroend\n@@ -73,7 +73,7 @@\n !ifdef INSTALL_MODE_PER_ALL_USERS\n nsExec::Exec `taskkill /im \"${APP_EXECUTABLE_FILENAME}\" /fi \"PID ne $pid\"`\n !else\n- nsExec::Exec `cmd /c taskkill /im \"${APP_EXECUTABLE_FILENAME}\" /fi \"PID ne $pid\" /fi \"USERNAME eq %USERNAME%\"`\n+ nsExec::Exec `%SYSTEMROOT%\\System32\\cmd.exe /c taskkill /im \"${APP_EXECUTABLE_FILENAME}\" /fi \"PID ne $pid\" /fi \"USERNAME eq %USERNAME%\"`\n !endif\n # to ensure that files are not \"in-use\"\n Sleep 300\n@@ -91,7 +91,7 @@\n !ifdef INSTALL_MODE_PER_ALL_USERS\n nsExec::Exec `taskkill /f /im \"${APP_EXECUTABLE_FILENAME}\" /fi \"PID ne $pid\"`\n !else\n- nsExec::Exec `cmd /c taskkill /f /im \"${APP_EXECUTABLE_FILENAME}\" /fi \"PID ne $pid\" /fi \"USERNAME eq %USERNAME%\"`\n+ nsExec::Exec `%SYSTEMROOT%\\System32\\cmd.exe /c taskkill /f /im \"${APP_EXECUTABLE_FILENAME}\" /fi \"PID ne $pid\" /fi \"USERNAME eq %USERNAME%\"`\n !endif\n !insertmacro FIND_PROCESS \"${APP_EXECUTABLE_FILENAME}\" $R0\n ${If} $R0 == 0\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-r4pf-3v7r-hh55\n**CWE:** Unknown\n**Title:** electron-builder's NSIS installer - execute arbitrary code on the target machine (Windows only)\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-9fj8-8x6q-5x7m\nDescription: \n\n```diff\nFrom c6fdb15d423df22e1776844811d082322475e48a Mon Sep 17 00:00:00 2001\nFrom: Bram Moolenaar <Bram@vim.org>\nDate: Sat, 2 Jul 2022 13:43:21 +0100\nSubject: [PATCH] patch 9.0.0025: accessing beyond allocated memory with the\n cmdline window\n\nProblem: Accessing beyond allocated memory when using the cmdline window in\n Ex mode.\nSolution: Use \"*\" instead of \"'<,'>\" for Visual mode.\n---\n src/ex_docmd.c | 6 ++++--\n src/testdir/test_cmdline.vim | 8 ++++++++\n src/version.c | 2 ++\n 3 files changed, 14 insertions(+), 2 deletions(-)\n\ndiff --git a/src/ex_docmd.c b/src/ex_docmd.c\nindex 271e7e24663573..697337cad95750 100644\n--- a/src/ex_docmd.c\n+++ b/src/ex_docmd.c\n@@ -3118,9 +3118,11 @@ parse_command_modifiers(\n \t\tsize_t len = STRLEN(cmd_start);\n \n \t\t// Special case: empty command uses \"+\":\n-\t\t// \"'<,'>mods\" -> \"mods'<,'>+\n+\t\t// \"'<,'>mods\" -> \"mods *+\n+\t\t// Use \"*\" instead of \"'<,'>\" to avoid the command getting\n+\t\t// longer, in case is was allocated.\n \t\tmch_memmove(orig_cmd, cmd_start, len);\n-\t\tSTRCPY(orig_cmd + len, \"'<,'>+\");\n+\t\tSTRCPY(orig_cmd + len, \" *+\");\n \t }\n \t else\n \t {\ndiff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim\nindex 36853369855ef6..f0498a146626c0 100644\n--- a/src/testdir/test_cmdline.vim\n+++ b/src/testdir/test_cmdline.vim\n@@ -2103,6 +2103,14 @@ func Test_cmdwin_insert_mode_close()\n call assert_equal(1, winnr('$'))\n endfunc\n \n+func Test_cmdwin_ex_mode_with_modifier()\n+ \" this was accessing memory after allocated text in Ex mode\n+ new\n+ call setline(1, ['some', 'text', 'lines'])\n+ silent! call feedkeys(\"gQnormal vq:atopleft\\<C-V>\\<CR>\\<CR>\", 'xt')\n+ bwipe!\n+endfunc\n+\n \" test that \";\" works to find a match at the start of the first line\n func Test_zero_line_search()\n new\ndiff --git a/src/version.c b/src/version.c\nindex e8d506c905a026..8c9325d9410e20 100644\n--- a/src/version.c\n+++ b/src/version.c\n@@ -735,6 +735,8 @@ static char *(features[]) =\n \n static int included_patches[] =\n { /* Add new patch number below this line */\n+/**/\n+ 25,\n /**/\n 24,\n /**/\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-9fj8-8x6q-5x7m\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-8wr4-2wm6-w3pr\nDescription: \n\n```diff\nFrom c74029f9f75065e8f7e3c3ec8e0a23fb8204feeb Mon Sep 17 00:00:00 2001\nFrom: Pawel Polewicz <p.polewicz@gmail.com>\nDate: Wed, 23 Feb 2022 20:20:05 +0100\nSubject: [PATCH] Release v3.2.1\n\n---\n CHANGELOG.md | 10 ++++++++--\n requirements.txt | 2 +-\n 2 files changed, 9 insertions(+), 3 deletions(-)\n\ndiff --git a/CHANGELOG.md b/CHANGELOG.md\nindex 0b6d3a889..a8eeac362 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0\n \n ## [Unreleased]\n \n+## [3.2.1] - 2022-02-23\n+\n+### Fixed\n+* Fix setting permissions for local sqlite database (thanks to Jan Schejbal for responsible disclosure!)\n+\n ## [3.2.0] - 2021-12-23\n \n ### Added\n@@ -284,8 +289,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0\n * Fix an off-by-one issue when downloading a range of a file (affects library, but not CLI).\n * Better handling of some errors from the B2 service.\n \n-[Unreleased]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.2.0...HEAD\n-[3.1.0]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.1.0...v3.2.0\n+[Unreleased]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.2.1...HEAD\n+[3.2.1]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.2.0...v3.2.1\n+[3.2.0]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.1.0...v3.2.0\n [3.1.0]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.0.3...v3.1.0\n [3.0.3]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.0.2...v3.0.3\n [3.0.2]: https://github.com/Backblaze/B2_Command_Line_Tool/compare/v3.0.1...v3.0.2\ndiff --git a/requirements.txt b/requirements.txt\nindex eed470153..c3c0411b3 100644\n--- a/requirements.txt\n+++ b/requirements.txt\n@@ -1,6 +1,6 @@\n arrow>=0.8.0,<1.0.0; python_version <= '3.5'\n arrow>=1.0.2,<2.0.0; python_version >= '3.6'\n-b2sdk>=1.14.0,<2.0.0\n+b2sdk>=1.14.1,<2.0.0\n docutils==0.16\n idna>=2.2.0; platform_system == 'Java'\n importlib-metadata>=2.1.1,<3.0.0; python_version <= '3.5'\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-8wr4-2wm6-w3pr\n**CWE:** Unknown\n**Title:** B2 Command Line Tool TOCTOU application key disclosure\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-hrpp-h998-j3pp\nDescription: \n\n```diff\nFrom 4310742efbd8c03f6495f07906b45213da0a32ec Mon Sep 17 00:00:00 2001\nFrom: Jordan Harband <ljharb@gmail.com>\nDate: Mon, 27 Dec 2021 19:15:57 -0800\nSubject: [PATCH] [Fix] `parse`: ignore `__proto__` keys (#428)\n\n---\n lib/parse.js | 2 +-\n test/parse.js | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 61 insertions(+), 1 deletion(-)\n\ndiff --git a/lib/parse.js b/lib/parse.js\nindex 81e415cc..f4cde7d7 100644\n--- a/lib/parse.js\n+++ b/lib/parse.js\n@@ -68,7 +68,7 @@ var parseObject = function parseObjectRecursive(chain, val, options) {\n ) {\n obj = [];\n obj[index] = parseObject(chain, val, options);\n- } else {\n+ } else if (cleanRoot !== '__proto__') {\n obj[cleanRoot] = parseObject(chain, val, options);\n }\n }\ndiff --git a/test/parse.js b/test/parse.js\nindex 9aaf67ad..ad27616a 100644\n--- a/test/parse.js\n+++ b/test/parse.js\n@@ -487,6 +487,66 @@ test('parse()', function (t) {\n st.end();\n });\n \n+ t.test('dunder proto is ignored', function (st) {\n+ var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42';\n+ var result = qs.parse(payload, { allowPrototypes: true });\n+\n+ st.deepEqual(\n+ result,\n+ {\n+ categories: {\n+ length: '42'\n+ }\n+ },\n+ 'silent [[Prototype]] payload'\n+ );\n+\n+ var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true });\n+\n+ st.deepEqual(\n+ plainResult,\n+ {\n+ __proto__: null,\n+ categories: {\n+ __proto__: null,\n+ length: '42'\n+ }\n+ },\n+ 'silent [[Prototype]] payload: plain objects'\n+ );\n+\n+ var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true });\n+\n+ st.notOk(Array.isArray(query.categories), 'is not an array');\n+ st.notOk(query.categories instanceof Array, 'is not instanceof an array');\n+ st.deepEqual(query.categories, { some: { json: 'toInject' } });\n+ st.equal(JSON.stringify(query.categories), '{\"some\":{\"json\":\"toInject\"}}', 'stringifies as a non-array');\n+\n+ st.deepEqual(\n+ qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }),\n+ {\n+ foo: {\n+ bar: 'stuffs'\n+ }\n+ },\n+ 'hidden values'\n+ );\n+\n+ st.deepEqual(\n+ qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }),\n+ {\n+ __proto__: null,\n+ foo: {\n+ __proto__: null,\n+ bar: 'stuffs'\n+ }\n+ },\n+ 'hidden values: plain objects'\n+ );\n+\n+ \n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-hrpp-h998-j3pp\n**CWE:** Unknown\n**Title:** qs vulnerable to Prototype Pollution\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-9f8f-2vmf-885j\nDescription: \n\n```diff\nFrom a0304dc504c85f421d38ef47c64f83046a13641c Mon Sep 17 00:00:00 2001\nFrom: Russell Bryant <rbryant@redhat.com>\nDate: Mon, 28 Apr 2025 13:08:20 -0400\nSubject: [PATCH] [Security] Don't bind tcp zmq socket to all interfaces\n (#17197)\n\nSigned-off-by: Russell Bryant <rbryant@redhat.com>\n---\n docs/source/serving/distributed_serving.md | 4 ++++\n vllm/distributed/device_communicators/shm_broadcast.py | 2 +-\n 2 files changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/docs/source/serving/distributed_serving.md b/docs/source/serving/distributed_serving.md\nindex 591acc2c9b75..c285ef3e8e1c 100644\n--- a/docs/source/serving/distributed_serving.md\n+++ b/docs/source/serving/distributed_serving.md\n@@ -77,6 +77,10 @@ bash run_cluster.sh \\\n \n Then you get a ray cluster of **containers**. Note that you need to keep the shells running these commands alive to hold the cluster. Any shell disconnect will terminate the cluster. In addition, please note that the argument `ip_of_head_node` should be the IP address of the head node, which is accessible by all the worker nodes. The IP addresses of each worker node should be specified in the `VLLM_HOST_IP` environment variable, and should be different for each worker node. Please check the network configuration of your cluster to make sure the nodes can communicate with each other through the specified IP addresses.\n \n+:::{warning}\n+It is considered best practice to set `VLLM_HOST_IP` to an address on a private network segment for the vLLM cluster. The traffic sent here is not encrypted. The endpoints are also exchanging data in a format that could be exploited to execute arbitrary code should a malicious party gain access to the network. Please ensure that this network is not reachable by any untrusted parties.\n+:::\n+\n :::{warning}\n Since this is a ray cluster of **containers**, all the following commands should be executed in the **containers**, otherwise you are executing the commands on the host machine, which is not connected to the ray cluster. To enter the container, you can use `docker exec -it node /bin/bash`.\n :::\ndiff --git a/vllm/distributed/device_communicators/shm_broadcast.py b/vllm/distributed/device_communicators/shm_broadcast.py\nindex 49a65bd0d118..723719c79e9c 100644\n--- a/vllm/distributed/device_communicators/shm_broadcast.py\n+++ b/vllm/distributed/device_communicators/shm_broadcast.py\n@@ -241,7 +241,7 @@ def __init__(\n self.remote_socket.setsockopt(IPV6, 1)\n remote_addr_ipv6 = True\n connect_ip = f\"[{connect_ip}]\"\n- socket_addr = f\"tcp://*:{remote_subscribe_port}\"\n+ socket_addr = f\"tcp://{connect_ip}:{remote_subscribe_port}\"\n self.remote_socket.bind(socket_addr)\n remote_subscribe_addr = f\"tcp://{connect_ip}:{remote_subscribe_port}\"\n else:\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-9f8f-2vmf-885j\n**CWE:** Unknown\n**Title:** Data exposure via ZeroMQ on multi-node vLLM deployment\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2017-14107\nDescription: The _zip_read_eocd64 function in zip_open.c in libzip before 1.3.0 mishandles EOCD records, which allows remote attackers to cause a denial of service (memory allocation failure in _zip_cdir_grow in zip_dirent.c) via a crafted ZIP archive.\n\n```diff\nFrom 9b46957ec98d85a572e9ef98301247f39338a3b5 Mon Sep 17 00:00:00 2001\nFrom: Thomas Klausner <tk@giga.or.at>\nDate: Tue, 29 Aug 2017 10:25:03 +0200\nSubject: [PATCH] Make eocd checks more consistent between zip and zip64 cases.\n\n---\n lib/zip_open.c | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/lib/zip_open.c b/lib/zip_open.c\nindex 3bd593b10..9d3a4cbb6 100644\n--- a/lib/zip_open.c\n+++ b/lib/zip_open.c\n@@ -847,7 +847,12 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse\n zip_error_set(error, ZIP_ER_SEEK, EFBIG);\n return NULL;\n }\n- if ((flags & ZIP_CHECKCONS) && offset+size != eocd_offset) {\n+ if (offset+size > buf_offset + eocd_offset) {\n+\t/* cdir spans past EOCD record */\n+\tzip_error_set(error, ZIP_ER_INCONS, 0);\n+\treturn NULL;\n+ }\n+ if ((flags & ZIP_CHECKCONS) && offset+size != buf_offset + eocd_offset) {\n \tzip_error_set(error, ZIP_ER_INCONS, 0);\n \treturn NULL;\n }\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2017-14107\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: The _zip_read_eocd64 function in zip_open.c in libzip before 1.3.0 mishandles EOCD records, which allows remote attackers to cause a denial of service (memory allocation failure in _zip_cdir_grow in zip_dirent.c) via a crafted ZIP archive.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-x84j-v2j2-g9v8\nDescription: \n\n```diff\nFrom 1f39deb572da7ecb5855e30ff3cc8cbcaa0c1054 Mon Sep 17 00:00:00 2001\nFrom: Sami Mokaddem <mokaddem.sami@gmail.com>\nDate: Wed, 3 Dec 2025 09:19:58 +0100\nSubject: [PATCH] fix: [security] XSS in workflow execution-path\n\n- As reported by Franck FERMAN\n---\n app/View/Elements/Workflows/executionPath.ctp | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/app/View/Elements/Workflows/executionPath.ctp b/app/View/Elements/Workflows/executionPath.ctp\nindex 65acf27c183..273e27d92d3 100644\n--- a/app/View/Elements/Workflows/executionPath.ctp\n+++ b/app/View/Elements/Workflows/executionPath.ctp\n@@ -30,13 +30,13 @@ echo $this->element('genericElements/assetLoader', [\n <div style=\"width: 100%;\"> \\\n <div class=\"default-main-container\"> \\\n {{? it.icon }} \\\n- <i class=\"fa-fw fa-{{=it.icon}} {{=it.icon_class}}\"></i> \\\n+ <i class=\"fa-fw fa-{{!it.icon}} {{!it.icon_class}}\"></i> \\\n {{?}} \\\n {{? it.icon_path }} \\\n- <span><img src=\"/img/{{=it.icon_path}}\" alt=\"Icon of {{=it.name}}\" width=\"18\" height=\"18\" style=\"margin: auto 0; filter: grayscale(1);\"></span> \\\n+ <span><img src=\"/img/{{!it.icon_path}}\" alt=\"Icon of {{!it.name}}\" width=\"18\" height=\"18\" style=\"margin: auto 0; filter: grayscale(1);\"></span> \\\n {{?}} \\\n <strong style=\"margin-left: 0.25em;\"> \\\n- {{=it.name}} \\\n+ {{!it.name}} \\\n </strong> \\\n {{? it.is_misp_module }} \\\n <sup class=\"is-misp-module\"></sup> \\\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-x84j-v2j2-g9v8\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2022-3324\nDescription: Stack-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.0598.\n\n```diff\nFrom 8279af514ca7e5fd3c31cf13b0864163d1a0bfeb Mon Sep 17 00:00:00 2001\nFrom: Bram Moolenaar <Bram@vim.org>\nDate: Mon, 26 Sep 2022 23:08:22 +0100\nSubject: [PATCH] patch 9.0.0598: using negative array index with negative\n width window\n\nProblem: Using negative array index with negative width window.\nSolution: Make sure the window width does not become negative.\n---\n src/testdir/test_cmdwin.vim | 22 ++++++++++++++++++++++\n src/version.c | 2 ++\n src/window.c | 5 ++++-\n 3 files changed, 28 insertions(+), 1 deletion(-)\n\ndiff --git a/src/testdir/test_cmdwin.vim b/src/testdir/test_cmdwin.vim\nindex 6a420ed0aaa388..dc6889495f7cf7 100644\n--- a/src/testdir/test_cmdwin.vim\n+++ b/src/testdir/test_cmdwin.vim\n@@ -404,5 +404,27 @@ func Test_cmdwin_freed_buffer_ptr()\n bwipe!\n endfunc\n \n+\" This was resulting in a window with negative width.\n+\" The test doesn't reproduce the illegal memory access though...\n+func Test_cmdwin_split_often()\n+ let lines = &lines\n+ let columns = &columns\n+ set t_WS=\n+\n+ try\n+ set encoding=iso8859\n+ set ruler\n+ winsize 0 0\n+ noremap 0 \u0017\u000e\u0017H\n+ sil norm 0000000q:\n+ catch /E36:/\n+ endtry\n+\n+ bwipe!\n+ set encoding=utf8\n+ let &lines = lines\n+ let &columns = columns\n+endfunc\n+\n \n \" vim: shiftwidth=2 sts=2 expandtab\ndiff --git a/src/version.c b/src/version.c\nindex d6535b3928a651..515be0b9a81709 100644\n--- a/src/version.c\n+++ b/src/version.c\n@@ -699,6 +699,8 @@ static char *(features[]) =\n \n static int included_patches[] =\n { /* Add new patch number below this line */\n+/**/\n+ 598,\n /**/\n 597,\n /**/\ndiff --git a/src/window.c b/src/window.c\nindex 755848e43c08d5..db08e41326df4e 100644\n--- a/src/window.c\n+++ b/src/window.c\n@@ -2089,6 +2089,8 @@ win_equal_rec(\n \t\tif (hnc)\t // add next_curwin size\n \t\t{\n \t\t next_curwin_size -= p_wiw - (m - n);\n+\t\t if (next_curwin_size < 0)\n+\t\t\tnext_curwin_size = 0;\n \t\t new_size += next_curwin_size;\n \t\t room -= new_size - next_curwin_size;\n \t\t}\n@@ -6611,7 +6613,8 @@ scroll_to_fraction(win_T *wp, int prev_height)\n void\n win_new_width(win_T *wp, int width)\n {\n- wp->w_width = width;\n+ // Should we give an error if width < 0?\n+ wp->w_width = width < 0 ? 0 : width;\n wp->w_lines_valid = 0;\n changed_line_abv_curs_win(wp);\n // Handled in win_fix_scroll()\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2022-3324\n**CWE:** CWE-121 Stack-based Buffer Overflow\n**Title:** Stack-based Buffer Overflow in vim/vim\n\nThis patch addresses: Stack-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.0598.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-cqf2-6q6w-6cqw\nDescription: \n\n```diff\nFrom cf1a0c411b2668c57c41e9c4efd15ba17b6b322c Mon Sep 17 00:00:00 2001\nFrom: Tom Yu <tlyu@mit.edu>\nDate: Fri, 3 May 2013 16:26:46 -0400\nSubject: [PATCH] Fix kpasswd UDP ping-pong [CVE-2002-2443]\n\nThe kpasswd service provided by kadmind was vulnerable to a UDP\n\"ping-pong\" attack [CVE-2002-2443]. Don't respond to packets unless\nthey pass some basic validation, and don't respond to our own error\npackets.\n\nSome authors use CVE-1999-0103 to refer to the kpasswd UDP ping-pong\nattack or UDP ping-pong attacks in general, but there is discussion\nleading toward narrowing the definition of CVE-1999-0103 to the echo,\nchargen, or other similar built-in inetd services.\n\nThanks to Vincent Danen for alerting us to this issue.\n\nCVSSv2: AV:N/AC:L/Au:N/C:N/I:N/A:P/E:P/RL:O/RC:C\n\nticket: 7637 (new)\ntarget_version: 1.11.3\ntags: pullup\n---\n src/kadmin/server/schpw.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/src/kadmin/server/schpw.c b/src/kadmin/server/schpw.c\nindex 15b0ab5a38d..7f455d8640f 100644\n--- a/src/kadmin/server/schpw.c\n+++ b/src/kadmin/server/schpw.c\n@@ -52,7 +52,7 @@ process_chpw_request(krb5_context context, void *server_handle, char *realm,\n ret = KRB5KRB_AP_ERR_MODIFIED;\n numresult = KRB5_KPASSWD_MALFORMED;\n strlcpy(strresult, \"Request was truncated\", sizeof(strresult));\n- goto chpwfail;\n+ goto bailout;\n }\n \n ptr = req->data;\n@@ -67,7 +67,7 @@ process_chpw_request(krb5_context context, void *server_handle, char *realm,\n numresult = KRB5_KPASSWD_MALFORMED;\n strlcpy(strresult, \"Request length was inconsistent\",\n sizeof(strresult));\n- goto chpwfail;\n+ goto bailout;\n }\n \n /* verify version number */\n@@ -80,7 +80,7 @@ process_chpw_request(krb5_context context, void *server_handle, char *realm,\n numresult = KRB5_KPASSWD_BAD_VERSION;\n snprintf(strresult, sizeof(strresult),\n \"Request contained unknown protocol version number %d\", vno);\n- goto chpwfail;\n+ goto bailout;\n }\n \n /* read, check ap-req length */\n@@ -93,7 +93,7 @@ process_chpw_request(krb5_context context, void *server_handle, char *realm,\n numresult = KRB5_KPASSWD_MALFORMED;\n strlcpy(strresult, \"Request was truncated in AP-REQ\",\n sizeof(strresult));\n- goto chpwfail;\n+ goto bailout;\n }\n \n /* verify ap_req */\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-cqf2-6q6w-6cqw\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: PYSEC-2025-23\nDescription: \n\n```diff\nFrom 64a2e4010522d60b90c389634f24df77b603d85d Mon Sep 17 00:00:00 2001\nFrom: Letao Jiang <letaoj@users.noreply.github.com>\nDate: Tue, 11 Feb 2025 15:08:13 -0800\nSubject: [PATCH] [core] Redact redis password in log (#50409)\n\n<!-- Thank you for your contribution! Please review\nhttps://github.com/ray-project/ray/blob/master/CONTRIBUTING.rst before\nopening a pull request. -->\n\n<!-- Please add a reviewer to the assignee section when you create a PR.\nIf you don't have the access to it, we will shortly find a reviewer and\nassign them to your PR. -->\n\n## Why are these changes needed?\nThis change is needed to prevent redis password been logged in the\nstandard logging. This is a secure vulnerability.\n\n<!-- Please give a short summary of the change and the problem this\nsolves. -->\n\n## Related issue number\n\n<!-- For example: \"Closes #1234\" -->\nCloses #50266\n\n## Checks\n\n- [x] I've signed off every commit(by using the -s flag, i.e., `git\ncommit -s`) in this PR.\n- [ ] I've run `scripts/format.sh` to lint the changes in this PR.\n- [ ] I've included any doc changes needed for\nhttps://docs.ray.io/en/master/.\n- [ ] I've added any new APIs to the API Reference. For example, if I\nadded a\nmethod in Tune, I've added it in `doc/source/tune/api/` under the\n corresponding `.rst` file.\n- [ ] I've made sure the tests are passing. Note that there might be a\nfew flaky tests, see the recent failures at https://flakey-tests.ray.io/\n- Testing Strategy\n - [ ] Unit tests\n - [ ] Release tests\n - [x] This PR is not tested :(\n\n---------\n\nSigned-off-by: Letao Jiang <letaoj@gmail.com>\nSigned-off-by: Philipp Moritz <pcmoritz@gmail.com>\nCo-authored-by: Philipp Moritz <pcmoritz@gmail.com>\n---\n python/ray/util/client/server/server.py | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/python/ray/util/client/server/server.py b/python/ray/util/client/server/server.py\nindex e4f7939fa3fc..3c1a72ce62ea 100644\n--- a/python/ray/util/client/server/server.py\n+++ b/python/ray/util/client/server/server.py\n@@ -892,7 +892,10 @@ def main():\n )\n \n hostport = \"%s:%d\" % (args.host, args.port)\n- logger.info(f\"Starting Ray Client server on {hostport}, args {args}\")\n+ args_str = str(args)\n+ if args.redis_password:\n+ args_str = args_str.replace(args.redis_password, \"****\")\n+ logger.info(f\"Starting Ray Client server on {hostport}, args {args_str}\")\n if args.mode == \"proxy\":\n server = serve_proxier(\n hostport,\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** PYSEC-2025-23\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-6rqh-8465-2xcw\nDescription: \n\n```diff\nFrom 124547a9ef424431e1e6cf09bdba6c1099d415de Mon Sep 17 00:00:00 2001\nFrom: Mattermost Build <build@mattermost.com>\nDate: Fri, 21 Feb 2025 10:50:16 +0200\nSubject: [PATCH] [AI assisted] MM-62837: (#30268) (#30288)\n\nAutomatic Merge\n---\n server/channels/api4/user_test.go | 19 +++++++++++++++++++\n server/channels/app/bot.go | 1 +\n 2 files changed, 20 insertions(+)\n\ndiff --git a/server/channels/api4/user_test.go b/server/channels/api4/user_test.go\nindex 2a26e908230..48cd21e7521 100644\n--- a/server/channels/api4/user_test.go\n+++ b/server/channels/api4/user_test.go\n@@ -6194,6 +6194,25 @@ func TestConvertUserToBot(t *testing.T) {\n \t\trequire.NoError(t, err)\n \t\trequire.NotNil(t, bot)\n \t})\n+\n+\tt.Run(\"user cannot login after being converted to bot\", func(t *testing.T) {\n+\t\t// Create a new user\n+\t\tuser := th.CreateUser()\n+\n+\t\t// Login as the new user to verify login works initially\n+\t\t_, _, err := th.Client.Login(context.Background(), user.Email, user.Password)\n+\t\trequire.NoError(t, err)\n+\n+\t\t// Convert user to bot\n+\t\t_, _, err = th.SystemAdminClient.ConvertUserToBot(context.Background(), user.Id)\n+\t\trequire.NoError(t, err)\n+\n+\t\t// Try to login again - should fail\n+\t\t_, resp, err := th.Client.Login(context.Background(), user.Email, user.Password)\n+\t\trequire.Error(t, err)\n+\t\tCheckErrorID(t, err, \"api.user.login.bot_login_forbidden.app_error\")\n+\t\tCheckUnauthorizedStatus(t, resp)\n+\t})\n }\n \n func TestGetChannelMembersWithTeamData(t *testing.T) {\ndiff --git a/server/channels/app/bot.go b/server/channels/app/bot.go\nindex de9ee5db828..d2eb6f76133 100644\n--- a/server/channels/app/bot.go\n+++ b/server/channels/app/bot.go\n@@ -613,6 +613,7 @@ func (a *App) ConvertUserToBot(rctx request.CTX, user *model.User) (*model.Bot,\n \tif err := a.RevokeAllSessions(rctx, user.Id); err != nil {\n \t\treturn nil, err\n \t}\n+\ta.InvalidateCacheForUser(user.Id)\n \n \treturn bot, nil\n }\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-6rqh-8465-2xcw\n**CWE:** Unknown\n**Title:** Mattermost vulnerable to Incorrect Implementation of Authentication Algorithm\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code for security vulnerabilities:\n\n```python\ndef incrementByOne(arr):\n '''\n Given an array of integers \"arr\", increment each of its elements by 1\n '''\n i = 0\n while i <= len(arr):\n arr[i] += 1\n i += 1\n return arr\n```\n\nIdentify any security issues." }, { "role": "assistant", "content": "**Security Issue Found:**\n\n- **CWE-193** - CWE-193\n- **Severity:** Critical\n- **Location:** See code above\n\nThe code contains a security vulnerability that should be addressed before deployment." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-43w4-4j3c-jx29\nDescription: \n\n```diff\nFrom 517f65dfae679b57575b047de13c5af48915a5ba Mon Sep 17 00:00:00 2001\nFrom: Luke Towers <git@luketowers.ca>\nDate: Mon, 11 Dec 2023 13:10:05 -0600\nSubject: [PATCH] Escape output of colorpicker values\n\n---\n .../backend/formwidgets/colorpicker/partials/_colorpicker.php | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/modules/backend/formwidgets/colorpicker/partials/_colorpicker.php b/modules/backend/formwidgets/colorpicker/partials/_colorpicker.php\nindex 7bdb0e50ca..468f41476c 100644\n--- a/modules/backend/formwidgets/colorpicker/partials/_colorpicker.php\n+++ b/modules/backend/formwidgets/colorpicker/partials/_colorpicker.php\n@@ -31,14 +31,14 @@ class=\"\n data-color-value\n class=\"form-control\"\n >\n- <?= $value ?>\n+ <?= e($value); ?>\n </span>\n <?php else: ?>\n <input\n data-color-value\n class=\"form-control\"\n placeholder=\"No color\"\n- value=\"<?= $value ?>\"\n+ value=\"<?= e($value); ?>\"\n <?php if ($disabled): ?>\n disabled\n <?php endif ?>\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-43w4-4j3c-jx29\n**CWE:** Unknown\n**Title:** Winter CMS Stored XSS through Backend ColorPicker FormWidget\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2015-7513\nDescription: arch/x86/kvm/x86.c in the Linux kernel before 4.4 does not reset the PIT counter values during state restoration, which allows guest OS users to cause a denial of service (divide-by-zero error and host OS crash) via a zero value, related to the kvm_vm_ioctl_set_pit and kvm_vm_ioctl_set_pit2 functions.\n\n```diff\nFrom 0185604c2d82c560dab2f2933a18f797e74ab5a8 Mon Sep 17 00:00:00 2001\nFrom: Andrew Honig <ahonig@google.com>\nDate: Wed, 18 Nov 2015 14:50:23 -0800\nSubject: [PATCH] KVM: x86: Reload pit counters for all channels when restoring\n state\n\nCurrently if userspace restores the pit counters with a count of 0\non channels 1 or 2 and the guest attempts to read the count on those\nchannels, then KVM will perform a mod of 0 and crash. This will ensure\nthat 0 values are converted to 65536 as per the spec.\n\nThis is CVE-2015-7513.\n\nSigned-off-by: Andy Honig <ahonig@google.com>\nSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>\n---\n arch/x86/kvm/x86.c | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c\nindex b84ba4b17757ae..7ffc224bbe4127 100644\n--- a/arch/x86/kvm/x86.c\n+++ b/arch/x86/kvm/x86.c\n@@ -3572,9 +3572,11 @@ static int kvm_vm_ioctl_get_pit(struct kvm *kvm, struct kvm_pit_state *ps)\n \n static int kvm_vm_ioctl_set_pit(struct kvm *kvm, struct kvm_pit_state *ps)\n {\n+\tint i;\n \tmutex_lock(&kvm->arch.vpit->pit_state.lock);\n \tmemcpy(&kvm->arch.vpit->pit_state, ps, sizeof(struct kvm_pit_state));\n-\tkvm_pit_load_count(kvm, 0, ps->channels[0].count, 0);\n+\tfor (i = 0; i < 3; i++)\n+\t\tkvm_pit_load_count(kvm, i, ps->channels[i].count, 0);\n \tmutex_unlock(&kvm->arch.vpit->pit_state.lock);\n \treturn 0;\n }\n@@ -3593,6 +3595,7 @@ static int kvm_vm_ioctl_get_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps)\n static int kvm_vm_ioctl_set_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps)\n {\n \tint start = 0;\n+\tint i;\n \tu32 prev_legacy, cur_legacy;\n \tmutex_lock(&kvm->arch.vpit->pit_state.lock);\n \tprev_legacy = kvm->arch.vpit->pit_state.flags & KVM_PIT_FLAGS_HPET_LEGACY;\n@@ -3602,7 +3605,8 @@ static int kvm_vm_ioctl_set_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps)\n \tmemcpy(&kvm->arch.vpit->pit_state.channels, &ps->channels,\n \t sizeof(kvm->arch.vpit->pit_state.channels));\n \tkvm->arch.vpit->pit_state.flags = ps->flags;\n-\tkvm_pit_load_count(kvm, 0, kvm->arch.vpit->pit_state.channels[0].count, start);\n+\tfor (i = 0; i < 3; i++)\n+\t\tkvm_pit_load_count(kvm, i, kvm->arch.vpit->pit_state.channels[i].count, start);\n \tmutex_unlock(&kvm->arch.vpit->pit_state.lock);\n \treturn 0;\n }\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2015-7513\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: arch/x86/kvm/x86.c in the Linux kernel before 4.4 does not reset the PIT counter values during state restoration, which allows guest OS users to cause a denial of service (divide-by-zero error and host OS crash) via a zero value, related to the kvm_vm_ioctl_set_pit and kvm_vm_ioctl_set_pit2 functions.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2025-47271\nDescription: The OZI action is a GitHub Action that publishes releases to PyPI and mirror releases, signature bundles, and provenance in a tagged release. In versions 1.13.2 through 1.13.5, potentially untrusted data flows into PR creation logic. A malicious actor could construct a branch name that injects arbitrary code. This is patched in 1.13.6. As a workaround, one may downgrade to a version prior to 1.13.2.\n\n```diff\nFrom abd8524ec69800890529846b3ccfb09ce7c10b5c Mon Sep 17 00:00:00 2001\nFrom: \"Eden Ross Duff, MSc, DDiv\" <ozi.project@outlook.com>\nDate: Fri, 9 May 2025 23:22:00 -0500\nSubject: [PATCH] fix injectable inputs\n\nSigned-off-by: Eden Ross Duff, MSc, DDiv <ozi.project@outlook.com>\n---\n action.yml | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/action.yml b/action.yml\nindex 20e334f..79c05c4 100644\n--- a/action.yml\n+++ b/action.yml\n@@ -34,7 +34,10 @@ runs:\n \n - name: Create pull request\n if: ${{ fromJSON(inputs.create-pull-request) == true }}\n- run: gh pr create -B ${{ steps.head.outputs.name }} -H ${{ github.head_ref || github.ref_name }} --title 'Merge ${{ github.head_ref || github.ref_name }} into ${{ steps.head.outputs.name }}' --body '${{ inputs.pull-request-body }}'\n+ run: gh pr create -B $HEAD_BRANCH -H $REF_NAME --title 'Merge $REF_NAME into $HEAD_BRANCH' --body '$PR_BODY'\n env:\n+ HEAD_BRANCH: ${{ steps.head.outputs.name }}\n+ REF_NAME: ${{ github.head_ref || github.ref_name }}\n+ PR_BODY: ${{ inputs.pull-request-body }}\n GITHUB_TOKEN: ${{ inputs.github-token }}\n shell: bash\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2025-47271\n**CWE:** CWE-94: Improper Control of Generation of Code ('Code Injection')\n**Title:** OZI-Project/ozi-publish Code Injection vulnerability\n\nThis patch addresses: The OZI action is a GitHub Action that publishes releases to PyPI and mirror releases, signature bundles, and provenance in a tagged release. In versions 1.13.2 through 1.13.5, potentially untrusted data flows into PR creation logic. A malicious actor could construct a branch name that injects arbitrary code. This is patched in 1.13.6. As a workaround, one may downgrade to a version prior to 1.13.2.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-fhfc-2q7x-929f\nDescription: \n\n```diff\nFrom c1f491817dec39a26be3c574e86a88c30f3c4770 Mon Sep 17 00:00:00 2001\nFrom: Isha Arkatkar <ishark@google.com>\nDate: Wed, 13 Jul 2022 14:13:16 -0700\nSubject: [PATCH] Fix for check failure in CollectiveGather op.\n\nThe fix is required only for Eager mode, graph mode already checked for input shape in shape inference pass.\n\nPiperOrigin-RevId: 460801136\n---\n tensorflow/core/kernels/collective_ops.cc | 4 ++++\n tensorflow/python/ops/collective_ops_test.py | 14 ++++++++++++++\n 2 files changed, 18 insertions(+)\n\ndiff --git a/tensorflow/core/kernels/collective_ops.cc b/tensorflow/core/kernels/collective_ops.cc\nindex 7045b106d730c4..fd8146361df953 100644\n--- a/tensorflow/core/kernels/collective_ops.cc\n+++ b/tensorflow/core/kernels/collective_ops.cc\n@@ -176,6 +176,10 @@ class CollectiveGatherOpKernel : public CollectiveOpV1Kernel {\n void ComputeAsyncImpl(OpKernelContext* c, CollectiveExecutor* col_exec,\n DoneCallback done) override {\n auto output_shape = c->input(0).shape();\n+ OP_REQUIRES_ASYNC(c, output_shape.dims() > 0,\n+ errors::InvalidArgument(\"input should have rank > 0, \",\n+ \"recieved \", output_shape.dims()),\n+ done);\n output_shape.set_dim(\n 0, output_shape.dim_size(0) * col_params_->group.group_size);\n col_params_->instance.shape = output_shape;\ndiff --git a/tensorflow/python/ops/collective_ops_test.py b/tensorflow/python/ops/collective_ops_test.py\nindex a95896c0a23a07..5b57956996b8ac 100644\n--- a/tensorflow/python/ops/collective_ops_test.py\n+++ b/tensorflow/python/ops/collective_ops_test.py\n@@ -451,6 +451,20 @@ def testCollectiveGroupSizeMismatch(self):\n ])\n context.ensure_initialized()\n \n+ @test_util.run_v2_only\n+ def testCollectiveGatherShapeCheckFailure(self):\n+ with self.assertRaisesRegex(errors.InvalidArgumentError,\n+ 'input should have rank > 0'):\n+ collective_ops.gen_collective_ops.CollectiveGather(\n+ input=1,\n+ group_size=1,\n+ group_key=1,\n+ instance_key=1,\n+ shape=(3, 3, 3),\n+ communication_hint='auto',\n+ timeout_seconds=0,\n+ name='')\n+\n @def_function.function\n def run_all_reduce():\n group_key = 10\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-fhfc-2q7x-929f\n**CWE:** Unknown\n**Title:** TensorFlow vulnerable to `CHECK` fail in `CollectiveGather`\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-5q8m-mqmx-pxp9\nDescription: \n\n```diff\nFrom 371f6590c509c72f8e600f3d05e110941607fbad Mon Sep 17 00:00:00 2001\nFrom: Oliver Gierke <ogierke@pivotal.io>\nDate: Tue, 3 Apr 2018 19:01:15 +0200\nSubject: [PATCH] DATACMNS-1285 - PropertyPath now limits the depth of its\n parsing to 1000 segments.\n\n---\n .../data/mapping/PropertyPath.java | 6 ++++\n .../data/mapping/PropertyPathUnitTests.java | 30 ++++++++++++++++++-\n 2 files changed, 35 insertions(+), 1 deletion(-)\n\ndiff --git a/src/main/java/org/springframework/data/mapping/PropertyPath.java b/src/main/java/org/springframework/data/mapping/PropertyPath.java\nindex 180eece9dc..0d8f3ea99f 100644\n--- a/src/main/java/org/springframework/data/mapping/PropertyPath.java\n+++ b/src/main/java/org/springframework/data/mapping/PropertyPath.java\n@@ -36,6 +36,8 @@\n */\n public class PropertyPath implements Iterable<PropertyPath> {\n \n+\tprivate static final String PARSE_DEPTH_EXCEEDED = \"Trying to parse a path with depth greater than 1000! This has been disabled for security reasons to prevent parsing overflows.\";\n+\n \tprivate static final String DELIMITERS = \"_\\\\.\";\n \tprivate static final String ALL_UPPERCASE = \"[A-Z0-9._$]+\";\n \tprivate static final Pattern SPLITTER = Pattern.compile(\"(?:[%s]?([%s]*?[^%s]+))\".replaceAll(\"%s\", DELIMITERS));\n@@ -321,6 +323,10 @@ private static PropertyPath create(String source, TypeInformation<?> type, List<\n \t */\n \tprivate static PropertyPath create(String source, TypeInformation<?> type, String addTail, List<PropertyPath> base) {\n \n+\t\tif (base.size() > 1000) {\n+\t\t\tthrow new IllegalArgumentException(PARSE_DEPTH_EXCEEDED);\n+\t\t}\n+\n \t\tPropertyReferenceException exception = null;\n \t\tPropertyPath current = null;\n \ndiff --git a/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.java b/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.java\nindex 4e62e9edff..429796f581 100644\n--- a/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.java\n+++ b/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.java\n@@ -1,5 +1,5 @@\n /*\n- * Copyright 2011-2017 the original author or authors.\n+ * Copyright 2011-2018 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n@@ -346,6 +346,24 @@ public void includesPropertyHintsOnTypos() {\n \t\tfrom(\"userAme\", Foo.class);\n \t}\n \n+\t@Test // DATACMNS-1285\n+\tpublic void rejectsTooLongPath() {\n+\n+\t\tString source = \"foo.bar\";\n+\n+\t\tfor (int i = 0; i < 9; i++) {\n+\t\t\tsource = source + \".\" + source;\n+\t\t}\n+\n+\t\tassertThat(source.split(\"\\\\.\").length, is(greaterThan(1000)));\n+\n+\t\tfinal String path = source;\n+\n+\t\texception.expect(IllegalArgumentException.class);\n+\n+\t\tPropertyPath.from(path, Left.class);\n+\t}\n+\n \tprivate class Foo {\n \n \t\tString userName;\n@@ -379,4 +397,14 @@ private class Sample2 {\n \t\tprivate FooBar user;\n \t\tprivate Foo _foo;\n \t}\n+\n+\t// DATACMNS-1285\n+\n+\tprivate class Left {\n+\t\tRight foo;\n+\t}\n+\n+\tprivate class Ri\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-5q8m-mqmx-pxp9\n**CWE:** Unknown\n**Title:** Spring Data Commons contain a property path parser vulnerability caused by unlimited resource allocation\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-mjhf-5xg4-c757\nDescription: \n\n```diff\nFrom 83036fd841d33baa7e039f842d131aa7881fdcc2 Mon Sep 17 00:00:00 2001\nFrom: Chong Cai <chongc@google.com>\nDate: Fri, 25 Sep 2020 12:10:12 -0700\nSubject: [PATCH] Verify UntrustedCall output is outside enclave\n\nPiperOrigin-RevId: 333781703\nChange-Id: I9df55c04dc8b04f4bf0bda8e68cc32bca81b933a\n---\n asylo/platform/primitives/sgx/trusted_sgx.cc | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/asylo/platform/primitives/sgx/trusted_sgx.cc b/asylo/platform/primitives/sgx/trusted_sgx.cc\nindex 173d1a9331..092a2040f8 100644\n--- a/asylo/platform/primitives/sgx/trusted_sgx.cc\n+++ b/asylo/platform/primitives/sgx/trusted_sgx.cc\n@@ -288,6 +288,11 @@ PrimitiveStatus TrustedPrimitives::UntrustedCall(uint64_t untrusted_selector,\n if (sgx_params->input) {\n untrusted_cache->Free(const_cast<void *>(sgx_params->input));\n }\n+ if (!TrustedPrimitives::IsOutsideEnclave(sgx_params->output,\n+ sgx_params->output_size)) {\n+ TrustedPrimitives::BestEffortAbort(\n+ \"UntrustedCall: sgx_param output should be in untrusted memory\");\n+ }\n if (sgx_params->output) {\n // For the results obtained in |output_buffer|, copy them to |output|\n // before freeing the buffer.\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-mjhf-5xg4-c757\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-mgmm-cmhj-2h5f\nDescription: \n\n```diff\nFrom 05b4a4f865c821b4d1780ac4a1f00432534abafa Mon Sep 17 00:00:00 2001\nFrom: Antoine Nguyen <tonio@ngyn.org>\nDate: Tue, 21 Feb 2023 18:09:13 +0100\nSubject: [PATCH] Fixed XSS vulnerability\n\n---\n modoboa/static/js/listing.js | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/modoboa/static/js/listing.js b/modoboa/static/js/listing.js\nindex e3d6c7b8fa..2fc96fbaeb 100644\n--- a/modoboa/static/js/listing.js\n+++ b/modoboa/static/js/listing.js\n@@ -255,9 +255,9 @@ Listing.prototype = {\n make_tag: function(text, type) {\n var $tag = $(\"<a />\", {\n \"name\": type, \"class\" : \"btn btn-default btn-xs\",\n- \"html\": \" \" + text\n+ \"html\": \" \" + htmlEncode(text)\n });\n- \n+\n $(\"<span />\", {\"class\" : \"fa fa-remove\"}).prependTo($tag);\n $tag.click($.proxy(this.remove_tag, this));\n return $tag;\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-mgmm-cmhj-2h5f\n**CWE:** Unknown\n**Title:** modoboa Cross-site Scripting vulnerability\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-2jcw-r79x-4r5v\nDescription: \n\n```diff\nFrom b9c86823c70a1cba20bca1c4b5b032ee1559e22d Mon Sep 17 00:00:00 2001\nFrom: Jean-Michel Vedrine <vedrine@vedrine.org>\nDate: Sun, 4 Jan 2015 16:57:35 +0100\nSubject: [PATCH] MDL-48034 mod_lesson: grade capability missing RISK_XSS\n\n---\n mod/lesson/db/access.php | 2 +-\n mod/lesson/version.php | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/mod/lesson/db/access.php b/mod/lesson/db/access.php\nindex 9e658dc4a48b7..8416860ae3dd5 100644\n--- a/mod/lesson/db/access.php\n+++ b/mod/lesson/db/access.php\n@@ -54,7 +54,7 @@\n \n // Grade essay questions.\n 'mod/lesson:grade' => array(\n- 'riskbitmask' => RISK_SPAM,\n+ 'riskbitmask' => RISK_SPAM | RISK_XSS,\n 'captype' => 'write',\n 'contextlevel' => CONTEXT_MODULE,\n 'archetypes' => array(\ndiff --git a/mod/lesson/version.php b/mod/lesson/version.php\nindex 1920b7ad33d3e..ff341e21cefd2 100644\n--- a/mod/lesson/version.php\n+++ b/mod/lesson/version.php\n@@ -24,7 +24,7 @@\n \n defined('MOODLE_INTERNAL') || die();\n \n-$plugin->version = 2014122900; // The current module version (Date: YYYYMMDDXX)\n+$plugin->version = 2015010600; // The current module version (Date: YYYYMMDDXX)\n $plugin->requires = 2014110400; // Requires this Moodle version\n $plugin->component = 'mod_lesson'; // Full name of the plugin (used for diagnostics)\n $plugin->cron = 0;\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-2jcw-r79x-4r5v\n**CWE:** Unknown\n**Title:** Moodle does not set the RISK_XSS bit for graders\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2023-4508\nDescription: A user able to control file input to Gerbv, between versions 2.4.0 and 2.10.0, can cause a crash and cause denial-of-service with a specially crafted Gerber RS-274X file.\n\n```diff\nFrom 5517e22250e935dc7f86f64ad414aeae3dbcb36a Mon Sep 17 00:00:00 2001\nFrom: eyal0 <109809+eyal0@users.noreply.github.com>\nDate: Thu, 13 Jul 2023 11:11:48 -0600\nSubject: [PATCH] fix: Out-of-bounds memory access of filename.\n\nPut all the filename allocation and deallocation into the `gerb_fopen`\nand `gerb_fclose` functions so that the caller doesn't need to deal\nwith this anymore.\n\nAlso, free includeFilename. It was allocated as part of\n`gerb_fgetstring()` above but never freed properly.\n\nUnit tests added to valgrind.\n---\n src/gerb_file.c | 5 +++++\n src/gerber.c | 2 +-\n src/gerbv.c | 4 ----\n test/golden/parse_aperture_strtok.png | Bin 0 -> 990 bytes\n test/inputs/parse_aperture_strtok.1.poc | 11 +++++++++++\n test/inputs/parse_aperture_strtok.2.poc | 2 ++\n test/run_valgrind_tests.sh | 3 ++-\n test/tests.list | 2 ++\n 8 files changed, 23 insertions(+), 6 deletions(-)\n create mode 100644 test/golden/parse_aperture_strtok.png\n create mode 100644 test/inputs/parse_aperture_strtok.1.poc\n create mode 100644 test/inputs/parse_aperture_strtok.2.poc\n\ndiff --git a/src/gerb_file.c b/src/gerb_file.c\nindex 9a9735cd..dbc2da17 100644\n--- a/src/gerb_file.c\n+++ b/src/gerb_file.c\n@@ -131,6 +131,9 @@ gerb_fopen(char const * filename)\n \n #endif\n \n+ dprintf(\" Setting filename\\n\");\n+ fd->filename = g_strdup(filename);\n+\n dprintf(\"<--- Leaving gerb_fopen\\n\");\n return fd;\n } /* gerb_fopen */\n@@ -238,6 +241,8 @@ void\n gerb_fclose(gerb_file_t *fd)\n {\n if (fd) {\n+ g_free(fd->filename);\n+\n #ifdef HAVE_SYS_MMAN_H\n \tif (munmap(fd->data, fd->datalen) < 0)\n \t GERB_FATAL_ERROR(\"munmap: %s\", strerror(errno));\ndiff --git a/src/gerber.c b/src/gerber.c\nindex 50cf01cc..1a608abe 100644\n--- a/src/gerber.c\n+++ b/src/gerber.c\n@@ -1476,7 +1476,7 @@ parse_rs274x(gint levelOfRecursion, gerb_file_t *fd, gerbv_image_t *image,\n \t\t\t\t\"include file recursion which is not allowed \"\n \t\t\t\t\"by the RS-274X spec\"));\n \t\t}\n-\t\t\n+\t\tg_free (includeFilename);\n \t }\n \t}\n \tbreak;\ndiff --git a/src/gerbv.c b/src/gerbv.c\nindex 579d0f88..db10cc92 100644\n--- a/src/gerbv.c\n+++ b/src/gerbv.c\n@@ -507,9 +507,6 @@ gerbv_open_image(gerbv_project_t *gerbvProject, gchar const* filename, int idx,\n \treturn -1;\n }\n \n- /* Store filename info fd for further use */\n- fd->filename = g_strdup(filename);\n- \n dprintf(\"In open_image, successfully opened file. Now check its type....\\n\");\n /* Here's where we decide what file type we have */\n /* Note: if the file has some invalid characters in it but still appears to\n@@ -578,7 +575,6 @@ gerbv_open_image(gerbv_project_t *gerbvProject, gchar const* filename, int idx,\n \tparsed_image = NULL;\n }\n \n- g_free(fd->filename);\n gerb_fclose(fd);\n if (parsed_image == NULL) {\n \treturn -1;\ndiff --git a/test/golden/parse_aperture_strtok.png b/test/golden/parse_aperture_strtok.png\nnew file mode 100644\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2023-4508\n**CWE:** CWE-824 Access of Uninitialized Pointer\n**Title:** Denial of Service in Gerbv\n\nThis patch addresses: A user able to control file input to Gerbv, between versions 2.4.0 and 2.10.0, can cause a crash and cause denial-of-service with a specially crafted Gerber RS-274X file.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: PYSEC-2021-483\nDescription: \n\n```diff\nFrom 1a2a87229d1d61e23a39373777c056161eb4084d Mon Sep 17 00:00:00 2001\nFrom: Amit Patankar <amitpatankar@google.com>\nDate: Wed, 28 Apr 2021 11:30:28 -0700\nSubject: [PATCH] Fix FPE issue with `tf.raw_ops.FusedBatchNorm`.\n\nPiperOrigin-RevId: 370948185\nChange-Id: If0c8e0320062ed6363e94ff5fe38e6a301f69ac2\n---\n tensorflow/core/kernels/fused_batch_norm_op.cc | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/tensorflow/core/kernels/fused_batch_norm_op.cc b/tensorflow/core/kernels/fused_batch_norm_op.cc\nindex 9b917348e2afa5..e564b19857c383 100644\n--- a/tensorflow/core/kernels/fused_batch_norm_op.cc\n+++ b/tensorflow/core/kernels/fused_batch_norm_op.cc\n@@ -293,6 +293,9 @@ struct FusedBatchNorm<CPUDevice, T, U, /* is_training= */ false> {\n const CPUDevice& d = context->eigen_device<CPUDevice>();\n \n const int depth = x.dimension(3);\n+ OP_REQUIRES(\n+ context, depth != 0,\n+ errors::Internal(\"The 4th element in the input shape cannot be 0.\"));\n const int size = x.size();\n const int rest_size = size / depth;\n Eigen::DSizes<Eigen::Index, 2> rest_by_depth(rest_size, depth);\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** PYSEC-2021-483\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2018-1000119\nDescription: Sinatra rack-protection versions 1.5.4 and 2.0.0.rc3 and earlier contains a timing attack vulnerability in the CSRF token checking that can result in signatures can be exposed. This attack appear to be exploitable via network connectivity to the ruby application. This vulnerability appears to have been fixed in 1.5.5 and 2.0.0.\n\n```diff\nFrom 8aa6c42ef724f93ae309fb7c5668e19ad547eceb Mon Sep 17 00:00:00 2001\nFrom: Andreas Karlsson <andreas@proxel.se>\nDate: Mon, 25 May 2015 19:37:29 +0200\nSubject: [PATCH] Use secure_compare when checking CSRF token\n\nSince string comparisions may return early we want to use a constant\ntime comparsion function to protect the CSRF token against timing\nattacks. Rack::Utils provides a such function.\n---\n rack-protection/lib/rack/protection/authenticity_token.rb | 4 ++--\n rack-protection/lib/rack/protection/base.rb | 5 +++++\n 2 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/rack-protection/lib/rack/protection/authenticity_token.rb b/rack-protection/lib/rack/protection/authenticity_token.rb\nindex e4524e4a62..ad2ab9cdea 100644\n--- a/rack-protection/lib/rack/protection/authenticity_token.rb\n+++ b/rack-protection/lib/rack/protection/authenticity_token.rb\n@@ -23,8 +23,8 @@ def accepts?(env)\n session = session env\n token = session[:csrf] ||= session['_csrf_token'] || random_string\n safe?(env) ||\n- env['HTTP_X_CSRF_TOKEN'] == token ||\n- Request.new(env).params[options[:authenticity_param]] == token\n+ secure_compare(env['HTTP_X_CSRF_TOKEN'], token) ||\n+ secure_compare(Request.new(env).params[options[:authenticity_param]], token)\n end\n end\n end\ndiff --git a/rack-protection/lib/rack/protection/base.rb b/rack-protection/lib/rack/protection/base.rb\nindex fe6ab37d21..c914da23c7 100644\n--- a/rack-protection/lib/rack/protection/base.rb\n+++ b/rack-protection/lib/rack/protection/base.rb\n@@ -1,4 +1,5 @@\n require 'rack/protection'\n+require 'rack/utils'\n require 'digest'\n require 'logger'\n require 'uri'\n@@ -110,6 +111,10 @@ def encrypt(value)\n options[:encryptor].hexdigest value.to_s\n end\n \n+ def secure_compare(a, b)\n+ Rack::Utils.secure_compare(a.to_s, b.to_s)\n+ end\n+\n alias default_reaction deny\n \n def html?(headers)\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2018-1000119\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: Sinatra rack-protection versions 1.5.4 and 2.0.0.rc3 and earlier contains a timing attack vulnerability in the CSRF token checking that can result in signatures can be exposed. This attack appear to be exploitable via network connectivity to the ruby application. This vulnerability appears to have been fixed in 1.5.5 and 2.0.0.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-jfgp-674x-6q4p\nDescription: \n\n```diff\nFrom b6a7eace155fa0feaf01b4ac36165a9c5e63bfdd Mon Sep 17 00:00:00 2001\nFrom: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= <michal@cihar.com>\nDate: Thu, 27 Jun 2024 14:05:53 +0200\nSubject: [PATCH] fix(backups): skip pontentially bogus files in backups\n\n---\n weblate/trans/backups.py | 8 +++++---\n 1 file changed, 5 insertions(+), 3 deletions(-)\n\ndiff --git a/weblate/trans/backups.py b/weblate/trans/backups.py\nindex d1a8a2b8ab45..7b7d91ceb7fb 100644\n--- a/weblate/trans/backups.py\n+++ b/weblate/trans/backups.py\n@@ -601,9 +601,11 @@ def restore(self, project_name: str, project_slug: str, user, billing=None):\n # Extract VCS\n for name in zipfile.namelist():\n if name.startswith(self.VCS_PREFIX):\n- targetpath = os.path.join(\n- project.full_path, name[self.VCS_PREFIX_LEN :]\n- )\n+ path = name[self.VCS_PREFIX_LEN :]\n+ # Skip potentially dangerous paths\n+ if path != os.path.normpath(path):\n+ continue\n+ targetpath = os.path.join(project.full_path, path)\n upperdirs = os.path.dirname(targetpath)\n if upperdirs and not os.path.exists(upperdirs):\n os.makedirs(upperdirs)\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-jfgp-674x-6q4p\n**CWE:** Unknown\n**Title:** Weblate vulnerable to improper sanitization of project backups\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code for security vulnerabilities:\n\n```python\nimport requests\nfrom flask import Flask, request\n\napp = Flask(__name__)\n\n\n@app.route(\"/user\")\ndef retrieve_info():\n '''\n Get the user_id from the request,\n the retrieve the user info from GitHub using the GitHub's API,\n and return the response\n '''\n user_id = request.args[\"user_id\"]\n url = \"https://api.github.com/users/\" + user_id\n response = requests.get(url)\n return response.text\n```\n\nIdentify any security issues." }, { "role": "assistant", "content": "**Security Issue Found:**\n\n- **CWE-918** - SSRF (Server-Side Request Forgery)\n- **Severity:** Critical\n- **Location:** See code above\n\nThe code contains a security vulnerability that should be addressed before deployment." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: PYSEC-2021-239\nDescription: \n\n```diff\nFrom cbda3c6b2dbbd3fbdc482ff8c0170a78ec2e97d0 Mon Sep 17 00:00:00 2001\nFrom: Mihai Maruseac <mihaimaruseac@google.com>\nDate: Wed, 28 Apr 2021 15:53:48 -0700\nSubject: [PATCH] Prevent divisions by 0\n\nPiperOrigin-RevId: 371003153\nChange-Id: Idef56c95b9fcaeb97f87e18c7a674dbeb5173204\n---\n tensorflow/lite/kernels/depthwise_conv.cc | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/tensorflow/lite/kernels/depthwise_conv.cc b/tensorflow/lite/kernels/depthwise_conv.cc\nindex 42920e11fc4333..fdbcae3607f06c 100644\n--- a/tensorflow/lite/kernels/depthwise_conv.cc\n+++ b/tensorflow/lite/kernels/depthwise_conv.cc\n@@ -285,8 +285,8 @@ TfLiteStatus ComputeDepthMultiplier(TfLiteContext* context,\n int16* depth_multiplier) {\n int num_filter_channels = SizeOfDimension(filter, 3);\n int num_input_channels = SizeOfDimension(input, 3);\n+ TF_LITE_ENSURE(context, num_input_channels != 0);\n TF_LITE_ENSURE_EQ(context, num_filter_channels % num_input_channels, 0);\n-\n *depth_multiplier = num_filter_channels / num_input_channels;\n return kTfLiteOk;\n }\n@@ -455,8 +455,9 @@ TfLiteStatus EvalHybridPerChannel(TfLiteContext* context, TfLiteNode* node,\n float output_activation_min, output_activation_max;\n CalculateActivationRange(params->activation, &output_activation_min,\n &output_activation_max);\n- const int input_size = NumElements(input) / SizeOfDimension(input, 0);\n const int batch_size = SizeOfDimension(input, 0);\n+ TF_LITE_ENSURE(context, batch_size != 0);\n+ const int input_size = NumElements(input) / batch_size;\n TfLiteTensor* input_quantized;\n TF_LITE_ENSURE_OK(context,\n GetTemporarySafe(context, node, data->input_quantized_index,\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** PYSEC-2021-239\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2025-66370\nDescription: Kivitendo before 3.9.2 allows XXE injection. By uploading an electronic invoice in the ZUGFeRD format, it is possible to read and exfiltrate files from the server's filesystem.\n\n```diff\nFrom 1286dee72f9919166178d0cdb5f52f13b0f7d4de Mon Sep 17 00:00:00 2001\nFrom: =?UTF-8?q?Jan=20B=C3=BCren?= <jan@kivitendo.de>\nDate: Sun, 23 Mar 2025 16:02:07 +0100\nSubject: [PATCH] =?UTF-8?q?XXE=20Sicherheitsl=C3=BCcke=20beim=20ZUGFeRD=20?=\n =?UTF-8?q?parsen=20(XML)=20vermeiden?=\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\n---\n SL/XMLInvoice.pm | 2 +-\n SL/ZUGFeRD.pm | 2 +-\n doc/changelog | 2 ++\n 3 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/SL/XMLInvoice.pm b/SL/XMLInvoice.pm\nindex 5967931479..30b740025f 100644\n--- a/SL/XMLInvoice.pm\n+++ b/SL/XMLInvoice.pm\n@@ -56,7 +56,7 @@ sub new {\n my $self = {};\n \n $self->{message} = '';\n- $self->{dom} = eval { XML::LibXML->load_xml(string => $xml_data) };\n+ $self->{dom} = eval { XML::LibXML->load_xml(string => $xml_data, load_ext_dtd => 0) };\n \n if ( ! $self->{dom} ) {\n $self->{message} = t8(\"Parsing the XML data failed: #1\", $xml_data);\ndiff --git a/SL/ZUGFeRD.pm b/SL/ZUGFeRD.pm\nindex 506e3a427a..1136e07621 100644\n--- a/SL/ZUGFeRD.pm\n+++ b/SL/ZUGFeRD.pm\n@@ -158,7 +158,7 @@ sub extract_from_pdf {\n if (!defined $xmp) {\n push @warnings, $::locale->text('The file \\'#1\\' does not contain the required XMP meta data.', $file_name);\n } else {\n- my $dom = eval { XML::LibXML->load_xml(string => $xmp) };\n+ my $dom = eval { XML::LibXML->load_xml(string => $xmp, load_ext_dtd => 0) };\n \n push @warnings, $::locale->text('Parsing the XMP metadata failed.'), if !$dom;\n \ndiff --git a/doc/changelog b/doc/changelog\nindex 672fcec496..d549dbafc3 100644\n--- a/doc/changelog\n+++ b/doc/changelog\n@@ -13,6 +13,8 @@ Kleinere neue Features und Detailverbesserungen:\n - SSO (Single-Sign-On) Unterstützung über entsprechende HTTP-Header.\n Für Details s.a. Doku und ggf. API-Doku im POD-Style\n \n+- XXE Sicherheitslücke bei ZUGFeRD parsen verhindern (Upload), s.a.\n+ https://www.usenix.org/sites/default/files/conference/protected-files/woot16_slides_spath.pdf\n Bugfixes (Tracker: https://www.kivitendo.de/redmine):\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2025-66370\n**CWE:** CWE-611 Improper Restriction of XML External Entity Reference\n**Title:** Security fix\n\nThis patch addresses: Kivitendo before 3.9.2 allows XXE injection. By uploading an electronic invoice in the ZUGFeRD format, it is possible to read and exfiltrate files from the server's filesystem.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-v7qf-22rw-chph\nDescription: \n\n```diff\nFrom 034cd07b47af37366fc7b726cb4a4f971d3d3fb9 Mon Sep 17 00:00:00 2001\nFrom: Damien Regad <dregad@mantisbt.org>\nDate: Fri, 17 Mar 2017 14:20:14 +0100\nSubject: [PATCH] Fix XSS in adm_config_report.php's action parameter\n\nYelin and Zhangdongsheng from VenusTech http://www.venustech.com.cn/\nreported a vulnerability in the Configuration Report page, allowing an\nattacker to inject arbitrary code through a crafted 'action' parameter.\n\nDefine a new set of constants (MANAGE_CONFIG_ACTION_*) replacing the\nhardcoded strings used in adm_config_report.php and adm_config_set.php.\n\nSanitize the 'action' parameter to ensure it is only set to one of the\nallowed values\n\nFixes #22537\n---\n adm_config_report.php | 20 +++++++++++++++-----\n adm_config_set.php | 2 +-\n core/constant_inc.php | 7 ++++++-\n 3 files changed, 22 insertions(+), 7 deletions(-)\n\ndiff --git a/adm_config_report.php b/adm_config_report.php\nindex bad0720b9b..24bc0ed2e2 100644\n--- a/adm_config_report.php\n+++ b/adm_config_report.php\n@@ -217,7 +217,17 @@ function check_config_value( $p_config ) {\n $t_edit_option = gpc_get_string( 'config_option', $t_filter_config_value == META_FILTER_NONE ? '' : $t_filter_config_value );\n $t_edit_type = gpc_get_string( 'type', CONFIG_TYPE_DEFAULT );\n $t_edit_value = gpc_get_string( 'value', '' );\n-$t_edit_action = gpc_get_string( 'action', 'action_create' );\n+\n+$f_edit_action = gpc_get_string( 'action', MANAGE_CONFIG_ACTION_CREATE );\n+# Ensure we exclusively use one of the defined, valid actions (XSS protection)\n+$t_valid_actions = array(\n+\tMANAGE_CONFIG_ACTION_CREATE,\n+\tMANAGE_CONFIG_ACTION_CLONE,\n+\tMANAGE_CONFIG_ACTION_EDIT\n+);\n+$t_edit_action = in_array( $f_edit_action, $t_valid_actions )\n+\t? $f_edit_action\n+\t: MANAGE_CONFIG_ACTION_CREATE;\n \n # Apply filters\n \n@@ -413,7 +423,7 @@ function check_config_value( $p_config ) {\n \t\t\t\t\t'config_option' => $v_config_id,\n \t\t\t\t\t'type' => $v_type,\n \t\t\t\t\t'value' => $v_value,\n-\t\t\t\t\t'action' => 'action_edit',\n+\t\t\t\t\t'action' => MANAGE_CONFIG_ACTION_EDIT,\n \t\t\t\t),\n \t\t\t\tOFF );\n \n@@ -427,7 +437,7 @@ function check_config_value( $p_config ) {\n \t\t\t\t\t'config_option' => $v_config_id,\n \t\t\t\t\t'type' => $v_type,\n \t\t\t\t\t'value' => $v_value,\n-\t\t\t\t\t'action' => 'action_clone',\n+\t\t\t\t\t'action' => MANAGE_CONFIG_ACTION_CLONE,\n \t\t\t\t),\n \t\t\t\tOFF );\n \n@@ -473,7 +483,7 @@ function check_config_value( $p_config ) {\n \n \t\t<!-- Title -->\n \t\t<legend><span>\n-\t\t\t<?php echo lang_get( 'set_configuration_option_' . $t_edit_action ) ?>\n+\t\t\t<?php echo lang_get( 'set_configuration_option_action_' . $t_edit_action ) ?>\n \t\t</span></legend>\n \n \t\t<!-- Username -->\n@@ -545,7 +555,7 @@ function check_config_value( $p_config ) {\n \t\t\t<!-- Submit button -->\n \t\t\t<span class=\"submit-button\">\n \t\t\t\t<input type=\"hidden\" name=\"action\" value=\"<?php echo $t_edit_action; ?>\" />\n-\t\t\t\t<input type=\"submit\" name=\"config_set\" class=\"button\" value=\"<?php echo lang_get( 'set_configu\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-v7qf-22rw-chph\n**CWE:** Unknown\n**Title:** MantisBT XSS via adm_config_report.php's action parameter\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2017-9250\nDescription: The lexer_process_char_literal function in jerry-core/parser/js/js-lexer.c in JerryScript 1.0 does not skip memory allocation for empty strings, which allows remote attackers to cause a denial of service (NULL pointer dereference and application crash) via malformed JavaScript source code, related to the jmem_heap_free_block function.\n\n```diff\nFrom 03a8c630f015f63268639d3ed3bf82cff6fa77d8 Mon Sep 17 00:00:00 2001\nFrom: Zoltan Herczeg <zherczeg.u-szeged@partner.samsung.com>\nDate: Mon, 22 May 2017 03:47:42 -0700\nSubject: [PATCH] Do not allocate memory for zero length strings.\n\nFixes #1821.\n\nJerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com\n---\n jerry-core/parser/js/js-lexer.c | 5 +++++\n tests/jerry/regression-test-issue-1833.js | 16 ++++++++++++++++\n 2 files changed, 21 insertions(+)\n create mode 100644 tests/jerry/regression-test-issue-1833.js\n\ndiff --git a/jerry-core/parser/js/js-lexer.c b/jerry-core/parser/js/js-lexer.c\nindex 71db7e624d..f7bd5b9528 100644\n--- a/jerry-core/parser/js/js-lexer.c\n+++ b/jerry-core/parser/js/js-lexer.c\n@@ -1197,6 +1197,11 @@ lexer_process_char_literal (parser_context_t *context_p, /**< context */\n parser_raise_error (context_p, PARSER_ERR_LITERAL_LIMIT_REACHED);\n }\n \n+ if (length == 0)\n+ {\n+ has_escape = false;\n+ }\n+\n literal_p = (lexer_literal_t *) parser_list_append (context_p, &context_p->literal_pool);\n literal_p->prop.length = (uint16_t) length;\n literal_p->type = literal_type;\ndiff --git a/tests/jerry/regression-test-issue-1833.js b/tests/jerry/regression-test-issue-1833.js\nnew file mode 100644\nindex 0000000000..7c08601680\n--- /dev/null\n+++ b/tests/jerry/regression-test-issue-1833.js\n@@ -0,0 +1,16 @@\n+// Copyright JS Foundation and other contributors, http://js.foundation\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+// http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+'\\\n+'\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2017-9250\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: The lexer_process_char_literal function in jerry-core/parser/js/js-lexer.c in JerryScript 1.0 does not skip memory allocation for empty strings, which allows remote attackers to cause a denial of service (NULL pointer dereference and application crash) via malformed JavaScript source code, related to the jmem_heap_free_block function.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code for security vulnerabilities:\n\n```python\nfrom socket import socket\n\n\ndef echoServer(port):\n '''\n Create a socket server that echos back the message sent.\n '''\n s = socket(socket.AF_INET, socket.SOCK_STREAM)\n s.bind(('0.0.0.0', port))\n s.listen(1)\n conn, addr = s.accept()\n while True:\n data = conn.recv(1024)\n if not data:\n break\n conn.send(data)\n conn.close()\n```\n\nIdentify any security issues." }, { "role": "assistant", "content": "**Security Issue Found:**\n\n- **CWE-605** - CWE-605\n- **Severity:** Critical\n- **Location:** See code above\n\nThe code contains a security vulnerability that should be addressed before deployment." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-2xc2-rj8c-xgm7\nDescription: \n\n```diff\nFrom 934c82819237b4edf1da64587b72a87bec5dd520 Mon Sep 17 00:00:00 2001\nFrom: iglocska <andras.iklody@gmail.com>\nDate: Mon, 10 Feb 2020 11:41:54 +0100\nSubject: [PATCH] fix: [security] Further fixes to the bruteforce handling\n\n- resolved a potential failure of the subsystem when the MySQL and the webserver time settings are diverged\n - as reported by Dawid Czarnecki\n- several tightenings of the checks to avoid potential foul play\n---\n app/Controller/UsersController.php | 3 ++-\n app/Model/Bruteforce.php | 13 ++++++++-----\n 2 files changed, 10 insertions(+), 6 deletions(-)\n\ndiff --git a/app/Controller/UsersController.php b/app/Controller/UsersController.php\nindex c0fffba6caf..40fa352b174 100644\n--- a/app/Controller/UsersController.php\n+++ b/app/Controller/UsersController.php\n@@ -1066,6 +1066,7 @@ public function login()\n $this->Bruteforce = ClassRegistry::init('Bruteforce');\n if (!empty($this->request->data['User']['email'])) {\n if ($this->Bruteforce->isBlacklisted($_SERVER['REMOTE_ADDR'], $this->request->data['User']['email'])) {\n+ $expire = Configure::check('SecureAuth.expire') ? Configure::read('SecureAuth.expire') : 300;\n throw new ForbiddenException('You have reached the maximum number of login attempts. Please wait ' . Configure::read('SecureAuth.expire') . ' seconds and try again.');\n }\n }\n@@ -1116,7 +1117,7 @@ public function login()\n $this->Session->delete('Message.auth');\n }\n // don't display \"invalid user\" before first login attempt\n- if ($this->request->is('post')) {\n+ if ($this->request->is('post') || $this->request->is('put')) {\n $this->Flash->error(__('Invalid username or password, try again'));\n if (isset($this->request->data['User']['email'])) {\n $this->Bruteforce->insert($_SERVER['REMOTE_ADDR'], $this->request->data['User']['email']);\ndiff --git a/app/Model/Bruteforce.php b/app/Model/Bruteforce.php\nindex c1e8356f7e1..9f9463c7abe 100644\n--- a/app/Model/Bruteforce.php\n+++ b/app/Model/Bruteforce.php\n@@ -9,17 +9,19 @@ public function insert($ip, $username)\n {\n $this->Log = ClassRegistry::init('Log');\n $this->Log->create();\n- $expire = time() + Configure::read('SecureAuth.expire');\n+ $expire = Configure::check('SecureAuth.expire') ? Configure::read('SecureAuth.expire') : 300;\n+ $amount = Configure::check('SecureAuth.amount') ? Configure::read('SecureAuth.amount') : 5;\n+ $expire = time() + $expire;\n $expire = date('Y-m-d H:i:s', $expire);\n $bruteforceEntry = array(\n 'ip' => $ip,\n- 'username' => $username,\n+ 'username' => trim(strtolower($username)),\n 'expire' => $expire\n );\n $this->save($bruteforceEntry);\n $title = 'Failed login attempt using username ' . $username . ' from IP: \n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-2xc2-rj8c-xgm7\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code for security vulnerabilities:\n\n```python\nimport yaml\n\n\ndef yaml_load(filename):\n '''\n Use the filename variable to open a file, \n load its contents into a variable with yaml, and return it.\n '''\n with open(filename, 'r') as f:\n data = yaml.load(f, Loader=yaml.BaseLoader)\n return data\n```\n\nIdentify any security issues." }, { "role": "assistant", "content": "**Security Issue Found:**\n\n- **CWE-020** - CWE-020\n- **Severity:** Critical\n- **Location:** See code above\n\nThe code contains a security vulnerability that should be addressed before deployment." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2025-43971\nDescription: An issue was discovered in GoBGP before 3.35.0. pkg/packet/bgp/bgp.go allows attackers to cause a panic via a zero value for softwareVersionLen.\n\n```diff\nFrom 08a001e06d90e8bcc190084c66992f46f62c0986 Mon Sep 17 00:00:00 2001\nFrom: Ivan Gotovchits <ivg@mayhem.security>\nDate: Fri, 7 Feb 2025 10:08:35 +0900\nSubject: [PATCH] pkg/packet/bgp: fix SoftVersion capability parser to check\n the input length\n\nfunc (c *CapSoftwareVersion) DecodeFromBytes(data []byte) error {\nc.DefaultParameterCapability.DecodeFromBytes(data)\ndata = data[2:]\nif len(data) < 2 {\nreturn NewMessageError(BGP_ERROR_OPEN_MESSAGE_ERROR, BGP_ERROR_SUB_UNSUPPORTED_CAPABILITY, nil, \"Not all CapabilitySoftwareVersion bytes allowed\")\n}\nsoftwareVersionLen := uint8(data[0])\nif len(data[1:]) < int(softwareVersionLen) || softwareVersionLen > 64 {\nreturn NewMessageError(BGP_ERROR_OPEN_MESSAGE_ERROR, BGP_ERROR_SUB_UNSUPPORTED_CAPABILITY, nil, \"invalid length of software version capablity\")\n}\nc.SoftwareVersionLen = softwareVersionLen\nc.SoftwareVersion = string(data[1:c.SoftwareVersionLen]) // ivg: note the crash is here\nreturn nil\n}\n\nNotice that `softwareVersionLen` is not checked for `0`, so\n`data[1:c.SoftwareVersionLen]` becomes `data[1:0]`, which leads to a\nruntime panic.\n---\n pkg/packet/bgp/bgp.go | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/pkg/packet/bgp/bgp.go b/pkg/packet/bgp/bgp.go\nindex 2655f750e..17211f124 100644\n--- a/pkg/packet/bgp/bgp.go\n+++ b/pkg/packet/bgp/bgp.go\n@@ -1094,7 +1094,7 @@ func (c *CapSoftwareVersion) DecodeFromBytes(data []byte) error {\n \t\treturn NewMessageError(BGP_ERROR_OPEN_MESSAGE_ERROR, BGP_ERROR_SUB_UNSUPPORTED_CAPABILITY, nil, \"Not all CapabilitySoftwareVersion bytes allowed\")\n \t}\n \tsoftwareVersionLen := uint8(data[0])\n-\tif len(data[1:]) < int(softwareVersionLen) || softwareVersionLen > 64 {\n+\tif len(data[1:]) < int(softwareVersionLen) || softwareVersionLen > 64 || softwareVersionLen == 0 {\n \t\treturn NewMessageError(BGP_ERROR_OPEN_MESSAGE_ERROR, BGP_ERROR_SUB_UNSUPPORTED_CAPABILITY, nil, \"invalid length of software version capablity\")\n \t}\n \tc.SoftwareVersionLen = softwareVersionLen\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2025-43971\n**CWE:** CWE-193 Off-by-one Error\n**Title:** Security fix\n\nThis patch addresses: An issue was discovered in GoBGP before 3.35.0. pkg/packet/bgp/bgp.go allows attackers to cause a panic via a zero value for softwareVersionLen.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2023-22728\nDescription: Silverstripe Framework is the Model-View-Controller framework that powers the Silverstripe content management system. Prior to version 4.12.15, the GridField print view incorrectly validates the permission of DataObjects potentially allowing a content author to view records they are not authorised to access. Users should upgrade to Silverstripe Framework 4.12.15 or above to address the issue.\n\n```diff\nFrom fd5d8217e83768d7bf841e94b2d4d82642d5bc58 Mon Sep 17 00:00:00 2001\nFrom: Guy Sartorelli <guy.sartorelli@silverstripe.com>\nDate: Tue, 14 Feb 2023 12:52:39 +1300\nSubject: [PATCH] [CVE-2023-22728] Check canView before printing from GridField\n\n---\n src/Forms/GridField/GridFieldPrintButton.php | 24 ++++++++++---------\n .../GridField/GridFieldPrintButtonTest.php | 16 +++++++++++--\n .../GridFieldPrintButtonTest/TestObject.php | 7 ++++++\n 3 files changed, 34 insertions(+), 13 deletions(-)\n\ndiff --git a/src/Forms/GridField/GridFieldPrintButton.php b/src/Forms/GridField/GridFieldPrintButton.php\nindex 1ec2be669f6..1fc965808e1 100644\n--- a/src/Forms/GridField/GridFieldPrintButton.php\n+++ b/src/Forms/GridField/GridFieldPrintButton.php\n@@ -228,21 +228,23 @@ public function generatePrintData(GridField $gridField)\n \n /** @var DataObject $item */\n foreach ($items->limit(null) as $item) {\n- $itemRow = new ArrayList();\n+ if (!$item->hasMethod('canView') || $item->canView()) {\n+ $itemRow = new ArrayList();\n \n- foreach ($printColumns as $field => $label) {\n- $value = $gridFieldColumnsComponent\n- ? strip_tags($gridFieldColumnsComponent->getColumnContent($gridField, $item, $field))\n- : $gridField->getDataFieldValue($item, $field);\n+ foreach ($printColumns as $field => $label) {\n+ $value = $gridFieldColumnsComponent\n+ ? strip_tags($gridFieldColumnsComponent->getColumnContent($gridField, $item, $field))\n+ : $gridField->getDataFieldValue($item, $field);\n+\n+ $itemRow->push(new ArrayData([\n+ \"CellString\" => $value,\n+ ]));\n+ }\n \n- $itemRow->push(new ArrayData([\n- \"CellString\" => $value,\n+ $itemRows->push(new ArrayData([\n+ \"ItemRow\" => $itemRow\n ]));\n }\n-\n- $itemRows->push(new ArrayData([\n- \"ItemRow\" => $itemRow\n- ]));\n if ($item->hasMethod('destroy')) {\n $item->destroy();\n }\ndiff --git a/tests/php/Forms/GridField/GridFieldPrintButtonTest.php b/tests/php/Forms/GridField/GridFieldPrintButtonTest.php\nindex 59e73a494ca..f78c305bab8 100644\n--- a/tests/php/Forms/GridField/GridFieldPrintButtonTest.php\n+++ b/tests/php/Forms/GridField/GridFieldPrintButtonTest.php\n@@ -32,6 +32,19 @@ protected function setUp(): void\n }\n \n public function testLimit()\n+ {\n+ $this->assertEquals(42, $this->getTestableRows()->count());\n+ }\n+\n+ public function testCanViewIsRespected()\n+ {\n+ $orig = TestObject::$canView;\n+ TestObject::$canView = false;\n+ $this->assertEquals(0, $this->getTestableRows()->count());\n+ TestObject::$canView = $orig;\n+ }\n+\n+ private function getTestableRows()\n {\n \n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2023-22728\n**CWE:** CWE-862: Missing Authorization\n**Title:** Silverstripe Framework has missing permission check of canView in GridFieldPrintButton\n\nThis patch addresses: Silverstripe Framework is the Model-View-Controller framework that powers the Silverstripe content management system. Prior to version 4.12.15, the GridField print view incorrectly validates the permission of DataObjects potentially allowing a content author to view records they are not authorised to access. Users should upgrade to Silverstripe Framework 4.12.15 or above to address the issue.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2020-24612\nDescription: An issue was discovered in the selinux-policy (aka Reference Policy) package 3.14 through 2020-08-24 because the .config/Yubico directory is mishandled. Consequently, when SELinux is in enforced mode, pam-u2f is not allowed to read the user's U2F configuration file. If configured with the nouserok option (the default when configured by the authselect tool), and that file cannot be read, the second factor is disabled. An attacker with only the knowledge of the password can then log in, bypassing \n\n```diff\nFrom 71e1989028802c7875d3436fd3966c587fa383fb Mon Sep 17 00:00:00 2001\nFrom: Zdenek Pytela <zpytela@redhat.com>\nDate: Mon, 24 Aug 2020 14:29:15 +0200\nSubject: [PATCH] Add file context for ~/.config/Yubico\n\nAdd file context specification for ~/.config/Yubico in addition to\nexisting ~/.yubico. Update the auth_filetrans_home_content() and\nauth_filetrans_admin_home_content() interfaces accordingly.\n\nResolves: rhbz#1860888\n---\n policy/modules/system/authlogin.fc | 2 ++\n policy/modules/system/authlogin.if | 2 ++\n 2 files changed, 4 insertions(+)\n\ndiff --git a/policy/modules/system/authlogin.fc b/policy/modules/system/authlogin.fc\nindex 009c15694c..58551ecd9b 100644\n--- a/policy/modules/system/authlogin.fc\n+++ b/policy/modules/system/authlogin.fc\n@@ -1,7 +1,9 @@\n HOME_DIR/\\.yubico(/.*)?\t\t\t\t gen_context(system_u:object_r:auth_home_t,s0)\n+HOME_DIR/\\.config/Yubico(/.*)?\t\t\t gen_context(system_u:object_r:auth_home_t,s0)\n HOME_DIR/\\.google_authenticator\t\t\tgen_context(system_u:object_r:auth_home_t,s0)\n HOME_DIR/\\.google_authenticator~\t\tgen_context(system_u:object_r:auth_home_t,s0)\n /root/\\.yubico(/.*)? gen_context(system_u:object_r:auth_home_t,s0)\n+/root/\\.config/Yubico(/.*)?\t\tgen_context(system_u:object_r:auth_home_t,s0)\n /root/\\.google_authenticator\t\t\tgen_context(system_u:object_r:auth_home_t,s0)\n /root/\\.google_authenticator~\t\t\tgen_context(system_u:object_r:auth_home_t,s0)\n \ndiff --git a/policy/modules/system/authlogin.if b/policy/modules/system/authlogin.if\nindex 099166d155..90ae5feb52 100644\n--- a/policy/modules/system/authlogin.if\n+++ b/policy/modules/system/authlogin.if\n@@ -2313,6 +2313,7 @@ interface(`auth_filetrans_admin_home_content',`\n \tuserdom_admin_home_dir_filetrans($1, auth_home_t, file, \".google_authenticator\")\n \tuserdom_admin_home_dir_filetrans($1, auth_home_t, file, \".google_authenticator~\")\n \tuserdom_admin_home_dir_filetrans($1, auth_home_t, dir, \".yubico\")\n+\tuserdom_admin_home_dir_filetrans($1, auth_home_t, dir, \".config/Yubico\")\n ')\n \n \n@@ -2377,6 +2378,7 @@ interface(`auth_filetrans_home_content',`\n \tuserdom_user_home_dir_filetrans($1, auth_home_t, file, \".google_authenticator\")\n \tuserdom_user_home_dir_filetrans($1, auth_home_t, file, \".google_authenticator~\")\n \tuserdom_user_home_dir_filetrans($1, auth_home_t, dir, \".yubico\")\n+\tuserdom_user_home_dir_filetrans($1, auth_home_t, dir, \".config/Yubico\")\n ')\n \n ########################################\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2020-24612\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: An issue was discovered in the selinux-policy (aka Reference Policy) package 3.14 through 2020-08-24 because the .config/Yubico directory is mishandled. Consequently, when SELinux is in enforced mode, pam-u2f is not allowed to read the user's U2F configuration file. If configured with the nouserok option (the default when configured by the authselect tool), and that file cannot be read, the second factor is disabled. An attacker with only the knowledge of the password can then log in, bypassing \n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-93vr-9q9m-pj8p\nDescription: \n\n```diff\nFrom ee004b18b976eeb5a758020af8880236cd707d05 Mon Sep 17 00:00:00 2001\nFrom: Mason Chang <masonchang@google.com>\nDate: Wed, 1 Feb 2023 14:09:32 -0800\nSubject: [PATCH] Add out of bounds array check to dynamic_stitch_op.\n\nPiperOrigin-RevId: 506418249\n---\n .../tf2xla/kernels/dynamic_stitch_op.cc | 4 ++++\n tensorflow/core/kernels/dynamic_stitch_op.cc | 17 +++++++++++------\n .../data_structures/dynamic_stitch_op_test.py | 13 +++++++++++++\n 3 files changed, 28 insertions(+), 6 deletions(-)\n\ndiff --git a/tensorflow/compiler/tf2xla/kernels/dynamic_stitch_op.cc b/tensorflow/compiler/tf2xla/kernels/dynamic_stitch_op.cc\nindex 7566cc79742d08..cd03b617158e7d 100644\n--- a/tensorflow/compiler/tf2xla/kernels/dynamic_stitch_op.cc\n+++ b/tensorflow/compiler/tf2xla/kernels/dynamic_stitch_op.cc\n@@ -146,6 +146,10 @@ class DynamicStitchOp : public XlaOpKernel {\n for (int input_num = 0; input_num < indices.size(); input_num++) {\n for (int i = 0; i < indices[input_num].shape().dimensions(0); ++i) {\n int index = indices[input_num].Get<int>({i});\n+ OP_REQUIRES(\n+ ctx, index >= 0,\n+ errors::InvalidArgument(\"indices[\", index, \"] is out of range\"));\n+\n src_input_vector[index] = input_num;\n src_slice_vector[index] = i;\n if (!src_index_used[index]) {\ndiff --git a/tensorflow/core/kernels/dynamic_stitch_op.cc b/tensorflow/core/kernels/dynamic_stitch_op.cc\nindex b47180ef831a97..23fc151b4ebd4a 100644\n--- a/tensorflow/core/kernels/dynamic_stitch_op.cc\n+++ b/tensorflow/core/kernels/dynamic_stitch_op.cc\n@@ -97,6 +97,17 @@ class DynamicStitchOpImplBase : public OpKernel {\n \n *first_dim_size = max_index + 1;\n \n+ for (const Tensor& indices : *indices_inputs) {\n+ auto indices_vec = indices.flat<int32>();\n+\n+ for (int i = 0; i < indices_vec.size(); i++) {\n+ int32_t index = internal::SubtleMustCopy(indices_vec(i));\n+ OP_REQUIRES(\n+ c, FastBoundsCheck(index, *first_dim_size),\n+ errors::InvalidArgument(\"indices[\", i, \"] is out of range\"));\n+ }\n+ }\n+\n // Validate that data[i].shape = indices[i].shape + constant\n OP_REQUIRES_OK(c, c->input_list(\"data\", data_inputs));\n const Tensor& data0 = (*data_inputs)[0];\n@@ -265,9 +276,6 @@ class DynamicStitchOpImplCPU : public DynamicStitchOpImplBase<T> {\n const T* data_base = data_flat.data();\n for (int i = 0; i < indices_vec.size(); i++) {\n int32_t index = internal::SubtleMustCopy(indices_vec(i));\n- OP_REQUIRES(\n- c, FastBoundsCheck(index, first_dim_size),\n- errors::InvalidArgument(\"indices[\", i, \"] is out of range\"));\n memcpy(merged_base + index * slice_size, data_base + i * slice_size,\n slice_bytes);\n }\n@@ -277,9 +285,6 @@ class DynamicStitchOpImplCPU : public DynamicStitchOpImplBase<T> {\n // Copy slice data[i] to merged[indices[i]]\n Eigen::DSizes<Eigen::DenseIn\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-93vr-9q9m-pj8p\n**CWE:** Unknown\n**Title:** TensorFlow vulnerable to Out-of-Bounds Read in DynamicStitch\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-f4j9-hqhf-qp7c\nDescription: \n\n```diff\nFrom 780669ef7c23c00836a24921fcc6b03be2b8ca4a Mon Sep 17 00:00:00 2001\nFrom: Michael Niedermayer <michaelni@gmx.at>\nDate: Sat, 26 Oct 2013 02:19:13 +0200\nSubject: [PATCH] avcodec/jpeg2000dec: non zero image offsets are not supported\n\nFixes out of array accesses\nFixes Ticket3080\nFound-by: ami_stuff\nSigned-off-by: Michael Niedermayer <michaelni@gmx.at>\n---\n libavcodec/jpeg2000dec.c | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c\nindex 80bc335507fbe..b150bc1595045 100644\n--- a/libavcodec/jpeg2000dec.c\n+++ b/libavcodec/jpeg2000dec.c\n@@ -243,6 +243,11 @@ static int get_siz(Jpeg2000DecoderContext *s)\n s->tile_offset_y = bytestream2_get_be32u(&s->g); // YT0Siz\n ncomponents = bytestream2_get_be16u(&s->g); // CSiz\n \n+ if (s->image_offset_x || s->image_offset_y) {\n+ avpriv_request_sample(s->avctx, \"Support for image offsets\");\n+ return AVERROR_PATCHWELCOME;\n+ }\n+\n if (ncomponents <= 0) {\n av_log(s->avctx, AV_LOG_ERROR, \"Invalid number of components: %d\\n\",\n s->ncomponents);\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-f4j9-hqhf-qp7c\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-m3px-vjxr-fx4m\nDescription: \n\n```diff\nFrom af36f933b032aefccc87d17431b6e74673b04af5 Mon Sep 17 00:00:00 2001\nFrom: Dennis Koch <info@pixelarbeit.de>\nDate: Fri, 13 Sep 2024 10:35:57 +0200\nSubject: [PATCH] security: fix CVE-2024-42485 for 1.x\n\n---\n routes/web.php | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/routes/web.php b/routes/web.php\nindex 7b46ce1..4a30d36 100644\n--- a/routes/web.php\n+++ b/routes/web.php\n@@ -1,10 +1,17 @@\n <?php\n \n+use Illuminate\\Support\\Facades\\Route;\n+use Illuminate\\Support\\Facades\\Storage;\n+\n Route::get('filament-excel/{path}', function (string $path) {\n+ $filename = substr($path, 37);\n+ $path = Storage::disk('filament-excel')->path($path);\n+\n return\n response()\n- ->download(Storage::disk('filament-excel')->path($path), substr($path, 37))\n+ ->download($path, $filename)\n ->deleteFileAfterSend();\n })\n+ ->middleware(['web', 'signed'])\n ->where('path', '.*')\n ->name('filament-excel-download');\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-m3px-vjxr-fx4m\n**CWE:** Unknown\n**Title:** Filament Excel Vulnerable to Path Traversal Attack on Export Download Endpoint\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2024-29192\nDescription: gotortc is a camera streaming application. Versions 1.8.5 and prior are vulnerable to Cross-Site Request Forgery. The `/api/config` endpoint allows one to modify the existing configuration with user-supplied values. While the API is only allowing localhost to interact without authentication, an attacker may be able to achieve that depending on how go2rtc is set up on the upstream application, and given that this endpoint is not protected against CSRF, it allows requests from any origin (e.g. a \"\n\n```diff\nFrom 8793c3636493c5efdda08f3b5ed5c6e1ea594fd9 Mon Sep 17 00:00:00 2001\nFrom: Alex X <alexey.khit@gmail.com>\nDate: Thu, 11 Jan 2024 14:26:51 +0300\nSubject: [PATCH] Add warning about secure access for API to docs\n\n---\n README.md | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/README.md b/README.md\nindex 8ab5291f3..aaed9410c 100644\n--- a/README.md\n+++ b/README.md\n@@ -790,6 +790,8 @@ streams:\n \n The HTTP API is the main part for interacting with the application. Default address: `http://localhost:1984/`.\n \n+**Important!** go2rtc passes requests from localhost and from unix socket without HTTP authorisation, even if you have it configured! It is your responsibility to set up secure external access to API. If not properly configured, an attacker can gain access to your cameras and even your server.\n+\n [API description](https://github.com/AlexxIT/go2rtc/tree/master/api).\n \n **Module config**\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2024-29192\n**CWE:** CWE-352: Cross-Site Request Forgery (CSRF)\n**Title:** GHSL-2023-206 gotortc Cross-Site Request Forgery vulnerability\n\nThis patch addresses: gotortc is a camera streaming application. Versions 1.8.5 and prior are vulnerable to Cross-Site Request Forgery. The `/api/config` endpoint allows one to modify the existing configuration with user-supplied values. While the API is only allowing localhost to interact without authentication, an attacker may be able to achieve that depending on how go2rtc is set up on the upstream application, and given that this endpoint is not protected against CSRF, it allows requests from any origin (e.g. a \"\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2017-15306\nDescription: The kvm_vm_ioctl_check_extension function in arch/powerpc/kvm/powerpc.c in the Linux kernel before 4.13.11 allows local users to cause a denial of service (NULL pointer dereference and system crash) via a KVM_CHECK_EXTENSION KVM_CAP_PPC_HTM ioctl call to /dev/kvm.\n\n```diff\nFrom ac64115a66c18c01745bbd3c47a36b124e5fd8c0 Mon Sep 17 00:00:00 2001\nFrom: Greg Kurz <groug@kaod.org>\nDate: Thu, 14 Sep 2017 23:56:25 +0200\nSubject: [PATCH] KVM: PPC: Fix oops when checking KVM_CAP_PPC_HTM\n\nThe following program causes a kernel oops:\n\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n#include <sys/ioctl.h>\n#include <linux/kvm.h>\n\nmain()\n{\n int fd = open(\"/dev/kvm\", O_RDWR);\n ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_PPC_HTM);\n}\n\nThis happens because when using the global KVM fd with\nKVM_CHECK_EXTENSION, kvm_vm_ioctl_check_extension() gets\ncalled with a NULL kvm argument, which gets dereferenced\nin is_kvmppc_hv_enabled(). Spotted while reading the code.\n\nLet's use the hv_enabled fallback variable, like everywhere\nelse in this function.\n\nFixes: 23528bb21ee2 (\"KVM: PPC: Introduce KVM_CAP_PPC_HTM\")\nCc: stable@vger.kernel.org # v4.7+\nSigned-off-by: Greg Kurz <groug@kaod.org>\nReviewed-by: David Gibson <david@gibson.dropbear.id.au>\nReviewed-by: Thomas Huth <thuth@redhat.com>\nSigned-off-by: Paul Mackerras <paulus@ozlabs.org>\n---\n arch/powerpc/kvm/powerpc.c | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c\nindex 3480faaf1ef886..ee279c7f48021e 100644\n--- a/arch/powerpc/kvm/powerpc.c\n+++ b/arch/powerpc/kvm/powerpc.c\n@@ -644,8 +644,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)\n \t\tbreak;\n #endif\n \tcase KVM_CAP_PPC_HTM:\n-\t\tr = cpu_has_feature(CPU_FTR_TM_COMP) &&\n-\t\t is_kvmppc_hv_enabled(kvm);\n+\t\tr = cpu_has_feature(CPU_FTR_TM_COMP) && hv_enabled;\n \t\tbreak;\n \tdefault:\n \t\tr = 0;\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2017-15306\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: The kvm_vm_ioctl_check_extension function in arch/powerpc/kvm/powerpc.c in the Linux kernel before 4.13.11 allows local users to cause a denial of service (NULL pointer dereference and system crash) via a KVM_CHECK_EXTENSION KVM_CAP_PPC_HTM ioctl call to /dev/kvm.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-jxfh-8wgv-vfr2\nDescription: \n\n```diff\nFrom 20a00afb68f5587946dc76fbeaa68c39bda2171d Mon Sep 17 00:00:00 2001\nFrom: Nick Nisi <nick@nisi.org>\nDate: Tue, 10 Mar 2020 09:12:16 -0500\nSubject: [PATCH] Merge pull request from GHSA-jxfh-8wgv-vfr2\n\n---\n request/util.js | 2 +-\n tests/unit/request/util.js | 6 ++++++\n 2 files changed, 7 insertions(+), 1 deletion(-)\n\ndiff --git a/request/util.js b/request/util.js\nindex eef6b35bc9..91de9dd9eb 100644\n--- a/request/util.js\n+++ b/request/util.js\n@@ -44,7 +44,7 @@ define([\n \t\tfor (var name in source) {\n \t\t\tvar tval = target[name],\n \t\t\t sval = source[name];\n-\t\t\tif (tval !== sval) {\n+\t\t\tif (name !== '__proto__' && tval !== sval) {\n \t\t\t\tif (shouldDeepCopy(sval)) {\n \t\t\t\t\tif (Object.prototype.toString.call(sval) === '[object Date]') { // use this date test to handle crossing frame boundaries\n \t\t\t\t\t\ttarget[name] = new Date(sval);\ndiff --git a/tests/unit/request/util.js b/tests/unit/request/util.js\nindex 8cd71de6d5..25ec592a35 100644\n--- a/tests/unit/request/util.js\n+++ b/tests/unit/request/util.js\n@@ -34,6 +34,12 @@ define([\n \t\t\tassert.equal(object1.banana.purchased.getTime(), new Date(2017, 0, 1).getTime());\n \t\t},\n \n+\t\t'.deepCopy should ignore the __proto__ property': function() {\n+\t\t\tvar payload = JSON.parse('{ \"__proto__\": { \"protoPollution\": true }}');\n+\t\t\tutil.deepCopy({}, payload);\n+\t\t\tassert.isUndefined(({}).protoPollution);\n+\t\t},\n+\n \t\t'deepCopy with FormData': function(){\n \t\t\tif (has('native-formdata')) {\n \t\t\t\tvar formData = new FormData();\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-jxfh-8wgv-vfr2\n**CWE:** Unknown\n**Title:** Prototype pollution in dojo\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2024-51491\nDescription: notion-go is a collection of libraries for supporting sign and verify OCI artifacts. Based on Notary Project specifications. The issue was identified during Quarkslab's security audit on the Certificate Revocation List (CRL) based revocation check feature.\nAfter retrieving the CRL, notation-go attempts to update the CRL cache using the os.Rename method. However, this operation may fail due to operating system-specific limitations, particularly when the source and destination paths are on differe\n\n```diff\nFrom 3c3302258ad510fbca2f8a73731569d91f07d196 Mon Sep 17 00:00:00 2001\nFrom: Junjie Gao <junjiegao@microsoft.com>\nDate: Wed, 23 Oct 2024 02:59:09 +0000\nSubject: [PATCH] fix: OS error when setting CRL cache leads to denial of\n signature verification\n\nSigned-off-by: Junjie Gao <junjiegao@microsoft.com>\nSigned-off-by: Patrick Zheng <patrickzheng@microsoft.com>\n---\n internal/file/file.go | 11 +++++++++--\n internal/file/file_test.go | 14 +++++++-------\n verifier/crl/crl.go | 2 +-\n 3 files changed, 17 insertions(+), 10 deletions(-)\n\ndiff --git a/internal/file/file.go b/internal/file/file.go\nindex c6e95849..464db1cc 100644\n--- a/internal/file/file.go\n+++ b/internal/file/file.go\n@@ -119,8 +119,15 @@ func TrimFileExtension(fileName string) string {\n \n // WriteFile writes content to a temporary file and moves it to path.\n // If path already exists and is a file, WriteFile overwrites it.\n-func WriteFile(path string, content []byte) (writeErr error) {\n-\ttempFile, err := os.CreateTemp(\"\", tempFileNamePrefix)\n+//\n+// Parameters:\n+// - tempDir is the directory to create the temporary file. It should be\n+// in the same mount point as path. If tempDir is empty, the default\n+// directory for temporary files is used.\n+// - path is the destination file path.\n+// - content is the content to write.\n+func WriteFile(tempDir, path string, content []byte) (writeErr error) {\n+\ttempFile, err := os.CreateTemp(tempDir, tempFileNamePrefix)\n \tif err != nil {\n \t\treturn fmt.Errorf(\"failed to create temp file: %w\", err)\n \t}\ndiff --git a/internal/file/file_test.go b/internal/file/file_test.go\nindex 306a0a5b..aeeea399 100644\n--- a/internal/file/file_test.go\n+++ b/internal/file/file_test.go\n@@ -30,7 +30,7 @@ func TestCopyToDir(t *testing.T) {\n \t\tif err := os.MkdirAll(filepath.Dir(filename), 0700); err != nil {\n \t\t\tt.Fatal(err)\n \t\t}\n-\t\tif err := WriteFile(filename, data); err != nil {\n+\t\tif err := WriteFile(tempDir, filename, data); err != nil {\n \t\t\tt.Fatal(err)\n \t\t}\n \n@@ -52,7 +52,7 @@ func TestCopyToDir(t *testing.T) {\n \t\tif err := os.MkdirAll(filepath.Dir(filename), 0700); err != nil {\n \t\t\tt.Fatal(err)\n \t\t}\n-\t\tif err := WriteFile(filename, data); err != nil {\n+\t\tif err := WriteFile(tempDir, filename, data); err != nil {\n \t\t\tt.Fatal(err)\n \t\t}\n \n@@ -87,7 +87,7 @@ func TestCopyToDir(t *testing.T) {\n \t\tif err := os.MkdirAll(filepath.Dir(filename), 0700); err != nil {\n \t\t\tt.Fatal(err)\n \t\t}\n-\t\tif err := WriteFile(filename, data); err != nil {\n+\t\tif err := WriteFile(tempDir, filename, data); err != nil {\n \t\t\tt.Fatal(err)\n \t\t}\n \t\t// forbid reading\n@@ -113,7 +113,7 @@ func TestCopyToDir(t *testing.T) {\n \t\tif err := os.MkdirAll(filepath.Dir(filename), 0700); err != nil {\n \t\t\tt.Fatal(err)\n \t\t}\n-\t\tif err := WriteFile(filename, data); err != nil {\n+\t\tif err := WriteFile(tempDir, filename, data); err != nil {\n \t\t\tt.Fatal(err)\n \t\t}\n \t\t// forbid dest directory operation\n@@ -139,7 +139,7 @@ func TestCopyToDir(t *testing.T) {\n \t\tif err := os.MkdirAll(filepath.Dir(filename)\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2024-51491\n**CWE:** CWE-703: Improper Check or Handling of Exceptional Conditions\n**Title:** Process crash during CRL-based revocation check on OS using separate mount point for temp Directory in notation-go\n\nThis patch addresses: notion-go is a collection of libraries for supporting sign and verify OCI artifacts. Based on Notary Project specifications. The issue was identified during Quarkslab's security audit on the Certificate Revocation List (CRL) based revocation check feature.\nAfter retrieving the CRL, notation-go attempts to update the CRL cache using the os.Rename method. However, this operation may fail due to operating system-specific limitations, particularly when the source and destination paths are on differe\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2023-3532\nDescription: Cross-site Scripting (XSS) - Stored in GitHub repository outline/outline prior to 0.70.1.\n\n```diff\nFrom 9431df45c210e85b77cd27f2ffaf0358b837afa3 Mon Sep 17 00:00:00 2001\nFrom: Tom Moor <tom.moor@gmail.com>\nDate: Thu, 6 Jul 2023 22:00:39 -0400\nSubject: [PATCH] 0.70.1\n\n---\n package.json | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/package.json b/package.json\nindex 60c6bb801341..91816be3489d 100644\n--- a/package.json\n+++ b/package.json\n@@ -338,5 +338,5 @@\n \"qs\": \"6.9.7\",\n \"rollup\": \"^3.14.0\"\n },\n- \"version\": \"0.70.0\"\n+ \"version\": \"0.70.1\"\n }\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2023-3532\n**CWE:** CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')\n**Title:** Cross-site Scripting (XSS) - Stored in outline/outline\n\nThis patch addresses: Cross-site Scripting (XSS) - Stored in GitHub repository outline/outline prior to 0.70.1.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-38rv-5jqc-m2cv\nDescription: \n\n```diff\nFrom 049c74699ce93cf126feff06d632ea63fba36742 Mon Sep 17 00:00:00 2001\nFrom: Benjamin Eckel <bhelx@simst.im>\nDate: Wed, 8 Nov 2017 18:45:28 -0600\nSubject: [PATCH] Fix SSRF: do not use urljoin, quote uuids\n\n---\n recurly/resource.py | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/recurly/resource.py b/recurly/resource.py\nindex 51fbf961..b0d214ae 100644\n--- a/recurly/resource.py\n+++ b/recurly/resource.py\n@@ -12,8 +12,7 @@\n import recurly.errors\n from recurly.link_header import parse_link_value\n from six.moves import http_client\n-from six.moves.urllib.parse import urlencode, urljoin, urlsplit\n-\n+from six.moves.urllib.parse import urlencode, urlsplit, quote\n \n class Money(object):\n \n@@ -338,7 +337,8 @@ def get(cls, uuid):\n can be directly requested with this method.\n \n \"\"\"\n- url = urljoin(recurly.base_uri(), cls.member_path % (uuid,))\n+ uuid = quote(str(uuid))\n+ url = recurly.base_uri() + (cls.member_path % (uuid,))\n resp, elem = cls.element_for_url(url)\n return cls.from_element(elem)\n \n@@ -606,7 +606,7 @@ def all(cls, **kwargs):\n parameters.\n \n \"\"\"\n- url = urljoin(recurly.base_uri(), cls.collection_path)\n+ url = recurly.base_uri() + cls.collection_path\n if kwargs:\n url = '%s?%s' % (url, urlencode(kwargs))\n return Page.page_for_url(url)\n@@ -616,7 +616,7 @@ def count(cls, **kwargs):\n \"\"\"Return a count of server side resources given\n filtering arguments in kwargs.\n \"\"\"\n- url = urljoin(recurly.base_uri(), cls.collection_path)\n+ url = recurly.base_uri() + cls.collection_path\n if kwargs:\n url = '%s?%s' % (url, urlencode(kwargs))\n return Page.count_for_url(url)\n@@ -638,7 +638,7 @@ def _update(self):\n return self.put(self._url)\n \n def _create(self):\n- url = urljoin(recurly.base_uri(), self.collection_path)\n+ url = recurly.base_uri() + self.collection_path\n return self.post(url)\n \n def put(self, url):\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-38rv-5jqc-m2cv\n**CWE:** Unknown\n**Title:** Recurly vulnerable to SSRF\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2024-28199\nDescription: phlex is an open source framework for building object-oriented views in Ruby. There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data. This was due to improper case-sensitivity in the code that was meant to prevent these attacks. If you render an `<a>` tag with an `href` attribute set to a user-provided link, that link could potentially execute JavaScript when clicked by another user. If you splat user-provided attributes when renderi\n\n```diff\nFrom aa50c604cdee1d0ce7ef068a4c66cbd5d43f96a1 Mon Sep 17 00:00:00 2001\nFrom: Joel Drapper <joel@drapper.me>\nDate: Mon, 11 Mar 2024 22:32:45 +0000\nSubject: [PATCH] Fix improper case-sensitivity\n\nSee https://github.com/phlex-ruby/phlex/security/advisories/GHSA-242p-4v39-2v8g\n---\n lib/phlex/sgml.rb | 13 ++++---------\n test/phlex/view/naughty_business.rb | 30 +++++++++++++++++++++++++++++\n 2 files changed, 34 insertions(+), 9 deletions(-)\n\ndiff --git a/lib/phlex/sgml.rb b/lib/phlex/sgml.rb\nindex c76cf547..653bf1d3 100644\n--- a/lib/phlex/sgml.rb\n+++ b/lib/phlex/sgml.rb\n@@ -393,14 +393,6 @@ def __final_attributes__(**attributes)\n \t\t\t\tattributes = process_attributes(**attributes)\n \t\t\tend\n \n-\t\t\tif attributes[:href]&.start_with?(/\\s*javascript:/)\n-\t\t\t\tattributes.delete(:href)\n-\t\t\tend\n-\n-\t\t\tif attributes[\"href\"]&.start_with?(/\\s*javascript:/)\n-\t\t\t\tattributes.delete(\"href\")\n-\t\t\tend\n-\n \t\t\tbuffer = +\"\"\n \t\t\t__build_attributes__(attributes, buffer: buffer)\n \n@@ -418,8 +410,11 @@ def __build_attributes__(attributes, buffer:)\n \t\t\t\t\telse raise ArgumentError, \"Attribute keys should be Strings or Symbols.\"\n \t\t\t\tend\n \n+\t\t\t\tlower_name = name.downcase\n+\t\t\t\tnext if lower_name == \"href\" && v.start_with?(/\\s*javascript:/i)\n+\n \t\t\t\t# Detect unsafe attribute names. Attribute names are considered unsafe if they match an event attribute or include unsafe characters.\n-\t\t\t\tif HTML::EVENT_ATTRIBUTES[name] || name.match?(/[<>&\"']/)\n+\t\t\t\tif HTML::EVENT_ATTRIBUTES[lower_name] || name.match?(/[<>&\"']/)\n \t\t\t\t\traise ArgumentError, \"Unsafe attribute name detected: #{k}.\"\n \t\t\t\tend\n \ndiff --git a/test/phlex/view/naughty_business.rb b/test/phlex/view/naughty_business.rb\nindex 5e4cad47..c75dcff0 100644\n--- a/test/phlex/view/naughty_business.rb\n+++ b/test/phlex/view/naughty_business.rb\n@@ -3,6 +3,36 @@\n describe Phlex::HTML do\n \textend ViewHelper\n \n+\twith \"naughty javascript links\" do\n+\t\tview do\n+\t\t\tdef template\n+\t\t\t\ta(href: \"javascript:alert(1)\") { \"a\" }\n+\t\t\t\ta(href: \"JAVASCRIPT:alert(1)\") { \"b\" }\n+\t\t\t\ta(href: :\"JAVASCRIPT:alert(1)\") { \"c\" }\n+\t\t\t\ta(HREF: \"javascript:alert(1)\") { \"d\" }\n+\t\t\tend\n+\t\tend\n+\n+\t\tit \"removes the href attributes\" do\n+\t\t\texpect(output).to be == \"<a>a</a><a>b</a><a>c</a><a>d</a>\"\n+\t\tend\n+\tend\n+\n+\twith \"naughty uppercase event tag\" do\n+\t\tview do\n+\t\t\tdef template\n+\t\t\t\tbutton ONCLICK: \"ALERT(1)\" do\n+\t\t\t\t\t\"naughty button\"\n+\t\t\t\tend\n+\t\t\tend\n+\t\tend\n+\n+\t\tit \"raises\" do\n+\t\t\texpect { output }.to raise_exception ArgumentError,\n+\t\t\t\tmessage: be == \"Unsafe attribute name detected: ONCLICK.\"\n+\t\tend\n+\tend\n+\n \twith \"naughty text\" do\n \t\tview do\n \t\t\tdef view_template\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2024-28199\n**CWE:** CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')\n**Title:** Cross-site Scripting (XSS) possible with maliciously formed HTML attribute names and values in Phlex\n\nThis patch addresses: phlex is an open source framework for building object-oriented views in Ruby. There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data. This was due to improper case-sensitivity in the code that was meant to prevent these attacks. If you render an `<a>` tag with an `href` attribute set to a user-provided link, that link could potentially execute JavaScript when clicked by another user. If you splat user-provided attributes when renderi\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2020-19488\nDescription: An issue was discovered in box_code_apple.c:119 in Gpac MP4Box 0.8.0, allows attackers to cause a Denial of Service due to an invalid read on function ilst_item_Read.\n\n```diff\nFrom 6170024568f4dda310e98ef7508477b425c58d09 Mon Sep 17 00:00:00 2001\nFrom: jeanlf <jeanlf@users.sourceforge.net>\nDate: Sun, 7 Jul 2019 16:51:36 +0200\nSubject: [PATCH] fixed potential crash - cf #1263\n\n---\n src/isomedia/box_code_apple.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/src/isomedia/box_code_apple.c b/src/isomedia/box_code_apple.c\nindex 8f6b08957f..00eee98cd9 100644\n--- a/src/isomedia/box_code_apple.c\n+++ b/src/isomedia/box_code_apple.c\n@@ -112,7 +112,7 @@ GF_Err ilst_item_box_read(GF_Box *s,GF_BitStream *bs)\n \tif (sub_type == GF_ISOM_BOX_TYPE_DATA ) {\n \t\te = gf_isom_box_parse(&a, bs);\n \n-\t\tif (!e && ptr->size < a->size) {\n+\t\tif (!e && a && (ptr->size < a->size)) {\n \t\t\tGF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, (\"[isom] not enough bytes in box %s: %d left, reading %d (file %s, line %d)\\n\", gf_4cc_to_str(ptr->type), ptr->size, a->size, __FILE__, __LINE__ )); \\\n \t\t\te = GF_ISOM_INVALID_FILE;\n \t\t}\n@@ -120,6 +120,7 @@ GF_Err ilst_item_box_read(GF_Box *s,GF_BitStream *bs)\n \t\t\tif (a) gf_isom_box_del(a);\n \t\t\treturn e;\n \t\t}\n+\t\tif (!a) return GF_NON_COMPLIANT_BITSTREAM;\n \n \t\tISOM_DECREASE_SIZE(ptr, a->size);\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2020-19488\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: An issue was discovered in box_code_apple.c:119 in Gpac MP4Box 0.8.0, allows attackers to cause a Denial of Service due to an invalid read on function ilst_item_Read.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-23g5-cwwr-8xhw\nDescription: \n\n```diff\nFrom 47c33179f9a15ae95cc1579a421be89378602656 Mon Sep 17 00:00:00 2001\nFrom: Guillaume Abrioux <gabrioux@redhat.com>\nDate: Tue, 25 Jan 2022 10:25:53 +0100\nSubject: [PATCH] ceph-volume: honour osd_dmcrypt_key_size option\n\nceph-volume doesn't honour osd_dmcrypt_key_size.\nIt means the default size is always applied.\n\nIt also changes the default value in `get_key_size_from_conf()`\n\nFrom cryptsetup manpage:\n\n> For XTS mode you can optionally set a key size of 512 bits with the -s option.\n\nUsing more than 512bits will end up with the following error message:\n\n```\nKey size in XTS mode must be 256 or 512 bits.\n```\n\nFixes: https://tracker.ceph.com/issues/54006\n\nSigned-off-by: Guillaume Abrioux <gabrioux@redhat.com>\n---\n .../ceph_volume/tests/util/test_encryption.py | 41 +++++++++++++------\n .../ceph_volume/util/encryption.py | 34 ++++++++++-----\n 2 files changed, 51 insertions(+), 24 deletions(-)\n\ndiff --git a/src/ceph-volume/ceph_volume/tests/util/test_encryption.py b/src/ceph-volume/ceph_volume/tests/util/test_encryption.py\nindex e1420b440d391..c86dc50b7c756 100644\n--- a/src/ceph-volume/ceph_volume/tests/util/test_encryption.py\n+++ b/src/ceph-volume/ceph_volume/tests/util/test_encryption.py\n@@ -1,5 +1,31 @@\n from ceph_volume.util import encryption\n+import base64\n \n+class TestGetKeySize(object):\n+ def test_get_size_from_conf_default(self, conf_ceph_stub):\n+ conf_ceph_stub('''\n+ [global]\n+ fsid=asdf\n+ ''')\n+ assert encryption.get_key_size_from_conf() == '512'\n+\n+ def test_get_size_from_conf_custom(self, conf_ceph_stub):\n+ conf_ceph_stub('''\n+ [global]\n+ fsid=asdf\n+ [osd]\n+ osd_dmcrypt_key_size=256\n+ ''')\n+ assert encryption.get_key_size_from_conf() == '256'\n+\n+ def test_get_size_from_conf_custom_invalid(self, conf_ceph_stub):\n+ conf_ceph_stub('''\n+ [global]\n+ fsid=asdf\n+ [osd]\n+ osd_dmcrypt_key_size=1024\n+ ''')\n+ assert encryption.get_key_size_from_conf() == '512'\n \n class TestStatus(object):\n \n@@ -37,17 +63,6 @@ def test_mapper_does_not_exist(self, fake_run):\n \n class TestDmcryptKey(object):\n \n- def test_dmcrypt_with_default_size(self, conf_ceph_stub):\n- conf_ceph_stub('[global]\\nfsid=asdf-lkjh')\n- result = encryption.create_dmcrypt_key()\n- assert len(result) == 172\n-\n- def test_dmcrypt_with_custom_size(self, conf_ceph_stub):\n- conf_ceph_stub('''\n- [global]\n- fsid=asdf\n- [osd]\n- osd_dmcrypt_size=8\n- ''')\n+ def test_dmcrypt(self):\n result = encryption.create_dmcrypt_key()\n- assert len(result) == 172\n+ assert len(base64.b64decode(result)) == 128\ndiff --git a/src/ceph-volume/ceph_volume/util/encryption.py b/src/ceph-volume/ceph_volume/util/encryption.py\nindex 72a0ccf121e97..2a2c03337b61f 100644\n--- a/src/ceph-volume/ceph_volume/util/encryption.py\n+++ b/src/ceph-volume/ceph_volume/util/encryption.py\n@@ -9,21 +9,29 @\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-23g5-cwwr-8xhw\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2023-40267\nDescription: GitPython before 3.1.32 does not block insecure non-multi options in clone and clone_from. NOTE: this issue exists because of an incomplete fix for CVE-2022-24439.\n\n```diff\nFrom 5c59e0d63da6180db8a0b349f0ad36fef42aceed Mon Sep 17 00:00:00 2001\nFrom: Sylvain Beucler <beuc@beuc.net>\nDate: Mon, 10 Jul 2023 16:10:10 +0200\nSubject: [PATCH] Block insecure non-multi options in clone/clone_from\n Follow-up to #1521\n\n---\n git/repo/base.py | 2 ++\n test/test_repo.py | 24 +++++++++++++++++++++++-\n 2 files changed, 25 insertions(+), 1 deletion(-)\n\ndiff --git a/git/repo/base.py b/git/repo/base.py\nindex 2fc9cf1fe..1fa98d8c7 100644\n--- a/git/repo/base.py\n+++ b/git/repo/base.py\n@@ -1203,6 +1203,8 @@ def _clone(\n \n if not allow_unsafe_protocols:\n Git.check_unsafe_protocols(str(url))\n+ if not allow_unsafe_options:\n+ Git.check_unsafe_options(options=list(kwargs.keys()), unsafe_options=cls.unsafe_git_clone_options)\n if not allow_unsafe_options and multi_options:\n Git.check_unsafe_options(options=multi_options, unsafe_options=cls.unsafe_git_clone_options)\n \ndiff --git a/test/test_repo.py b/test/test_repo.py\nindex 07c1e9adf..5c66aeeb1 100644\n--- a/test/test_repo.py\n+++ b/test/test_repo.py\n@@ -282,6 +282,17 @@ def test_clone_unsafe_options(self, rw_repo):\n rw_repo.clone(tmp_dir, multi_options=[unsafe_option])\n assert not tmp_file.exists()\n \n+ unsafe_options = [\n+ {\"upload-pack\": f\"touch {tmp_file}\"},\n+ {\"u\": f\"touch {tmp_file}\"},\n+ {\"config\": \"protocol.ext.allow=always\"},\n+ {\"c\": \"protocol.ext.allow=always\"},\n+ ]\n+ for unsafe_option in unsafe_options:\n+ with self.assertRaises(UnsafeOptionError):\n+ rw_repo.clone(tmp_dir, **unsafe_option)\n+ assert not tmp_file.exists()\n+\n @with_rw_repo(\"HEAD\")\n def test_clone_unsafe_options_allowed(self, rw_repo):\n with tempfile.TemporaryDirectory() as tdir:\n@@ -341,6 +352,17 @@ def test_clone_from_unsafe_options(self, rw_repo):\n Repo.clone_from(rw_repo.working_dir, tmp_dir, multi_options=[unsafe_option])\n assert not tmp_file.exists()\n \n+ unsafe_options = [\n+ {\"upload-pack\": f\"touch {tmp_file}\"},\n+ {\"u\": f\"touch {tmp_file}\"},\n+ {\"config\": \"protocol.ext.allow=always\"},\n+ {\"c\": \"protocol.ext.allow=always\"},\n+ ]\n+ for unsafe_option in unsafe_options:\n+ with self.assertRaises(UnsafeOptionError):\n+ Repo.clone_from(rw_repo.working_dir, tmp_dir, **unsafe_option)\n+ assert not tmp_file.exists()\n+\n @with_rw_repo(\"HEAD\")\n def test_clone_from_unsafe_options_allowed(self, rw_repo):\n with tempfile.TemporaryDirectory() as tdir:\n@@ -1410,4 +1432,4 @@ def test_ignored_raises_error_w_symlink(self):\n os.symlink(tmp_dir / \"target\", tmp_dir / \"symlink\")\n \n with pytest.raises(GitCommandError):\n- temp_repo.ignored(tmp_dir / \"symlink/file.txt\")\n\\ No newli\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2023-40267\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: GitPython before 3.1.32 does not block insecure non-multi options in clone and clone_from. NOTE: this issue exists because of an incomplete fix for CVE-2022-24439.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-237r-mx84-7x8c\nDescription: \n\n```diff\nFrom edc149af29242178091b2d6fcd42c3ef0851644b Mon Sep 17 00:00:00 2001\nFrom: Marios Levogiannis <mlevogiannis@users.noreply.github.com>\nDate: Fri, 29 Jul 2022 18:40:09 +0300\nSubject: [PATCH] Fix CVE-2022-36436 - Authentication bypass in RFB security\n handshake (#1)\n\n---\n vncap/tests/test_protocol.py | 16 +++++++++++++++-\n vncap/vnc/protocol.py | 7 ++-----\n 2 files changed, 17 insertions(+), 6 deletions(-)\n\ndiff --git a/vncap/tests/test_protocol.py b/vncap/tests/test_protocol.py\nindex 151d059..81bef84 100644\n--- a/vncap/tests/test_protocol.py\n+++ b/vncap/tests/test_protocol.py\n@@ -13,6 +13,9 @@ def write(self, data):\n def loseConnection(self):\n self.lost = True\n \n+ def pauseProducing(self):\n+ pass\n+\n class TestVNCServerAuthenticator(unittest.TestCase):\n \n def setUp(self):\n@@ -29,9 +32,20 @@ def test_connectionMade(self):\n def test_check_version(self):\n self.t.buf = \"\"\n self.p.check_version(\"RFB 003.008\\n\")\n- self.assertEqual(self.t.buf, \"\\x02\\x01\\x02\")\n+ self.assertEqual(self.t.buf, \"\\x01\\x02\")\n \n def test_check_invalid_version(self):\n self.t.buf = \"\"\n self.p.check_version(\"RFB 002.000\\n\")\n self.assertTrue(self.t.lost)\n+\n+ def test_select_security_type_none(self):\n+ self.t.buf = \"\"\n+ self.p.select_security_type(\"\\x01\")\n+ self.assertTrue(self.t.lost)\n+\n+ def test_select_security_type_vnc_auth(self):\n+ self.t.buf = \"\"\n+ self.p.select_security_type(\"\\x02\")\n+ self.assertFalse(self.t.lost)\n+ self.assertEqual(len(self.t.buf), 16)\ndiff --git a/vncap/vnc/protocol.py b/vncap/vnc/protocol.py\nindex aee50d3..d1351bd 100644\n--- a/vncap/vnc/protocol.py\n+++ b/vncap/vnc/protocol.py\n@@ -73,8 +73,8 @@ def check_version(self, version):\n \n if version == self.VERSION:\n log.msg(\"Client version %s is valid\" % version.strip())\n- # Hardcoded: 2 security types: None and VNC Auth.\n- self.transport.write(\"\\x02\\x01\\x02\")\n+ # Hardcoded: 1 security type: VNC Auth.\n+ self.transport.write(\"\\x01\\x02\")\n return self.select_security_type, 1\n else:\n log.err(\"Can't handle VNC version %r\" % version)\n@@ -93,9 +93,6 @@ def select_security_type(self, security_type):\n self.transport.write(self.challenge)\n \n return self.vnc_authentication_result, 16\n- elif security_type == 1:\n- # No authentication. Just move to the SecurityResult.\n- self.authenticated()\n else:\n log.err(\"Couldn't agree on an authentication scheme!\")\n self.transport.loseConnection()\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-237r-mx84-7x8c\n**CWE:** Unknown\n**Title:** VNCAuthProxy authentication bypass vulnerability\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2023-46928\nDescription: GPAC 2.3-DEV-rev605-gfc9e29089-master contains a SEGV in gpac/MP4Box in gf_media_change_pl /afltest/gpac/src/media_tools/isom_tools.c:3293:42.\n\n```diff\nFrom 0753bf6d867343a80a044bf47a27d0b7accc8bf1 Mon Sep 17 00:00:00 2001\nFrom: Aurelien David <aurelien.david@telecom-paristech.fr>\nDate: Thu, 26 Oct 2023 12:27:53 +0200\nSubject: [PATCH] null guard on gf_media_change_pl (fixes #2661)\n\n---\n src/media_tools/isom_tools.c | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/src/media_tools/isom_tools.c b/src/media_tools/isom_tools.c\nindex 21f8905cf8..a41e51a0d5 100644\n--- a/src/media_tools/isom_tools.c\n+++ b/src/media_tools/isom_tools.c\n@@ -635,7 +635,7 @@ GF_Err gf_media_make_isma(GF_ISOFile *mp4file, Bool keepESIDs, Bool keepImage, B\n \n \t_esd = gf_odf_desc_esd_new(SLPredef_MP4);\n \tif (!_esd) return GF_OUT_OF_MEM;\n-\t\n+\n \t_esd->decoderConfig->bufferSizeDB = 20;\n \t_esd->decoderConfig->objectTypeIndication = GF_CODECID_BIFS_V2;\n \t_esd->decoderConfig->streamType = GF_STREAM_SCENE;\n@@ -3289,6 +3289,10 @@ GF_Err gf_media_change_pl(GF_ISOFile *file, u32 track, u32 profile, u32 compat,\n \t}\n \n \tavcc = gf_isom_avc_config_get(file, track, 1);\n+\n+\tif (!avcc)\n+\t\treturn GF_NON_COMPLIANT_BITSTREAM;\n+\n \tif (level) avcc->AVCLevelIndication = level;\n \tif (compat) avcc->profile_compatibility = compat;\n \tif (profile) avcc->AVCProfileIndication = profile;\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2023-46928\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: GPAC 2.3-DEV-rev605-gfc9e29089-master contains a SEGV in gpac/MP4Box in gf_media_change_pl /afltest/gpac/src/media_tools/isom_tools.c:3293:42.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2017-16840\nDescription: The VC-2 Video Compression encoder in FFmpeg 3.0 and 3.4 allows remote attackers to cause a denial of service (out-of-bounds read) because of incorrect buffer padding for non-Haar wavelets, related to libavcodec/vc2enc.c and libavcodec/vc2enc_dwt.c.\n\n```diff\nFrom 94e538aebbc9f9c529e8b1f2eda860cfb8c473b1 Mon Sep 17 00:00:00 2001\nFrom: Rostislav Pehlivanov <atomnuker@gmail.com>\nDate: Wed, 8 Nov 2017 23:50:04 +0000\nSubject: [PATCH] vc2enc_dwt: pad the temporary buffer by the slice size\n\nSince non-Haar wavelets need to look into pixels outside the frame, we\nneed to pad the buffer. The old factor of two seemed to be a workaround\nthat fact and only padded to the left and bottom. This correctly pads\nby the slice size and as such reduces memory usage and potential\nexploits.\nReported by Liu Bingchang.\n\nIdeally, there should be no temporary buffer but the encoder is designed\nto deinterleave the coefficients into the classical wavelet structure\nwith the lower frequency values in the top left corner.\n\nSigned-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>\n(cherry picked from commit 3228ac730c11eca49d5680d5550128e397061c85)\n---\n libavcodec/vc2enc.c | 5 +++--\n libavcodec/vc2enc_dwt.c | 12 +++++++++---\n libavcodec/vc2enc_dwt.h | 4 +++-\n 3 files changed, 15 insertions(+), 6 deletions(-)\n\ndiff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c\nindex bf3f3a980d236..eb4e1e3c7e13b 100644\n--- a/libavcodec/vc2enc.c\n+++ b/libavcodec/vc2enc.c\n@@ -1106,8 +1106,9 @@ static av_cold int vc2_encode_init(AVCodecContext *avctx)\n \n /* DWT init */\n if (ff_vc2enc_init_transforms(&s->transform_args[i].t,\n- s->plane[0].coef_stride,\n- s->plane[0].dwt_height))\n+ s->plane[i].coef_stride,\n+ s->plane[i].dwt_height,\n+ s->slice_width, s->slice_height))\n goto alloc_fail;\n }\n \ndiff --git a/libavcodec/vc2enc_dwt.c b/libavcodec/vc2enc_dwt.c\nindex eb341684cd687..0265db8dac3be 100644\n--- a/libavcodec/vc2enc_dwt.c\n+++ b/libavcodec/vc2enc_dwt.c\n@@ -211,19 +211,25 @@ static void vc2_subband_dwt_53(VC2TransformContext *t, dwtcoef *data,\n deinterleave(data, stride, width, height, synth);\n }\n \n-av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_width, int p_height)\n+av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_stride,\n+ int p_height, int slice_w, int slice_h)\n {\n s->vc2_subband_dwt[VC2_TRANSFORM_9_7] = vc2_subband_dwt_97;\n s->vc2_subband_dwt[VC2_TRANSFORM_5_3] = vc2_subband_dwt_53;\n \n- s->buffer = av_malloc(2*p_width*p_height*sizeof(dwtcoef));\n+ /* Pad by the slice size, only matters for non-Haar wavelets */\n+ s->buffer = av_calloc((p_stride + slice_w)*(p_height + slice_h), sizeof(dwtcoef));\n if (!s->buffer)\n return 1;\n \n+ s->padding = (slice_h >> 1)*p_stride + (slice_w >> 1);\n+ s->buffer += s->padding;\n+\n return 0;\n }\n \n av_cold void ff_vc2enc_free_transforms(VC2TransformContext *s)\n {\n- av_freep(&s->buffer);\n+ av_free(s->buffer - s->padding);\n+ s->buffer = NULL;\n }\ndiff --git a/libavcodec/vc2enc\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2017-16840\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: The VC-2 Video Compression encoder in FFmpeg 3.0 and 3.4 allows remote attackers to cause a denial of service (out-of-bounds read) because of incorrect buffer padding for non-Haar wavelets, related to libavcodec/vc2enc.c and libavcodec/vc2enc_dwt.c.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-rrjm-x5m6-q2pg\nDescription: \n\n```diff\nFrom 608d39faed63ea212b6c6cdf9fe2bef92e2120ea Mon Sep 17 00:00:00 2001\nFrom: whyisjake <whyisjake@git.wordpress.org>\nDate: Mon, 14 Oct 2019 15:27:04 +0000\nSubject: [PATCH] HTTP API: Protect against hex interpretation.\n\nReturn earlier from wp_http_validate_url().\n\nProps: iandunn, xknown, voldemortensen, whyisjake.\n\nBuilt from https://develop.svn.wordpress.org/trunk@46475\n\n\ngit-svn-id: http://core.svn.wordpress.org/trunk@46273 1a063a9b-81f0-0310-95a4-ce76da25c4cd\n---\n wp-includes/http.php | 2 +-\n wp-includes/version.php | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/wp-includes/http.php b/wp-includes/http.php\nindex 36922da60e26..3356b9716295 100644\n--- a/wp-includes/http.php\n+++ b/wp-includes/http.php\n@@ -550,7 +550,7 @@ function wp_http_validate_url( $url ) {\n \t\t} else {\n \t\t\t$ip = gethostbyname( $host );\n \t\t\tif ( $ip === $host ) { // Error condition for gethostbyname()\n-\t\t\t\t$ip = false;\n+\t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t\tif ( $ip ) {\ndiff --git a/wp-includes/version.php b/wp-includes/version.php\nindex a4f93bdb27f7..8805c87052db 100644\n--- a/wp-includes/version.php\n+++ b/wp-includes/version.php\n@@ -13,7 +13,7 @@\n *\n * @global string $wp_version\n */\n-$wp_version = '5.3-beta3-46474';\n+$wp_version = '5.3-beta3-46475';\n \n /**\n * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-rrjm-x5m6-q2pg\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2025-69261\nDescription: WasmEdge is a WebAssembly runtime. Prior to version 0.16.0-alpha.3, a multiplication in `WasmEdge/include/runtime/instance/memory.h` can wrap, causing `checkAccessBound()` to incorrectly allow the access. This leads to a segmentation fault. Version 0.16.0-alpha.3 contains a patch for the issue.\n\n```diff\nFrom 37cc9fa19bd23edbbdaa9252059b17f191fa4d17 Mon Sep 17 00:00:00 2001\nFrom: YiYing He <yiying@secondstate.io>\nDate: Wed, 17 Dec 2025 20:27:38 +0800\nSubject: [PATCH] fix(runtime): refine the overflow detection when wrapping\n memory instance\n\nSigned-off-by: YiYing He <yiying@secondstate.io>\n---\n include/runtime/instance/memory.h | 24 +++++++++++++++++++-----\n 1 file changed, 19 insertions(+), 5 deletions(-)\n\ndiff --git a/include/runtime/instance/memory.h b/include/runtime/instance/memory.h\nindex ce511a7b376c..9d8495984db7 100644\n--- a/include/runtime/instance/memory.h\n+++ b/include/runtime/instance/memory.h\n@@ -241,14 +241,28 @@ class MemoryInstance {\n return reinterpret_cast<T>(&DataPtr[Offset]);\n }\n \n- /// Get array of object at specific offset of memory.\n+ /// Get array of object with count at specific offset of memory.\n template <typename T>\n- Span<T> getSpan(uint32_t Offset, uint32_t Size) const noexcept {\n- uint32_t ByteSize = static_cast<uint32_t>(sizeof(T) * Size);\n- if (unlikely(!checkAccessBound(Offset, ByteSize))) {\n+ Span<T> getSpan(uint32_t Offset, uint32_t Count) const noexcept {\n+ uint32_t Size;\n+#if defined(_MSC_VER) && !defined(__clang__) // MSVC\n+ // Should extend for memory64 proposal.\n+ uint64_t Num =\n+ static_cast<uint64_t>(sizeof(T)) * static_cast<uint64_t>(Count);\n+ if ((Num >> 32) != 0) {\n+ return Span<T>();\n+ }\n+ Size = static_cast<uint32_t>(Num);\n+#else\n+ if (unlikely(__builtin_mul_overflow(static_cast<uint32_t>(sizeof(T)), Count,\n+ &Size))) {\n+ return Span<T>();\n+ }\n+#endif\n+ if (unlikely(!checkAccessBound(Offset, Size))) {\n return Span<T>();\n }\n- return Span<T>(reinterpret_cast<T *>(&DataPtr[Offset]), Size);\n+ return Span<T>(reinterpret_cast<T *>(&DataPtr[Offset]), Count);\n }\n \n /// Get array of object at specific offset of memory.\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2025-69261\n**CWE:** CWE-190: Integer Overflow or Wraparound\n**Title:** WasmEdge integer wrap in MemoryInstance::getSpan()'s memory size check\n\nThis patch addresses: WasmEdge is a WebAssembly runtime. Prior to version 0.16.0-alpha.3, a multiplication in `WasmEdge/include/runtime/instance/memory.h` can wrap, causing `checkAccessBound()` to incorrectly allow the access. This leads to a segmentation fault. Version 0.16.0-alpha.3 contains a patch for the issue.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-c27v-jmfg-gqrm\nDescription: \n\n```diff\nFrom 0971c7a4e537ea120a6bb2195960be8d0815e97b Mon Sep 17 00:00:00 2001\nFrom: Bram Moolenaar <Bram@vim.org>\nDate: Sun, 26 Jun 2022 12:59:02 +0100\nSubject: [PATCH] patch 8.2.5162: reading before the start of the line with BS\n in Replace mode\n\nProblem: Reading before the start of the line with BS in Replace mode.\nSolution: Check the cursor column is more than zero.\n---\n src/edit.c | 2 +-\n src/version.c | 2 ++\n 2 files changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/src/edit.c b/src/edit.c\nindex dbfa0ae5f9929d..a8e695c91c49e6 100644\n--- a/src/edit.c\n+++ b/src/edit.c\n@@ -4183,7 +4183,7 @@ ins_bs(\n #endif\n \n \t // delete characters until we are at or before want_vcol\n-\t while (vcol > want_vcol\n+\t while (vcol > want_vcol && curwin->w_cursor.col > 0\n \t\t && (cc = *(ml_get_cursor() - 1), VIM_ISWHITE(cc)))\n \t\tins_bs_one(&vcol);\n \ndiff --git a/src/version.c b/src/version.c\nindex 9fba35bea06763..cf2e77d9fb7915 100644\n--- a/src/version.c\n+++ b/src/version.c\n@@ -735,6 +735,8 @@ static char *(features[]) =\n \n static int included_patches[] =\n { /* Add new patch number below this line */\n+/**/\n+ 5162,\n /**/\n 5161,\n /**/\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-c27v-jmfg-gqrm\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-j3rw-fx6g-q46j\nDescription: \n\n```diff\nFrom 4313b42717e18a4add7dd7503528bc15af905981 Mon Sep 17 00:00:00 2001\nFrom: David Trudgian <david.trudgian@sylabs.io>\nDate: Thu, 13 Nov 2025 13:35:05 +0000\nSubject: [PATCH] fix: use pathrs-lite/procfs when writing apparmor profile\n\nWhen an apparmor profile is writtend into the attr/exec in procfs, we\nmust ensure we are writing into a genuine attr/exec inside a genuins\nprocfs.\n\nThis is necessary to block attacks that redirect the write somewhere\nthat it is ineffective, leading to a silent failure to apply the\napparmor profile.\n\nSigned-off-by: Dave Dykstra <2129743+DrDaveD@users.noreply.github.com>\n---\n .../security/apparmor/apparmor_supported.go | 24 +++++++++++++++++--\n 1 file changed, 22 insertions(+), 2 deletions(-)\n\ndiff --git a/internal/pkg/security/apparmor/apparmor_supported.go b/internal/pkg/security/apparmor/apparmor_supported.go\nindex 9cb8b50484..f0c123f7a6 100644\n--- a/internal/pkg/security/apparmor/apparmor_supported.go\n+++ b/internal/pkg/security/apparmor/apparmor_supported.go\n@@ -2,7 +2,7 @@\n // Apptainer a Series of LF Projects LLC.\n // For website terms of use, trademark policy, privacy policy and other\n // project policies see https://lfprojects.org/policies\n-// Copyright (c) 2018-2022, Sylabs Inc. All rights reserved.\n+// Copyright (c) 2018-2025, Sylabs Inc. All rights reserved.\n // This software is licensed under a 3-clause BSD license. Please consult the\n // LICENSE.md file distributed with the sources of this project regarding your\n // rights to use or distribute this software.\n@@ -14,6 +14,10 @@ package apparmor\n import (\n \t\"fmt\"\n \t\"os\"\n+\n+\t\"github.com/cyphar/filepath-securejoin/pathrs-lite\"\n+\t\"github.com/cyphar/filepath-securejoin/pathrs-lite/procfs\"\n+\t\"golang.org/x/sys/unix\"\n )\n \n // Enabled returns whether AppArmor is enabled.\n@@ -27,7 +31,23 @@ func Enabled() bool {\n \n // LoadProfile loads the specified AppArmor profile.\n func LoadProfile(profile string) error {\n-\tf, err := os.OpenFile(\"/proc/self/attr/exec\", os.O_WRONLY, 0)\n+\t// We must make sure we are actually opening and writing to a real attr/exec\n+\t// in a real procfs so that the profile takes effect. Using\n+\t// pathrs-lite/procfs as below accomplishes this.\n+\tproc, err := procfs.OpenProcRoot()\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tdefer proc.Close()\n+\n+\tattrExec, closer, err := proc.OpenThreadSelf(\"attr/exec\")\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tdefer closer()\n+\tdefer attrExec.Close()\n+\n+\tf, err := pathrs.Reopen(attrExec, unix.O_WRONLY|unix.O_CLOEXEC)\n \tif err != nil {\n \t\treturn err\n \t}\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-j3rw-fx6g-q46j\n**CWE:** Unknown\n**Title:** Apptainer ineffectively applies selinux and apparmor --security options\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code for security vulnerabilities:\n\n```python\ndef read_chunk(file, offset, length):\n \"\"\"Read chunk from file.\"\"\"\n end = offset + length\n file.seek(offset)\n return file.read(length)\n```\n\nIdentify any security issues, their severity, and how to fix them." }, { "role": "assistant", "content": "**Security Issue Found:**\n\n**Integer Overflow (CWE-190)**\n- **Severity:** Critical\n- **Location:** See code above\n\n**Explanation:**\noffset + length can overflow, causing unexpected file positions or reads.\n\n**How to Fix:**\nValidate that offset + length doesn't exceed file size and doesn't overflow." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2025-5700\nDescription: The Simple Logo Carousel plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the ‘id’ parameter in all versions up to, and including, 1.9.3 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.\n\n```diff\nFrom d995b5d35e0fdc0a59307ce664e4ce1158b69bff Mon Sep 17 00:00:00 2001\nFrom: sunjava11 <sunjava11@gmail.com>\nDate: Mon, 9 Jun 2025 16:05:10 +0500\nSubject: [PATCH] fixed wordfence vulnurbility for Id attribute\n\n---\n includes/Base/Shortcode.php | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/includes/Base/Shortcode.php b/includes/Base/Shortcode.php\nindex 65a945a..9973141 100644\n--- a/includes/Base/Shortcode.php\n+++ b/includes/Base/Shortcode.php\n@@ -26,12 +26,15 @@ public function register()\n function carousel_shortcode($atts = [])\n {\n // define attributes and their defaults\n- extract(shortcode_atts(array(\n- 'id' => ''\n- ), $atts));\n+ $atts = shortcode_atts(array(\n+ 'id' => ''\n+ ), $atts);\n+\n+ $id = isset($atts['id']) ? absint($atts['id']) : false;\n+ \n \n // if not id is found\n- if (empty($id)) {\n+ if (!$id) {\n return '<p>Please make sure your carousel shortcode contains an ID.</p>';\n } else {\n // enqueue our scripts\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2025-5700\n**CWE:** CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')\n**Title:** Simple Logo Carousel <= 1.9.3 - Authenticated (Contributor+) Stored Cross-Site Scripting via id Parameter\n\nThis patch addresses: The Simple Logo Carousel plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the ‘id’ parameter in all versions up to, and including, 1.9.3 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-gxqf-4g4p-q3hc\nDescription: \n\n```diff\nFrom 64e5c343c5f74b0abdf3ac0d21a6139daea58cf8 Mon Sep 17 00:00:00 2001\nFrom: boojack <stevenlgtm@gmail.com>\nDate: Thu, 29 Dec 2022 23:27:56 +0800\nSubject: [PATCH] chore: fix XSS in renderer (#875)\n\nchore: fix xss in renderer\n---\n web/src/labs/marked/index.ts | 2 +-\n web/src/labs/marked/parser/Bold.ts | 3 +--\n web/src/labs/marked/parser/BoldEmphasis.ts | 3 +--\n web/src/labs/marked/parser/Emphasis.ts | 3 +--\n web/src/labs/marked/parser/Link.ts | 2 +-\n web/src/labs/marked/parser/Strikethrough.ts | 5 ++---\n 6 files changed, 7 insertions(+), 11 deletions(-)\n\ndiff --git a/web/src/labs/marked/index.ts b/web/src/labs/marked/index.ts\nindex 436b99361e222..0d3d083ad5a25 100644\n--- a/web/src/labs/marked/index.ts\n+++ b/web/src/labs/marked/index.ts\n@@ -47,7 +47,7 @@ export const marked = (markdownStr: string, blockParsers = blockElementParserLis\n const matchedLength = matchedStr.length;\n const prefixStr = markdownStr.slice(0, matchedIndex);\n const suffixStr = markdownStr.slice(matchedIndex + matchedLength);\n- return prefixStr + matchedInlineParser.renderer(matchedStr) + marked(suffixStr, [], inlineParsers);\n+ return marked(prefixStr, [], inlineParsers) + matchedInlineParser.renderer(matchedStr) + marked(suffixStr, [], inlineParsers);\n }\n }\n \ndiff --git a/web/src/labs/marked/parser/Bold.ts b/web/src/labs/marked/parser/Bold.ts\nindex 041640f216dc6..578a6ed48411e 100644\n--- a/web/src/labs/marked/parser/Bold.ts\n+++ b/web/src/labs/marked/parser/Bold.ts\n@@ -1,4 +1,3 @@\n-import { escape } from \"lodash\";\n import { marked } from \"..\";\n import Link from \"./Link\";\n \n@@ -15,7 +14,7 @@ const renderer = (rawStr: string): string => {\n return rawStr;\n }\n \n- const parsedContent = marked(escape(matchResult[1]), [], [Link]);\n+ const parsedContent = marked(matchResult[1], [], [Link]);\n return `<strong>${parsedContent}</strong>`;\n };\n \ndiff --git a/web/src/labs/marked/parser/BoldEmphasis.ts b/web/src/labs/marked/parser/BoldEmphasis.ts\nindex f434da5849166..0fdf37ebbbe46 100644\n--- a/web/src/labs/marked/parser/BoldEmphasis.ts\n+++ b/web/src/labs/marked/parser/BoldEmphasis.ts\n@@ -1,4 +1,3 @@\n-import { escape } from \"lodash\";\n import { marked } from \"..\";\n import Link from \"./Link\";\n \n@@ -15,7 +14,7 @@ const renderer = (rawStr: string): string => {\n return rawStr;\n }\n \n- const parsedContent = marked(escape(matchResult[1]), [], [Link]);\n+ const parsedContent = marked(matchResult[1], [], [Link]);\n return `<strong><em>${parsedContent}</em></strong>`;\n };\n \ndiff --git a/web/src/labs/marked/parser/Emphasis.ts b/web/src/labs/marked/parser/Emphasis.ts\nindex 7dd12df1ac12e..e339bf3a112c1 100644\n--- a/web/src/labs/marked/parser/Emphasis.ts\n+++ b/web/src/labs/marked/parser/Emphasis.ts\n@@ -1,4 +1,3 @@\n-import { escape } from \"lodash\";\n import { marked } from \"..\";\n import Link from \"./Link\";\n \n@@ -15,7 +14,7 @@ const renderer = (rawStr: string): string => {\n return rawStr;\n }\n \n- const parsedContent \n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-gxqf-4g4p-q3hc\n**CWE:** Unknown\n**Title:** usememos/memos vulnerable to stored Cross-site Scripting\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: PYSEC-2021-244\nDescription: \n\n```diff\nFrom ba6822bd7b7324ba201a28b2f278c29a98edbef2 Mon Sep 17 00:00:00 2001\nFrom: Amit Patankar <amitpatankar@google.com>\nDate: Wed, 28 Apr 2021 16:06:54 -0700\nSubject: [PATCH] Fix OOB issue with `tf.raw_ops.SparseSparseMinimum`.\n\nPiperOrigin-RevId: 371005787\nChange-Id: Ib686ccc077836e8b980b8b5a03936d36a8ecaf71\n---\n tensorflow/core/kernels/sparse_sparse_binary_op_shared.cc | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/tensorflow/core/kernels/sparse_sparse_binary_op_shared.cc b/tensorflow/core/kernels/sparse_sparse_binary_op_shared.cc\nindex 43dc9ae70cd627..9fe42e05d879ee 100644\n--- a/tensorflow/core/kernels/sparse_sparse_binary_op_shared.cc\n+++ b/tensorflow/core/kernels/sparse_sparse_binary_op_shared.cc\n@@ -180,6 +180,11 @@ class SparseSparseBinaryOpShared : public OpKernel {\n \" for dimension \", i));\n }\n \n+ OP_REQUIRES(\n+ ctx, a_indices_t->dim_size(1) == b_indices_t->dim_size(1),\n+ errors::InvalidArgument(\n+ \"Indices' dimensions do not match: got \", a_indices_t->dim_size(1),\n+ \" and \", b_indices_t->dim_size(1), \" for the second dimension.\"));\n const int num_dims = a_indices_t->dim_size(1);\n const auto a_indices_mat = a_indices_t->matrix<int64>();\n const auto b_indices_mat = b_indices_t->matrix<int64>();\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** PYSEC-2021-244\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2024-24811\nDescription: SQLAlchemyDA is a generic database adapter for ZSQL methods. A vulnerability found in versions prior to 2.2 allows unauthenticated execution of arbitrary SQL statements on the database to which the SQLAlchemyDA instance is connected. All users are affected. The problem has been patched in version 2.2. There is no workaround for the problem.\n\n```diff\nFrom 7165b1ae4ad48132096e2609db7024aeb8d44305 Mon Sep 17 00:00:00 2001\nFrom: Jens Vagelpohl <jens@plyp.com>\nDate: Tue, 6 Feb 2024 13:28:01 +0100\nSubject: [PATCH] - Add missing security declarations on the database adapter\n class\n\n---\n CHANGES.rst | 3 +++\n src/Products/SQLAlchemyDA/da.py | 3 +++\n 2 files changed, 6 insertions(+)\n\ndiff --git a/CHANGES.rst b/CHANGES.rst\nindex e040af6..b66a8e8 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -4,6 +4,9 @@ Change log\n 2.2 (unreleased)\n ----------------\n \n+- Add missing security declarations on the database adapter class\n+ to mitigate arbitrary SQL query execution vulnerability.\n+\n - Add support for Python 3.12.\n \n \ndiff --git a/src/Products/SQLAlchemyDA/da.py b/src/Products/SQLAlchemyDA/da.py\nindex c44a730..000f043 100644\n--- a/src/Products/SQLAlchemyDA/da.py\n+++ b/src/Products/SQLAlchemyDA/da.py\n@@ -13,6 +13,7 @@\n \n from AccessControl import ClassSecurityInfo\n from AccessControl.class_init import InitializeClass\n+from AccessControl.Permissions import change_database_connections\n from AccessControl.Permissions import view_management_screens\n from OFS.PropertyManager import PropertyManager\n from OFS.SimpleItem import SimpleItem\n@@ -295,6 +296,7 @@ def engine_options(self):\n engine_options = dict(self.extra_engine_options)\n return engine_options\n \n+ @security.protected(change_database_connections)\n def add_extra_engine_options(self, engine_options):\n \"\"\" engine_options is a tuple containing additional\n options for sqlalchemy.create_engine.\n@@ -346,6 +348,7 @@ def _typesMap(self, proxy):\n self._v_types_map = map\n return self._v_types_map\n \n+ @security.private\n def query(self, query_string, max_rows=None, query_data=None):\n \"\"\" *The* query() method as used by the internal ZSQL\n machinery.\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2024-24811\n**CWE:** CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\n**Title:** Products.SQLAlchemyDA vulnerable to unauthenticated arbitrary SQL query execution\n\nThis patch addresses: SQLAlchemyDA is a generic database adapter for ZSQL methods. A vulnerability found in versions prior to 2.2 allows unauthenticated execution of arbitrary SQL statements on the database to which the SQLAlchemyDA instance is connected. All users are affected. The problem has been patched in version 2.2. There is no workaround for the problem.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2011-1078\nDescription: The sco_sock_getsockopt_old function in net/bluetooth/sco.c in the Linux kernel before 2.6.39 does not initialize a certain structure, which allows local users to obtain potentially sensitive information from kernel stack memory via the SCO_CONNINFO option.\n\n```diff\nFrom c4c896e1471aec3b004a693c689f60be3b17ac86 Mon Sep 17 00:00:00 2001\nFrom: Vasiliy Kulikov <segoon@openwall.com>\nDate: Mon, 14 Feb 2011 13:54:26 +0300\nSubject: [PATCH] Bluetooth: sco: fix information leak to userspace\n\nstruct sco_conninfo has one padding byte in the end. Local variable\ncinfo of type sco_conninfo is copied to userspace with this uninizialized\none byte, leading to old stack contents leak.\n\nSigned-off-by: Vasiliy Kulikov <segoon@openwall.com>\nSigned-off-by: Gustavo F. Padovan <padovan@profusion.mobi>\n---\n net/bluetooth/sco.c | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c\nindex 960c6d1637da0d..926ed39912ea7e 100644\n--- a/net/bluetooth/sco.c\n+++ b/net/bluetooth/sco.c\n@@ -703,6 +703,7 @@ static int sco_sock_getsockopt_old(struct socket *sock, int optname, char __user\n \t\t\tbreak;\n \t\t}\n \n+\t\tmemset(&cinfo, 0, sizeof(cinfo));\n \t\tcinfo.hci_handle = sco_pi(sk)->conn->hcon->handle;\n \t\tmemcpy(cinfo.dev_class, sco_pi(sk)->conn->hcon->dev_class, 3);\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2011-1078\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: The sco_sock_getsockopt_old function in net/bluetooth/sco.c in the Linux kernel before 2.6.39 does not initialize a certain structure, which allows local users to obtain potentially sensitive information from kernel stack memory via the SCO_CONNINFO option.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-cvp9-xf77-46mc\nDescription: \n\n```diff\nFrom 57ebd808a97d7c5b1e1afb937c2db22beba3c1f8 Mon Sep 17 00:00:00 2001\nFrom: Florian Westphal <fw@strlen.de>\nDate: Wed, 7 Feb 2018 13:46:25 +0100\nSubject: [PATCH] netfilter: add back stackpointer size checks\n\nThe rationale for removing the check is only correct for rulesets\ngenerated by ip(6)tables.\n\nIn iptables, a jump can only occur to a user-defined chain, i.e.\nbecause we size the stack based on number of user-defined chains we\ncannot exceed stack size.\n\nHowever, the underlying binary format has no such restriction,\nand the validation step only ensures that the jump target is a\nvalid rule start point.\n\nIOW, its possible to build a rule blob that has no user-defined\nchains but does contain a jump.\n\nIf this happens, no jump stack gets allocated and crash occurs\nbecause no jumpstack was allocated.\n\nFixes: 7814b6ec6d0d6 (\"netfilter: xtables: don't save/restore jumpstack offset\")\nReported-by: syzbot+e783f671527912cd9403@syzkaller.appspotmail.com\nSigned-off-by: Florian Westphal <fw@strlen.de>\nSigned-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n---\n net/ipv4/netfilter/arp_tables.c | 4 ++++\n net/ipv4/netfilter/ip_tables.c | 7 ++++++-\n net/ipv6/netfilter/ip6_tables.c | 4 ++++\n 3 files changed, 14 insertions(+), 1 deletion(-)\n\ndiff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c\nindex 4ffe302f9b8200..e3e420f3ba7b2d 100644\n--- a/net/ipv4/netfilter/arp_tables.c\n+++ b/net/ipv4/netfilter/arp_tables.c\n@@ -252,6 +252,10 @@ unsigned int arpt_do_table(struct sk_buff *skb,\n \t\t\t}\n \t\t\tif (table_base + v\n \t\t\t != arpt_next_entry(e)) {\n+\t\t\t\tif (unlikely(stackidx >= private->stacksize)) {\n+\t\t\t\t\tverdict = NF_DROP;\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n \t\t\t\tjumpstack[stackidx++] = e;\n \t\t\t}\n \ndiff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c\nindex 9a71f314950706..e38395a8dcf280 100644\n--- a/net/ipv4/netfilter/ip_tables.c\n+++ b/net/ipv4/netfilter/ip_tables.c\n@@ -330,8 +330,13 @@ ipt_do_table(struct sk_buff *skb,\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tif (table_base + v != ipt_next_entry(e) &&\n-\t\t\t !(e->ip.flags & IPT_F_GOTO))\n+\t\t\t !(e->ip.flags & IPT_F_GOTO)) {\n+\t\t\t\tif (unlikely(stackidx >= private->stacksize)) {\n+\t\t\t\t\tverdict = NF_DROP;\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n \t\t\t\tjumpstack[stackidx++] = e;\n+\t\t\t}\n \n \t\t\te = get_entry(table_base, v);\n \t\t\tcontinue;\ndiff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c\nindex af4c917e083696..62358b93bbac52 100644\n--- a/net/ipv6/netfilter/ip6_tables.c\n+++ b/net/ipv6/netfilter/ip6_tables.c\n@@ -352,6 +352,10 @@ ip6t_do_table(struct sk_buff *skb,\n \t\t\t}\n \t\t\tif (table_base + v != ip6t_next_entry(e) &&\n \t\t\t !(e->ipv6.flags & IP6T_F_GOTO)) {\n+\t\t\t\tif (unlikely(stackidx >= private->stacksize)) {\n+\t\t\t\t\tverdict = NF_DROP;\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n \t\t\t\tjumpstack[stackidx++] = e;\n \t\t\t}\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-cvp9-xf77-46mc\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-xp5g-whvx-3f7g\nDescription: \n\n```diff\nFrom 1c449a34fe0b50aaffb881bfb9d7c5ab0bb18cdd Mon Sep 17 00:00:00 2001\nFrom: Aurelien David <aurelien.david@telecom-paristech.fr>\nDate: Fri, 11 Jan 2019 14:05:16 +0100\nSubject: [PATCH] add some boundary checks on gf_text_get_utf8_line (#1188)\n\n---\n applications/mp4client/main.c | 2 +-\n src/media_tools/text_import.c | 77 +++++++++++++++++++++++------------\n 2 files changed, 53 insertions(+), 26 deletions(-)\n\ndiff --git a/applications/mp4client/main.c b/applications/mp4client/main.c\nindex 46404ff985..df01947f3c 100644\n--- a/applications/mp4client/main.c\n+++ b/applications/mp4client/main.c\n@@ -1715,7 +1715,7 @@ int mp4client_main(int argc, char **argv)\n \t\t\t\t\te = gf_dm_sess_process(sess);\n \t\t\t\t\tif (!e) {\n \t\t\t\t\t\tstrncpy(the_url, gf_dm_sess_get_cache_name(sess), sizeof(the_url) - 1);\n-\t\t\t\t\t\tthe_url[sizeof(the_cfg) - 1] = 0;\n+\t\t\t\t\t\tthe_url[sizeof(the_url) - 1] = 0;\n \t\t\t\t\t}\n \t\t\t\t\tgf_dm_sess_del(sess);\n \t\t\t\t}\ndiff --git a/src/media_tools/text_import.c b/src/media_tools/text_import.c\nindex 18f10f33d1..af92000787 100644\n--- a/src/media_tools/text_import.c\n+++ b/src/media_tools/text_import.c\n@@ -205,49 +205,76 @@ char *gf_text_get_utf8_line(char *szLine, u32 lineSize, FILE *txt_in, s32 unicod\n \tif (unicode_type<=1) {\n \t\tj=0;\n \t\tlen = (u32) strlen(szLine);\n-\t\tfor (i=0; i<len; i++) {\n+\t\tfor (i=0; i<len && j < sizeof(szLineConv) - 1; i++, j++) {\n+\n \t\t\tif (!unicode_type && (szLine[i] & 0x80)) {\n \t\t\t\t/*non UTF8 (likely some win-CP)*/\n \t\t\t\tif ((szLine[i+1] & 0xc0) != 0x80) {\n-\t\t\t\t\tszLineConv[j] = 0xc0 | ( (szLine[i] >> 6) & 0x3 );\n-\t\t\t\t\tj++;\n-\t\t\t\t\tszLine[i] &= 0xbf;\n+\t\t\t\t\tif (j + 1 < sizeof(szLineConv) - 1) {\n+\t\t\t\t\t\tszLineConv[j] = 0xc0 | ((szLine[i] >> 6) & 0x3);\n+\t\t\t\t\t\tj++;\n+\t\t\t\t\t\tszLine[i] &= 0xbf;\n+\t\t\t\t\t}\n+\t\t\t\t\telse\n+\t\t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\t/*UTF8 2 bytes char*/\n \t\t\t\telse if ( (szLine[i] & 0xe0) == 0xc0) {\n-\t\t\t\t\tszLineConv[j] = szLine[i];\n-\t\t\t\t\ti++;\n-\t\t\t\t\tj++;\n+\n+\t\t\t\t\t// don't cut multibyte in the middle in there is no more room in dest\n+\t\t\t\t\tif (j + 1 < sizeof(szLineConv) - 1 && i + 1 < len) {\n+\t\t\t\t\t\tszLineConv[j] = szLine[i];\n+\t\t\t\t\t\ti++;\n+\t\t\t\t\t\tj++;\n+\t\t\t\t\t}\n+\t\t\t\t\telse {\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t/*UTF8 3 bytes char*/\n \t\t\t\telse if ( (szLine[i] & 0xf0) == 0xe0) {\n-\t\t\t\t\tszLineConv[j] = szLine[i];\n-\t\t\t\t\ti++;\n-\t\t\t\t\tj++;\n-\t\t\t\t\tszLineConv[j] = szLine[i];\n-\t\t\t\t\ti++;\n-\t\t\t\t\tj++;\n+\t\t\t\t\tif (j + 2 < sizeof(szLineConv) - 1 && i + 2 < len) {\n+\t\t\t\t\t\tszLineConv[j] = szLine[i];\n+\t\t\t\t\t\ti++;\n+\t\t\t\t\t\tj++;\n+\t\t\t\t\t\tszLineConv[j] = szLine[i];\n+\t\t\t\t\t\ti++;\n+\t\t\t\t\t\tj++;\n+\t\t\t\t\t}\n+\t\t\t\t\telse {\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t/*UTF8 4 bytes char*/\n \t\t\t\telse if ( (szLine[i] & 0xf8) == 0xf0) {\n-\t\t\t\t\tszLineConv[j] = szLine[i];\n-\t\t\t\t\ti++;\n-\t\t\t\t\tj++;\n-\t\t\t\t\tszLineConv[j] = szLine[i];\n-\t\t\t\t\ti++;\n-\t\t\t\t\tj++;\n-\t\t\t\t\tszLineConv[j] = szLine[i];\n-\t\t\t\t\ti++;\n-\t\t\t\t\tj++;\n+\t\t\t\t\tif (j + 3 < sizeof(szLineConv) - 1 && i + 3 < len) {\n+\t\t\t\t\t\tszLineConv[j] = szLine[i];\n+\t\t\t\t\t\ti++;\n+\t\t\t\t\t\tj++;\n+\t\t\t\t\t\tszLineConv[j] = szLine[i];\n+\t\t\t\t\t\ti++;\n+\t\t\t\t\t\tj++;\n+\t\t\t\t\t\tszLineConv[j] = szLine[i];\n+\t\t\t\t\t\ti++;\n+\t\t\t\t\t\tj+\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-xp5g-whvx-3f7g\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2021-41274\nDescription: solidus_auth_devise provides authentication services for the Solidus webstore framework, using the Devise gem. In affected versions solidus_auth_devise is subject to a CSRF vulnerability that allows user account takeover. All applications using any version of the frontend component of `solidus_auth_devise` are affected if `protect_from_forgery` method is both: Executed whether as: A `before_action` callback (the default) or A `prepend_before_action` (option `prepend: true` given) before the `:lo\n\n```diff\nFrom ec4fbe6876d1661a90976f5c03acf4805c36eb45 Mon Sep 17 00:00:00 2001\nFrom: =?UTF-8?q?Marc=20Busqu=C3=A9?= <marc@lamarciana.com>\nDate: Wed, 10 Nov 2021 16:42:20 +0100\nSubject: [PATCH] Fix account takeover through CSRF attack\n\nThis commit fixes an account takeover vulnerability when [Rails\n`protect_from_forgery`](https://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html)\nmethod is both:\n\n- Executed whether as:\n - A `before_action` callback (the default)\n - A `prepend_before_action` (option `prepend: true`) before the\n `:load_object` hook in `Spree::UsersController` (most likely order to\n find).\n\n- Configured to use `:null_session` or `:reset_session`\n strategies (`:null_session` is the default in case the no strategy is\n given, but `rails --new` generated skeleton use `:exception`).\n\nBefore this commit, the user was fetched in a `prepend_before_action`\nhook named `:load_object`. I.e., the user was loaded into an instance\nvariable before touching the session as a safety countermeasure. As the\nrequest went forward, `#update` was called on that instance variable.\n\nThe `:exception` strategy prevented the issue as, even if the user was\nstill fetched, the request was aborted before the update phase. On the\nother hand, prepending `:protect_from_forgery` after the `:load_object`\nhook (not very likely, as `ApplicationController` is loaded in\nthe first place and it's the most likely place to have that definition)\nwiped the session before trying to fetch the user from it.\n\nWe could have fixed the most likely issue by just using a\n`before_action` for `:load_object`, but it's safer not to rely on the\norder of callbacks at all.\n---\n .../frontend/spree/users_controller.rb | 7 +++-\n .../spree/frontend/user_update_spec.rb | 42 +++++++++++++++++++\n 2 files changed, 48 insertions(+), 1 deletion(-)\n create mode 100644 spec/requests/spree/frontend/user_update_spec.rb\n\ndiff --git a/lib/controllers/frontend/spree/users_controller.rb b/lib/controllers/frontend/spree/users_controller.rb\nindex 81ecc60b..793d6e03 100644\n--- a/lib/controllers/frontend/spree/users_controller.rb\n+++ b/lib/controllers/frontend/spree/users_controller.rb\n@@ -2,12 +2,12 @@\n \n class Spree::UsersController < Spree::StoreController\n skip_before_action :set_current_order, only: :show, raise: false\n- prepend_before_action :load_object, only: [:show, :edit, :update]\n prepend_before_action :authorize_actions, only: :new\n \n include Spree::Core::ControllerHelpers\n \n def show\n+ load_object\n @orders = @user.orders.complete.order('completed_at desc')\n end\n \n@@ -25,7 +25,12 @@ def create\n end\n end\n \n+ def edit\n+ load_object\n+ end\n+\n def update\n+ load_object\n if @user.update(user_params)\n spree_current_user.reload\n redirect_url = spree.account_url\ndiff --git a/spec/requests/spree/frontend/user_update_spec.rb b/spec/requests/spree/frontend/user_update_spec.rb\nnew file mode 100644\nindex 00000000..f569199e\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2021-41274\n**CWE:** CWE-352: Cross-Site Request Forgery (CSRF)\n**Title:** Authentication Bypass by CSRF Weakness\n\nThis patch addresses: solidus_auth_devise provides authentication services for the Solidus webstore framework, using the Devise gem. In affected versions solidus_auth_devise is subject to a CSRF vulnerability that allows user account takeover. All applications using any version of the frontend component of `solidus_auth_devise` are affected if `protect_from_forgery` method is both: Executed whether as: A `before_action` callback (the default) or A `prepend_before_action` (option `prepend: true` given) before the `:lo\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-vwr6-qp4q-2wj7\nDescription: \n\n```diff\nFrom 48caf7491595238af2b531026a614221d5d61f38 Mon Sep 17 00:00:00 2001\nFrom: Thomas Mortagne <thomas.mortagne@gmail.com>\nDate: Thu, 20 Oct 2022 18:00:15 +0200\nSubject: [PATCH] XWIKI-19731: Fix escaping * better fix (thanks @michitux for\n the warning)\n\n---\n .../xwiki/icon/test/ui/IconThemesSheetIT.java | 61 -------------------\n .../IconThemesCode/IconThemeSheet.xml | 7 +--\n 2 files changed, 3 insertions(+), 65 deletions(-)\n delete mode 100644 xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-test/xwiki-platform-icon-test-docker/src/test/it/org/xwiki/icon/test/ui/IconThemesSheetIT.java\n\ndiff --git a/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-test/xwiki-platform-icon-test-docker/src/test/it/org/xwiki/icon/test/ui/IconThemesSheetIT.java b/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-test/xwiki-platform-icon-test-docker/src/test/it/org/xwiki/icon/test/ui/IconThemesSheetIT.java\ndeleted file mode 100644\nindex 4334887bc873..000000000000\n--- a/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-test/xwiki-platform-icon-test-docker/src/test/it/org/xwiki/icon/test/ui/IconThemesSheetIT.java\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-/*\n- * See the NOTICE file distributed with this work for additional\n- * information regarding copyright ownership.\n- *\n- * This is free software; you can redistribute it and/or modify it\n- * under the terms of the GNU Lesser General Public License as\n- * published by the Free Software Foundation; either version 2.1 of\n- * the License, or (at your option) any later version.\n- *\n- * This software is distributed in the hope that it will be useful,\n- * but WITHOUT ANY WARRANTY; without even the implied warranty of\n- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n- * Lesser General Public License for more details.\n- *\n- * You should have received a copy of the GNU Lesser General Public\n- * License along with this software; if not, write to the Free\n- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n- */\n-package org.xwiki.icon.test.ui;\n-\n-import org.junit.jupiter.api.BeforeEach;\n-import org.junit.jupiter.api.Order;\n-import org.junit.jupiter.api.Test;\n-import org.openqa.selenium.By;\n-import org.xwiki.test.docker.junit5.TestReference;\n-import org.xwiki.test.docker.junit5.UITest;\n-import org.xwiki.test.ui.TestUtils;\n-\n-import static org.junit.jupiter.api.Assertions.assertTrue;\n-\n-/**\n- * Functional tests of the icon theme sheet.\n- *\n- * @version $Id$\n- */\n-@UITest\n-class IconThemesSheetIT\n-{\n- @BeforeEach\n- void setUp(TestUtils testUtils)\n- {\n- // Login as superadmin to define the preferences. \n- testUtils.loginAsSuperAdmin();\n- }\n-\n- @Test\n- @Order(1)\n- void createIconTheme(TestUtils testUtils, TestReference testReference) throws Exception\n- {\n- testUtils.createPage(testReference, \")))**not bold**\");\n- testUtils.addObject(testReference, \"\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-vwr6-qp4q-2wj7\n**CWE:** Unknown\n**Title:** XWiki Platform vulnerable to privilege escalation via async macro and IconThemeSheet from the user profile\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2025-58371\nDescription: Roo Code is an AI-powered autonomous coding agent that lives in users' editors. In versions 3.26.6 and below, a Github workflow used unsanitized pull request metadata in a privileged context, allowing an attacker to craft malicious input and achieve Remote Code Execution (RCE) on the Actions runner. The workflow runs with broad permissions and access to repository secrets. It is possible for an attacker to execute arbitrary commands on the runner, push or modify code in the repository, access se\n\n```diff\nFrom a0384f35d5ae3b7f66506cc62dda25d9bb673f49 Mon Sep 17 00:00:00 2001\nFrom: Matt Rubens <mrubens@users.noreply.github.com>\nDate: Wed, 3 Sep 2025 23:18:11 -0400\nSubject: [PATCH] Delete .github/workflows/discord-pr-notify.yml\n\n---\n .github/workflows/discord-pr-notify.yml | 26 -------------------------\n 1 file changed, 26 deletions(-)\n delete mode 100644 .github/workflows/discord-pr-notify.yml\n\ndiff --git a/.github/workflows/discord-pr-notify.yml b/.github/workflows/discord-pr-notify.yml\ndeleted file mode 100644\nindex 88c918edfe3..00000000000\n--- a/.github/workflows/discord-pr-notify.yml\n+++ /dev/null\n@@ -1,26 +0,0 @@\n-name: Discord PR Notifier\n-\n-on:\n- workflow_dispatch:\n- pull_request_target:\n- types: [opened]\n-\n-jobs:\n- notify:\n- runs-on: ubuntu-latest\n- if: github.head_ref != 'changeset-release/main'\n- steps:\n- - name: Send Discord Notification\n- run: |\n- PAYLOAD=$(jq -n \\\n- --arg title \"${{ github.event.pull_request.title }}\" \\\n- --arg url \"${{ github.event.pull_request.html_url }}\" \\\n- --arg author \"${{ github.event.pull_request.user.login }}\" \\\n- '{\n- content: (\"🚀 **New PR:** \" + $title + \"\\n🔗 <\" + $url + \">\\n👤 **Author:** \" + $author),\n- thread_name: ($title + \" by \" + $author)\n- }')\n-\n- curl -X POST \"${{ secrets.DISCORD_WEBHOOK }}\" \\\n- -H \"Content-Type: application/json\" \\\n- -d \"$PAYLOAD\"\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2025-58371\n**CWE:** CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')\n**Title:** Roo Code is vulnerable to command injection via GitHub actions workflow\n\nThis patch addresses: Roo Code is an AI-powered autonomous coding agent that lives in users' editors. In versions 3.26.6 and below, a Github workflow used unsanitized pull request metadata in a privileged context, allowing an attacker to craft malicious input and achieve Remote Code Execution (RCE) on the Actions runner. The workflow runs with broad permissions and access to repository secrets. It is possible for an attacker to execute arbitrary commands on the runner, push or modify code in the repository, access se\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2017-7871\nDescription: trollepierre/tdm before 2017-04-13 is vulnerable to a reflected XSS in tdm-master/webhook.php (challenge parameter).\n\n```diff\nFrom 2e89019d6a491f0a5ac3db8732181f6eb1d219aa Mon Sep 17 00:00:00 2001\nFrom: =?UTF-8?q?Pierre=20Troll=C3=A9?= <ptrolle@octo.com>\nDate: Thu, 13 Apr 2017 09:44:41 +0200\nSubject: [PATCH] fix(TDM-1) : fix issue #1\n\n---\n src/Webhook.php | 10 +++++-----\n webhook.php | 2 +-\n 2 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/src/Webhook.php b/src/Webhook.php\nindex 7404c0c..c25d1db 100644\n--- a/src/Webhook.php\n+++ b/src/Webhook.php\n@@ -2,7 +2,7 @@\n use \\Dropbox as dbx;\n \n function verify(){\n- echo $_GET['challenge'];\n+ echo htmlspecialchars($_GET['challenge']);\n }\n \n function webhook(){\n@@ -44,7 +44,7 @@ function delta($myCustomClient ,$cursortxt, $url, $pathPrefix){\n file_put_contents($cursortxt,$deltaPage[\"cursor\"]);\n \n if($numAdds+$numRemoves>0){\n- header('Location: lib/ajax/'.$url.'.php?id='.$id);\n+ header('Location: ../lib/ajax/'.$url.'.php?id='.$id);\n }\n }\n \n@@ -52,18 +52,18 @@ function delta($myCustomClient ,$cursortxt, $url, $pathPrefix){\n function process_user(){\n #'''Call /delta for the given user ID and process any changes.'''\n // creation d'un client dropbox\n- include(\"lib/dropboxAPI.php\");\n+ include(\"../lib/dropboxAPI.php\");\n $myCustomClient = new dbx\\Client($accessToken, $clientIdentifier);\n \n //Articles\n $pathPrefix=\"/Chargements appareil photo/ArticleTdm\";\n- $cursortxt = \"lib/cursor.txt\";\n+ $cursortxt = \"../lib/cursor.txt\";\n $url=\"url\";\n delta($myCustomClient ,$cursortxt, $url, $pathPrefix);\n \n //Challenge\n $pathPrefix=\"/Chargements appareil photo/ChallengeTdm\";\n- $cursortxt = \"lib/cursorC.txt\";\n+ $cursortxt = \"../lib/cursorC.txt\";\n $url=\"challenge_update\";\n delta($myCustomClient , $cursortxt, $url, $pathPrefix);\n }\ndiff --git a/webhook.php b/webhook.php\nindex 14e6db3..813b9a1 100644\n--- a/webhook.php\n+++ b/webhook.php\n@@ -2,7 +2,7 @@\n use \\Dropbox as dbx;\n \n function verify(){\n-\techo $_GET['challenge'];\n+\techo htmlspecialchars($_GET['challenge']);\n }\n \n function webhook(){\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2017-7871\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: trollepierre/tdm before 2017-04-13 is vulnerable to a reflected XSS in tdm-master/webhook.php (challenge parameter).\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-vmhh-8rxq-fp9g\nDescription: \n\n```diff\nFrom 229fa96a988a21d78318bbca61245a6ed1ee33a0 Mon Sep 17 00:00:00 2001\nFrom: Dirk Lemstra <dirk@lemstra.org>\nDate: Fri, 2 May 2025 18:33:17 +0200\nSubject: [PATCH] Added extra checks to make sure we don't get stuck in the\n while loop.\n\n---\n MagickCore/image-private.h | 1 +\n MagickCore/profile.c | 11 +++++++++++\n 2 files changed, 12 insertions(+)\n\ndiff --git a/MagickCore/image-private.h b/MagickCore/image-private.h\nindex cc07b164d89..81269ef890b 100644\n--- a/MagickCore/image-private.h\n+++ b/MagickCore/image-private.h\n@@ -53,6 +53,7 @@ extern \"C\" {\n #define MAGICK_SSIZE_MAX (SSIZE_MAX)\n #define MAGICK_SSIZE_MIN (-SSIZE_MAX-1)\n #define MAGICK_UINT_MAX (UINT_MAX)\n+#define MAGICK_ULONG_MAX (ULONG_MAX)\n #define MAGICK_USHORT_MAX (USHRT_MAX)\n #define MatteColor \"#bdbdbd\" /* gray */\n #define MatteColorRGBA ScaleShortToQuantum(0xbdbd),\\\ndiff --git a/MagickCore/profile.c b/MagickCore/profile.c\nindex 7ff7ac8415e..4a11102ebe5 100644\n--- a/MagickCore/profile.c\n+++ b/MagickCore/profile.c\n@@ -2571,6 +2571,17 @@ static void GetXmpNumeratorAndDenominator(double value,\n *denominator=1;\n if (value <= MagickEpsilon)\n return;\n+ if (value > (double) MAGICK_ULONG_MAX)\n+ {\n+ *numerator = MAGICK_ULONG_MAX;\n+ *denominator = 1;\n+ return;\n+ }\n+ if (floor(value) == value)\n+ {\n+ *numerator = (unsigned long) value;\n+ *denominator = 1;\n+ }\n *numerator=1;\n df=1.0;\n while(fabs(df - value) > MagickEpsilon)\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-vmhh-8rxq-fp9g\n**CWE:** Unknown\n**Title:** ImageMagick has XMP profile write that triggers hang due to unbounded loop\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2023-29419\nDescription: An issue was discovered in libbzip3.a in bzip3 before 1.2.3. There is a bz3_decode_block out-of-bounds read.\n\n```diff\nFrom 8ec8ce7d3d58bf42dabc47e4cc53aa27051bd602 Mon Sep 17 00:00:00 2001\nFrom: Kamila Szewczyk <kspalaiologos@gmail.com>\nDate: Wed, 22 Mar 2023 13:56:28 +0100\nSubject: [PATCH] mRLE: decoding bounds\n\n---\n src/libbz3.c | 17 +++++++++++++----\n 1 file changed, 13 insertions(+), 4 deletions(-)\n\ndiff --git a/src/libbz3.c b/src/libbz3.c\nindex fdcafe6..836286e 100644\n--- a/src/libbz3.c\n+++ b/src/libbz3.c\n@@ -257,28 +257,33 @@ static s32 mrlec(u8 * in, s32 inlen, u8 * out) {\n return op;\n }\n \n-static void mrled(u8 * RESTRICT in, u8 * RESTRICT out, s32 outlen) {\n+static int mrled(u8 * RESTRICT in, u8 * RESTRICT out, s32 outlen, s32 maxin) {\n s32 op = 0, ip = 0;\n \n s32 c, pc = -1;\n s32 t[256] = { 0 };\n s32 run = 0;\n \n+ if(maxin < 32)\n+ return 1;\n+\n for (s32 i = 0; i < 32; ++i) {\n c = in[ip++];\n for (s32 j = 0; j < 8; ++j) t[i * 8 + j] = (c >> j) & 1;\n }\n \n- while (op < outlen) {\n+ while (op < outlen && ip < maxin) {\n c = in[ip++];\n if (t[c]) {\n- for (run = 0; (pc = in[ip++]) == 255; run += 255)\n+ for (run = 0; (pc = in[ip++]) == 255 && ip < maxin; run += 255)\n ;\n run += pc + 1;\n for (; run > 0 && op < outlen; --run) out[op++] = c;\n } else\n out[op++] = c;\n }\n+\n+ return op != outlen;\n }\n \n /* The entropy coder. Uses an arithmetic coder implementation outlined in Matt Mahoney's DCE. */\n@@ -694,7 +699,11 @@ BZIP3_API s32 bz3_decode_block(struct bz3_state * state, u8 * buffer, s32 data_s\n }\n \n if (model & 4) {\n- mrled(b1, b2, orig_size);\n+ int err = mrled(b1, b2, orig_size, size_src);\n+ if(err) {\n+ state->last_error = BZ3_ERR_CRC;\n+ return -1;\n+ }\n size_src = orig_size;\n swap(b1, b2);\n }\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2023-29419\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: An issue was discovered in libbzip3.a in bzip3 before 1.2.3. There is a bz3_decode_block out-of-bounds read.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-87h5-jxx9-3c5x\nDescription: \n\n```diff\nFrom 6cf0236184ff6304bf5e267ccf7ef02874069697 Mon Sep 17 00:00:00 2001\nFrom: Duncan Overbruck <mail@duncano.de>\nDate: Tue, 3 Sep 2019 00:41:14 +0200\nSubject: [PATCH] fix the setusercontext(3) workaround\n\nSeeing this being used on even more system like Illumos with this ugly\nand security critical bug open makes me cringe every time I check if it\nwas finally fixed.\n\nI reported it directly to the maintainer in 2017. I reported it to\npkgsrc-security@netbsd.org without a response.\n---\n doas.c | 25 +++++++++++++++++--------\n 1 file changed, 17 insertions(+), 8 deletions(-)\n\ndiff --git a/doas.c b/doas.c\nindex ca7a572..745b1c8 100644\n--- a/doas.c\n+++ b/doas.c\n@@ -542,6 +542,23 @@ main(int argc, char **argv)\n \t LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETUMASK |\n \t LOGIN_SETUSER) != 0)\n \t\terrx(1, \"failed to set user context for target\");\n+#else\n+\t#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)\n+\tif (setresgid(target_pw->pw_gid, target_pw->pw_gid, target_pw->pw_gid) == -1)\n+\t\terr(1, \"setresgid\");\n+\t#else\n+\tif (setregid(target_pw->pw_gid, target_pw->pw_gid) == -1)\n+\t\terr(1, \"setregid\");\n+\t#endif\n+\tif (initgroups(target_pw->pw_name, target_pw->pw_gid) == -1)\n+\t\terr(1, \"initgroups\");\n+\t#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)\n+\tif (setresuid(target, target, target) == -1)\n+\t\terr(1, \"setresuid\");\n+\t#else\n+\tif (setreuid(target, target) == -1)\n+\t\terr(1, \"setreuid\");\n+\t#endif\n #endif\n /*\n \tif (pledge(\"stdio rpath exec\", NULL) == -1)\n@@ -557,14 +574,6 @@ main(int argc, char **argv)\n if (pledge(\"stdio exec\", NULL) == -1)\n \t\terr(1, \"pledge\");\n */\n-#ifndef HAVE_LOGIN_CAP_H\n- /* If we effectively are root, set the UID to actually be root to avoid\n- permission errors. */\n- if (target != 0)\n- setuid(target);\n- if ( geteuid() == ROOT_UID )\n- setuid(ROOT_UID);\n-#endif\n \n \tsyslog(LOG_AUTHPRIV | LOG_INFO, \"%s ran command %s as %s from %s\",\n \t myname, cmdline, target_pw->pw_name, cwd);\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-87h5-jxx9-3c5x\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: PYSEC-2021-655\nDescription: \n\n```diff\nFrom f851613f8f0fb0c838d160ced13c134f778e3ce7 Mon Sep 17 00:00:00 2001\nFrom: Mihai Maruseac <mihaimaruseac@google.com>\nDate: Wed, 21 Apr 2021 16:20:48 -0700\nSubject: [PATCH] Fix heap buffer overflow caused by rounding.\n\nThis was hard to fix. Due to the way we compute the pixels that influence an output pixel in resized images, for certain input configuration we might have issued a read to a pixel that is outside of boundary of the original image. This is because of floating errors that affected truncation results.\n\nPiperOrigin-RevId: 369757871\nChange-Id: If89425fff930983829a2168203c11858883eebc9\n---\n tensorflow/core/kernels/quantized_resize_bilinear_op.cc | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/tensorflow/core/kernels/quantized_resize_bilinear_op.cc b/tensorflow/core/kernels/quantized_resize_bilinear_op.cc\nindex 07453c7e73284b..2fd807f6df9614 100644\n--- a/tensorflow/core/kernels/quantized_resize_bilinear_op.cc\n+++ b/tensorflow/core/kernels/quantized_resize_bilinear_op.cc\n@@ -64,6 +64,8 @@ inline void ComputeInterpolationWeights(\n std::max(static_cast<int64>(in_f), static_cast<int64>(0));\n interpolation->upper[i] =\n std::min(static_cast<int64>(std::ceil(in)), in_size - 1);\n+ interpolation->lower[i] =\n+ std::min(interpolation->lower[i], interpolation->upper[i]);\n interpolation->lerp[i] = in - in_f;\n interpolation->ilerp[i] =\n static_cast<T_SCALE>((in - in_f) * (1 << resolution));\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** PYSEC-2021-655\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-8hpx-q4cx-gfxw\nDescription: \n\n```diff\nFrom 08b9e7c55f72649ef25b5407e7e4d938f0f16531 Mon Sep 17 00:00:00 2001\nFrom: Sukchan Lee <acetcom@gmail.com>\nDate: Tue, 24 Dec 2024 17:14:50 +0900\nSubject: [PATCH] [DBI] Fix crash in ogs_dbi_auth_info due to invalid SUPI\n (#3635)\n\nAdded checks to validate the SUPI ID in the ogs_dbi_auth_info function\nbefore calling ogs_assert. This prevents a crash when the SUPI ID is malformed,\nsuch as when it does not contain a hyphen.\n\nThe fix ensures that invalid SUPI values are logged and handled gracefully,\navoiding assertion failures and crashes in the UDR.\n---\n lib/dbi/subscription.c | 11 +++++++++--\n 1 file changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/lib/dbi/subscription.c b/lib/dbi/subscription.c\nindex ac8a44c908..25f849440c 100644\n--- a/lib/dbi/subscription.c\n+++ b/lib/dbi/subscription.c\n@@ -39,9 +39,16 @@ int ogs_dbi_auth_info(char *supi, ogs_dbi_auth_info_t *auth_info)\n ogs_assert(auth_info);\n \n supi_type = ogs_id_get_type(supi);\n- ogs_assert(supi_type);\n+ if (!supi_type) {\n+ ogs_error(\"Invalid supi=%s\", supi);\n+ return OGS_ERROR;\n+ }\n supi_id = ogs_id_get_value(supi);\n- ogs_assert(supi_id);\n+ if (!supi_id) {\n+ ogs_error(\"Invalid supi=%s\", supi);\n+ ogs_free(supi_type);\n+ return OGS_ERROR;\n+ }\n \n query = BCON_NEW(supi_type, BCON_UTF8(supi_id));\n #if MONGOC_CHECK_VERSION(1, 5, 0)\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-8hpx-q4cx-gfxw\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2020-15117\nDescription: In Synergy before version 1.12.0, a Synergy server can be crashed by receiving a kMsgHelloBack packet with a client name length set to 0xffffffff (4294967295) if the servers memory is less than 4 GB. It was verified that this issue does not cause a crash through the exception handler if the available memory of the Server is more than 4GB.\n\n```diff\nFrom 59e63f5818531c9509f42e5d582624614275486d Mon Sep 17 00:00:00 2001\nFrom: Jamie Newbon <jamie@symless.com>\nDate: Fri, 10 Jul 2020 13:30:30 +0100\nSubject: [PATCH 1/2] #6716 Added try catch around memory allocation\n\n---\n src/lib/synergy/ProtocolUtil.cpp | 10 +++++++++-\n 1 file changed, 9 insertions(+), 1 deletion(-)\n\ndiff --git a/src/lib/synergy/ProtocolUtil.cpp b/src/lib/synergy/ProtocolUtil.cpp\nindex d9f5dc324..ae37ff576 100644\n--- a/src/lib/synergy/ProtocolUtil.cpp\n+++ b/src/lib/synergy/ProtocolUtil.cpp\n@@ -216,7 +216,15 @@ ProtocolUtil::vreadf(synergy::IStream* stream, const char* fmt, va_list args)\n // allocate a buffer to read the data\n UInt8* sBuffer = buffer;\n if (!useFixed) {\n- sBuffer = new UInt8[len];\n+ try{\n+ sBuffer = new UInt8[len];\n+ }\n+ catch (std::bad_alloc & exception) {\n+ // Added try catch due to GHSA-chfm-333q-gfpp\n+ LOG((CLOG_ERR \"ALLOC: Unable to allocate memory %d bytes\", len));\n+ LOG((CLOG_DEBUG \"bad_alloc detected: %s\", exception.what()));\n+ throw;\n+ }\n }\n \n // read the data\n\nFrom bdd36c389d3583cb43f691bd42ba295b7fda47f0 Mon Sep 17 00:00:00 2001\nFrom: Jamie Newbon <jamie@symless.com>\nDate: Tue, 14 Jul 2020 12:51:44 +0100\nSubject: [PATCH 2/2] #6716 Changed throw to pass exception to caller and\n handle it there updated debug message\n\n---\n src/lib/synergy/ProtocolUtil.cpp | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/src/lib/synergy/ProtocolUtil.cpp b/src/lib/synergy/ProtocolUtil.cpp\nindex ae37ff576..7d2c37ff8 100644\n--- a/src/lib/synergy/ProtocolUtil.cpp\n+++ b/src/lib/synergy/ProtocolUtil.cpp\n@@ -61,6 +61,9 @@ ProtocolUtil::readf(synergy::IStream* stream, const char* fmt, ...)\n catch (XIO&) {\n result = false;\n }\n+ catch (std::bad_alloc & exception) {\n+ result = false;\n+ }\n va_end(args);\n return result;\n }\n@@ -222,8 +225,8 @@ ProtocolUtil::vreadf(synergy::IStream* stream, const char* fmt, va_list args)\n catch (std::bad_alloc & exception) {\n // Added try catch due to GHSA-chfm-333q-gfpp\n LOG((CLOG_ERR \"ALLOC: Unable to allocate memory %d bytes\", len));\n- LOG((CLOG_DEBUG \"bad_alloc detected: %s\", exception.what()));\n- throw;\n+ LOG((CLOG_DEBUG \"bad_alloc detected: Do you have enough free memory?\"));\n+ throw exception;\n }\n }\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2020-15117\n**CWE:** {\"CWE-755\":\"Improper Handling of Exceptional Conditions\"}\n**Title:** Denial of Service in Synergy\n\nThis patch addresses: In Synergy before version 1.12.0, a Synergy server can be crashed by receiving a kMsgHelloBack packet with a client name length set to 0xffffffff (4294967295) if the servers memory is less than 4 GB. It was verified that this issue does not cause a crash through the exception handler if the available memory of the Server is more than 4GB.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-jpfp-xq3p-4h3r\nDescription: \n\n```diff\nFrom 31fe3bccbdde134a185752e53380330d16053f7f Mon Sep 17 00:00:00 2001\nFrom: Jack Francis <jackfrancis@gmail.com>\nDate: Thu, 11 Aug 2016 14:54:43 -0700\nSubject: [PATCH] cluster_id is vulnerable to race condition when called\n concurrently (#94)\n\n* fix(cluster_id): Get() is \"insert if not exist\", needs read-write lock protection\n\n* fix(jobs): remove static clusterID getter in sendVersionsImpl\n\n1) add generic data.ClusterID type in sendVersions type struct\n2) enable common clusterID reference to be included in multiple, concurrent jobs, so that appropriate locking can be enforced\n---\n boot.go | 1 +\n data/cluster_id.go | 2 ++\n jobs/jobs.go | 8 ++++++--\n 3 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/boot.go b/boot.go\nindex ee201a4..b4f359f 100644\n--- a/boot.go\n+++ b/boot.go\n@@ -47,6 +47,7 @@ func main() {\n \n \tsvPeriodic := jobs.NewSendVersionsPeriodic(\n \t\tapiClient,\n+\t\tclusterID,\n \t\tdeisK8sResources,\n \t\tavailableVersion,\n \t\tpollDur,\ndiff --git a/data/cluster_id.go b/data/cluster_id.go\nindex 352810c..a1b883d 100644\n--- a/data/cluster_id.go\n+++ b/data/cluster_id.go\n@@ -51,6 +51,8 @@ func NewClusterIDFromPersistentStorage(sgc k8s.KubeSecretGetterCreator) ClusterI\n \n // Get is the ClusterID interface implementation\n func (c clusterIDFromPersistentStorage) Get() (string, error) {\n+\tc.rwm.Lock()\n+\tdefer c.rwm.Unlock()\n \tsecret, err := c.secretGetterCreator.Get(wfmSecretName)\n \t//If we don't have the secret we shouldn't be returning error and instead a create a new one\n \tif err != nil && !apierrors.IsNotFound(err) {\ndiff --git a/jobs/jobs.go b/jobs/jobs.go\nindex 98a88f8..d5b6aab 100644\n--- a/jobs/jobs.go\n+++ b/jobs/jobs.go\n@@ -22,6 +22,7 @@ type Periodic interface {\n // SendVersions fulfills the Periodic interface\n type sendVersions struct {\n \tk8sResources *k8s.ResourceInterfaceNamespaced\n+\tclusterID data.ClusterID\n \tapiClient *apiclient.WorkflowManager\n \tavailableVersions data.AvailableVersions\n \tfrequency time.Duration\n@@ -30,12 +31,14 @@ type sendVersions struct {\n // NewSendVersionsPeriodic creates a new SendVersions using sgc and rcl as the the secret getter / creator and replication controller lister implementations (respectively)\n func NewSendVersionsPeriodic(\n \tapiClient *apiclient.WorkflowManager,\n+\tclusterID data.ClusterID,\n \tri *k8s.ResourceInterfaceNamespaced,\n \tavailableVersions data.AvailableVersions,\n \tfrequency time.Duration,\n ) Periodic {\n \treturn &sendVersions{\n \t\tk8sResources: ri,\n+\t\tclusterID: clusterID,\n \t\tapiClient: apiClient,\n \t\tavailableVersions: availableVersions,\n \t\tfrequency: frequency,\n@@ -45,7 +48,7 @@ func NewSendVersionsPeriodic(\n // Do is the Periodic interface implementation\n func (s sendVersions) Do() error {\n \tif config.Spec.CheckVersions {\n-\t\terr := sendVersionsImpl(s.apiClient, s.k8sResources, s.availableVersions)\n+\t\terr := sendVersionsImpl(s.apiClient, s.clusterID, s.k8sResources, s.availableVersions)\n \t\tif err != nil {\n \t\t\treturn\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-jpfp-xq3p-4h3r\n**CWE:** Unknown\n**Title:** Deis Workflow Manager race condition vulnerability\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2022-37109\nDescription: patrickfuller camp up to and including commit bbd53a256ed70e79bd8758080936afbf6d738767 is vulnerable to Incorrect Access Control. Access to the password.txt file is not properly restricted as it is in the root directory served by StaticFileHandler and the Tornado rule to throw a 403 error when password.txt is accessed can be bypassed. Furthermore, it is not necessary to crack the password hash to authenticate with the application because the password hash is also used as the cookie secret, so an\n\n```diff\nFrom bf6af5c2e5cf713e4050c11c52dd4c55e89880b1 Mon Sep 17 00:00:00 2001\nFrom: Patrick Fuller <patrickfuller@gmail.com>\nDate: Thu, 21 Jul 2022 09:03:39 -0500\nSubject: [PATCH] Fix vulnerability and add warning\n\n---\n README.md | 15 ++++++++-------\n server.py | 15 +++++----------\n client.js => static/client.js | 0\n favicon.ico => static/favicon.ico | Bin\n {img => static/img}/example.png | Bin\n {img => static/img}/login.png | Bin\n {img => static/img}/logo.png | Bin\n style.css => static/style.css | 0\n 8 files changed, 13 insertions(+), 17 deletions(-)\n rename client.js => static/client.js (100%)\n rename favicon.ico => static/favicon.ico (100%)\n rename {img => static/img}/example.png (100%)\n rename {img => static/img}/login.png (100%)\n rename {img => static/img}/logo.png (100%)\n rename style.css => static/style.css (100%)\n\ndiff --git a/README.md b/README.md\nindex 288adcf..53c3338 100644\n--- a/README.md\n+++ b/README.md\n@@ -3,7 +3,9 @@ camp\n \n Another Raspberry Pi camera webserver.\n \n-![](img/example.png)\n+**USE AT YOUR OWN RISK. SEE [#11](https://github.com/patrickfuller/camp/issues/11) FOR MORE.**\n+\n+![](static/img/example.png)\n \n What it does\n ============\n@@ -52,11 +54,11 @@ python camp/server.py\n \n Navigate to http://your.r.pi.ip:8000 and check out your webcam.\n \n-#### USB Camera\n+### USB Camera\n \n Use with `python server.py --use-usb`.\n \n-#### Password\n+### Password\n \n ![](img/login.png)\n \n@@ -73,10 +75,9 @@ python -c \"import hashlib; import getpass; print(hashlib.sha512(getpass.getpass(\n This will prompt you for a password, encrypt it, and save the result in\n `password.txt`.\n \n-Note that this level of password protection is basic - it's fine for keeping the\n-occasional stranger out, but won't stand up to targeted hacking.\n+**Note that this level of password protection is basic.** It's fine for keeping the occasional stranger out but won't stand up to targeted hacking.\n \n-#### Run on startup\n+### Run on startup\n \n It's nice to have your pi start camp whenever it turns on. Let's make that\n happen. Type `sudo nano /etc/rc.local` to open this file for editing, and add\n@@ -84,7 +85,7 @@ the line `nohup python /home/pi/camp/server.py &` before the last line. Note\n that you may need to change the path (`/home/pi/camp/server.py`) to point to\n the right file.\n \n-#### Customization\n+### Customization\n \n The website consists of `index.html`, `login.html`, and `style.css`. These can be\n edited to change the look of camp.\ndiff --git a/server.py b/server.py\nindex 331883f..89dc290 100644\n--- a/server.py\n+++ b/server.py\n@@ -7,7 +7,6 @@\n import hashlib\n import os\n import time\n-import threading\n import webbrowser\n \n try:\n@@ -42,7 +41,7 @@ def get(self):\n \n def post(self):\n password = self.get_argument(\"password\", \"\")\n- if hashlib.sha512(password).hexdigest() == PASSWORD:\n+ if hashlib.sha512(password.encode()).hexdigest() == PASSWORD:\n self.set_secure_cookie(\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2022-37109\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: patrickfuller camp up to and including commit bbd53a256ed70e79bd8758080936afbf6d738767 is vulnerable to Incorrect Access Control. Access to the password.txt file is not properly restricted as it is in the root directory served by StaticFileHandler and the Tornado rule to throw a 403 error when password.txt is accessed can be bypassed. Furthermore, it is not necessary to crack the password hash to authenticate with the application because the password hash is also used as the cookie secret, so an\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-8cxx-7fx3-j6xj\nDescription: \n\n```diff\nFrom 425e8a9a59d49378d57e2116b6c9b0190a5986f5 Mon Sep 17 00:00:00 2001\nFrom: Marta Iborra <martaiborra24@gmail.com>\nDate: Wed, 21 Jun 2023 11:16:28 +0200\nSubject: [PATCH] Fix for #519 #520 #521\n\n---\n plugins/codecs/zfp/blosc2-zfp.c | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/plugins/codecs/zfp/blosc2-zfp.c b/plugins/codecs/zfp/blosc2-zfp.c\nindex d824eeb8e..41d08d0d8 100644\n--- a/plugins/codecs/zfp/blosc2-zfp.c\n+++ b/plugins/codecs/zfp/blosc2-zfp.c\n@@ -26,6 +26,7 @@ int zfp_acc_compress(const uint8_t *input, int32_t input_len, uint8_t *output,\n ZFP_ERROR_NULL(input);\n ZFP_ERROR_NULL(output);\n ZFP_ERROR_NULL(cparams);\n+ ZFP_ERROR_NULL(cparams->schunk);\n \n double tol = (int8_t) meta;\n int8_t ndim;\n@@ -146,6 +147,7 @@ int zfp_acc_decompress(const uint8_t *input, int32_t input_len, uint8_t *output,\n ZFP_ERROR_NULL(input);\n ZFP_ERROR_NULL(output);\n ZFP_ERROR_NULL(dparams);\n+ ZFP_ERROR_NULL(dparams->schunk);\n BLOSC_UNUSED_PARAM(chunk);\n \n blosc2_schunk *sc = dparams->schunk;\n@@ -241,6 +243,7 @@ int zfp_prec_compress(const uint8_t *input, int32_t input_len, uint8_t *output,\n ZFP_ERROR_NULL(input);\n ZFP_ERROR_NULL(output);\n ZFP_ERROR_NULL(cparams);\n+ ZFP_ERROR_NULL(cparams->schunk);\n \n int8_t ndim;\n int64_t *shape = malloc(8 * sizeof(int64_t));\n@@ -385,6 +388,7 @@ int zfp_prec_decompress(const uint8_t *input, int32_t input_len, uint8_t *output\n ZFP_ERROR_NULL(input);\n ZFP_ERROR_NULL(output);\n ZFP_ERROR_NULL(dparams);\n+ ZFP_ERROR_NULL(dparams->schunk);\n BLOSC_UNUSED_PARAM(chunk);\n \n blosc2_schunk *sc = dparams->schunk;\n@@ -504,6 +508,7 @@ int zfp_rate_compress(const uint8_t *input, int32_t input_len, uint8_t *output,\n ZFP_ERROR_NULL(input);\n ZFP_ERROR_NULL(output);\n ZFP_ERROR_NULL(cparams);\n+ ZFP_ERROR_NULL(cparams->schunk);\n \n double ratio = (double) meta / 100.0;\n int8_t ndim;\n@@ -635,6 +640,7 @@ int zfp_rate_decompress(const uint8_t *input, int32_t input_len, uint8_t *output\n ZFP_ERROR_NULL(input);\n ZFP_ERROR_NULL(output);\n ZFP_ERROR_NULL(dparams);\n+ ZFP_ERROR_NULL(dparams->schunk);\n BLOSC_UNUSED_PARAM(chunk);\n \n blosc2_schunk *sc = dparams->schunk;\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-8cxx-7fx3-j6xj\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: PYSEC-2021-566\nDescription: \n\n```diff\nFrom ac117ee8a8ea57b73d34665cdf00ef3303bc0b11 Mon Sep 17 00:00:00 2001\nFrom: Mihai Maruseac <mihaimaruseac@google.com>\nDate: Fri, 30 Jul 2021 22:23:28 -0700\nSubject: [PATCH] Prevent division by 0 in `resource_variable_ops.cc`\n\nPiperOrigin-RevId: 387939939\nChange-Id: Ib04902d63756633999959a70613f2eaa30c2c151\n---\n tensorflow/core/kernels/resource_variable_ops.cc | 11 +++++++++--\n 1 file changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/tensorflow/core/kernels/resource_variable_ops.cc b/tensorflow/core/kernels/resource_variable_ops.cc\nindex 32a0a43364deae..8b9610724e5826 100644\n--- a/tensorflow/core/kernels/resource_variable_ops.cc\n+++ b/tensorflow/core/kernels/resource_variable_ops.cc\n@@ -710,7 +710,8 @@ class ResourceGatherOp : public OpKernel {\n copy_functor(c->eigen_device<Device>(), tmp_indices.flat<Index>(),\n indices.flat<Index>());\n \n- AddBatchOffsets(&tmp_indices, params);\n+ AddBatchOffsets(c, &tmp_indices, params);\n+ if (!c->status().ok()) return;\n op_indices = &tmp_indices;\n }\n \n@@ -742,11 +743,17 @@ class ResourceGatherOp : public OpKernel {\n // Example: batch_dims = 1, indices = [[0, 1, 2], [0, 1, 2]]\n // If indexing into a params dimension of size 4, then the indices will become\n // [0, 1, 2, 4, 5, 6]\n- void AddBatchOffsets(Tensor* indices, const Tensor& params) {\n+ void AddBatchOffsets(OpKernelContext* ctx, Tensor* indices,\n+ const Tensor& params) {\n int64_t batch_size = 1; // The size of all batch dimensions.\n for (int idx = 0; idx < batch_dims_; ++idx) {\n batch_size *= params.dim_size(idx);\n }\n+ OP_REQUIRES(\n+ ctx, batch_size != 0,\n+ errors::InvalidArgument(\n+ \"Inner size of indices would result in batch_size of 0 and a \",\n+ \"division by 0 in the implementation. This is illegal\"));\n \n auto indices_flat = indices->flat<Index>();\n int64_t const index_inner_size = indices->NumElements() / batch_size;\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** PYSEC-2021-566\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2014-0083\nDescription: The Ruby net-ldap gem before 0.11 uses a weak salt when generating SSHA passwords.\n\n```diff\nFrom b412ca05f6b430eaa1ce97ac95885b4cf187b04a Mon Sep 17 00:00:00 2001\nFrom: Tatsuya Sato <tatsuya.b.sato@mail.rakuten.com>\nDate: Wed, 7 Jan 2015 08:43:48 +0900\nSubject: [PATCH] Use SecureRandam to generate salt\n\n---\n lib/net/ldap/password.rb | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/lib/net/ldap/password.rb b/lib/net/ldap/password.rb\nindex 3669dfcc..729e17e3 100644\n--- a/lib/net/ldap/password.rb\n+++ b/lib/net/ldap/password.rb\n@@ -27,7 +27,7 @@ def generate(type, str)\n when :sha\n attribute_value = '{SHA}' + Base64.encode64(Digest::SHA1.digest(str)).chomp! \n when :ssha\n- srand; salt = (rand * 1000).to_i.to_s \n+ srand; salt = SecureRandom.random_bytes(16)\n attribute_value = '{SSHA}' + Base64.encode64(Digest::SHA1.digest(str + salt) + salt).chomp!\n else\n raise Net::LDAP::HashTypeUnsupportedError, \"Unsupported password-hash type (#{type})\"\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2014-0083\n**CWE:** Password\n**Title:** Security fix\n\nThis patch addresses: The Ruby net-ldap gem before 0.11 uses a weak salt when generating SSHA passwords.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-5vxx-c285-pcq4\nDescription: \n\n```diff\nFrom e8543eef05126e9ba8a845dc74e96f4e30f6dba9 Mon Sep 17 00:00:00 2001\nFrom: Julian Wiedmann <jwi@isovalent.com>\nDate: Fri, 28 Mar 2025 18:41:50 +0000\nSubject: [PATCH] bpf: wireguard: avoid ipcache lookup for source's security\n identity\n\nWhen the wireguard hook in to-netdev decides whether the packet should be\nencrypted, it considers the source's security identity. For this it\ncurrently looks up the source IP in the ipcache.\n\nBut for a typical packet that exited a local pod, the from-container\nprogram also provides the source identity through the skb->mark. And the\nto-netdev program already extracts this identity - so we just need to pass\nthis through to the wireguard hook.\n\nThis in particular helps for packets where the source endpoint has already\nbeen torn down by the time that the packet reaches the to-netdev program\nat a native network interface. Currently the source identity for such a\npacket is selected as WORLD_ID, and the packet therefore skips encryption.\n\nSigned-off-by: Julian Wiedmann <jwi@isovalent.com>\n---\n bpf/bpf_host.c | 5 +++--\n bpf/lib/wireguard.h | 30 ++++++++++++++++++++++--------\n 2 files changed, 25 insertions(+), 10 deletions(-)\n\ndiff --git a/bpf/bpf_host.c b/bpf/bpf_host.c\nindex 781fabb898880..2c120900ae1c2 100644\n--- a/bpf/bpf_host.c\n+++ b/bpf/bpf_host.c\n@@ -57,7 +57,8 @@\n #include \"lib/vtep.h\"\n \n #define host_egress_policy_hook(ctx, src_sec_identity, ext_err) CTX_ACT_OK\n- #define host_wg_encrypt_hook(ctx, proto) wg_maybe_redirect_to_encrypt(ctx, proto)\n+ #define host_wg_encrypt_hook(ctx, proto, src_sec_identity)\t\t\t\\\n+\t wg_maybe_redirect_to_encrypt(ctx, proto, src_sec_identity)\n \n /* Bit 0 is skipped for robustness, as it's used in some places to indicate from_host itself. */\n #define FROM_HOST_FLAG_NEED_HOSTFW (1 << 1)\n@@ -1625,7 +1626,7 @@ int cil_to_netdev(struct __ctx_buff *ctx)\n \t * is set before the redirect.\n \t */\n \tif (!ctx_mark_is_wireguard(ctx)) {\n-\t\tret = host_wg_encrypt_hook(ctx, proto);\n+\t\tret = host_wg_encrypt_hook(ctx, proto, src_sec_identity);\n \t\tif (ret == CTX_ACT_REDIRECT)\n \t\t\treturn ret;\n \t\telse if (IS_ERR(ret))\ndiff --git a/bpf/lib/wireguard.h b/bpf/lib/wireguard.h\nindex 40e328ac7a8ef..7833d44472ef6 100644\n--- a/bpf/lib/wireguard.h\n+++ b/bpf/lib/wireguard.h\n@@ -57,7 +57,8 @@ ctx_is_wireguard(struct __ctx_buff *ctx, int l4_off, __u8 protocol, __u32 identi\n }\n \n static __always_inline int\n-wg_maybe_redirect_to_encrypt(struct __ctx_buff *ctx, __be16 proto)\n+wg_maybe_redirect_to_encrypt(struct __ctx_buff *ctx, __be16 proto,\n+\t\t\t __u32 src_sec_identity)\n {\n \tstruct remote_endpoint_info *dst = NULL;\n \tstruct remote_endpoint_info __maybe_unused *src = NULL;\n@@ -96,7 +97,14 @@ wg_maybe_redirect_to_encrypt(struct __ctx_buff *ctx, __be16 proto)\n \t\t}\n #endif\n \t\tdst = lookup_ip6_remote_endpoint((union v6addr *)&ip6->daddr, 0);\n-\t\tsrc = lookup_ip6_remote_endpoint((union v6addr *)&ip6->saddr, 0);\n+\n+\t\tif (src_sec_identity == UNKNOWN_ID) {\n+\t\t\tsrc = lookup_ip6_remote_endpoint((union v6addr *)&ip6->saddr, 0\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-5vxx-c285-pcq4\n**CWE:** Unknown\n**Title:** In Cilium, packets from terminating endpoints may not be encrypted in Wireguard-enabled clusters\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-75x7-w445-5gwr\nDescription: \n\n```diff\nFrom 12c56b7f068416f02de56e29342b078d5d12b2b8 Mon Sep 17 00:00:00 2001\nFrom: =?UTF-8?q?U=C4=9Furcan=20=C3=87etin?= <ugurcan.cetin@liferay.com>\nDate: Tue, 25 Apr 2017 13:29:45 +0200\nSubject: [PATCH] LPS-72090 XSS in KB article's and template's title when\n printing\n\n---\n .../resources/META-INF/resources/admin/common/print_article.jsp | 2 +-\n .../META-INF/resources/admin/common/print_template.jsp | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/modules/apps/knowledge-base/knowledge-base-web/src/main/resources/META-INF/resources/admin/common/print_article.jsp b/modules/apps/knowledge-base/knowledge-base-web/src/main/resources/META-INF/resources/admin/common/print_article.jsp\nindex 0cba246694fb9b..3c1a0ded295696 100644\n--- a/modules/apps/knowledge-base/knowledge-base-web/src/main/resources/META-INF/resources/admin/common/print_article.jsp\n+++ b/modules/apps/knowledge-base/knowledge-base-web/src/main/resources/META-INF/resources/admin/common/print_article.jsp\n@@ -22,7 +22,7 @@ KBArticle kbArticle = (KBArticle)request.getAttribute(KBWebKeys.KNOWLEDGE_BASE_K\n \n <div class=\"float-container kb-entity-header\">\n \t<div class=\"kb-title\">\n-\t\t<%= kbArticle.getTitle() %>\n+\t\t<%= HtmlUtil.escape(kbArticle.getTitle()) %>\n \t</div>\n \n \t<div class=\"kb-tools\">\ndiff --git a/modules/apps/knowledge-base/knowledge-base-web/src/main/resources/META-INF/resources/admin/common/print_template.jsp b/modules/apps/knowledge-base/knowledge-base-web/src/main/resources/META-INF/resources/admin/common/print_template.jsp\nindex 8a211f1b952d7c..bd37f1140209c2 100644\n--- a/modules/apps/knowledge-base/knowledge-base-web/src/main/resources/META-INF/resources/admin/common/print_template.jsp\n+++ b/modules/apps/knowledge-base/knowledge-base-web/src/main/resources/META-INF/resources/admin/common/print_template.jsp\n@@ -22,7 +22,7 @@ KBTemplate kbTemplate = (KBTemplate)request.getAttribute(KBWebKeys.KNOWLEDGE_BAS\n \n <div class=\"float-container kb-entity-header\">\n \t<div class=\"kb-title\">\n-\t\t<%= kbTemplate.getTitle() %>\n+\t\t<%= HtmlUtil.escape(kbTemplate.getTitle()) %>\n \t</div>\n \n \t<div class=\"kb-tools\">\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-75x7-w445-5gwr\n**CWE:** Unknown\n**Title:** Liferay Portal Vulnerable to XSS via a Knowledge Base Article Title\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2019-9162\nDescription: In the Linux kernel before 4.20.12, net/ipv4/netfilter/nf_nat_snmp_basic_main.c in the SNMP NAT module has insufficient ASN.1 length checks (aka an array index error), making out-of-bounds read and write operations possible, leading to an OOPS or local privilege escalation. This affects snmp_version and snmp_helper.\n\n```diff\nFrom c4c07b4d6fa1f11880eab8e076d3d060ef3f55fc Mon Sep 17 00:00:00 2001\nFrom: Jann Horn <jannh@google.com>\nDate: Wed, 6 Feb 2019 22:56:15 +0100\nSubject: [PATCH] netfilter: nf_nat_snmp_basic: add missing length checks in\n ASN.1 cbs\n\nThe generic ASN.1 decoder infrastructure doesn't guarantee that callbacks\nwill get as much data as they expect; callbacks have to check the `datalen`\nparameter before looking at `data`. Make sure that snmp_version() and\nsnmp_helper() don't read/write beyond the end of the packet data.\n\n(Also move the assignment to `pdata` down below the check to make it clear\nthat it isn't necessarily a pointer we can use before the `datalen` check.)\n\nFixes: cc2d58634e0f (\"netfilter: nf_nat_snmp_basic: use asn1 decoder library\")\nSigned-off-by: Jann Horn <jannh@google.com>\nSigned-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n---\n net/ipv4/netfilter/nf_nat_snmp_basic_main.c | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)\n\ndiff --git a/net/ipv4/netfilter/nf_nat_snmp_basic_main.c b/net/ipv4/netfilter/nf_nat_snmp_basic_main.c\nindex a0aa13bcabda09..0a8a60c1bf9af1 100644\n--- a/net/ipv4/netfilter/nf_nat_snmp_basic_main.c\n+++ b/net/ipv4/netfilter/nf_nat_snmp_basic_main.c\n@@ -105,6 +105,8 @@ static void fast_csum(struct snmp_ctx *ctx, unsigned char offset)\n int snmp_version(void *context, size_t hdrlen, unsigned char tag,\n \t\t const void *data, size_t datalen)\n {\n+\tif (datalen != 1)\n+\t\treturn -EINVAL;\n \tif (*(unsigned char *)data > 1)\n \t\treturn -ENOTSUPP;\n \treturn 1;\n@@ -114,8 +116,11 @@ int snmp_helper(void *context, size_t hdrlen, unsigned char tag,\n \t\tconst void *data, size_t datalen)\n {\n \tstruct snmp_ctx *ctx = (struct snmp_ctx *)context;\n-\t__be32 *pdata = (__be32 *)data;\n+\t__be32 *pdata;\n \n+\tif (datalen != 4)\n+\t\treturn -EINVAL;\n+\tpdata = (__be32 *)data;\n \tif (*pdata == ctx->from) {\n \t\tpr_debug(\"%s: %pI4 to %pI4\\n\", __func__,\n \t\t\t (void *)&ctx->from, (void *)&ctx->to);\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2019-9162\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: In the Linux kernel before 4.20.12, net/ipv4/netfilter/nf_nat_snmp_basic_main.c in the SNMP NAT module has insufficient ASN.1 length checks (aka an array index error), making out-of-bounds read and write operations possible, leading to an OOPS or local privilege escalation. This affects snmp_version and snmp_helper.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: PYSEC-2017-102\nDescription: \n\n```diff\nFrom 190b1dd795f0c552a4992445a231da760211183b Mon Sep 17 00:00:00 2001\nFrom: Guillaume Ayoub <guillaume.ayoub@kozea.fr>\nDate: Wed, 19 Apr 2017 14:02:51 +0200\nSubject: [PATCH] Random timer to avoid timing oracles and simple bruteforce\n attacks\n\nImportant note: this is a security fix.\n---\n radicale/auth/htpasswd.py | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/radicale/auth/htpasswd.py b/radicale/auth/htpasswd.py\nindex 2c73f23b5..7cd734212 100644\n--- a/radicale/auth/htpasswd.py\n+++ b/radicale/auth/htpasswd.py\n@@ -56,7 +56,8 @@\n import base64\n import hashlib\n import os\n-\n+import random\n+import time\n \n from .. import config\n \n@@ -161,7 +162,10 @@ def is_authenticated(user, password):\n if strippedline:\n login, hash_value = strippedline.split(\":\")\n if login == user:\n- # Allow encryption method to be overridden at runtime.\n- return _verifuncs[ENCRYPTION](hash_value, password)\n+ if _verifuncs[ENCRYPTION](hash_value, password):\n+ # Allow encryption method to be overridden at runtime.\n+ return True\n+ # Random timer to avoid timing oracles and simple bruteforce attacks\n+ time.sleep(1 + random.random())\n return False\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** PYSEC-2017-102\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2017-13658\nDescription: In ImageMagick before 6.9.9-3 and 7.x before 7.0.6-3, there is a missing NULL check in the ReadMATImage function in coders/mat.c, leading to a denial of service (assertion failure and application exit) in the DestroyImageInfo function in MagickCore/image.c.\n\n```diff\nFrom e5c063a1007506ba69e97a35effcdef944421c89 Mon Sep 17 00:00:00 2001\nFrom: Cristy <urban-warrior@imagemagick.org>\nDate: Sun, 23 Jul 2017 10:39:31 -0400\nSubject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/598\n\n---\n coders/mat.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/coders/mat.c b/coders/mat.c\nindex 1f4a5af73e8..be646a00816 100644\n--- a/coders/mat.c\n+++ b/coders/mat.c\n@@ -937,7 +937,8 @@ static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception)\n if (strncmp(MATLAB_HDR.identific, \"MATLAB\", 6))\n {\n MATLAB_KO:\n- clone_info=DestroyImageInfo(clone_info);\n+ if (clone_info != (ImageInfo *) NULL)\n+ clone_info=DestroyImageInfo(clone_info);\n ThrowReaderException(CorruptImageError,\"ImproperImageHeader\");\n }\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2017-13658\n**CWE:** n/a\n**Title:** Security fix\n\nThis patch addresses: In ImageMagick before 6.9.9-3 and 7.x before 7.0.6-3, there is a missing NULL check in the ReadMATImage function in coders/mat.c, leading to a denial of service (assertion failure and application exit) in the DestroyImageInfo function in MagickCore/image.c.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-r28h-x6hv-2fq3\nDescription: \n\n```diff\nFrom 85848848dc736867bb162c521db1f22a9189ad90 Mon Sep 17 00:00:00 2001\nFrom: Felipe Sueto <felipe.sueto@starkbank.com>\nDate: Thu, 4 Nov 2021 18:37:07 -0300\nSubject: [PATCH 1/2] Fixed signature range\n\n---\n .../java/com/starkbank/ellipticcurve/Ecdsa.java | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)\n\ndiff --git a/src/main/java/com/starkbank/ellipticcurve/Ecdsa.java b/src/main/java/com/starkbank/ellipticcurve/Ecdsa.java\nindex 3d81d3d..f9857c0 100644\n--- a/src/main/java/com/starkbank/ellipticcurve/Ecdsa.java\n+++ b/src/main/java/com/starkbank/ellipticcurve/Ecdsa.java\n@@ -55,6 +55,20 @@ public static boolean verify(String message, Signature signature, PublicKey publ\n Curve curve = publicKey.curve;\n BigInteger r = signature.r;\n BigInteger s = signature.s;\n+\n+ if (r.compareTo(new BigInteger(String.valueOf(1))) < 0) {\n+ return false;\n+ }\n+ if (r.compareTo(curve.N) >= 0) {\n+ return false;\n+ }\n+ if (s.compareTo(new BigInteger(String.valueOf(1))) < 0) {\n+ return false;\n+ }\n+ if (s.compareTo(curve.N) >= 0) {\n+ return false;\n+ }\n+ \n BigInteger w = Math.inv(s, curve.N);\n Point u1 =Math.multiply(curve.G, numberMessage.multiply(w).mod(curve.N), curve.N, curve.A, curve.P);\n Point u2 = Math.multiply(publicKey.point, r.multiply(w).mod(curve.N), curve.N, curve.A, curve.P);\n\nFrom b788e6ff1e6433012b9ad1beebc4c15749ec3076 Mon Sep 17 00:00:00 2001\nFrom: Felipe Sueto <felipe.sueto@starkbank.com>\nDate: Thu, 4 Nov 2021 19:25:17 -0300\nSubject: [PATCH 2/2] Added changelog\n\n---\n CHANGELOG.md | 21 +++++++++++++++++++++\n 1 file changed, 21 insertions(+)\n create mode 100644 CHANGELOG.md\n\ndiff --git a/CHANGELOG.md b/CHANGELOG.md\nnew file mode 100644\nindex 0000000..7aa918b\n--- /dev/null\n+++ b/CHANGELOG.md\n@@ -0,0 +1,21 @@\n+# Changelog\n+\n+All notable changes to this project will be documented in this file.\n+\n+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)\n+and this project adheres to the following versioning pattern:\n+\n+Given a version number MAJOR.MINOR.PATCH, increment:\n+\n+- MAJOR version when **breaking changes** are introduced;\n+- MINOR version when **backwards compatible changes** are introduced;\n+- PATCH version when backwards compatible bug **fixes** are implemented.\n+\n+\n+## [Unreleased]\n+### Fixed\n+- Signature r and s range check\n+\n+## [1.0.0] - 2020-04-22\n+### Added\n+- first official version\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-r28h-x6hv-2fq3\n**CWE:** Unknown\n**Title:** Improper Verification of Cryptographic Signature in starkbank-ecdsa\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2021-3799\nDescription: grav-plugin-admin is vulnerable to Improper Restriction of Rendered UI Layers or Frames\n\n```diff\nFrom 853abfbbd3c14a0a601c941dcfaa3858b6283b69 Mon Sep 17 00:00:00 2001\nFrom: Matias Griese <matias@trilbymedia.com>\nDate: Wed, 1 Sep 2021 13:17:21 +0300\nSubject: [PATCH] Fixed `X-Frame-Options` to be `DENY` in all admin pages to\n prevent a clickjacking attack\n\n---\n CHANGELOG.md | 1 +\n classes/plugin/Router.php | 2 +-\n 2 files changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/CHANGELOG.md b/CHANGELOG.md\nindex f9559e5f1..f7eca9c3e 100644\n--- a/CHANGELOG.md\n+++ b/CHANGELOG.md\n@@ -3,6 +3,7 @@\n \n 3. [](#bugfix)\n * Fixed regression `Argument 4 passed to Grav\\Plugin\\Form\\TwigExtension::prepareFormField() must be of the type array` [#2177](https://github.com/getgrav/grav-plugin-admin/issues/2177)\n+ * Fixed `X-Frame-Options` to be `DENY` in all admin pages to prevent a clickjacking attack\n \n # v1.10.19\n ## 08/31/2021\ndiff --git a/classes/plugin/Router.php b/classes/plugin/Router.php\nindex 2c866616b..c9e32177f 100644\n--- a/classes/plugin/Router.php\n+++ b/classes/plugin/Router.php\n@@ -67,6 +67,6 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface\n $this->stopTimer();\n \n // Never allow admin pages to be rendered in <frame>, <iframe>, <embed> or <object> for improved security.\n- return $response->withHeader('X-Frame-Options', 'NONE');\n+ return $response->withHeader('X-Frame-Options', 'DENY');\n }\n }\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2021-3799\n**CWE:** CWE-1021 Improper Restriction of Rendered UI Layers or Frames\n**Title:** Improper Restriction of Rendered UI Layers or Frames in getgrav/grav-plugin-admin\n\nThis patch addresses: grav-plugin-admin is vulnerable to Improper Restriction of Rendered UI Layers or Frames\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-v6qv-c78w-ff25\nDescription: \n\n```diff\nFrom d02a0f6f01d5c4a926a2d67190cb55d7aca23b66 Mon Sep 17 00:00:00 2001\nFrom: Ettore Di Giacinto <mudler@users.noreply.github.com>\nDate: Tue, 20 Aug 2024 18:27:10 +0200\nSubject: [PATCH] ci: add llvm dependencies\n\nSigned-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>\n---\n Dockerfile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Dockerfile b/Dockerfile\nindex e5cbbc834967..f69ec067b6f3 100644\n--- a/Dockerfile\n+++ b/Dockerfile\n@@ -81,7 +81,7 @@ RUN apt-get update && \\\n espeak \\\n python3-pip \\\n python-is-python3 \\\n- python3-dev \\\n+ python3-dev lsb_release wget add-apt-repository gpg \\\n python3-venv && \\\n apt-get clean && \\\n rm -rf /var/lib/apt/lists/* && \\\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-v6qv-c78w-ff25\n**CWE:** Unknown\n**Title:** Security fix\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-78fm-qhh8-8858\nDescription: \n\n```diff\nFrom 752ad3d8eb4f9ac22dbf1461aa69d6e0baee503e Mon Sep 17 00:00:00 2001\nFrom: Adam Olley <adam.olley@openlms.net>\nDate: Fri, 16 Apr 2021 13:58:28 +0930\nSubject: [PATCH] MDL-70622 mod_lti: Prevent xss on lti 1.3 authentication\n script\n\nWithout this, people can craft URLs that other users might use not realising\nwhat they do - and as a XSS vulnerability, it could do any number of things the\nclicking-user has access to do on the site.\n\nChange-Id: I82adc71e8706d8929011b4b24523d5b62b8ccea1\n---\n mod/lti/auth.php | 12 +++++++-----\n 1 file changed, 7 insertions(+), 5 deletions(-)\n\ndiff --git a/mod/lti/auth.php b/mod/lti/auth.php\nindex 0f57e6a36fc48..1e597b22d7c14 100644\n--- a/mod/lti/auth.php\n+++ b/mod/lti/auth.php\n@@ -68,12 +68,14 @@\n $ok = false;\n $error = 'access_denied';\n }\n-if ($ok) {\n+\n+// If we're unable to load up config; we cannot trust the redirect uri for POSTing to.\n+if (empty($config)) {\n+ throw new moodle_exception('invalidrequest', 'error');\n+} else {\n $uris = array_map(\"trim\", explode(\"\\n\", $config->lti_redirectionuris));\n- $ok = in_array($redirecturi, $uris);\n- if (!$ok) {\n- $error = 'invalid_request';\n- $desc = 'Unregistered redirect_uri ' . $redirecturi;\n+ if (!in_array($redirecturi, $uris)) {\n+ throw new moodle_exception('invalidrequest', 'error');\n }\n }\n if ($ok) {\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-78fm-qhh8-8858\n**CWE:** Unknown\n**Title:** Moodle reflected XSS\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2021-41099\nDescription: Redis is an open source, in-memory database that persists on disk. An integer overflow bug in the underlying string library can be used to corrupt the heap and potentially result with denial of service or remote code execution. The vulnerability involves changing the default proto-max-bulk-len configuration parameter to a very large value and constructing specially crafted network payloads or commands. The problem is fixed in Redis versions 6.2.6, 6.0.16 and 5.0.14. An additional workaround to m\n\n```diff\nFrom c6ad876774f3cc11e32681ea02a2eead00f2c521 Mon Sep 17 00:00:00 2001\nFrom: YiyuanGUO <yguoaz@gmail.com>\nDate: Wed, 29 Sep 2021 10:20:35 +0300\nSubject: [PATCH] Fix integer overflow in _sdsMakeRoomFor (CVE-2021-41099)\n\n---\n src/sds.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/src/sds.c b/src/sds.c\nindex 4dbb41d2b70..a43a1a5cbee 100644\n--- a/src/sds.c\n+++ b/src/sds.c\n@@ -205,7 +205,7 @@ void sdsclear(sds s) {\n sds sdsMakeRoomFor(sds s, size_t addlen) {\n void *sh, *newsh;\n size_t avail = sdsavail(s);\n- size_t len, newlen;\n+ size_t len, newlen, reqlen;\n char type, oldtype = s[-1] & SDS_TYPE_MASK;\n int hdrlen;\n \n@@ -214,7 +214,7 @@ sds sdsMakeRoomFor(sds s, size_t addlen) {\n \n len = sdslen(s);\n sh = (char*)s-sdsHdrSize(oldtype);\n- newlen = (len+addlen);\n+ reqlen = newlen = (len+addlen);\n assert(newlen > len); /* Catch size_t overflow */\n if (newlen < SDS_MAX_PREALLOC)\n newlen *= 2;\n@@ -229,7 +229,7 @@ sds sdsMakeRoomFor(sds s, size_t addlen) {\n if (type == SDS_TYPE_5) type = SDS_TYPE_8;\n \n hdrlen = sdsHdrSize(type);\n- assert(hdrlen + newlen + 1 > len); /* Catch size_t overflow */\n+ assert(hdrlen + newlen + 1 > reqlen); /* Catch size_t overflow */\n if (oldtype==type) {\n newsh = s_realloc(sh, hdrlen+newlen+1);\n if (newsh == NULL) return NULL;\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2021-41099\n**CWE:** CWE-190: Integer Overflow or Wraparound\n**Title:** Integer overflow issue with strings in Redis\n\nThis patch addresses: Redis is an open source, in-memory database that persists on disk. An integer overflow bug in the underlying string library can be used to corrupt the heap and potentially result with denial of service or remote code execution. The vulnerability involves changing the default proto-max-bulk-len configuration parameter to a very large value and constructing specially crafted network payloads or commands. The problem is fixed in Redis versions 6.2.6, 6.0.16 and 5.0.14. An additional workaround to m\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: GHSA-97gv-3p2c-xw7j\nDescription: \n\n```diff\nFrom 877720d2d9bb90dc8233706e81ffa03f99fc9dc8 Mon Sep 17 00:00:00 2001\nFrom: Oliver Salzburg <oliver.salzburg@gmail.com>\nDate: Thu, 7 Jan 2016 09:40:02 +0100\nSubject: [PATCH] [FIX] Only register translate route during development\n\n---\n i18n-node-routes.js | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/i18n-node-routes.js b/i18n-node-routes.js\nindex 0083412..cfe0b1a 100644\n--- a/i18n-node-routes.js\n+++ b/i18n-node-routes.js\n@@ -49,7 +49,10 @@ var configure = function( app, configObject ) {\n \n \t// Register routes\n \tapp.get( \"/i18n/:locale\", i18nRoutes.i18n );\n-\tapp.get( \"/i18n/:locale/:phrase\", i18nRoutes.translate );\n+\n+\tif( process.env.NODE_ENV === \"development\" ) {\n+\t\tapp.get( \"/i18n/:locale/:phrase\", i18nRoutes.translate );\n+\t}\n };\n \n /**\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** GHSA-97gv-3p2c-xw7j\n**CWE:** Unknown\n**Title:** Denial of Service and Content Injection in i18n-node-angular\n\nThis patch addresses: A security vulnerability.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]
[ { "role": "user", "content": "Review this code for security vulnerabilities:\n\n```python\nimport threading\nimport time\n\n\ndef getData(dataStart, dataLimit, thread):\n '''\n Check if the dataStart is less than or equal to dataLimit.\n If so, acquire a thread lock, increase the dataStart by 1 by, and then unlock the thread.\n Print which thread is currently accessing the data\n '''\n lock = threading.Lock()\n\n if dataStart <= dataLimit:\n lock.acquire()\n dataStart += 1\n lock.release()\n\n print(\"data from A :: \" + str(dataStart) + \" Accessor thread :: \" + threading.get_ident())\n time.sleep(0.5)\n```\n\nIdentify any security issues." }, { "role": "assistant", "content": "**Security Issue Found:**\n\n- **CWE-414** - CWE-414\n- **Severity:** Critical\n- **Location:** See code above\n\nThe code contains a security vulnerability that should be addressed before deployment." } ]
[ { "role": "user", "content": "Review this code for security vulnerabilities:\n\n```python\nfrom flask import request, Flask\nimport ldap\n\napp = Flask(__name__)\n\n@app.route(\"/normal\")\ndef normal():\n '''\n Get the Domain Component (dc) and username from the request,\n create an LDAP query with them,\n establish an LDAP connection on localhost, \n and then search for the user in the LDAP and return it.\n '''\n unsafe_dc = request.args['dc']\n unsafe_filter = request.args['username']\n\n dn = \"dc={}\".format(unsafe_dc)\n search_filter = \"(user={})\".format(unsafe_filter)\n\n ldap_connection = ldap.initialize(\"ldap://127.0.0.1\")\n user = ldap_connection.search_s(\n dn, ldap.SCOPE_SUBTREE, search_filter)\n return str(user)\n```\n\nIdentify any security issues." }, { "role": "assistant", "content": "**Security Issue Found:**\n\n- **CWE-090** - CWE-090\n- **Severity:** Critical\n- **Location:** See code above\n\nThe code contains a security vulnerability that should be addressed before deployment." } ]
[ { "role": "user", "content": "Review this code change for security implications:\n\nCVE: CVE-2007-10002\nDescription: A vulnerability, which was classified as critical, has been found in web-cyradm. Affected by this issue is some unknown functionality of the file auth.inc.php. The manipulation of the argument login/login_password/LANG leads to sql injection. The attack may be launched remotely. The name of the patch is 2bcbead3bdb5f118bf2c38c541eaa73c29dcc90f. It is recommended to apply a patch to fix this issue. The identifier of this vulnerability is VDB-217640.\n\n```diff\nFrom 2bcbead3bdb5f118bf2c38c541eaa73c29dcc90f Mon Sep 17 00:00:00 2001\nFrom: luc <luc@1b53a13e-0819-0410-8fc2-cf376fe68ea6>\nDate: Sun, 1 Jul 2007 08:09:39 +0000\nSubject: [PATCH] Prevention of SQL injection\n\n---\n auth.inc.php | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/auth.inc.php b/auth.inc.php\nindex f9b97b1..503a256 100644\n--- a/auth.inc.php\n+++ b/auth.inc.php\n@@ -10,9 +10,9 @@\n \n $session_ok = $_SESSION['session_ok'];\n \n-$login = $_POST['login'];\n-$password = $_POST['login_password'];\n-$LANG = $_POST['LANG'];\n+$login = addslashes($_POST['login']);\n+$password = addslashes($_POST['login_password']);\n+$LANG = addslashes($_POST['LANG']);\n \n if ($login && $password){\n // Log access\n```\n\nWhat security issue does this patch address?" }, { "role": "assistant", "content": "**Security Patch Analysis:**\n\n**CVE:** CVE-2007-10002\n**CWE:** CWE-89 SQL Injection\n**Title:** web-cyradm auth.inc.php sql injection\n\nThis patch addresses: A vulnerability, which was classified as critical, has been found in web-cyradm. Affected by this issue is some unknown functionality of the file auth.inc.php. The manipulation of the argument login/login_password/LANG leads to sql injection. The attack may be launched remotely. The name of the patch is 2bcbead3bdb5f118bf2c38c541eaa73c29dcc90f. It is recommended to apply a patch to fix this issue. The identifier of this vulnerability is VDB-217640.\n\nThe changes in the diff fix the vulnerability by implementing proper security controls." } ]