T09 · Insecure Skill Coding Practices
- Location
scripts/main.py:248- Finding
R Code Injection Through Unescaped CLI Arguments
- Content
View full analysis
% mutate(regulation = case_when( .data[[pvalue_col]] < pvalue_thresh & .data[[log2fc_col]] > log2fc_thresh ~ "up", .data[[pvalue_col]] < pvalue_thresh & .data[[log2fc_col]] < -log2fc_thresh ~ "down", TRUE ~ "ns" )) # Create plot p <- ggplot(data, aes(x=.data[[log2fc_col]], y=negLog10_pvalue, color=regulation)) + geom_point(alpha=0.6, size=1.5) + scale_color_manual(values=c("up"="{args.color_up}", "down"="{args.color_down}", "ns"="{args.color_ns}"), labels=c("up"="Upregulated", "down"="Downregulated", "ns"="Not significant")) + geom_hline(yintercept=-log10(pvalue_thresh), linetype="dashed", color="gray") + geom_vline(xintercept=c(-log2fc_thresh, log2fc_thresh), linetype="dashed", color="gray") + labs(x="{args.xlabel}", y="{args.ylabel}", title="{args.title}") + theme_minimal() + theme(legend.position="bottom") # Save plot ggsave("{output_path}", p, width=10, height=8, dpi={args.dpi}) print(paste("Plot saved to:", "{output_path}")) ''' ``` ### Technical Analysis The optional R exporter constructs executable R source code through direct Python f-string interpolation. Several attacker-controllable command-line values are placed inside quoted R string literals without escaping or val ...[truncated 2121 chars]- Remediation
View remediation
