Skip to content
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

Use defusedxml for xml parsing, only parse one in proj creation #1316

Merged
merged 4 commits into from
Mar 2, 2024

Conversation

spwoodcock
Copy link
Member

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Describe this PR

  • We were parsing XML directly from the user previously.
  • This opens up FMTM to a whole host of exploits and is bad security.
  • Using the defusedxml package is a drop in replacement for Python standard lib xml.
  • It removes potential security threats.
  • I also refactored to make the XForm parsing logic more modular.
  • We now only parse the XLSForm once during project creation, then pass through the data to the task creation.
  • This should hopefully prevent issues of filesystem conflicts between API replicas etc.

Affects the form validity check during project creation, and the file form parsing in generate-project-files.

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@spwoodcock spwoodcock added this to the FMTM Public Beta milestone Mar 1, 2024
@spwoodcock spwoodcock requested a review from Sujanadh March 1, 2024 21:12
@spwoodcock spwoodcock self-assigned this Mar 1, 2024
@github-actions github-actions bot added frontend Related to frontend code backend Related to backend code labels Mar 1, 2024
@spwoodcock spwoodcock merged commit 3d26f8d into development Mar 2, 2024
8 checks passed
@spwoodcock spwoodcock deleted the fix/defusedxml branch March 2, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code frontend Related to frontend code
Projects
Development

Successfully merging this pull request may close these issues.

1 participant