aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/SystemConfig.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-08-22 14:34:37 +0200
committerLouis Chemineau <louis@chmn.me>2024-08-28 10:27:14 +0200
commit9d0248545d85d6a680f2c9507f1bcfe13e889535 (patch)
treef4009f91b5f85255833eb83383ce9705862745b1 /lib/private/SystemConfig.php
parent1363e142d8ed6008388f52b7bf422f238df4e50b (diff)
downloadnextcloud-server-9d0248545d85d6a680f2c9507f1bcfe13e889535.tar.gz
nextcloud-server-9d0248545d85d6a680f2c9507f1bcfe13e889535.zip
fix: mark systemconfig value as not being tainted because they are implicitly trusted
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/SystemConfig.php')
-rw-r--r--lib/private/SystemConfig.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/private/SystemConfig.php b/lib/private/SystemConfig.php
index f817e327b19..ed77526c29c 100644
--- a/lib/private/SystemConfig.php
+++ b/lib/private/SystemConfig.php
@@ -115,6 +115,24 @@ class SystemConfig {
}
/**
+ * Since system config is admin controlled, we can tell psalm to ignore any taint
+ *
+ * @psalm-taint-escape sql
+ * @psalm-taint-escape html
+ * @psalm-taint-escape ldap
+ * @psalm-taint-escape callable
+ * @psalm-taint-escape file
+ * @psalm-taint-escape ssrf
+ * @psalm-taint-escape cookie
+ * @psalm-taint-escape header
+ * @psalm-taint-escape has_quotes
+ * @psalm-pure
+ */
+ public static function trustSystemConfig(mixed $value): mixed {
+ return $value;
+ }
+
+ /**
* Lists all available config keys
* @return array an array of key names
*/
@@ -150,7 +168,7 @@ class SystemConfig {
* @return mixed the value or $default
*/
public function getValue($key, $default = '') {
- return $this->config->getValue($key, $default);
+ return $this->trustSystemConfig($this->config->getValue($key, $default));
}
/**