Skip to content

Conversation

@Xhoenix
Copy link
Member

@Xhoenix Xhoenix commented Apr 8, 2025

Fixes: #4074

@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2025

📊 Quantitative test results for language: eng, year: 2023, size: 10K, paranoia level: 1:
🚀 Quantitative testing did not detect new false positives

@fzipi fzipi added the release:new-detection In this PR we introduce a new detection label Apr 8, 2025
@Xhoenix Xhoenix requested a review from dune73 April 9, 2025 05:30
Xhoenix added 2 commits April 9, 2025 08:07
ERB Template engine syntax and slim interpolation
@Xhoenix Xhoenix changed the title feat: detect ruby errors feat: added detection for ruby errors and code leakage Apr 9, 2025
@Xhoenix
Copy link
Member Author

Xhoenix commented Apr 9, 2025

I've this following additional rule, similar to rule 953110 but looks like this is going to be VERY prone to False positives, any suggestions are welcome.

#
# -=[ Ruby source code leakage ]=-
#
# Detect some common Ruby keywords in output.
#
SecRule RESPONSE_BODY "@rx (?:\b(?:def|class|module|end|if|else|elsif|unless|while|until|for|do|begin|rescue|ensure|case|when|then|yield|return|super|self|nil|true|false|and|or|not|attr_accessor|attr_reader|attr_writer|alias|break|next|redo|retry|require|include|extend|private|protected|public|__FILE__|__LINE__|BEGIN|END)\b)" \
    "id:956120,\
    phase:4,\
    block,\
    capture,\
    t:none,\
    msg:'Ruby source code leakage',\
    logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}',\
    tag:'application-multi',\
    tag:'language-ruby',\
    tag:'platform-multi',\
    tag:'attack-disclosure',\
    tag:'paranoia-level/1',\
    tag:'OWASP_CRS',\
    tag:'OWASP_CRS/DATA-LEAKAGES-RUBY',\
    tag:'capec/1000/118/116',\
    tag:'PCI/6.5.6',\
    ver:'OWASP_CRS/4.14.0-dev',\
    severity:'ERROR',\
    setvar:'tx.outbound_anomaly_score_pl1=+%{tx.error_anomaly_score}'"

@Xhoenix Xhoenix requested a review from theseion April 9, 2025 10:07
@github-actions github-actions bot added the Stale label May 10, 2025
@Xhoenix Xhoenix removed the Stale label May 15, 2025
@Xhoenix Xhoenix requested a review from a team May 15, 2025 07:14
@Xhoenix
Copy link
Member Author

Xhoenix commented May 23, 2025

Ping!

@Xhoenix
Copy link
Member Author

Xhoenix commented Jun 14, 2025

Pong!

gif

@Xhoenix Xhoenix requested review from fzipi and theseion July 5, 2025 04:18
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
Xhoenix and others added 2 commits July 5, 2025 18:54
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
theseion
theseion previously approved these changes Jul 21, 2025
theseion
theseion previously approved these changes Jul 21, 2025
@Xhoenix
Copy link
Member Author

Xhoenix commented Jul 21, 2025

The new tag is causing linter error, even though it is already added to APPROVED_TAGS.

@Xhoenix Xhoenix requested a review from theseion July 21, 2025 05:44
@airween
Copy link
Contributor

airween commented Jul 21, 2025

The new tag is causing linter error, even though it is already added to APPROVED_TAGS.

Let me check that soon.

@theseion
Copy link
Contributor

The issue are the PCI tags, not the language tag.

@theseion theseion added this pull request to the merge queue Jul 22, 2025
Merged via the queue into coreruleset:main with commit b3722fc Jul 22, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:new-detection In this PR we introduce a new detection

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create ruby-errors.data

4 participants