Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

Sanitize input for configuration settings.

smicallef3e255aa71ff4
diff --git a/sfwebui.py b/sfwebui.py
index 232bdc79..abcb4d72 100644
--- a/sfwebui.py
+++ b/sfwebui.py
@@ -44,7 +44,9 @@ class SpiderFootWebUi:
ret = list()
for item in inputList:
- ret.append(cgi.escape(item))
+ c = cgi.escape(item, True)
+ c = c.replace('\'', '"')
+ ret.append(c)
return ret
@@ -166,12 +168,16 @@ class SpiderFootWebUi:
self.config = deepcopy(self.defaultConfig) # Clear in memory
else:
useropts = json.loads(allopts)
+ cleanopts = dict()
+ for opt in useropts.keys():
+ cleanopts[opt] = self.cleanUserInput([useropts[opt]])[0]
+
currentopts = deepcopy(self.config)
# Make a new config where the user options override
# the current system config.
sf = SpiderFoot(self.config)
- self.config = sf.configUnserialize(useropts, currentopts)
+ self.config = sf.configUnserialize(cleanopts, currentopts)
dbh.configSet(sf.configSerialize(currentopts))
except Exception as e: