JSteele179692 (Community Member) asked a question.

How can I sanitize CWE 117 for Python? Following the documentation on supported cleansing functions (https://docs.veracode.com/r/Supported_Python_Cleansing_Functions) it indicates that `repr` should be supported but it doesn't seem to work

Some examples of usage that all still generate a CWE 117 flaw:

 

logger.debug('An example log: %r', database_object.uuid)

logger.debug('An example log : %s', repr(database_object.uuid))

logger.debug(f'An example log : {repr(database_object.uuid)}')

logger.debug(repr(f'An example log : {database_object.uuid}'))

 

How should I be using the sanctioned cleansing functions in this case?


  • Hello @JSteele179692 (Community Member)​,

     

    Our engineers have enhanced the Python scan engine used within Veracode Static Analysis. The `repr` function is a cleanser for CWE-117 in that scan engine. There is currently a plan to transition all customers to the new engine on 20 July. Early access is available upon request through your AppSec team.

     

    Kind regards,

    Dee

     

    Expand Post

Topics (4)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.