You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dreamorosi opened this issue
Oct 18, 2023
· 2 comments
· Fixed by #1750
Assignees
Labels
completedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)tracerThis item relates to the Tracer Utility
The Tracer utility logs a warning when it can't manipulate a segment, this is done to avoid throwing an error and blocking customer code. The log includes the name of the segment that threw an error.
Currently the name of the segment is included using string concatenation with a non-literal variable. We should update this to use constant values for the format string, and leverage the language (i.e. util.format('hello %s', 'Alice'); or console.warn('hello %s', 'Bob');), so that the value is handled properly.
Detected string concatenation with a non-literal variable in a util.format / console.log function. If an attacker injects a format specifier in the string, it will forge the log message.
Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered:
dreamorosi
added
tracer
This item relates to the Tracer Utility
internal
PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)
confirmed
The scope is clear, ready for implementation
labels
Oct 18, 2023
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
completedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)tracerThis item relates to the Tracer Utility
Summary
The Tracer utility logs a warning when it can't manipulate a segment, this is done to avoid throwing an error and blocking customer code. The log includes the name of the segment that threw an error.
Currently the name of the segment is included using string concatenation with a non-literal variable. We should update this to use constant values for the format string, and leverage the language (i.e.
util.format('hello %s', 'Alice');
orconsole.warn('hello %s', 'Bob');
), so that the value is handled properly.Why is this needed?
According to Semgrep guidance:
Which area does this relate to?
Tracer
Solution
See recommendation in section above.
Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: