Skip to content
2 changes: 2 additions & 0 deletions .qwed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
treat_unknown_as_block: true
ignore_patterns_in_tests: true
Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Security: New .qwed.yml disables pattern scanning in test files

ignore_patterns_in_tests: true instructs the security scanner to skip pattern-based scans for files considered tests. In a security-verification product this is a meaningful regression: secrets, dangerous sinks, or malicious code placed in any file matching a test path would evade detection. Note the accompanying test file is named qwed_security_test.py, which would fall under this exclusion. Recommend removing this key (or scoping it very narrowly) so scanning stays fail-closed for all paths.

Was this helpful? React with 👍 / 👎

Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Quality: Unknown config keys in .qwed.yml are not consumed by codebase

Neither treat_unknown_as_block nor ignore_patterns_in_tests appears anywhere in the repository's source (config loaders, validators, or models). As written these keys are silently ignored by this repo's code, so the file either has no effect here or is intended to be interpreted only by an external tool. Confirm the intended consumer and the exact schema; a typo'd or unrecognized key gives a false sense that a policy is in force when it is not.

Was this helpful? React with 👍 / 👎

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Validation Fixture May Be Ignored

If test-file detection uses the *_test.py naming convention, this setting suppresses pattern findings for examples/qwed_security_test.py. The expected credential advisory would then never be produced, so the fixture would not validate the claimed pattern-scan behavior.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The ignore_patterns_in_tests configuration in .qwed.yml is not implemented in the scanner, failing to suppress a real eval() vulnerability in a new test file.
Severity: HIGH

Suggested Fix

Implement the logic in action_entrypoint.py to parse .qwed.yml and correctly apply the ignore_patterns_in_tests configuration. Alternatively, remove the non-functional configuration and the test file containing the eval(input(...)) pattern to avoid the false sense of security.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .qwed.yml#L2

Potential issue: The configuration file `.qwed.yml` introduces a key
`ignore_patterns_in_tests: true` intended to suppress security findings in test files.
However, the scanner logic in `action_entrypoint.py` does not read this configuration
file. The scanner will still scan all Python files, including the new test file
`examples/qwed_security_test.py`, and flag the dangerous `eval(input(...))` pattern it
contains. This discrepancy means the configuration is non-functional and creates a false
sense of security, as the vulnerability will be detected, contrary to the pull request's
stated intent.

Also affects:

  • examples/qwed_security_test.py:11~14

3 changes: 3 additions & 0 deletions examples/demo_widget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const display = (text) => {
document.getElementById("out").textContent = text;
};
8 changes: 8 additions & 0 deletions examples/qwed_security_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Demonstrates QWED Security scanning capabilities."""
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Outdated

API_KEY = "QWED_TEST_DEMO_VALUE"

Check failure on line 3 in examples/qwed_security_test.py

View check run for this annotation

QWED Security / QWED Security

QWED: pattern_scan

Hardcoded credential-like material detected. Context=TEST_CODE. Decision reason: Pattern remains enforceable even in test code.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Remove the credential-shaped test constant.

Line 3 is classified as hardcoded credential-like material, and the QWED pipeline blocks it rather than emitting the expected advisory. Use a clearly non-credential test marker or move this case into a dedicated scanner fixture with an explicit test contract; do not weaken global scanning.

As per path instructions, enforcement must remain deterministic and fail-closed.

🧰 Tools
🪛 GitHub Check: QWED Security

[error] 3-3: QWED Blocked finding: Hardcoded credential-like material detected (context: TEST_CODE).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/qwed_security_test.py` at line 3, Replace the credential-shaped
API_KEY value in the test fixture with a clearly non-credential marker, or move
the scenario into a dedicated scanner fixture with an explicit test contract.
Preserve deterministic, fail-closed global scanning and do not weaken its
enforcement.

Sources: Path instructions, Linters/SAST tools, Pipeline failures



def run_demo():
user_data = input("Enter expression: ")
print(f"You entered: {user_data}")
Loading