Skip to content

‎contrib/examples/sensors/echo_flask_app.py Snyk Finding Cross-site Scripting (XSS) #6070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ in development

Fixed
~~~~~
* ‎Fix Snyk Security Finding Cross-site Scripting (XSS) in contrib/examples/sensors/echo_flask_app.py
Contributed by (@philipphomberger Schwarz IT KG)

* Additional fixes for st2 client auth when proxy auth mode enabled #6049
Contributed by @floatingstatic

Expand Down
6 changes: 4 additions & 2 deletions contrib/examples/sensors/echo_flask_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from flask import request, Flask
from flask import request, jsonify, Flask

from st2reactor.sensor.base import Sensor

Expand Down Expand Up @@ -41,7 +41,9 @@ def echo():
self._sensor_service.dispatch(
trigger="examples.echoflasksensor", payload=payload
)
return request.data
return jsonify(
request.get_json(force=True), status=200, mimetype="application/json"
)

self._log.info(
"Listening for payload on http://{}:{}{}".format(
Expand Down