]> git.openstreetmap.org Git - chef.git/commitdiff
Validate local parts for messages.openstreetmap.org to untaint them
authorTom Hughes <tom@compton.nu>
Wed, 20 Mar 2024 12:45:49 +0000 (12:45 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 20 Mar 2024 12:46:09 +0000 (12:46 +0000)
roles/web-frontend.rb

index 2549e98dc1d4aa4dfbe344788117a16e6ce413f8..b6d80ae8c2fb04a1b9b8a9179d0d9ae55dd87a39 100644 (file)
@@ -38,7 +38,8 @@ default_attributes(
       :messages => {
         :comment => "messages.openstreetmap.org",
         :domains => ["messages.openstreetmap.org"],
-        :command => "/usr/local/bin/deliver-message $local_part",
+        :local_parts => ["^c-(\\\\d+)-(\\\\d+)-(.*)\\$", "^m-(\\\\d+)-(.*)\\$"],
+        :command => "/usr/local/bin/deliver-message $local_part_data",
         :user => "rails",
         :group => "rails",
         :home_directory => "/srv/www.openstreetmap.org/rails",