Reviewed-By: Daniel Leidert <dleidert@debian.org>
Origin: https://github.com/apache/trafficserver/pull/11856
Bug: https://github.com/apache/trafficserver/pull/11856
Bug-Debian: https://bugs.debian.org/
1087531
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2024-38479
Bug-Freexian-Security: https://deb.freexian.com/extended-lts/tracker/CVE-2024-38479
Gbp-Pq: Name CVE-2024-38479.patch
}
}
+void
+CacheKey::appendMatrix(const ConfigMatrix &config)
+{
+ if (config.toBeRemoved()) {
+ return;
+ }
+
+ const char *matrix;
+ int length;
+
+ matrix = TSUrlHttpParamsGet(_buf, _url, &length);
+ if (matrix == nullptr || length == 0) {
+ return;
+ }
+
+ if (matrix && length) {
+ _key.append(";");
+ _key.append(matrix, length);
+ }
+}
+
/**
* @brief Append User-Agent header captures specified in the Pattern configuration object.
*
void appendPath(Pattern &pathCapture, Pattern &pathCaptureUri);
void appendHeaders(const ConfigHeaders &config);
void appendQuery(const ConfigQuery &config);
+ void appendMatrix(const ConfigMatrix &config);
void appendCookies(const ConfigCookies &config);
void appendUaCaptures(Pattern &config);
bool appendUaClass(Classifier &classifier);
return _NAME;
}
+bool
+ConfigMatrix::finalize()
+{
+ _remove = noIncludeExcludeRules();
+ return true;
+}
+
+const String ConfigMatrix::_NAME = "matrix parameter";
+inline const String &
+ConfigMatrix::name() const
+{
+ return _NAME;
+}
+
/**
* @briefs finalizes the headers related configuration.
*
static const String _NAME;
};
+class ConfigMatrix : public ConfigElements
+{
+public:
+ bool finalize() override;
+
+private:
+ const String &name() const override;
+ static const String _NAME;
+};
+
/**
* @brief Headers configuration class.
*/
/* Make the following members public to avoid unnecessary accessors */
ConfigQuery _query; /**< @brief query parameter related configuration */
ConfigHeaders _headers; /**< @brief headers related configuration */
+ ConfigMatrix _matrix; /**< @brief matrix parameter related configuration */
ConfigCookies _cookies; /**< @brief cookies related configuration */
Pattern _uaCapture; /**< @brief the capture groups and the replacement string used for the User-Agent header capture */
String _prefix; /**< @brief cache key prefix string */
if (!config->pathToBeRemoved()) {
cachekey.appendPath(config->_pathCapture, config->_pathCaptureUri);
}
+
+ /* Append the matrix parameters to the cache key. */
+ cachekey.appendMatrix(config->_matrix);
+
/* Append query parameters to the cache key. */
cachekey.appendQuery(config->_query);