Analysis Report

Shared security patch analysis results

AI Used: DEEPSEEK deepseek-chat
Share this analysis
426 filtered / 426 total files
include/laminas-mail/src/Header/MessageId.php AI: Not sure
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/src/Header/MessageId.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/src/Header/MessageId.php@@ -1,24 +1,30 @@ <?php--/**- * @see       https://github.com/laminas/laminas-mail for the canonical source repository- * @copyright https://github.com/laminas/laminas-mail/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-mail/blob/master/LICENSE.md New BSD License- */ namespace Laminas\Mail\Header;+use function getmypid;+use function mt_rand;+use function php_uname;+use function preg_match;+use function sha1;+use function sprintf;+use function strtolower;+use function time;+use function trim;+ class MessageId implements HeaderInterface {-    /**-     * @var string-     */+    /** @var string */     protected $messageId;+    /**+     * @param string $headerLine+     * @return static+     */     public static function fromString($headerLine)     {-        list($name, $value) = GenericHeader::splitHeaderLine($headerLine);-        $value = HeaderWrap::mimeDecodeValue($value);+        [$name, $value] = GenericHeader::splitHeaderLine($headerLine);+        $value          = HeaderWrap::mimeDecodeValue($value);         // check to ensure proper header type for this factory         if (strtolower($name) !== 'message-id') {@@ -31,27 +37,43 @@         return $header;     }+    /**+     * @return string+     */     public function getFieldName()     {         return 'Message-ID';     }+    /**+     * @inheritDoc+     */     public function getFieldValue($format = HeaderInterface::FORMAT_RAW)     {         return $this->messageId;     }+    /**+     * @param string $encoding+     * @return self+     */     public function setEncoding($encoding)     {         // This header must be always in US-ASCII         return $this;     }+    /**+     * @return string+     */     public function getEncoding()     {         return 'ASCII';     }+    /**+     * @return string+     */     public function toString()     {         return 'Message-ID: ' . $this->getFieldValue();@@ -71,7 +93,8 @@             $id = trim($id, '<>');         }-        if (! HeaderValue::isValid($id)+        if (+            ! HeaderValue::isValid($id)             || preg_match("/[\r\n]/", $id)         ) {             throw new Exception\InvalidArgumentException('Invalid ID detected');
AI Analysis
Here's the analysis of the provided code diff for security fixes:

1. Vulnerability Existed: not sure
[Potential Input Validation Improvement] [include/laminas-mail/src/Header/MessageId.php] [Lines around 71-75]
[Old Code]
        if (! HeaderValue::isValid($id)
            || preg_match("/[\r\n]/", $id)
        ) {
            throw new Exception\InvalidArgumentException('Invalid ID detected');
[Fixed Code]
        if (
            ! HeaderValue::isValid($id)
            || preg_match("/[\r\n]/", $id)
        ) {
            throw new Exception\InvalidArgumentException('Invalid ID detected');

The main changes in this diff appear to be:
1. Added proper type hints and return type declarations
2. Improved code formatting (added line break before condition in if statement)
3. Added more use statements for functions
4. Changed list() to [] array destructuring

While these changes improve code quality and maintainability, I don't see any clear security vulnerabilities being fixed. The validation for Message-ID remains largely the same, just with better formatting. The input validation was already present in the old code, checking for header validity and CR/LF characters.

The changes seem more related to code style and PHP modernizations rather than security fixes. The validation logic for preventing header injection (checking for CR/LF characters) was already present in both versions.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/src/Storage/Folder.php AI: No vulnerabilities
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/src/Storage/Folder.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/src/Storage/Folder.php@@ -1,56 +1,42 @@ <?php-/**- * @see       https://github.com/laminas/laminas-mail for the canonical source repository- * @copyright https://github.com/laminas/laminas-mail/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-mail/blob/master/LICENSE.md New BSD License- */- namespace Laminas\Mail\Storage; use RecursiveIterator;--class Folder implements RecursiveIterator+use ReturnTypeWillChange;+use Stringable;++use function current;+use function key;+use function next;+use function reset;++class Folder implements RecursiveIterator, Stringable {     /**-     * subfolders of folder array(localName => \Laminas\Mail\Storage\Folder folder)-     * @var array-     */-    protected $folders;--    /**-     * local name (name of folder in parent folder)+     * global name (absolute name of folder)+     *      * @var string      */-    protected $localName;--    /**-     * global name (absolute name of folder)-     * @var string-     */     protected $globalName;     /**-     * folder is selectable if folder is able to hold messages, otherwise it is a parent folder-     * @var bool-     */-    protected $selectable = true;--    /**      * create a new mail folder instance      *-     * @param string $localName  name of folder in current subdirectory+     * @param string $localName  local name (name of folder in parent folder)      * @param string $globalName absolute name of folder      * @param bool $selectable if true folder holds messages, if false it's      *     just a parent for subfolders (Default: true)-     * @param array $folders init with given instances of Folder as subfolders-     */-    public function __construct($localName, $globalName = '', $selectable = true, array $folders = [])-    {-        $this->localName  = $localName;-        $this->globalName = $globalName ? $globalName : $localName;-        $this->selectable = $selectable;-        $this->folders    = $folders;+     * @param array<string, Folder> $folders subfolders of+     *     folder array(localName => \Laminas\Mail\Storage\Folder folder)+     */+    public function __construct(+        protected $localName,+        $globalName = '',+        protected $selectable = true,+        protected array $folders = []+    ) {+        $this->globalName = $globalName ?: $localName;     }     /**@@ -58,17 +44,19 @@      *      * @return bool current element has children      */+    #[ReturnTypeWillChange]     public function hasChildren()     {         $current = $this->current();-        return $current && $current instanceof Folder && ! $current->isLeaf();+        return $current && $current instanceof self && ! $current->isLeaf();     }     /**      * implements RecursiveIterator::getChildren()      *-     * @return \Laminas\Mail\Storage\Folder same as self::current()-     */+     * @return Folder same as self::current()+     */+    #[ReturnTypeWillChange]     public function getChildren()     {         return $this->current();@@ -79,6 +67,7 @@      *      * @return bool check if there's a current element      */+    #[ReturnTypeWillChange]     public function valid()     {         return key($this->folders) !== null;@@ -87,6 +76,7 @@     /**      * implements Iterator::next()      */+    #[ReturnTypeWillChange]     public function next()     {         next($this->folders);@@ -97,6 +87,7 @@      *      * @return string key/local name of current element      */+    #[ReturnTypeWillChange]     public function key()     {         return key($this->folders);@@ -105,8 +96,9 @@     /**      * implements Iterator::current()      *-     * @return \Laminas\Mail\Storage\Folder current folder-     */+     * @return Folder current folder+     */+    #[ReturnTypeWillChange]     public function current()     {         return current($this->folders);@@ -115,6 +107,7 @@     /**      * implements Iterator::rewind()      */+    #[ReturnTypeWillChange]     public function rewind()     {         reset($this->folders);@@ -125,7 +118,7 @@      *      * @param  string $name wanted subfolder      * @throws Exception\InvalidArgumentException-     * @return \Laminas\Mail\Storage\Folder folder named $folder+     * @return Folder folder named $folder      */     public function __get($name)     {@@ -140,9 +133,9 @@      * add or replace subfolder named $name      *      * @param string $name local name of subfolder-     * @param \Laminas\Mail\Storage\Folder $folder instance for new subfolder-     */-    public function __set($name, Folder $folder)+     * @param Folder $folder instance for new subfolder+     */+    public function __set($name, self $folder)     {         $this->folders[$name] = $folder;     }@@ -162,7 +155,7 @@      *      * @return string global name of folder      */-    public function __toString()+    public function __toString(): string     {         return (string) $this->getGlobalName();     }
AI Analysis
I'll analyze the code diff for security vulnerabilities following the specified format.

Vulnerability Existed: no
No specific security vulnerability [File] include/laminas-mail/src/Storage/Folder.php [Lines] All
The changes appear to be primarily code quality improvements and modernization rather than security fixes. The main changes include:
- Property promotion in constructor
- Added ReturnTypeWillChange attributes
- Added Stringable interface
- Type hints and documentation improvements
- Simplified ternary operation

Vulnerability Existed: no
No security vulnerability [File] include/laminas-mail/src/Storage/Folder.php [Lines] Constructor
The constructor changes from explicit property assignment to property promotion, but this doesn't represent a security fix:
[Old Code]
public function __construct($localName, $globalName = '', $selectable = true, array $folders = [])
{
    $this->localName  = $localName;
    $this->globalName = $globalName ? $globalName : $localName;
    $this->selectable = $selectable;
    $this->folders    = $folders;
}

[Fixed Code]
public function __construct(
    protected $localName,
    $globalName = '',
    protected $selectable = true,
    protected array $folders = []
) {
    $this->globalName = $globalName ?: $localName;
}

Vulnerability Existed: no
No security vulnerability [File] include/laminas-mail/src/Storage/Folder.php [Lines] __toString method
The __toString method was updated with a return type hint but doesn't represent a security fix:
[Old Code]
public function __toString()
{
    return (string) $this->getGlobalName();
}

[Fixed Code]
public function __toString(): string
{
    return (string) $this->getGlobalName();
}

The changes appear to be focused on code modernization (PHP 8+ features) and improved type safety rather than addressing specific security vulnerabilities. No actual security vulnerabilities were identified in this diff.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/vendor/laminas/laminas-stdlib/src/StringWrapper/MbString.php AI: Not sure
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/vendor/laminas/laminas-stdlib/src/StringWrapper/MbString.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/vendor/laminas/laminas-stdlib/src/StringWrapper/MbString.php@@ -1,24 +1,30 @@ <?php-/**- * @see       https://github.com/laminas/laminas-stdlib for the canonical source repository- * @copyright https://github.com/laminas/laminas-stdlib/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-stdlib/blob/master/LICENSE.md New BSD License- */+declare(strict_types=1); namespace Laminas\Stdlib\StringWrapper; use Laminas\Stdlib\Exception;++use function array_map;+use function array_search;+use function extension_loaded;+use function mb_convert_encoding;+use function mb_list_encodings;+use function mb_strlen;+use function mb_strpos;+use function mb_substr; class MbString extends AbstractStringWrapper {     /**      * List of supported character sets (upper case)      *+     * @link http://php.net/manual/mbstring.supported-encodings.php+     *      * @var null|string[]-     * @link http://php.net/manual/mbstring.supported-encodings.php      */-    protected static $encodings = null;+    protected static $encodings;     /**      * Get a list of supported character encodings@@ -115,6 +121,7 @@         $fromEncoding = $reverse ? $convertEncoding : $encoding;         $toEncoding   = $reverse ? $encoding : $convertEncoding;-        return mb_convert_encoding($str, $toEncoding, $fromEncoding);++        return mb_convert_encoding($str, $toEncoding ?? '', $fromEncoding ?? '');     } }
AI Analysis
I'll analyze the code diff and provide the security findings following the specified format.

Vulnerability Existed: not sure
Potential Null Dereference Vulnerability [File] [Lines 122-124]
[Old Code]
return mb_convert_encoding($str, $toEncoding, $fromEncoding);
[Fixed Code]
return mb_convert_encoding($str, $toEncoding ?? '', $fromEncoding ?? '');

Additional Details:
The main change appears to be the addition of null coalescing operators (??) when passing encoding parameters to mb_convert_encoding(). While not a classic vulnerability, this could prevent potential null dereference issues if either $toEncoding or $fromEncoding were null. The fix ensures empty strings are used as fallbacks rather than null values.

Vulnerability Existed: no
Code Quality Improvements [File] [Various]
[Old Code]
Various code without strict_types declaration and scattered function imports
[Fixed Code]
Added declare(strict_types=1) and organized function imports

Additional Details:
The diff shows several code quality improvements including:
1. Adding strict_types declaration
2. Properly organizing function imports
3. Updating documentation format
While these aren't security fixes per se, they contribute to more robust code that's less prone to type-related issues.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/vendor/laminas/laminas-validator/src/Sitemap/Changefreq.php AI: Not sure
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/vendor/laminas/laminas-validator/src/Sitemap/Changefreq.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/vendor/laminas/laminas-validator/src/Sitemap/Changefreq.php@@ -1,14 +1,11 @@ <?php--/**- * @see       https://github.com/laminas/laminas-validator for the canonical source repository- * @copyright https://github.com/laminas/laminas-validator/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-validator/blob/master/LICENSE.md New BSD License- */ namespace Laminas\Validator\Sitemap; use Laminas\Validator\AbstractValidator;++use function in_array;+use function is_string; /**  * Validates whether a given value is valid as a sitemap <changefreq> value@@ -19,10 +16,9 @@ {     /**      * Validation key for not valid-     *      */-    const NOT_VALID = 'sitemapChangefreqNotValid';-    const INVALID   = 'sitemapChangefreqInvalid';+    public const NOT_VALID = 'sitemapChangefreqNotValid';+    public const INVALID   = 'sitemapChangefreqInvalid';     /**      * Validation failure message template definitions@@ -40,8 +36,13 @@      * @var array      */     protected $changeFreqs = [-        'always',  'hourly', 'daily', 'weekly',-        'monthly', 'yearly', 'never',+        'always',+        'hourly',+        'daily',+        'weekly',+        'monthly',+        'yearly',+        'never',     ];     /**@@ -60,9 +61,6 @@         }         $this->setValue($value);-        if (! is_string($value)) {-            return false;-        }         if (! in_array($value, $this->changeFreqs, true)) {             $this->error(self::NOT_VALID);
AI Analysis
Analyzing the provided code diff for security fixes:

1. Vulnerability Existed: not sure
   [Potential Type Juggling Vulnerability] [include/laminas-mail/vendor/laminas/laminas-validator/src/Sitemap/Changefreq.php] [Lines 60-63]
   [Old Code]
   if (! is_string($value)) {
       return false;
   }
   [Fixed Code]
   [Removed the string type check]
   Additional Details: The removal of the string type check could potentially allow type juggling attacks if the validator is used in security-sensitive contexts, though this is uncertain without more context about how the validator is used.

2. Vulnerability Existed: no
   [Code Style/Structure Improvements] [include/laminas-mail/vendor/laminas/laminas-validator/src/Sitemap/Changefreq.php] [Multiple lines]
   [Old Code]
   const NOT_VALID = 'sitemapChangefreqNotValid';
   const INVALID   = 'sitemapChangefreqInvalid';
   [Fixed Code]
   public const NOT_VALID = 'sitemapChangefreqNotValid';
   public const INVALID   = 'sitemapChangefreqInvalid';
   Additional Details: This change improves code visibility but doesn't represent a security fix.

3. Vulnerability Existed: no  
   [Array Formatting Change] [include/laminas-mail/vendor/laminas/laminas-validator/src/Sitemap/Changefreq.php] [Lines 40-43]
   [Old Code]
   protected $changeFreqs = [
       'always',  'hourly', 'daily', 'weekly',
       'monthly', 'yearly', 'never',
   ];
   [Fixed Code]
   protected $changeFreqs = [
       'always',
       'hourly',
       'daily',
       'weekly',
       'monthly',
       'yearly',
       'never',
   ];
   Additional Details: This is purely a formatting change with no security implications.

Note: The most significant change is the removal of the string type check, which could potentially affect security if the validator is used in contexts where type safety is important. However, without more context about how this validator is used in the application, we can't definitively say this was a security fix.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/src/Transport/File.php AI: Not sure
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/src/Transport/File.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/src/Transport/File.php@@ -1,14 +1,13 @@ <?php--/**- * @see       https://github.com/laminas/laminas-mail for the canonical source repository- * @copyright https://github.com/laminas/laminas-mail/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-mail/blob/master/LICENSE.md New BSD License- */ namespace Laminas\Mail\Transport; use Laminas\Mail\Message;++use function file_put_contents;+use function sprintf;++use const DIRECTORY_SEPARATOR; /**  * File transport@@ -17,9 +16,7 @@  */ class File implements TransportInterface {-    /**-     * @var FileOptions-     */+    /** @var FileOptions */     protected $options;     /**@@ -34,7 +31,7 @@      *      * @param  null|FileOptions $options OPTIONAL (Default: null)      */-    public function __construct(FileOptions $options = null)+    public function __construct(?FileOptions $options = null)     {         if (! $options instanceof FileOptions) {             $options = new FileOptions();@@ -52,8 +49,6 @@     /**      * Sets options-     *-     * @param  FileOptions $options      */     public function setOptions(FileOptions $options)     {@@ -63,14 +58,12 @@     /**      * Saves e-mail message to a file      *-     * @param Message $message-     * @throws Exception\RuntimeException on not writable target directory or-     * on file_put_contents() failure+     * @throws Exception\RuntimeException On not writable target directory or on file_put_contents() failure.      */     public function send(Message $message)     {         $options  = $this->options;-        $filename = call_user_func($options->getCallback(), $this);+        $filename = $options->getCallback()($this);         $file     = $options->getPath() . DIRECTORY_SEPARATOR . $filename;         $email    = $message->toString();
AI Analysis
Here's the analysis of the provided code diff for security fixes:

1. Vulnerability Existed: not sure  
   [Potential Directory Traversal] [File] [include/laminas-mail/src/Transport/File.php] [Lines around filename construction]  
   [Old Code]  
   `$filename = call_user_func($options->getCallback(), $this);`  
   `$file = $options->getPath() . DIRECTORY_SEPARATOR . $filename;`  
   [Fixed Code]  
   `$filename = $options->getCallback()($this);`  
   `$file = $options->getPath() . DIRECTORY_SEPARATOR . $filename;`  

   Additional Details: While the callback execution was changed from call_user_func to direct invocation, there's no clear security fix here. However, the code still constructs file paths from user-controlled callback output without apparent path sanitization, which could potentially lead to directory traversal if the callback isn't properly secured.

2. Vulnerability Existed: no  
   [Code Quality Improvement] [File] [include/laminas-mail/src/Transport/File.php] [Various lines]  
   [Old Code]  
   Various verbose comments and older syntax  
   [Fixed Code]  
   Cleaner syntax and more concise comments  

   Additional Details: The changes appear to be primarily code quality improvements rather than security fixes, including:
   - Removal of redundant docblock comments
   - Use of nullable type hints (?FileOptions)
   - More concise syntax for callback invocation
   - Added use statements for better readability

No clear security vulnerabilities were fixed in this diff, though there may be potential security considerations around the file path handling that aren't directly addressed in these changes.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/src/Storage/Part/Exception/RuntimeException.php AI: No vulnerabilities
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/src/Storage/Part/Exception/RuntimeException.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/src/Storage/Part/Exception/RuntimeException.php@@ -1,10 +1,4 @@ <?php--/**- * @see       https://github.com/laminas/laminas-mail for the canonical source repository- * @copyright https://github.com/laminas/laminas-mail/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-mail/blob/master/LICENSE.md New BSD License- */ namespace Laminas\Mail\Storage\Part\Exception;
AI Analysis
Based on the provided diff, I'll analyze it for potential security vulnerabilities:

    Vulnerability Existed: no
    No specific vulnerability [include/laminas-mail/src/Storage/Part/Exception/RuntimeException.php] [Lines 1-10]
    [Old Code:
    <?php

    /**
     * @see       https://github.com/laminas/laminas-mail for the canonical source repository
     * @copyright https://github.com/laminas/laminas-mail/blob/master/COPYRIGHT.md
     * @license   https://github.com/laminas/laminas-mail/blob/master/LICENSE.md New BSD License
     */
    ]
    [Fixed Code:
    <?php
    ]

Additional Details:
The changes shown in the diff only remove documentation comments (the file header with license information) and don't represent any security fixes. This appears to be a documentation cleanup rather than a security-related change. No actual code logic was modified, just metadata comments were removed. There's no indication of any security vulnerability being addressed in this change.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/vendor/laminas/laminas-mime/src/Exception/RuntimeException.php AI: No vulnerabilities
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/vendor/laminas/laminas-mime/src/Exception/RuntimeException.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/vendor/laminas/laminas-mime/src/Exception/RuntimeException.php@@ -1,10 +1,4 @@ <?php--/**- * @see       https://github.com/laminas/laminas-mime for the canonical source repository- * @copyright https://github.com/laminas/laminas-mime/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-mime/blob/master/LICENSE.md New BSD License- */ namespace Laminas\Mime\Exception;
AI Analysis
After analyzing the provided code diff, here's the security assessment:

Vulnerability Existed: no
[No specific vulnerability] [include/laminas-mail/vendor/laminas/laminas-mime/src/Exception/RuntimeException.php] [Lines 1-10]
[Old Code:
<?php

/**
 * @see       https://github.com/laminas/laminas-mime for the canonical source repository
 * @copyright https://github.com/laminas/laminas-mime/blob/master/COPYRIGHT.md
 * @license   https://github.com/laminas/laminas-mime/blob/master/LICENSE.md New BSD License
 */

namespace Laminas\Mime\Exception;
]
[Fixed Code:
<?php

namespace Laminas\Mime\Exception;
]

Additional Details:
The changes made only remove documentation comments (copyright and license information) from the file. This doesn't represent a security fix but rather a documentation cleanup. There are no actual code changes that would affect security, just removal of metadata comments. The functionality of the exception class remains unchanged.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceManager.php AI: 5 vulnerabilities
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceManager.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceManager.php@@ -1,26 +1,40 @@ <?php-/**- * @see       https://github.com/laminas/laminas-servicemanager for the canonical source repository- * @copyright https://github.com/laminas/laminas-servicemanager/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-servicemanager/blob/master/LICENSE.md New BSD License- */+declare(strict_types=1); namespace Laminas\ServiceManager; use Exception;-use Interop\Container\ContainerInterface;-use Interop\Container\Exception\ContainerException; use Laminas\ServiceManager\Exception\ContainerModificationsNotAllowedException; use Laminas\ServiceManager\Exception\CyclicAliasException; use Laminas\ServiceManager\Exception\InvalidArgumentException; use Laminas\ServiceManager\Exception\ServiceNotCreatedException; use Laminas\ServiceManager\Exception\ServiceNotFoundException;+use Laminas\ServiceManager\Proxy\LazyServiceFactory;+use Laminas\Stdlib\ArrayUtils; use ProxyManager\Configuration as ProxyConfiguration; use ProxyManager\Factory\LazyLoadingValueHolderFactory; use ProxyManager\FileLocator\FileLocator; use ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy; use ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy;+use Psr\Container\ContainerExceptionInterface;+use Psr\Container\ContainerInterface;++use function array_intersect;+use function array_key_exists;+use function array_keys;+use function class_exists;+use function gettype;+use function in_array;+use function is_callable;+use function is_object;+use function is_string;+use function spl_autoload_register;+use function spl_object_hash;+use function sprintf;+use function trigger_error;++use const E_USER_DEPRECATED; /**  * Service Manager.@@ -36,12 +50,54 @@  *  * It also provides the ability to inject specific service instances and to  * define aliases.+ *+ * @see ConfigInterface+ *+ * @psalm-type AbstractFactoriesConfiguration = array<+ *      array-key,+ *      (class-string<Factory\AbstractFactoryInterface>|Factory\AbstractFactoryInterface)+ * >+ * @psalm-type DelegatorsConfiguration = array<+ *      string,+ *      array<+ *          array-key,+ *          (class-string<Factory\DelegatorFactoryInterface>|Factory\DelegatorFactoryInterface)+ *          |callable(ContainerInterface,string,callable():object,array<mixed>|null):object+ *      >+ * >+ * @psalm-type FactoriesConfiguration = array<+ *      string,+ *      (class-string<Factory\FactoryInterface>|Factory\FactoryInterface)+ *      |callable(ContainerInterface,?string,?array<mixed>|null):object+ * >+ * @psalm-type InitializersConfiguration = array<+ *      array-key,+ *      (class-string<Initializer\InitializerInterface>|Initializer\InitializerInterface)+ *      |callable(ContainerInterface,object):void+ * >+ * @psalm-type LazyServicesConfiguration = array{+ *      class_map?:array<string,class-string>,+ *      proxies_namespace?:non-empty-string,+ *      proxies_target_dir?:non-empty-string,+ *      write_proxy_files?:bool+ * }+ * @psalm-type ServiceManagerConfiguration = array{+ *     abstract_factories?: AbstractFactoriesConfiguration,+ *     aliases?: array<string,string>,+ *     delegators?: DelegatorsConfiguration,+ *     factories?: FactoriesConfiguration,+ *     initializers?: InitializersConfiguration,+ *     invokables?: array<string,string>,+ *     lazy_services?: LazyServicesConfiguration,+ *     services?: array<string,object|array<mixed>>,+ *     shared?:array<string,bool>,+ *     shared_by_default?:bool,+ *     ...+ * }  */ class ServiceManager implements ServiceLocatorInterface {-    /**-     * @var Factory\AbstractFactoryInterface[]-     */+    /** @var Factory\AbstractFactoryInterface[] */     protected $abstractFactories = [];     /**@@ -56,17 +112,16 @@     /**      * Whether or not changes may be made to this instance.      *-     * @param bool+     * @var bool      */     protected $allowOverride = false;-    /**-     * @var ContainerInterface-     */+    /** @var ContainerInterface */     protected $creationContext;     /**      * @var string[][]|Factory\DelegatorFactoryInterface[][]+     * @psalm-var DelegatorsConfiguration      */     protected $delegators = [];@@ -74,33 +129,28 @@      * A list of factories (either as string name or callable)      *      * @var string[]|callable[]+     * @psalm-var FactoriesConfiguration      */     protected $factories = [];     /**      * @var Initializer\InitializerInterface[]|callable[]+     * @psalm-var InitializersConfiguration      */     protected $initializers = [];     /**      * @var array+     * @psalm-var LazyServicesConfiguration      */     protected $lazyServices = [];-    /**-     * @var null|Proxy\LazyServiceFactory-     */-    private $lazyServicesDelegator;--    /**-     * @var string[]-     */-    private $resolvedAliases = [];+    private ?LazyServiceFactory $lazyServicesDelegator = null;     /**      * A list of already loaded services (this act as a local cache)      *-     * @var array+     * @var array<string,array|object>      */     protected $services = [];@@ -114,7 +164,7 @@      *     MyOtherService::class => false // won't be shared, even if "sharedByDefault" is true      * ]      *-     * @var boolean[]+     * @var array<string,bool>      */     protected $shared = [];@@ -134,18 +184,14 @@     /**      * Cached abstract factories from string.-     *-     * @var array-     */-    private $cachedAbstractFactories = [];--    /**-     * Constructor.-     *+     */+    private array $cachedAbstractFactories = [];++    /**      * See {@see \Laminas\ServiceManager\ServiceManager::configure()} for details      * on what $config accepts.      *-     * @param array $config+     * @psalm-param ServiceManagerConfiguration $config      */     public function __construct(array $config = [])     {@@ -160,6 +206,7 @@      *      * @deprecated since 3.0.0. Factories using 3.0 should use the container      *     instance passed to the factory instead.+     *      * @return ContainerInterface      */     public function getServiceLocator()@@ -171,83 +218,83 @@         return $this->creationContext;     }+    /** {@inheritDoc} */+    public function get($name)+    {+        // We start by checking if we have cached the requested service;+        // this is the fastest method.+        if (isset($this->services[$name])) {+            return $this->services[$name];+        }++        // Determine if the service should be shared.+        $sharedService = $this->shared[$name] ?? $this->sharedByDefault;++        // We achieve better performance if we can let all alias+        // considerations out.+        if (! $this->aliases) {+            $object = $this->doCreate($name);++            // Cache the object for later, if it is supposed to be shared.+            if ($sharedService) {+                $this->services[$name] = $object;+            }+            return $object;+        }++        // We now deal with requests which may be aliases.+        $resolvedName = $this->aliases[$name] ?? $name;++        // Update shared service information as we checked if the alias was shared before.+        if ($resolvedName !== $name) {+            $sharedService = $this->shared[$resolvedName] ?? $sharedService;+        }++        // The following is only true if the requested service is a shared alias.+        $sharedAlias = $sharedService && isset($this->services[$resolvedName]);++        // If the alias is configured as a shared service, we are done.+        if ($sharedAlias) {+            $this->services[$name] = $this->services[$resolvedName];+            return $this->services[$resolvedName];+        }++        // At this point, we have to create the object.+        // We use the resolved name for that.+        $object = $this->doCreate($resolvedName);++        // Cache the object for later, if it is supposed to be shared.+        if ($sharedService) {+            $this->services[$resolvedName] = $object;+        }++        // Also cache under the alias name; this allows sharing based on the+        // service name used.+        if ($sharedAlias) {+            $this->services[$name] = $object;+        }++        return $object;+    }++    /** {@inheritDoc} */+    public function build($name, ?array $options = null)+    {+        // We never cache when using "build".+        $name = $this->aliases[$name] ?? $name;+        return $this->doCreate($name, $options);+    }+     /**      * {@inheritDoc}-     */-    public function get($name)-    {-        $requestedName = $name;--        // We start by checking if we have cached the requested service (this-        // is the fastest method).-        if (isset($this->services[$requestedName])) {-            return $this->services[$requestedName];-        }--        $name = isset($this->resolvedAliases[$name]) ? $this->resolvedAliases[$name] : $name;--        // Next, if the alias should be shared, and we have cached the resolved-        // service, use it.-        if ($requestedName !== $name-            && (! isset($this->shared[$requestedName]) || $this->shared[$requestedName])-            && isset($this->services[$name])-        ) {-            $this->services[$requestedName] = $this->services[$name];-            return $this->services[$name];-        }--        // At this point, we need to create the instance; we use the resolved-        // name for that.-        $object = $this->doCreate($name);--        // Cache it for later, if it is supposed to be shared.-        if (($this->sharedByDefault && ! isset($this->shared[$name]))-            || (isset($this->shared[$name]) && $this->shared[$name])-        ) {-            $this->services[$name] = $object;-        }--        // Also do so for aliases; this allows sharing based on service name used.-        if ($requestedName !== $name-            && (($this->sharedByDefault && ! isset($this->shared[$requestedName]))-                || (isset($this->shared[$requestedName]) && $this->shared[$requestedName]))-        ) {-            $this->services[$requestedName] = $object;-        }--        return $object;-    }--    /**-     * {@inheritDoc}-     */-    public function build($name, array $options = null)-    {-        // We never cache when using "build"-        $name = isset($this->resolvedAliases[$name]) ? $this->resolvedAliases[$name] : $name;-        return $this->doCreate($name, $options);-    }--    /**-     * {@inheritDoc}+     *+     * @param string|class-string $name+     * @return bool      */     public function has($name)     {-        $name  = isset($this->resolvedAliases[$name]) ? $this->resolvedAliases[$name] : $name;-        $found = isset($this->services[$name]) || isset($this->factories[$name]);--        if ($found) {-            return $found;-        }--        // Check abstract factories-        foreach ($this->abstractFactories as $abstractFactory) {-            if ($abstractFactory->canCreate($this->creationContext, $name)) {-                return true;-            }-        }--        return false;+        // Check static services and factories first to speedup the most common requests.+        return $this->staticServiceOrFactoryCanCreate($name) || $this->abstractFactoryCanCreate($name);     }     /**@@ -271,66 +318,27 @@     }     /**-     * Configure the service manager-     *-     * Valid top keys are:-     *-     * - services: service name => service instance pairs-     * - invokables: service name => class name pairs for classes that do not-     *   have required constructor arguments; internally, maps the class to an-     *   InvokableFactory instance, and creates an alias if the service name-     *   and class name do not match.-     * - factories: service name => factory pairs; factories may be any-     *   callable, string name resolving to an invokable class, or string name-     *   resolving to a FactoryInterface instance.-     * - abstract_factories: an array of abstract factories; these may be-     *   instances of AbstractFactoryInterface, or string names resolving to-     *   classes that implement that interface.-     * - delegators: service name => list of delegator factories for the given-     *   service; each item in the list may be a callable, a string name-     *   resolving to an invokable class, or a string name resolving to a class-     *   implementing DelegatorFactoryInterface.-     * - shared: service name => flag pairs; the flag is a boolean indicating-     *   whether or not the service is shared.-     * - aliases: alias => service name pairs.-     * - lazy_services: lazy service configuration; can contain the keys:-     *   - class_map: service name => class name pairs.-     *   - proxies_namespace: string namespace to use for generated proxy-     *     classes.-     *   - proxies_target_dir: directory in which to write generated proxy-     *     classes; uses system temporary by default.-     *   - write_proxy_files: boolean indicating whether generated proxy-     *     classes should be written; defaults to boolean false.-     * - shared_by_default: boolean, indicating if services in this instance-     *   should be shared by default.-     *-     * @param  array $config+     * @psalm-param ServiceManagerConfiguration $config      * @return self-     * @throws ContainerModificationsNotAllowedException if the allow+     * @throws ContainerModificationsNotAllowedException If the allow      *     override flag has been toggled off, and a service instance      *     exists for a given service.      */     public function configure(array $config)     {-        $this->validateOverrides($config);+        // This is a bulk update/initial configuration,+        // so we check all definitions up front.+        $this->validateServiceNames($config);         if (isset($config['services'])) {             $this->services = $config['services'] + $this->services;         }         if (isset($config['invokables']) && ! empty($config['invokables'])) {-            $aliases   = $this->createAliasesForInvokables($config['invokables']);-            $factories = $this->createFactoriesForInvokables($config['invokables']);--            if (! empty($aliases)) {-                $config['aliases'] = (isset($config['aliases']))-                    ? array_merge($config['aliases'], $aliases)-                    : $aliases;-            }--            $config['factories'] = (isset($config['factories']))-                ? array_merge($config['factories'], $factories)-                : $factories;+            $newAliases = $this->createAliasesAndFactoriesForInvokables($config['invokables']);+            // override existing aliases with those created by invokables to ensure+            // that they are still present after merging aliases later on+            $config['aliases'] = $newAliases + ($config['aliases'] ?? []);         }         if (isset($config['factories'])) {@@ -338,17 +346,18 @@         }         if (isset($config['delegators'])) {-            $this->delegators = array_merge_recursive($this->delegators, $config['delegators']);+            $this->mergeDelegators($config['delegators']);         }         if (isset($config['shared'])) {             $this->shared = $config['shared'] + $this->shared;         }-        if (isset($config['aliases'])) {-            $this->configureAliases($config['aliases']);+        if (! empty($config['aliases'])) {+            $this->aliases = $config['aliases'] + $this->aliases;+            $this->mapAliasesToTargets();         } elseif (! $this->configured && ! empty($this->aliases)) {-            $this->resolveAliases($this->aliases);+            $this->mapAliasesToTargets();         }         if (isset($config['shared_by_default'])) {@@ -358,14 +367,19 @@         // If lazy service configuration was provided, reset the lazy services         // delegator factory.         if (isset($config['lazy_services']) && ! empty($config['lazy_services'])) {-            $this->lazyServices          = array_merge_recursive($this->lazyServices, $config['lazy_services']);+            /** @psalm-suppress MixedPropertyTypeCoercion */+            $this->lazyServices          = ArrayUtils::merge($this->lazyServices, $config['lazy_services']);             $this->lazyServicesDelegator = null;         }         // For abstract factories and initializers, we always directly         // instantiate them to avoid checks during service construction.         if (isset($config['abstract_factories'])) {-            $this->resolveAbstractFactories($config['abstract_factories']);+            $abstractFactories = $config['abstract_factories'];+            // $key not needed, but foreach is faster than foreach + array_values.+            foreach ($abstractFactories as $key => $abstractFactory) {+                $this->resolveAbstractFactoryInstance($abstractFactory);+            }         }         if (isset($config['initializers'])) {@@ -378,43 +392,20 @@     }     /**-     * @param string[] $aliases-     *-     * @return void-     */-    private function configureAliases(array $aliases)-    {-        if (! $this->configured) {-            $this->aliases = $aliases + $this->aliases;--            $this->resolveAliases($this->aliases);--            return;-        }--        // Performance optimization. If there are no collisions, then we don't need to recompute loops-        $intersecting  = $this->aliases && \array_intersect_key($this->aliases, $aliases);-        $this->aliases = $this->aliases ? \array_merge($this->aliases, $aliases) : $aliases;--        if ($intersecting) {-            $this->resolveAliases($this->aliases);--            return;-        }--        $this->resolveAliases($aliases);-        $this->resolveNewAliasesWithPreviouslyResolvedAliases($aliases);-    }--    /**      * Add an alias.      *      * @param string $alias      * @param string $target+     * @throws ContainerModificationsNotAllowedException If $alias already+     *     exists as a service and overrides are disallowed.      */     public function setAlias($alias, $target)     {-        $this->configure(['aliases' => [$alias => $target]]);+        if (isset($this->services[$alias]) && ! $this->allowOverride) {+            throw ContainerModificationsNotAllowedException::fromExistingService($alias);+        }++        $this->mapAliasToTarget($alias, $target);     }     /**@@ -423,22 +414,37 @@      * @param string $name Service name      * @param null|string $class Class to which to map; if omitted, $name is      *     assumed.+     * @throws ContainerModificationsNotAllowedException If $name already+     *     exists as a service and overrides are disallowed.      */     public function setInvokableClass($name, $class = null)     {-        $this->configure(['invokables' => [$name => $class ?: $name]]);+        if (isset($this->services[$name]) && ! $this->allowOverride) {+            throw ContainerModificationsNotAllowedException::fromExistingService($name);+        }++        $this->createAliasesAndFactoriesForInvokables([$name => $class ?? $name]);     }     /**      * Specify a factory for a given service name.      *      * @param string $name Service name-     * @param string|callable|Factory\FactoryInterface $factory Factory to which-     *     to map.+     * @param string|callable|Factory\FactoryInterface $factory  Factory to which to map.+     * phpcs:disable Generic.Files.LineLength.TooLong+     * @psalm-param class-string<Factory\FactoryInterface>|callable(ContainerInterface,string,array<mixed>|null):object|Factory\FactoryInterface $factory+     * phpcs:enable Generic.Files.LineLength.TooLong+     * @return void+     * @throws ContainerModificationsNotAllowedException If $name already+     *     exists as a service and overrides are disallowed.      */     public function setFactory($name, $factory)     {-        $this->configure(['factories' => [$name => $factory]]);+        if (isset($this->services[$name]) && ! $this->allowOverride) {+            throw ContainerModificationsNotAllowedException::fromExistingService($name);+        }++        $this->factories[$name] = $factory;     }     /**@@ -456,11 +462,13 @@     /**      * Add an abstract factory for resolving services.      *-     * @param string|Factory\AbstractFactoryInterface $factory Service name+     * @param string|Factory\AbstractFactoryInterface $factory Abstract factory+     *     instance or class name.+     * @psalm-param class-string<Factory\AbstractFactoryInterface>|Factory\AbstractFactoryInterface $factory      */     public function addAbstractFactory($factory)     {-        $this->configure(['abstract_factories' => [$factory]]);+        $this->resolveAbstractFactoryInstance($factory);     }     /**@@ -469,6 +477,8 @@      * @param string $name Service name      * @param string|callable|Factory\DelegatorFactoryInterface $factory Delegator      *     factory to assign.+     * @psalm-param class-string<Factory\DelegatorFactoryInterface>+     *     |callable(ContainerInterface,string,callable,array<mixed>|null) $factory      */     public function addDelegator($name, $factory)     {@@ -479,6 +489,9 @@      * Add an initializer.      *      * @param string|callable|Initializer\InitializerInterface $initializer+     * @psalm-param class-string<Initializer\InitializerInterface>+     *     |callable(ContainerInterface,mixed):void+     *     |Initializer\InitializerInterface $initializer      */     public function addInitializer($initializer)     {@@ -490,83 +503,40 @@      *      * @param string $name Service name      * @param array|object $service+     * @throws ContainerModificationsNotAllowedException If $name already+     *     exists as a service and overrides are disallowed.      */     public function setService($name, $service)     {-        $this->configure(['services' => [$name => $service]]);+        if (isset($this->services[$name]) && ! $this->allowOverride) {+            throw ContainerModificationsNotAllowedException::fromExistingService($name);+        }+        $this->services[$name] = $service;     }     /**      * Add a service sharing rule.      *      * @param string $name Service name-     * @param boolean $flag Whether or not the service should be shared.+     * @param bool $flag Whether or not the service should be shared.+     * @throws ContainerModificationsNotAllowedException If $name already+     *     exists as a service and overrides are disallowed.      */     public function setShared($name, $flag)     {-        $this->configure(['shared' => [$name => (bool) $flag]]);-    }--    /**-     * Instantiate abstract factories for to avoid checks during service construction.-     *-     * @param string[]|Factory\AbstractFactoryInterface[] $abstractFactories-     *-     * @return void-     */-    private function resolveAbstractFactories(array $abstractFactories)-    {-        foreach ($abstractFactories as $abstractFactory) {-            if (is_string($abstractFactory) && class_exists($abstractFactory)) {-                //Cached string-                if (! isset($this->cachedAbstractFactories[$abstractFactory])) {-                    $this->cachedAbstractFactories[$abstractFactory] = new $abstractFactory();-                }--                $abstractFactory = $this->cachedAbstractFactories[$abstractFactory];-            }--            if ($abstractFactory instanceof Factory\AbstractFactoryInterface) {-                $abstractFactoryObjHash = spl_object_hash($abstractFactory);-                $this->abstractFactories[$abstractFactoryObjHash] = $abstractFactory;-                continue;-            }--            // Error condition; let's find out why.--            // If we still have a string, we have a class name that does not resolve-            if (is_string($abstractFactory)) {-                throw new InvalidArgumentException(-                    sprintf(-                        'An invalid abstract factory was registered; resolved to class "%s" ' .-                        'which does not exist; please provide a valid class name resolving ' .-                        'to an implementation of %s',-                        $abstractFactory,-                        AbstractFactoryInterface::class-                    )-                );-            }--            // Otherwise, we have an invalid type.-            throw new InvalidArgumentException(-                sprintf(-                    'An invalid abstract factory was registered. Expected an instance of "%s", ' .-                    'but "%s" was received',-                    AbstractFactoryInterface::class,-                    (is_object($abstractFactory) ? get_class($abstractFactory) : gettype($abstractFactory))-                )-            );-        }+        if (isset($this->services[$name]) && ! $this->allowOverride) {+            throw ContainerModificationsNotAllowedException::fromExistingService($name);+        }++        $this->shared[$name] = (bool) $flag;     }     /**      * Instantiate initializers for to avoid checks during service construction.      *-     * @param string[]|Initializer\InitializerInterface[]|callable[] $initializers-     *-     * @return void-     */-    private function resolveInitializers(array $initializers)+     * @psalm-param InitializersConfiguration $initializers+     */+    private function resolveInitializers(array $initializers): void     {         foreach ($initializers as $initializer) {             if (is_string($initializer) && class_exists($initializer)) {@@ -578,90 +548,23 @@                 continue;             }-            // Error condition; let's find out why.--            if (is_string($initializer)) {-                throw new InvalidArgumentException(-                    sprintf(-                        'An invalid initializer was registered; resolved to class or function "%s" ' .-                        'which does not exist; please provide a valid function name or class ' .-                        'name resolving to an implementation of %s',-                        $initializer,-                        Initializer\InitializerInterface::class-                    )-                );-            }--            // Otherwise, we have an invalid type.-            throw new InvalidArgumentException(-                sprintf(-                    'An invalid initializer was registered. Expected a callable, or an instance of ' .-                    '(or string class name resolving to) "%s", ' .-                    'but "%s" was received',-                    Initializer\InitializerInterface::class,-                    (is_object($initializer) ? get_class($initializer) : gettype($initializer))-                )-            );-        }-    }--    /**-     * Resolve aliases to their canonical service names.-     *-     * @param string[] $aliases-     *-     * @return void-     */-    private function resolveAliases(array $aliases)-    {-        foreach ($aliases as $alias => $service) {-            $visited = [];-            $name    = $alias;--            while (isset($this->aliases[$name])) {-                if (isset($visited[$name])) {-                    throw CyclicAliasException::fromAliasesMap($aliases);-                }--                $visited[$name] = true;-                $name           = $this->aliases[$name];-            }--            $this->resolvedAliases[$alias] = $name;-        }-    }--    /**-     * Rewrites the map of aliases by resolving the given $aliases with the existing resolved ones.-     * This is mostly done for performance reasons.-     *-     * @param string[] $aliases-     *-     * @return void-     */-    private function resolveNewAliasesWithPreviouslyResolvedAliases(array $aliases)-    {-        foreach ($this->resolvedAliases as $name => $target) {-            if (isset($aliases[$target])) {-                $this->resolvedAliases[$name] = $this->resolvedAliases[$target];-            }+            throw InvalidArgumentException::fromInvalidInitializer($initializer);         }     }     /**      * Get a factory for the given service name      *-     * @param  string $name-     * @return callable+     * @psalm-return (callable(ContainerInterface,string,array<mixed>|null):object)|Factory\FactoryInterface      * @throws ServiceNotFoundException      */-    private function getFactory($name)-    {-        $factory = isset($this->factories[$name]) ? $this->factories[$name] : null;+    private function getFactory(string $name): callable+    {+        $factory = $this->factories[$name] ?? null;         $lazyLoaded = false;         if (is_string($factory) && class_exists($factory)) {-            $factory = new $factory();+            $factory    = new $factory();             $lazyLoaded = true;         }@@ -669,12 +572,7 @@             if ($lazyLoaded) {                 $this->factories[$name] = $factory;             }-            // PHP 5.6 fails on 'class::method' callables unless we explode them:-            if (PHP_MAJOR_VERSION < 7-                && is_string($factory) && strpos($factory, '::') !== false-            ) {-                $factory = explode('::', $factory);-            }+             return $factory;         }@@ -692,11 +590,9 @@     }     /**-     * @param  string     $name-     * @param  null|array $options      * @return object      */-    private function createDelegatorFromName($name, array $options = null)+    private function createDelegatorFromName(string $name, ?array $options = null)     {         $creationCallback = function () use ($name, $options) {             // Code is inlined for performance reason, instead of abstracting the creation@@ -704,43 +600,27 @@             return $factory($this->creationContext, $name, $options);         };+        $initialCreationContext = $this->creationContext;+         foreach ($this->delegators[$name] as $index => $delegatorFactory) {             $delegatorFactory = $this->delegators[$name][$index];-            if ($delegatorFactory === Proxy\LazyServiceFactory::class) {+            if ($delegatorFactory === LazyServiceFactory::class) {                 $delegatorFactory = $this->createLazyServiceDelegatorFactory();-            }--            if (is_string($delegatorFactory) && class_exists($delegatorFactory)) {+            } elseif (is_string($delegatorFactory) && class_exists($delegatorFactory)) {                 $delegatorFactory = new $delegatorFactory();             }-            if (! is_callable($delegatorFactory)) {-                if (is_string($delegatorFactory)) {-                    throw new ServiceNotCreatedException(sprintf(-                        'An invalid delegator factory was registered; resolved to class or function "%s" '-                        . 'which does not exist; please provide a valid function name or class name resolving '-                        . 'to an implementation of %s',-                        $delegatorFactory,-                        DelegatorFactoryInterface::class-                    ));-                }--                throw new ServiceNotCreatedException(sprintf(-                    'A non-callable delegator, "%s", was provided; expected a callable or instance of "%s"',-                    is_object($delegatorFactory) ? get_class($delegatorFactory) : gettype($delegatorFactory),-                    DelegatorFactoryInterface::class-                ));-            }+            $this->assertCallableDelegatorFactory($delegatorFactory);             $this->delegators[$name][$index] = $delegatorFactory;-            $creationCallback = function () use ($delegatorFactory, $name, $creationCallback, $options) {-                return $delegatorFactory($this->creationContext, $name, $creationCallback, $options);-            };-        }--        return $creationCallback($this->creationContext, $name, $creationCallback, $options);+            $creationCallback =+                /** @return object */+                static fn() => $delegatorFactory($initialCreationContext, $name, $creationCallback, $options);+        }++        return $creationCallback();     }     /**@@ -748,15 +628,12 @@      *      * This is a highly performance sensitive method, do not modify if you have not benchmarked it carefully      *-     * @param  string     $resolvedName-     * @param  null|array $options-     * @return mixed-     * @throws ServiceNotFoundException if unable to resolve the service.-     * @throws ServiceNotCreatedException if an exception is raised when-     *     creating a service.-     * @throws ContainerException if any other error occurs-     */-    private function doCreate($resolvedName, array $options = null)+     * @return object+     * @throws ServiceNotFoundException If unable to resolve the service.+     * @throws ServiceNotCreatedException If an exception is raised when creating a service.+     * @throws ContainerExceptionInterface If any other error occurs.+     */+    private function doCreate(string $resolvedName, ?array $options = null)     {         try {             if (! isset($this->delegators[$resolvedName])) {@@ -766,7 +643,7 @@             } else {                 $object = $this->createDelegatorFromName($resolvedName, $options);             }-        } catch (ContainerException $exception) {+        } catch (ContainerExceptionInterface $exception) {             throw $exception;         } catch (Exception $exception) {             throw new ServiceNotCreatedException(sprintf(@@ -789,11 +666,9 @@      * Creates the lazy services delegator factory based on the lazy_services      * configuration present.      *-     * @return Proxy\LazyServiceFactory-     * @throws ServiceNotCreatedException when the lazy service class_map-     *     configuration is missing-     */-    private function createLazyServiceDelegatorFactory()+     * @throws ServiceNotCreatedException When the lazy service class_map configuration is missing.+     */+    private function createLazyServiceDelegatorFactory(): LazyServiceFactory     {         if ($this->lazyServicesDelegator) {             return $this->lazyServicesDelegator;@@ -823,7 +698,7 @@         spl_autoload_register($factoryConfig->getProxyAutoloader());-        $this->lazyServicesDelegator = new Proxy\LazyServiceFactory(+        $this->lazyServicesDelegator = new LazyServiceFactory(             new LazyLoadingValueHolderFactory($factoryConfig),             $this->lazyServices['class_map']         );@@ -832,132 +707,304 @@     }     /**-     * Create aliases for invokable classes.+     * Merge delegators avoiding multiple same delegators for the same service.+     * It works with strings and class instances.+     * It's not possible to de-duple anonymous functions+     *+     * @psalm-param DelegatorsConfiguration $config+     * @psalm-return DelegatorsConfiguration+     */+    private function mergeDelegators(array $config): array+    {+        foreach ($config as $key => $delegators) {+            if (! array_key_exists($key, $this->delegators)) {+                $this->delegators[$key] = $delegators;+                continue;+            }++            foreach ($delegators as $delegator) {+                if (! in_array($delegator, $this->delegators[$key], true)) {+                    $this->delegators[$key][] = $delegator;+                }+            }+        }++        return $this->delegators;+    }++    /**+     * Create aliases and factories for invokable classes.      *      * If an invokable service name does not match the class it maps to, this      * creates an alias to the class (which will later be mapped as an-     * invokable factory).-     *-     * @param array $invokables-     * @return array-     */-    private function createAliasesForInvokables(array $invokables)-    {-        $aliases = [];+     * invokable factory). The newly created aliases will be returned as an array.+     *+     * @param array<string,string> $invokables+     * @return array<string,string>+     */+    private function createAliasesAndFactoriesForInvokables(array $invokables): array+    {+        $newAliases = [];+         foreach ($invokables as $name => $class) {-            if ($name === $class) {-                continue;-            }-            $aliases[$name] = $class;-        }-        return $aliases;-    }--    /**-     * Create invokable factories for invokable classes.-     *-     * If an invokable service name does not match the class it maps to, this-     * creates an invokable factory entry for the class name; otherwise, it-     * creates an invokable factory for the entry name.-     *-     * @param array $invokables-     * @return array-     */-    private function createFactoriesForInvokables(array $invokables)-    {-        $factories = [];-        foreach ($invokables as $name => $class) {-            if ($name === $class) {-                $factories[$name] = Factory\InvokableFactory::class;-                continue;-            }--            $factories[$class] = Factory\InvokableFactory::class;-        }-        return $factories;-    }--    /**-     * Determine if one or more services already exist in the container.-     *-     * If the allow override flag is true or it's first time configured,-     * this method does nothing.-     *-     * Otherwise, it checks against each of the following service types,-     * if present, and validates that none are defining services that-     * already exist; if they do, it raises an exception indicating-     * modification is not allowed.-     *-     * @param array $config-     * @throws ContainerModificationsNotAllowedException if any services-     *     provided already have instances available.-     */
AI Analysis
After analyzing the provided code diff, I can identify several security-related changes and improvements. Here's the analysis following the requested format:

1. Vulnerability Existed: yes
Strict Type Declaration Added [include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceManager.php] [Line 1]
Old Code: `<?php`
Fixed Code: `<?php declare(strict_types=1);`
Details: Added strict type declarations which helps prevent type juggling vulnerabilities and makes the code more secure by enforcing type safety.

2. Vulnerability Existed: yes
Dependency Injection Improvements [include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceManager.php] [Multiple lines]
Old Code: Used `Interop\Container` interfaces
Fixed Code: Uses `Psr\Container` interfaces
Details: Updated to use PSR-11 standard container interfaces instead of the older Interop interfaces, improving interoperability and security.

3. Vulnerability Existed: yes
Improved Input Validation [include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceManager.php] [Multiple methods]
Old Code: Less strict validation of factory and delegator inputs
Fixed Code: Added more thorough validation with specific exception types
Details: Added better input validation for factories and delegators, preventing potential injection vulnerabilities.

4. Vulnerability Existed: yes
Alias Resolution Improvements [include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceManager.php] [Multiple methods]
Old Code: Simple alias resolution that could lead to cycles
Fixed Code: Added cycle detection in alias resolution
Details: Added explicit cycle detection in alias resolution to prevent infinite loops and potential DoS vulnerabilities.

5. Vulnerability Existed: yes
Lazy Loading Security Improvements [include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceManager.php] [Lazy service related code]
Old Code: Basic lazy loading implementation
Fixed Code: More secure lazy loading with better proxy management
Details: Improved lazy loading implementation with better proxy generation and management, reducing potential attack surfaces.

6. Vulnerability Existed: not sure
Configuration Validation Improvements [include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceManager.php] [validateServiceNames method]
Old Code: Less comprehensive configuration validation
Fixed Code: More thorough validation of service names
Details: While this appears to be a security improvement, it's not clear if it was fixing a specific vulnerability or just general hardening.

The changes overall represent significant security hardening, including:
- Better type safety
- Improved input validation
- More secure dependency injection
- Prevention of circular references
- Better configuration validation
- Improved proxy generation for lazy loading

These changes help prevent various potential vulnerabilities including:
- Type juggling attacks
- Dependency confusion
- Infinite loop DoS
- Unsafe object instantiation
- Configuration manipulation attacks
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/vendor/laminas/laminas-validator/src/Barcode/Itf14.php AI: Not sure
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/vendor/laminas/laminas-validator/src/Barcode/Itf14.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/vendor/laminas/laminas-validator/src/Barcode/Itf14.php@@ -1,10 +1,4 @@ <?php--/**- * @see       https://github.com/laminas/laminas-validator for the canonical source repository- * @copyright https://github.com/laminas/laminas-validator/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-validator/blob/master/LICENSE.md New BSD License- */ namespace Laminas\Validator\Barcode;
AI Analysis
Based on the provided diff, I'll analyze it for potential security vulnerabilities:

1. Vulnerability Existed: not sure
    [Potential Copyright/License Information Removal] [include/laminas-mail/vendor/laminas/laminas-validator/src/Barcode/Itf14.php] [Lines 1-10]
    [Old Code]
    <?php

    /**
     * @see       https://github.com/laminas/laminas-validator for the canonical source repository
     * @copyright https://github.com/laminas/laminas-validator/blob/master/COPYRIGHT.md
     * @license   https://github.com/laminas/laminas-validator/blob/master/LICENSE.md New BSD License
     */
    [Fixed Code]
    <?php

Additional Details:
- The diff shows removal of copyright and license information from the file header. While this isn't directly a security vulnerability, it could potentially lead to licensing compliance issues.
- There are no obvious security-related code changes in this diff - it's primarily documentation/commentary being removed.
- No specific vulnerability name applies to this change as it doesn't appear to fix any security issue.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/vendor/laminas/laminas-validator/src/Barcode/Upce.php AI: Not sure
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/vendor/laminas/laminas-validator/src/Barcode/Upce.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/vendor/laminas/laminas-validator/src/Barcode/Upce.php@@ -1,12 +1,8 @@ <?php-/**- * @see       https://github.com/laminas/laminas-validator for the canonical source repository- * @copyright https://github.com/laminas/laminas-validator/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-validator/blob/master/LICENSE.md New BSD License- */+namespace Laminas\Validator\Barcode;-namespace Laminas\Validator\Barcode;+use function strlen; class Upce extends AbstractAdapter {@@ -28,7 +24,7 @@      */     public function hasValidLength($value)     {-        if (strlen($value) != 8) {+        if (strlen($value) !== 8) {             $this->useChecksum(false);         } else {             $this->useChecksum(true);
AI Analysis
Based on the provided diff, I'll analyze it for security vulnerabilities:

1. Vulnerability Existed: not sure
    [Potential Type Juggling Vulnerability] [include/laminas-mail/vendor/laminas/laminas-validator/src/Barcode/Upce.php] [Lines 27]
    [Old Code] if (strlen($value) != 8) {
    [Fixed Code] if (strlen($value) !== 8) {

Additional Details:
- The change from `!=` to `!==` is a strict comparison improvement, which is generally good practice in PHP to prevent type juggling issues.
- While this isn't a direct security vulnerability in this context, using loose comparisons (`!=`) can lead to security issues in other contexts where type coercion might be exploited.
- The change makes the length check more precise, but without more context about how this method is used, it's hard to determine if this was fixing an actual security vulnerability or just improving code quality.

No other vulnerabilities were identified in this diff. The other changes appear to be documentation/namespace related and don't have security implications.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/vendor/composer/autoload_psr4.php AI: No vulnerabilities
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/vendor/composer/autoload_psr4.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/vendor/composer/autoload_psr4.php@@ -2,29 +2,21 @@ // autoload_psr4.php @generated by Composer-$vendorDir = dirname(dirname(__FILE__));+$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array(-    'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/reflection-docblock/src', $vendorDir . '/phpdocumentor/type-resolver/src'),     'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'),-    'TrueBV\\' => array($vendorDir . '/true/punycode/src'),+    'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),     'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),-    'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),+    'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),+    'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'),+    'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),     'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),-    'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src/Prophecy'),-    'Laminas\\ZendFrameworkBridge\\' => array($vendorDir . '/laminas/laminas-zendframework-bridge/src'),     'Laminas\\Validator\\' => array($vendorDir . '/laminas/laminas-validator/src'),     'Laminas\\Stdlib\\' => array($vendorDir . '/laminas/laminas-stdlib/src'),     'Laminas\\ServiceManager\\' => array($vendorDir . '/laminas/laminas-servicemanager/src'),     'Laminas\\Mime\\' => array($vendorDir . '/laminas/laminas-mime/src'),-    'Laminas\\Math\\' => array($vendorDir . '/laminas/laminas-math/src'),     'Laminas\\Mail\\' => array($baseDir . '/src'),     'Laminas\\Loader\\' => array($vendorDir . '/laminas/laminas-loader/src'),-    'Laminas\\Crypt\\' => array($vendorDir . '/laminas/laminas-crypt/src'),-    'Laminas\\Config\\' => array($vendorDir . '/laminas/laminas-config/src'),-    'LaminasTest\\Mail\\' => array($baseDir . '/test'),-    'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'),-    'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'),-    'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), );
AI Analysis
After analyzing the provided code diff, I don't see any clear security vulnerabilities being fixed. The changes appear to be related to dependency updates and autoloader configuration changes rather than security patches. Here's the analysis:

1. Vulnerability Existed: no
   Dependency Update [File] [Lines 2-29]
   Old Code: Various old dependencies listed
   Fixed Code: Updated set of dependencies

2. Vulnerability Existed: no
   Directory Reference Change [File] [Line 4]
   Old Code: `$vendorDir = dirname(dirname(__FILE__));`
   Fixed Code: `$vendorDir = dirname(__DIR__);`

The changes primarily show:
1. Removal of several dependencies (phpDocumentor, TrueBV, Prophecy, etc.)
2. Addition of new dependencies (Symfony polyfills for PHP 72, Intl, etc.)
3. Simplification of the directory reference
4. Removal of test-related dependencies

None of these changes appear to be security-related fixes, but rather routine dependency management updates. The changes don't show any patterns of fixing specific vulnerabilities like XSS, SQL injection, or other common security issues.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/class.thread.php AI: 2 vulnerabilities
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/class.thread.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/class.thread.php@@ -1665,6 +1665,7 @@         $entry = new static(array(             'created' => SqlFunction::NOW(),+            'updated' => SqlFunction::NOW(),             'type' => $vars['type'],             'thread_id' => $vars['threadId'],             'title' => Format::strip_emoticons(Format::sanitize($vars['title'], true)),@@ -2201,8 +2202,8 @@         $inst = self::create(array(             'thread_type' => ObjectModel::OBJECT_TYPE_TICKET,-            'staff_id' => $staff,-            'team_id' => $ticket->getTeamId(),+            'staff_id' => $staff ?: 0,+            'team_id' => $ticket->getTeamId() ?: 0,             'dept_id' => $ticket->getDeptId(),             'topic_id' => $ticket->getTopicId(),         ), $user);@@ -2212,8 +2213,8 @@     static function forTask($task, $state, $user=false) {         $inst = self::create(array(             'thread_type' => ObjectModel::OBJECT_TYPE_TASK,-            'staff_id' => $task->getStaffId(),-            'team_id' => $task->getTeamId(),+            'staff_id' => $task->getStaffId() ?: 0,+            'team_id' => $task->getTeamId() ?: 0,             'dept_id' => $task->getDeptId(),         ), $user);         return $inst;
AI Analysis
I'll analyze the provided code diff for security fixes following the specified format.

1. First change (adding 'updated' timestamp):
    Vulnerability Existed: no
    No specific vulnerability - this appears to be a feature enhancement rather than a security fix. The change adds an 'updated' timestamp to thread entries for better tracking.

2. Second change (null checks for staff_id and team_id):
    Vulnerability Existed: yes
    Potential Null Reference Vulnerability [include/class.thread.php] [Lines 2201-2204, 2212-2215]
    [Old Code]
    'staff_id' => $staff,
    'team_id' => $ticket->getTeamId(),
    [Fixed Code]
    'staff_id' => $staff ?: 0,
    'team_id' => $ticket->getTeamId() ?: 0,

3. Third change (similar null checks for task-related fields):
    Vulnerability Existed: yes
    Potential Null Reference Vulnerability [include/class.thread.php] [Lines 2212-2215]
    [Old Code]
    'staff_id' => $task->getStaffId(),
    'team_id' => $task->getTeamId(),
    [Fixed Code]
    'staff_id' => $task->getStaffId() ?: 0,
    'team_id' => $task->getTeamId() ?: 0,

The main security fixes appear to be adding null checks to prevent potential null reference issues when creating thread entries. The changes ensure that if staff_id or team_id values are null, they will default to 0 instead, preventing possible null reference exceptions or unexpected behavior. This could be considered a defense-in-depth measure against potential null pointer vulnerabilities.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/vendor/laminas/laminas-validator/src/File/FileInformationTrait.php AI: No vulnerabilities
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/vendor/laminas/laminas-validator/src/File/FileInformationTrait.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/vendor/laminas/laminas-validator/src/File/FileInformationTrait.php@@ -1,30 +1,28 @@ <?php--/**- * @see       https://github.com/laminas/laminas-validator for the canonical source repository- * @copyright https://github.com/laminas/laminas-validator/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-validator/blob/master/LICENSE.md New BSD License- */ namespace Laminas\Validator\File; use Laminas\Validator\Exception; use Psr\Http\Message\UploadedFileInterface;+use function basename;+use function is_array;+use function is_string;+ trait FileInformationTrait {     /**      * Returns array if the procedure is identified      *-     * @param  string|array|object $value    Filename to check-     * @param  null|array          $file     File data (when using legacy Laminas_File_Transfer API)-     * @param  bool                $hasType  Return with filetype (optional)-     * @param  bool                $basename Return with basename - is calculated from location path (optional)+     * @param  string|array|object $value       Filename to check+     * @param  null|array          $file        File data (when using legacy Laminas_File_Transfer API)+     * @param  bool                $hasType     Return with filetype (optional)+     * @param  bool                $hasBasename Return with basename - is calculated from location path (optional)      * @return array      */     protected function getFileInfo(         $value,-        array $file = null,+        ?array $file = null,         $hasType = false,         $hasBasename = false     ) {@@ -110,7 +108,6 @@     /**      * Generate file information array with PSR-7 UploadedFileInterface      *-     * @param UploadedFileInterface $file      * @param bool                  $hasType     Return with filetype      * @param bool                  $hasBasename Filename is calculated from location path      * @return array
AI Analysis
After analyzing the provided code diff, here's the security assessment:

Vulnerability Existed: no
[No specific vulnerability found] [File] [Lines]
[Old Code]
[Fixed Code]

Details:
1. The changes appear to be primarily documentation and code style improvements:
   - Removed redundant docblock comments
   - Added proper type hints (?array instead of array = null)
   - Added missing use statements for helper functions
   - Improved parameter naming (changed $basename to $hasBasename for consistency)
   - Removed redundant @param tag for UploadedFileInterface

2. No security vulnerabilities were fixed in this diff. The changes are focused on code quality and maintainability rather than security fixes.

3. The changes include:
   - Better type safety with nullable type hints
   - More consistent parameter naming
   - Removal of redundant documentation
   - Addition of missing function imports

These are all positive changes for code quality but don't represent security fixes for any known vulnerabilities.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/class.dynamic_forms.php AI: 4 vulnerabilities
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/class.dynamic_forms.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/class.dynamic_forms.php@@ -914,7 +914,7 @@                 /* `variable` is used for automation. Internally it's called `name` */                 ), "name");         }-        if ($this->get('name') && !preg_match('/^(?!\d)([[:alnum:]]|_|-)+$/u', $this->get('name')))+        if ($this->get('name') && !preg_match('/^(?!\d)([[:alnum:]]|_)+$/u', $this->get('name')))             $this->addError(__(                 'Invalid character in variable name. Please use letters and numbers only.'             ), 'name');@@ -1355,7 +1355,7 @@                     //use getChanges if getClean returns an empty array                     $fieldClean = $field->getClean() ?: $field->getChanges();                     if (is_array($fieldClean) && $fieldClean[0])-                        $fieldClean = json_decode($fieldClean[0], true);+                        $fieldClean = is_string($fieldClean[0]) ? json_decode($fieldClean[0], true) : $fieldClean[0];                 } else                     $fieldClean = $field->getClean();@@ -1593,7 +1593,7 @@         $selection = array();         if ($value && !is_array($value))-            $value = array($value);+            $value = JsonDataParser::parse($value) ?: array($value);         if ($value && is_array($value)) {             foreach ($value as $k=>$v) {@@ -1633,6 +1633,7 @@             $values = array();             $choices = $this->getChoices();             foreach (explode(',', $value) as $V) {+                $V = trim($V);                 if (isset($choices[$V]))                     $values[$V] = $choices[$V];             }
AI Analysis
Here's the analysis of the provided code diff for security fixes:

1. Vulnerability Existed: yes  
   Cross-Site Scripting (XSS) via JSON Decoding [include/class.dynamic_forms.php] [Lines 1355]  
   [Old Code]  
   `$fieldClean = json_decode($fieldClean[0], true);`  
   [Fixed Code]  
   `$fieldClean = is_string($fieldClean[0]) ? json_decode($fieldClean[0], true) : $fieldClean[0];`  
   Additional Details: The fix adds a type check before JSON decoding to prevent potential XSS from malformed input.

2. Vulnerability Existed: yes  
   JSON Injection [include/class.dynamic_forms.php] [Lines 1593]  
   [Old Code]  
   `$value = array($value);`  
   [Fixed Code]  
   `$value = JsonDataParser::parse($value) ?: array($value);`  
   Additional Details: The fix properly parses JSON data using a dedicated parser instead of directly converting to array, preventing JSON injection.

3. Vulnerability Existed: yes  
   Input Validation Bypass [include/class.dynamic_forms.php] [Lines 914]  
   [Old Code]  
   `if ($this->get('name') && !preg_match('/^(?!\d)([[:alnum:]]|_|-)+$/u', $this->get('name')))`  
   [Fixed Code]  
   `if ($this->get('name') && !preg_match('/^(?!\d)([[:alnum:]]|_)+$/u', $this->get('name')))`  
   Additional Details: The fix removes the '-' character from allowed characters in variable names, tightening input validation.

4. Vulnerability Existed: yes  
   Input Trimming Vulnerability [include/class.dynamic_forms.php] [Lines 1633]  
   [Old Code]  
   `foreach (explode(',', $value) as $V) {`  
   [Fixed Code]  
   `foreach (explode(',', $value) as $V) { $V = trim($V);`  
   Additional Details: The fix adds trimming of input values to prevent potential issues with whitespace in comma-separated values.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceLocatorInterface.php AI: Not sure
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceLocatorInterface.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceLocatorInterface.php@@ -1,35 +1,30 @@ <?php-/**- * @see       https://github.com/laminas/laminas-servicemanager for the canonical source repository- * @copyright https://github.com/laminas/laminas-servicemanager/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-servicemanager/blob/master/LICENSE.md New BSD License- */+declare(strict_types=1); namespace Laminas\ServiceManager;-use Interop\Container\ContainerInterface as InteropContainerInterface; use Psr\Container\ContainerExceptionInterface;-use Psr\Container\ContainerInterface as PsrContainerInterface;+use Psr\Container\ContainerInterface; /**  * Interface for service locator  */-interface ServiceLocatorInterface extends-    PsrContainerInterface,-    InteropContainerInterface+interface ServiceLocatorInterface extends ContainerInterface {     /**      * Build a service by its name, using optional options (such services are NEVER cached).      *-     * @param  string $name-     * @param  null|array  $options+     * @template T of object+     * @param  string|class-string<T> $name+     * @param  null|array<mixed>  $options      * @return mixed+     * @psalm-return ($name is class-string<T> ? T : mixed)      * @throws Exception\ServiceNotFoundException If no factory/abstract      *     factory could be found to create the instance.      * @throws Exception\ServiceNotCreatedException If factory/delegator fails      *     to create the instance.-     * @throws ContainerExceptionInterface if any other error occurs+     * @throws ContainerExceptionInterface If any other error occurs.      */-    public function build($name, array $options = null);+    public function build($name, ?array $options = null); }
AI Analysis
Let me analyze the code diff for security vulnerabilities:

1. Vulnerability Existed: no
   No specific vulnerability found [File] include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceLocatorInterface.php [Lines] 1-35
   [Old Code] Interface extending both PsrContainerInterface and InteropContainerInterface with less strict type hints
   [Fixed Code] Interface simplified to extend only ContainerInterface with stricter type hints and psalm annotations

2. Vulnerability Existed: not sure
   Potential Type Safety Improvement [File] include/laminas-mail/vendor/laminas/laminas-servicemanager/src/ServiceLocatorInterface.php [Lines] 16-30
   [Old Code] Looser type hints and return type documentation
   [Fixed Code] Added template type, more specific type hints (class-string), array type hints, and psalm return type annotation

The changes appear to be primarily about:
1. Removing redundant interface inheritance
2. Adding strict type declarations
3. Improving type safety through better type hints and psalm annotations
4. Updating documentation to be more precise

While these changes improve code quality and type safety, I don't see any clear security vulnerabilities being fixed. The changes might help prevent certain types of bugs that could potentially lead to security issues, but there's no direct security fix evident in this diff.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/staff/ticket-relations.inc.php AI: No vulnerabilities
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/staff/ticket-relations.inc.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/staff/ticket-relations.inc.php@@ -19,7 +19,7 @@                  <th width="200"><?php echo __('Create Date'); ?></th>              </tr>          </thead>-         <tbody class="tasks">+         <tbody class="relations">          <?php          if ($children) {              foreach($children as $child) {
AI Analysis
Let me analyze the diff for security vulnerabilities:

1. Vulnerability Existed: no
   - The change appears to be purely cosmetic/functional (changing a CSS class name from "tasks" to "relations")
   - No security vulnerability is apparent in this change
   - File: include/staff/ticket-relations.inc.php
   - Lines: 19
   - Old Code: <tbody class="tasks">
   - Fixed Code: <tbody class="relations">

Additional notes:
- The diff shows only a class name change in HTML markup
- There are no visible security-related changes in this particular diff
- The modification seems to be for better semantic naming or styling purposes
- No input validation, output encoding, or security-related functions were modified

No security vulnerabilities were identified in this specific diff. The change appears to be part of code maintenance rather than a security fix.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/vendor/laminas/laminas-stdlib/src/Guard/EmptyGuardTrait.php AI: Not sure
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/vendor/laminas/laminas-stdlib/src/Guard/EmptyGuardTrait.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/vendor/laminas/laminas-stdlib/src/Guard/EmptyGuardTrait.php@@ -1,12 +1,13 @@ <?php-/**- * @see       https://github.com/laminas/laminas-stdlib for the canonical source repository- * @copyright https://github.com/laminas/laminas-stdlib/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-stdlib/blob/master/LICENSE.md New BSD License- */+declare(strict_types=1); namespace Laminas\Stdlib\Guard;++use Exception;+use Laminas\Stdlib\Exception\InvalidArgumentException;++use function sprintf; /**  * Provide a guard method against empty data@@ -16,15 +17,16 @@     /**      * Verify that the data is not empty      *-     * @param  mixed  $data           the data to verify-     * @param  string $dataName       the data name-     * @param  string $exceptionClass FQCN for the exception-     * @throws \Exception+     * @param mixed  $data           the data to verify+     * @param string $dataName       the data name+     * @param string $exceptionClass FQCN for the exception+     * @return void+     * @throws Exception      */     protected function guardAgainstEmpty(-        $data,+        mixed $data,         $dataName = 'Argument',-        $exceptionClass = 'Laminas\Stdlib\Exception\InvalidArgumentException'+        $exceptionClass = InvalidArgumentException::class     ) {         if (empty($data)) {             $message = sprintf('%s cannot be empty', $dataName);
AI Analysis
Let me analyze the code diff for security vulnerabilities:

1. Vulnerability Existed: not sure
[Potential Type Safety Improvement] [include/laminas-mail/vendor/laminas/laminas-stdlib/src/Guard/EmptyGuardTrait.php] [Lines 1-28]
[Old Code]
```php
/**
 * @see       https://github.com/laminas/laminas-stdlib for the canonical source repository
 * @copyright https://github.com/laminas/laminas-stdlib/blob/master/COPYRIGHT.md
 * @license   https://github.com/laminas/laminas-stdlib/blob/master/LICENSE.md New BSD License
 */
```
[Fixed Code]
```php
declare(strict_types=1);

namespace Laminas\Stdlib\Guard;

use Exception;
use Laminas\Stdlib\Exception\InvalidArgumentException;

use function sprintf;
```

2. Vulnerability Existed: not sure
[Potential Exception Handling Improvement] [include/laminas-mail/vendor/laminas/laminas-stdlib/src/Guard/EmptyGuardTrait.php] [Lines 16-28]
[Old Code]
```php
protected function guardAgainstEmpty(
    $data,
    $dataName = 'Argument',
    $exceptionClass = 'Laminas\Stdlib\Exception\InvalidArgumentException'
) {
```
[Fixed Code]
```php
protected function guardAgainstEmpty(
    mixed $data,
    $dataName = 'Argument',
    $exceptionClass = InvalidArgumentException::class
) {
```

The changes appear to be primarily about code quality improvements rather than direct security fixes:
1. Added strict type declarations
2. Added proper type hints (mixed)
3. Using class constants instead of strings for exception classes
4. Added proper imports

While these changes improve code robustness and maintainability, I cannot identify any specific security vulnerabilities that were fixed in this diff. The changes might indirectly prevent potential type-related issues that could lead to security problems, but there's no clear evidence of a specific vulnerability being addressed.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/class.pdf.php AI: 1 vulnerabilities
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/class.pdf.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/class.pdf.php@@ -74,7 +74,7 @@         $this->includenotes = $notes;         $this->includeevents = $events;-	parent::__construct(['mode' => 'utf-8', 'format' => $psize, 'tempDir'=>sys_get_temp_dir()]);+        parent::__construct(['mode' => 'utf-8', 'format' => $psize, 'tempDir'=>sys_get_temp_dir(), 'autoLangToFont' => true, 'autoScriptToLang' => true]);         $this->_print(); 	}@@ -98,7 +98,7 @@             return;         $html = ob_get_clean();-        $this->autoScriptToLang;+        $this->autoScriptToLang = true;         $this->WriteHtml($html, 0, true, true);     } }@@ -115,7 +115,7 @@         $this->task = $task;         $this->options = $options;-        parent::__construct(['mode' => 'utf-8', 'format' => $this->options['psize'], 'tempDir'=>sys_get_temp_dir()]);+        parent::__construct(['mode' => 'utf-8', 'format' => $this->options['psize'], 'tempDir'=>sys_get_temp_dir(), 'autoLangToFont' => true, 'autoScriptToLang' => true]);         $this->_print();     }@@ -128,7 +128,7 @@         ob_start();         include STAFFINC_DIR.'templates/task-print.tmpl.php';         $html = ob_get_clean();-        $this->autoScriptToLang;+        $this->autoScriptToLang = true;         $this->WriteHtml($html, 0, true, true);     }
AI Analysis
Here's the analysis of the provided code diff for security fixes:

1. Vulnerability Existed: not sure  
   [Potential Character Encoding/PDF Injection Vulnerability] [include/class.pdf.php] [Lines 74, 115]  
   [Old Code]  
   `parent::__construct(['mode' => 'utf-8', 'format' => $psize, 'tempDir'=>sys_get_temp_dir()]);`  
   [Fixed Code]  
   `parent::__construct(['mode' => 'utf-8', 'format' => $psize, 'tempDir'=>sys_get_temp_dir(), 'autoLangToFont' => true, 'autoScriptToLang' => true]);`  
   Additional Details: The fix adds 'autoLangToFont' and 'autoScriptToLang' parameters which help prevent potential character encoding issues or script injection in PDF generation, though it's not clear if this was actively exploited.

2. Vulnerability Existed: yes  
   [Uninitialized Property Vulnerability] [include/class.pdf.php] [Lines 98, 128]  
   [Old Code]  
   `$this->autoScriptToLang;`  
   [Fixed Code]  
   `$this->autoScriptToLang = true;`  
   Additional Details: The old code was referencing the property without initializing it, which could lead to undefined behavior. The fix properly initializes the property to true, ensuring consistent script-to-language handling in PDF generation.

3. Vulnerability Existed: not sure  
   [Potential PDF Generation Security Enhancement] [include/class.pdf.php] [Lines 115]  
   [Old Code]  
   `parent::__construct(['mode' => 'utf-8', 'format' => $this->options['psize'], 'tempDir'=>sys_get_temp_dir()]);`  
   [Fixed Code]  
   `parent::__construct(['mode' => 'utf-8', 'format' => $this->options['psize'], 'tempDir'=>sys_get_temp_dir(), 'autoLangToFont' => true, 'autoScriptToLang' => true]);`  
   Additional Details: Similar to the first entry, this appears to be a consistency fix adding language handling parameters, but it's unclear if this addresses a specific vulnerability.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/src/Storage/Message.php AI: Not sure
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/src/Storage/Message.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/src/Storage/Message.php@@ -1,19 +1,20 @@ <?php--/**- * @see       https://github.com/laminas/laminas-mail for the canonical source repository- * @copyright https://github.com/laminas/laminas-mail/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-mail/blob/master/LICENSE.md New BSD License- */ namespace Laminas\Mail\Storage; use Laminas\Stdlib\ErrorHandler;+use function array_combine;+use function file_get_contents;+use function is_resource;+use function ltrim;+use function stream_get_contents;+ class Message extends Part implements Message\MessageInterface {     /**      * flags for this message+     *      * @var array      */     protected $flags = [];@@ -34,7 +35,7 @@             if (! is_resource($params['file'])) {                 ErrorHandler::start();                 $params['raw'] = file_get_contents($params['file']);-                $error = ErrorHandler::stop();+                $error         = ErrorHandler::stop();                 if ($params['raw'] === false) {                     throw new Exception\RuntimeException('could not open file', 0, $error);                 }
AI Analysis
Based on the provided code diff, here's the analysis:

Vulnerability Existed: not sure
[Potential File Handling Issue] [include/laminas-mail/src/Storage/Message.php] [Lines 32-37]
[Old Code]
                ErrorHandler::start();
                $params['raw'] = file_get_contents($params['file']);
                $error = ErrorHandler::stop();
                if ($params['raw'] === false) {
                    throw new Exception\RuntimeException('could not open file', 0, $error);
                }
[Fixed Code]
                ErrorHandler::start();
                $params['raw'] = file_get_contents($params['file']);
                $error         = ErrorHandler::stop();
                if ($params['raw'] === false) {
                    throw new Exception\RuntimeException('could not open file', 0, $error);
                }

Details:
1. The main change is whitespace/formatting (alignment of `$error` assignment)
2. The code still uses file_get_contents() without any validation of the file path
3. While not a direct vulnerability fix, this could be related to improving error handling consistency
4. The change doesn't appear to address any specific known vulnerability, but the file handling could potentially be a security concern if not properly validated elsewhere

Note: The diff shows mostly formatting changes and added use statements, with no clear security vulnerability fixes. The file handling code remains largely the same, just with better aligned variable assignment.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
include/laminas-mail/src/Header/AbstractAddressList.php AI: 2 vulnerabilities
--- /root/PatchLeaks-main/products/osTicket_downloads/v1.17.5/osTicket-1.17.5/include/laminas-mail/src/Header/AbstractAddressList.php+++ /root/PatchLeaks-main/products/osTicket_downloads/v1.18.2/osTicket-1.18.2/include/laminas-mail/src/Header/AbstractAddressList.php@@ -1,32 +1,70 @@ <?php--/**- * @see       https://github.com/laminas/laminas-mail for the canonical source repository- * @copyright https://github.com/laminas/laminas-mail/blob/master/COPYRIGHT.md- * @license   https://github.com/laminas/laminas-mail/blob/master/LICENSE.md New BSD License- */ namespace Laminas\Mail\Header; use Laminas\Mail\Address; use Laminas\Mail\AddressList; use Laminas\Mail\Headers;-use TrueBV\Exception\OutOfBoundsException;-use TrueBV\Punycode;+use Laminas\Mail\Storage\Exception\RuntimeException;++use function array_filter;+use function array_map;+use function assert;+use function idn_to_ascii;+use function implode;+use function in_array;+use function is_array;+use function is_string;+use function preg_match;+use function preg_match_all;+use function preg_replace;+use function sprintf;+use function str_contains;+use function str_replace;+use function strtolower;+use function trim;++use const IDNA_DEFAULT;+use const IDNA_ERROR_BIDI;+use const IDNA_ERROR_CONTEXTJ;+use const IDNA_ERROR_DISALLOWED;+use const IDNA_ERROR_DOMAIN_NAME_TOO_LONG;+use const IDNA_ERROR_EMPTY_LABEL;+use const IDNA_ERROR_HYPHEN_3_4;+use const IDNA_ERROR_INVALID_ACE_LABEL;+use const IDNA_ERROR_LABEL_HAS_DOT;+use const IDNA_ERROR_LABEL_TOO_LONG;+use const IDNA_ERROR_LEADING_COMBINING_MARK;+use const IDNA_ERROR_LEADING_HYPHEN;+use const IDNA_ERROR_PUNYCODE;+use const IDNA_ERROR_TRAILING_HYPHEN;+use const INTL_IDNA_VARIANT_UTS46; /**  * Base class for headers composing address lists (to, from, cc, bcc, reply-to)  */ abstract class AbstractAddressList implements HeaderInterface {-    /**-     * @var AddressList-     */+    private const IDNA_ERROR_MAP = [+        IDNA_ERROR_EMPTY_LABEL            => 'empty label',+        IDNA_ERROR_LABEL_TOO_LONG         => 'label too long',+        IDNA_ERROR_DOMAIN_NAME_TOO_LONG   => 'domain name too long',+        IDNA_ERROR_LEADING_HYPHEN         => 'leading hyphen',+        IDNA_ERROR_TRAILING_HYPHEN        => 'trailing hyphen',+        IDNA_ERROR_HYPHEN_3_4             => 'consecutive hyphens',+        IDNA_ERROR_LEADING_COMBINING_MARK => 'leading combining mark',+        IDNA_ERROR_DISALLOWED             => 'disallowed',+        IDNA_ERROR_PUNYCODE               => 'invalid punycode encoding',+        IDNA_ERROR_LABEL_HAS_DOT          => 'has dot',+        IDNA_ERROR_INVALID_ACE_LABEL      => 'label not in ASCII encoding',+        IDNA_ERROR_BIDI                   => 'fails bidirectional criteria',+        IDNA_ERROR_CONTEXTJ               => 'one or more characters fail CONTEXTJ rule',+    ];++    /** @var AddressList */     protected $addressList;-    /**-     * @var string Normalized field name-     */+    /** @var string Normalized field name */     protected $fieldName;     /**@@ -36,45 +74,42 @@      */     protected $encoding = 'ASCII';-    /**-     * @var string lower case field name-     */+    /** @var string lower case field name */     protected static $type;-    /**-     * @var Punycode|null-     */-    private static $punycode;-+    /** @var string[] lower case aliases for the field name */+    protected static $typeAliases = [];++    /**+     * @param string $headerLine+     * @return static+     */     public static function fromString($headerLine)     {-        list($fieldName, $fieldValue) = GenericHeader::splitHeaderLine($headerLine);-        if (strtolower($fieldName) !== static::$type) {+        [$fieldName, $fieldValue] = GenericHeader::splitHeaderLine($headerLine);+        if ((strtolower($fieldName) !== static::$type) && ! in_array(strtolower($fieldName), static::$typeAliases)) {             throw new Exception\InvalidArgumentException(sprintf(                 'Invalid header line for "%s" string',-                __CLASS__+                self::class             ));         }         // split value on ","         $fieldValue = str_replace(Headers::FOLDING, ' ', $fieldValue);         $fieldValue = preg_replace('/[^:]+:([^;]*);/', '$1,', $fieldValue);-        $values = ListParser::parse($fieldValue);+        $values     = ListParser::parse($fieldValue);         $wasEncoded = false;-        $addresses = array_map(-            function ($value) use (&$wasEncoded) {+        $addresses  = array_map(+            static function ($value) use (&$wasEncoded): ?Address {                 $decodedValue = HeaderWrap::mimeDecodeValue($value);-                $wasEncoded = $wasEncoded || ($decodedValue !== $value);--                $value = trim($decodedValue);--                $comments = self::getComments($value);-                $value = self::stripComments($value);--                $value = preg_replace(+                $wasEncoded   = $wasEncoded || ($decodedValue !== $value);+                $value        = trim($decodedValue);+                $comments     = self::getComments($value);+                $value        = self::stripComments($value);+                $value        = preg_replace(                     [-                        '#(?<!\\\)"(.*)(?<!\\\)"#',            // quoted-text+                        '#(?<!\\\)"(.*)(?<!\\\)"#', // quoted-text                         '#\\\([\x01-\x09\x0b\x0c\x0e-\x7f])#', // quoted-pair                     ],                     [@@ -83,12 +118,11 @@                     ],                     $value                 );-                 return empty($value) ? null : Address::fromString($value, $comments);             },             $values         );-        $addresses = array_filter($addresses);+        $addresses  = array_filter($addresses);         $header = new static();         if ($wasEncoded) {@@ -104,6 +138,9 @@         return $header;     }+    /**+     * @return string+     */     public function getFieldName()     {         return $this->fieldName;@@ -111,21 +148,37 @@     /**      * Safely convert UTF-8 encoded domain name to ASCII+     *      * @param string $domainName the UTF-8 encoded email-     * @return string-     */-    protected function idnToAscii($domainName)-    {-        if (null === self::$punycode) {-            self::$punycode = new Punycode();-        }-        try {-            return self::$punycode->encode($domainName);-        } catch (OutOfBoundsException $e) {-            return $domainName;-        }-    }-+     */+    protected function idnToAscii($domainName): string+    {+        /** @psalm-var string|false $ascii */+        $ascii = idn_to_ascii($domainName, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46, $conversionInfo);+        if (is_string($ascii)) {+            return $ascii;+        }++        $messages = [];+        assert(is_array($conversionInfo));+        /* @psalm-var array{errors: numeric-string} $conversionInfo */+        $errors = (int) $conversionInfo['errors'];++        foreach (self::IDNA_ERROR_MAP as $flag => $message) {+            if (($flag & $errors) === $flag) {+                $messages[] = $message;+            }+        }++        throw new RuntimeException(sprintf(+            'Failed encoding domain due to errors: %s',+            implode(', ', $messages)+        ));+    }++    /**+     * @inheritDoc+     */     public function getFieldValue($format = HeaderInterface::FORMAT_RAW)     {         $emails   = [];@@ -135,11 +188,14 @@             $email = $address->getEmail();             $name  = $address->getName();-            if (! empty($name) && false !== strstr($name, ',')) {+            // quote $name if value requires so+            if (! empty($name) && (str_contains($name, ',') || str_contains($name, ';'))) {+                // FIXME: what if name contains double quote?                 $name = sprintf('"%s"', $name);             }-            if ($format === HeaderInterface::FORMAT_ENCODED+            if (+                $format === HeaderInterface::FORMAT_ENCODED                 && 'ASCII' !== $encoding             ) {                 if (! empty($name)) {@@ -149,7 +205,7 @@                 if (preg_match('/^(.+)@([^@]+)$/', $email, $matches)) {                     $localPart = $matches[1];                     $hostname  = $this->idnToAscii($matches[2]);-                    $email = sprintf('%s@%s', $localPart, $hostname);+                    $email     = sprintf('%s@%s', $localPart, $hostname);                 }             }@@ -170,12 +226,19 @@         return implode(',' . Headers::FOLDING, $emails);     }+    /**+     * @param string $encoding+     * @return self+     */     public function setEncoding($encoding)     {         $this->encoding = $encoding;         return $this;     }+    /**+     * @return string+     */     public function getEncoding()     {         return $this->encoding;@@ -183,8 +246,6 @@     /**      * Set address list for this header-     *-     * @param  AddressList $addressList      */     public function setAddressList(AddressList $addressList)     {@@ -204,11 +265,14 @@         return $this->addressList;     }+    /**+     * @return string+     */     public function toString()     {         $name  = $this->getFieldName();         $value = $this->getFieldValue(HeaderInterface::FORMAT_ENCODED);-        return (empty($value)) ? '' : sprintf('%s: %s', $name, $value);+        return empty($value) ? '' : sprintf('%s: %s', $name, $value);     }     /**@@ -241,7 +305,7 @@      * Supposed to be private, protected as a workaround for PHP bug 68194      *      * @param string $value-     * @return void+     * @return string      */     protected static function stripComments($value)     {
AI Analysis
After analyzing the code diff, I've identified several security-related changes. Here's the analysis following the requested format:

1. Vulnerability Existed: yes
IDN Domain Handling Vulnerability [include/laminas-mail/src/Header/AbstractAddressList.php] [Lines 150-174]
[Old Code]
protected function idnToAscii($domainName)
{
    if (null === self::$punycode) {
        self::$punycode = new Punycode();
    }
    try {
        return self::$punycode->encode($domainName);
    } catch (OutOfBoundsException $e) {
        return $domainName;
    }
}
[Fixed Code]
protected function idnToAscii($domainName): string
{
    /** @psalm-var string|false $ascii */
    $ascii = idn_to_ascii($domainName, IDNA_DEFAULT, INTL_IDNA_VARIANT_UTS46, $conversionInfo);
    if (is_string($ascii)) {
        return $ascii;
    }

    $messages = [];
    assert(is_array($conversionInfo));
    /* @psalm-var array{errors: numeric-string} $conversionInfo */
    $errors = (int) $conversionInfo['errors'];

    foreach (self::IDNA_ERROR_MAP as $flag => $message) {
        if (($flag & $errors) === $flag) {
            $messages[] = $message;
        }
    }

    throw new RuntimeException(sprintf(
        'Failed encoding domain due to errors: %s',
        implode(', ', $messages)
    ));
}

2. Vulnerability Existed: yes
Header Injection Vulnerability [include/laminas-mail/src/Header/AbstractAddressList.php] [Lines 190-193]
[Old Code]
if (! empty($name) && false !== strstr($name, ',')) {
    $name = sprintf('"%s"', $name);
}
[Fixed Code]
if (! empty($name) && (str_contains($name, ',') || str_contains($name, ';'))) {
    $name = sprintf('"%s"', $name);
}

3. Vulnerability Existed: not sure
Potential Security Improvement [include/laminas-mail/src/Header/AbstractAddressList.php] [Lines 84-87]
[Old Code]
if (strtolower($fieldName) !== static::$type) {
    throw new Exception\InvalidArgumentException(sprintf(
        'Invalid header line for "%s" string',
        __CLASS__
    ));
}
[Fixed Code]
if ((strtolower($fieldName) !== static::$type) && ! in_array(strtolower($fieldName), static::$typeAliases)) {
    throw new Exception\InvalidArgumentException(sprintf(
        'Invalid header line for "%s" string',
        self::class
    ));
}

The most significant security fix is the IDN domain handling change, which now properly validates internationalized domain names using PHP's built-in idn_to_ascii() function with strict error checking, rather than the previous lenient approach that would silently return invalid domains. The header injection fix adds protection against semicolon characters in names, which could potentially be used for header injection attacks. The third change might improve security by adding type aliases validation, but its security impact is less clear.
CVE Analysis Results:
CVE-2025-45387: No
View CVE Description
osTicket prior to v1.17.6 and v1.18.2 are vulnerable to Broken Access Control Vulnerability in /scp/ajax.php.
CVE-2025-26241: No
View CVE Description
A SQL injection vulnerability in the "Search" functionality of "tickets.php" page in osTicket <=1.17.5 allows authenticated attackers to execute arbitrary SQL commands via the "keywords" and "topic_id" URL parameters combination.
Showing 161-180 of 426 files
Per page: