Securedrop: Data in the dev container should contain markup to help prevent regressions with escaping

Created on 18 Mar 2019  路  4Comments  路  Source: freedomofpress/securedrop

Description

The data that is loaded into the dev container should contain messages / replies with markup to ensure that both web interfaces and the client do not regress. We have tests and various measures in place to prevent this, but if we make the dev data include strings like <strong>this text should not be bold</strong>, then regression will be more noticeable during development and manual testing.

good first issue help wanted

All 4 comments

Hi, I'd like to help, but I'm not exactly clear about what needs to be done. Can someone elaborate, please?

Thanks for such a great product, team!

hey @RJ722: the place you want to edit is the create-dev-data.py script. The two places in that script you'll want to edit are the strings used:

The task here is to replace those strings with strings that better test our input validation.

One implementation would be to replace those two strings with a call to two new functions (maybe called generate_test_message() and generate_test_reply()) that e.g. return the existing string on the first call, and on the second call it returns the suggested string from the issue containing HTML markup like <strong>this text should not be bold</strong>. There are of course other perfectly reasonable ways to do this, a place you might want to look for inspiration is this list of good strings for finding issues with input validation.

I'm pretty interested in start contributing to SecureDrop. This seems like something I can take on. @RJ722 Are you still on it?

Hello @redshiftzero and @f-lai, I'm very sorry for replying so late. The notification got buried.

@redshiftzero thanks for the helpful message, got it. I shall raise a PR today.

@f-lai yes, I would like to continue with this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zenmonkeykstop picture zenmonkeykstop  路  5Comments

redshiftzero picture redshiftzero  路  5Comments

diracdeltas picture diracdeltas  路  5Comments

Hainish picture Hainish  路  6Comments

ageis picture ageis  路  3Comments