Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
iv
slapos
Commits
c2194135
Commit
c2194135
authored
10 years ago
by
Tristan Cavelier
Committed by
Cédric Le Ninivin
10 years ago
Browse files
Options
Download
Email Patches
Plain Diff
monitor: prevent html injection with cgi.escape
parent
0a2158e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
stack/monitor/webfile-directory/settings.cgi.in
stack/monitor/webfile-directory/settings.cgi.in
+4
-4
No files found.
stack/monitor/webfile-directory/settings.cgi.in
View file @
c2194135
...
...
@@ -44,8 +44,8 @@ print "<form action=\"/index.cgi\" method=\"post\" class=\"pure-form-aligned\">"
print "
<input
type=
\"hidden\"
name=
\"posting-script\"
value=
\"{{
pwd
}}/{{
this_file
}}\"
>
"
for option in parser.options("public"):
print "
<div
class=
\"pure-control-group\"
>
"
print "
<label
for=
\"%s\"
>
%s
</label>
"
%(option,
option)
print "
<input
type=
\"text\"
name=
\"%s\"
value=
\"%s\"
>
"
%(option,
parser.get('public', option))
print "
<label
for=
\"%s\"
>
%s
</label>
"
% (cgi.escape(option, quote=True), cgi.escape(
option)
)
print "
<input
type=
\"text\"
name=
\"%s\"
value=
\"%s\"
>
"
% (cgi.escape(option, quote=True), cgi.escape(
parser.get('public', option)
, quote=True)
)
print "
</div>
"
print "
<div
class=
\"pure-controls\"
><button
type=
\"submit\"
class=
\"pure-button
\
pure-button-primary
\"
>
Save
</button></div></form>
"
...
...
@@ -56,8 +56,8 @@ for section in parser.sections():
if section != 'public':
for option in parser.options(section):
print "
<div
class=
\"pure-control-group\"
>
"
print "
<label
for=
\"%s\"
>
%s
</label>
"
%(option,
option)
print "
<input
type=
\"text\"
name=
\"%s\"
value=
\"%s\"
readonly
>
"%(
option,
parser.get(section, option))
print "
<label
for=
\"%s\"
>
%s
</label>
"
% (cgi.escape(option, quote=True), cgi.escape(
option)
)
print "
<input
type=
\"text\"
name=
\"%s\"
value=
\"%s\"
readonly
>
"
%(
cgi.escape(option, quote=True), cgi.escape(
parser.get(section, option)
, quote=True)
)
print "
</div>
"
print "
</form>
"
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment