T09 · Insecure Skill Coding Practices
- Location
scripts/cors_tester.py:225- Finding
Unsafe Input Interpolation in Generated Server Configurations
- Content
View full analysis
Header set Access-Control-Allow-Origin "{o}" Header set Access-Control-Allow-Methods "{m}" Header set Access-Control-Allow-Headers "{h}" {"Header set Access-Control-Allow-Credentials true" if c else ""} Header set Access-Control-Max-Age "{ma}" """), ``` ```python "rails": lambda o, m, h, c, ma: dedent(f"""\ # config/initializers/cors.rb Rails.application.config.middleware.insert_before 0, Rack::Cors do allow do origins {', '.join(f"'{x.strip()}'" for x in o.split(','))} resource '*', headers: :any, methods: [{', '.join(f':{x.strip().lower()}' for x in m.split(','))}], credentials: {'true' if c else 'false'}, max_age: {ma} end end"""), } def cmd_config(args): framework = args.framework if framework not in ...[truncated 3037 chars]- Remediation
View remediation
