Skip to content

Commit

Permalink
Fix missing XML Escaping in Password String
Browse files Browse the repository at this point in the history
  • Loading branch information
Weishaupt committed May 16, 2024
1 parent 0d8a314 commit fd461fe
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion dnsapi/dns_inwx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,24 @@ _inwx_check_cookie() {
return 1
}

_htmlEscape() {
local s
s=${1//&/&}
s=${s//</&lt;}
s=${s//>/&gt;}
s=${s//'"'/&quot;}
printf -- %s "$s"
}

_inwx_login() {

if _inwx_check_cookie; then
_debug "Already logged in"
return 0
fi

XML_PASS=$(_htmlEscape "$INWX_Password")

xml_content=$(printf '<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>account.login</methodName>
Expand All @@ -190,7 +201,7 @@ _inwx_login() {
</value>
</param>
</params>
</methodCall>' "$INWX_User" "$INWX_Password")
</methodCall>' "$INWX_User" "$XML_PASS")

response="$(_post "$xml_content" "$INWX_Api" "" "POST")"

Expand Down

0 comments on commit fd461fe

Please sign in to comment.