0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-26 09:24:07 -05:00
forgejo/routers/web/repo/setting
Gusted 5b3a82d621
[FEAT] Enable ambiguous character detection in configured contexts
- The ambiguous character detection is an important security feature to
combat against sourcebase attacks (https://trojansource.codes/).
- However there are a few problems with the feature as it stands
today (i) it's apparantly an big performance hitter, it's twice as slow
as syntax highlighting (ii) it contains false positives, because it's
reporting valid problems but not valid within the context of a
programming language (ambiguous charachters in code comments being a
prime example) that can lead to security issues (iii) charachters from
certain languages always being marked as ambiguous. It's a lot of effort
to fix the aforementioned issues.
- Therefore, make it configurable in which context the ambiguous
character detection should be run, this avoids running detection in all
contexts such as file views, but still enable it in commits and pull
requests diffs where it matters the most. Ideally this also becomes an
per-repository setting, but the code architecture doesn't allow for a
clean implementation of that.
- Adds unit test.
- Adds integration tests to ensure that the contexts and instance-wide
is respected (and that ambigious charachter detection actually work in
different places).
- Ref: https://codeberg.org/forgejo/forgejo/pulls/2395#issuecomment-1575547
- Ref: https://codeberg.org/forgejo/forgejo/issues/564
2024-02-23 13:12:17 +01:00
..
avatar.go Refactor locale&string&template related code (#29165) 2024-02-16 15:20:52 +01:00
collaboration.go [MODERATION] User blocking 2024-02-05 15:56:45 +01:00
default_branch.go Revert "Fix schedule tasks bugs (#28691)" 2024-02-05 16:54:42 +01:00
deploy_key.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
git_hooks.go Move some files under repo/setting (#25585) 2023-07-02 08:59:32 +08:00
lfs.go [FEAT] Enable ambiguous character detection in configured contexts 2024-02-23 13:12:17 +01:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
protected_branch.go Refactor locale&string&template related code (#29165) 2024-02-16 15:20:52 +01:00
protected_tag.go Even more db.DefaultContext refactor (#27352) 2023-10-03 10:30:41 +00:00
runners.go Fix repo count in org action settings (#27245) 2023-09-29 15:46:07 +00:00
secrets.go Fix repo count in org action settings (#27245) 2023-09-29 15:46:07 +00:00
setting.go Add merge style fast-forward-only (#28954) 2024-02-14 17:19:19 +01:00
settings_test.go [MODERATION] User blocking 2024-02-05 15:56:45 +01:00
variables.go Added instance-level variables (#28115) 2023-12-25 07:28:59 +00:00
webhook.go Change webhook-type in create-view (#29114) 2024-02-17 23:24:30 +01:00